0x51664b04…8e63sent to0x14578924…b707·#16,723,611·view on Etherscan
if(s.exists(m.prev)&&s.exists(m.next)&&u(m.prev.ev,m.next.ev),r&&r.statusRemove(m.ev.seg),m.remove(),!f.primary){var w=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=w}c.push(f.seg)}i.getHead().remove()}return r&&r.done(),c}return e?{addRegion:function(e){for(var n,o,i,l=e[e.length-1],a=0;a<e.length;a++){n=l,l=e[a];var h=t.pointsCompare(n,l);0!==h&&s((o=h<0?n:l,i=h<0?l:n,{id:r?r.segmentId():-1,start:o,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(e){return h(e,!1)}}:{calculate:function(e,t,r,n){return e.forEach((function(e){s(o(e.start,e.end,e),!0)})),r.forEach((function(e){s(o(e.start,e.end,e),!1)})),h(t,n)}}}},{"./linked-list":6}],6:[function(e,t,r){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var n=e.root,o=e.root.next;null!==o;){if(r(o))return t.prev=o.prev,t.next=o,o.prev.next=t,void(o.prev=t);n=o,o=o.next}n.next=t,t.prev=n,t.next=null},findTransition:function(t){for(var r=e.root,n=e.root.next;null!==n&&!t(n);)r=n,n=n.next;return{before:r===e.root?null:r,after:n,insert:function(e){return e.prev=r,e.next=n,r.next=e,null!==n&&(n.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}},{}],7:[function(e,t,r){t.exports=function(e,t,r){var n=[],o=[];return e.forEach((function(e){var i=e.start,l=e.end;if(!t.pointsSame(i,l)){r&&r.chainStart(e);for(var s={index:0,matches_head:!1,matches_pt1:!1},a={index:0,matches_head:!1,matches_pt1:!1},h=s,u=0;u<n.length;u++){var c=(y=n[u])[0],f=(y[1],y[y.length-1]);y[y.length-2];if(t.pointsSame(c,i)){if(C(u,!0,!0))break}else if(t.pointsSame(c,l)){if(C(u,!0,!1))break}else if(t.pointsSame(f,i)){if(C(u,!1,!0))break}else if(t.pointsSame(f,l)&&C(u,!1,!1))break}if(h===s)return n.push([i,l]),void(r&&r.chainNew(i,l));if(h===a){r&&r.chainMatch(s.index);var d=s.index,p=s.matches_pt1?l:i,g=s.matches_head,y=n[d],v=g?y[0]:y[y.length-1],x=g?y[1]:y[y.length-2],b=g?y[y.length-1]:y[0],m=g?y[y.length-2]:y[1];return t.pointsCollinear(x,v,p)&&(g?(r&&r.chainRemoveHead(s.index,p),y.shift()):(r&&r.chainRemoveTail(s.index,p),y.pop()),v=x),t.pointsSame(b,p)?(n.splice(d,1),t.pointsCollinear(m,b,v)&&(g?(r&&r.chainRemoveTail(s.index,v),y.pop()):(r&&r.chainRemoveHead(s.index,v),y.shift())),r&&r.chainClose(s.index),void o.push(y)):void(g?(r&&r.chainAddHead(s.index,p),y.unshift(p)):(r&&r.chainAddTail(s.index,p),y.push(p)))}var w=s.index,P=a.index;r&&r.chainConnect(w,P);var R=n[w].length<n[P].length;s.matches_head?a.matches_head?R?(E(w),B(w,P)):(E(P),B(P,w)):B(P,w):a.matches_head?B(w,P):R?(E(w),B(P,w)):(E(P),B(w,P))}function C(e,t,r){return h.index=e,h.matches_head=t,h.matches_pt1=r,h===s?(h=a,!1):(h=null,!0)}function E(e){r&&r.chainReverse(e),n[e].reverse()}function B(e,o){var i=n[e],l=n[o],s=i[i.length-1],a=i[i.length-2],h=l[0],u=l[1];t.pointsCollinear(a,s,h)&&(r&&r.chainRemoveTail(e,s),i.pop(),s=a),t.pointsCollinear(s,h,u)&&(r&&r.chainRemoveHead(o,h),l.shift()),r&&r.chainJoin(e,o),n[e]=i.concat(l),n.splice(o,1)}})),o}},{}],8:[function(e,t,r){function n(e,t,r){var n=[];return e.forEach((function(e){var o=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[o]&&n.push({id:r?r.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[o],below:2===t[o]},otherFill:null})})),r&&r.selected(n),n}var o={union:function(e,t){return n(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return n(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return n(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return n(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return n(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};t.exports=o},{}]},{},[1]);function Yr(){var e,t,r=0;return Object.freeze({enqueue(n){const o={value:n,next:void 0};t=e?t.next=o:e=o,r++},dequeue(){if(e){const t=e.value;return e=e.next,r--,t}},peek:()=>e?.value,getCount:()=>r})}!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.pa?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Offset=e()}((function(){return function e(t,r,n){function o(l,s){if(!r[l]){if(!t[l]){var a="function"==typeof require&&require;if(!s&&a)return a(l,!0);if(i)return i(l,!0);throw(a=Error("Cannot find module '"+l+"'")).code="MODULE_NOT_FOUND",a}a=r[l]={exports:{}},t[l][0].call(a.exports,(function(e){var r=t[l][1][e];return o(r||e)}),a,a.exports,e,t,r,n)}return r[l].exports}for(var i="function"==typeof require&&require,l=0;l<n.length;l++)o(n[l]);return o}({1:[function(e,t){t.exports={ca:e("./lib/rbtree"),ka:e("./lib/bintree")}},{"./lib/bintree":2,"./lib/rbtree":3}],2:[function(e,t){function r(e){this.data=e,this.right=this.left=null}function n(e){this.c=null,this.s=e,this.size=0}var o=e("./treebase");r.prototype.g=function(e){return e?this.right:this.left},r.prototype.l=function(e,t){e?this.right=t:this.left=t},n.prototype=new o,n.prototype.W=function(e){if(null===this.c)return this.c=new r(e),this.size++,!0;for(var t=0,n=null,o=this.c;;){if(null===o)return o=new r(e),n.l(t,o),ret=!0,this.size++,!0;if(0===this.s(o.data,e))return!1;t=0>this.s(o.data,e),n=o,o=o.g(t)}},n.prototype.remove=function(e){if(null===this.c)return!1;var t=new r(void 0);(l=t).right=this.c;for(var n=null,o=null,i=1;null!==l.g(i);){n=l;var l=l.g(i),s=this.s(e,l.data);i=0<s;0===s&&(o=l)}return null!==o&&(o.data=l.data,n.l(n.right===l,l.g(null===l.left)),this.c=t.right,this.size--,!0)},t.exports=n},{"./treebase":4}],3:[function(e,t){function r(e){this.data=e,this.right=this.left=null,this.red=!0}function n(e){this.c=null,this.s=e,this.size=0}function o(e){return null!==e&&e.red}function i(e,t){var r=e.g(!t);return e.l(!t,r.g(t)),r.l(t,e),e.red=!0,r.red=!1,r}function l(e,t){return e.l(!t,i(e.g(!t),!t)),i(e,t)}var s=e("./treebase");r.prototype.g=function(e){return e?this.right:this.left},r.prototype.l=function(e,t){e?this.right=t:this.left=t},n.prototype=new s,n.prototype.W=function(e){var t=!1;if(null===this.c)this.c=new r(e),t=!0,this.size++;else{var n=new r(void 0),s=0,a=0,h=null,u=n,c=null,f=this.c;for(u.right=this.c;;){if(null===f?(f=new r(e),c.l(s,f),t=!0,this.size++):o(f.left)&&o(f.right)&&(f.red=!0,f.left.red=!1,f.right.red=!1),o(f)&&o(c)){var d=u.right===h;f===c.g(a)?u.l(d,i(h,!a)):u.l(d,l(h,!a))}if(0===(d=this.s(f.data,e)))break;a=s,s=0>d,null!==h&&(u=h),h=c,c=f,f=f.g(s)}this.c=n.right}return this.c.red=!1,t},n.prototype.remove=function(e){if(null===this.c)return!1;var t=new r(void 0);(c=t).right=this.c;for(var n,s=null,a=null,h=1;null!==c.g(h);){var u=h;n=s;s=c;var c=c.g(h),f=this.s(e,c.data);h=0<f;if(0===f&&(a=c),!o(c)&&!o(c.g(h)))if(o(c.g(!h)))n=i(c,h),s.l(u,n),s=n;else if(!o(c.g(!h))&&null!==(f=s.g(!u)))if(o(f.g(!u))||o(f.g(u))){var d=n.right===s;o(f.g(u))?n.l(d,l(s,u)):o(f.g(!u))&&n.l(d,i(s,u)),(u=n.g(d)).red=!0,c.red=!0,u.left.red=!1,u.right.red=!1}else s.red=!1,f.red=!0,c.red=!0}return null!==a&&(a.data=c.data,s.l(s.right===c,c.g(null===c.left)),this.size--),this.c=t.right,null!==this.c&&(this.c.red=!1),null!==a},t.exports=n},{"./treebase":4}],4:[function(e,t){function r(){}function n(e){this.V=e,this.i=[],this.f=null}r.prototype.clear=function(){this.c=null,this.size=0},r.prototype.find=function(e){for(var t=this.c;null!==t;){var r=this.s(e,t.data);if(0===r)return t.data;t=t.g(0<r)}return null},r.prototype.w=function(e){for(var t=this.c,r=this.iterator();null!==t;){var n=this.s(e,t.data);if(0===n)return r.f=t,r;r.i.push(t),t=t.g(0<n)}return null},r.prototype.lowerBound=function(e){for(var t=this.c,r=this.iterator(),n=this.s;null!==t;){var o=n(e,t.data);if(0===o)return r.f=t,r;r.i.push(t),t=t.g(0<o)}for(o=r.i.length-1;0<=o;--o)if(0>n(e,(t=r.i[o]).data))return r.f=t,r.i.length=o,r;return r.i.length=0,r},r.prototype.upperBound=function(e){for(var t=this.lowerBound(e),r=this.s;null!==t.data()&&0===r(t.data(),e);)t.next();return t},r.prototype.min=function(){var e=this.c;if(null===e)return null;for(;null!==e.left;)e=e.left;return e.data},r.prototype.max=function(){var e=this.c;if(null===e)return null;for(;null!==e.right;)e=e.right;return e.data},r.prototype.iterator=function(){return new n(this)},n.prototype.data=function(){return null!==this.f?this.f.data:null},n.prototype.next=function(){if(null===this.f){var e=this.V.c;null!==e&&this.S(e)}else if(null===this.f.right)do{if(e=this.f,!this.i.length){this.f=null;break}this.f=this.i.pop()}while(this.f.right===e);else this.i.push(this.f),this.S(this.f.right);return null!==this.f?this.f.data:null},n.prototype.F=function(){if(null===this.f){var e=this.V.c;null!==e&&this.R(e)}else if(null===this.f.left)do{if(e=this.f,!this.i.length){this.f=null;break}this.f=this.i.pop()}while(this.f.left===e);else this.i.push(this.f),this.R(this.f.left)},n.prototype.S=function(e){for(;null!==e.left;)this.i.push(e),e=e.left;this.f=e},n.prototype.R=function(e){for(;null!==e.right;)this.i.push(e),e=e.right;this.f=e},t.exports=r},{}],5:[function(e,t){t.exports=e("./src/index")},{"./src/index":10}],6:[function(e,t){var r=e("./signed_area");e("./equals"),t.exports=function(e,t){var n=e.a,o=t.a;return n[0]>o[0]?1:n[0]<o[0]?-1:n[1]!==o[1]?n[1]>o[1]?1:-1:e.left!==t.left?e.left?1:-1:0!==r(n,e.b.a,t.b.a)?e.H(t.b.a)?-1:1:!e.j&&t.j?1:-1}},{"./equals":9,"./signed_area":12}],7:[function(e,t){var r=e("./signed_area"),n=e("./compare_events"),o=e("./equals");t.exports=function(e,t){return e===t?0:0!==r(e.a,e.b.a,t.a)||0!==r(e.a,e.b.a,t.b.a)?o(e.a,t.a)?e.H(t.b.a)?-1:1:e.a[0]===t.a[0]?e.a[1]<t.a[1]?-1:1:1===n(e,t)?t.ia(e.a)?-1:1:e.H(t.a)?-1:1:e.j!==t.j?e.j?-1:1:o(e.a,t.a)?o(e.b.a,t.b.a)?0:e.m>t.m?1:-1:1===n(e,t)?1:-1}},{"./compare_events":6,"./equals":9,"./signed_area":12}],8:[function(e,t){t.exports={M:0,ba:1,N:2,L:3}},{}],9:[function(e,t){t.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]}},{}],10:[function(e,t){function r(e,t,n,o,i){var l,s;if("number"==typeof e[0][0])for(l=0,s=e.length-1;l<s;l++){var a=e[l],h=e[l+1],u=t,c=n+1,f=o,d=i,p=new g(a,!1,void 0,u);h=new g(h,!1,p,u);p.b=h,p.m=h.m=c,0<y(p,h)?h.left=!0:p.left=!0,d[0]=w(d[0],a[0]),d[1]=w(d[1],a[1]),d[2]=m(d[2],a[0]),d[3]=m(d[3],a[1]),f.push(p),f.push(h)}else for(l=0,s=e.length;l<s;l++)P++,r(e[l],t,P,o,i)}function n(e,t,n,o){var i=new d(null,y);return P=0,r(e,!0,0,i,n),r(t,!1,0,i,o),i}function o(e,t,r,n){null===t?(e.v=!1,e.u=!0):e.j===t.j?(e.v=!t.v,e.u=t.u):(e.v=!t.u,e.u=t.Y()?!t.v:t.v),t&&(e.G=!i(t,n)||t.Y()?t.G:t),e.K=i(e,n)}function i(e,t){switch(e.type){case f.M:switch(t){case 0:return!e.u;case 1:return e.u;case 2:return e.j&&e.u||!e.j&&!e.u;case 3:return!0}case f.N:return 0===t||1===t;case f.L:return 2===t}return!1}function l(e,t,r){var n=(o=x(e.a,e.b.a,t.a,t.b.a))?o.length:0;if(0===n||1===n&&(b(e.a,t.a)||b(e.b.a,t.b.a)))return 0;if(2===n&&e.j===t.j)return 0;if(1===n)return b(e.a,o[0])||b(e.b.a,o[0])||s(e,o[0],r),b(t.a,o[0])||b(t.b.a,o[0])||s(t,o[0],r),1;var o=[],i=n=!1;return b(e.a,t.a)?n=!0:1===y(e,t)?o.push(t,e):o.push(e,t),b(e.b.a,t.b.a)?i=!0:1===y(e.b,t.b)?o.push(t.b,e.b):o.push(e.b,t.b),n&&i||n?(e.type=f.ba,t.type=e.v===t.v?f.N:f.L,n&&!i&&s(o[0].b,o[1].a,r),2):i?(s(o[0],o[1].a,r),3):o[0]!==o[3].b?(s(o[0],o[1].a,r),s(o[1],o[2].a,r),3):(s(o[0],o[1].a,r),s(o[3].b,o[2].a,r),3)}function s(e,t,r){var n=new g(t,!1,e,e.j);return t=new g(t,!0,e.b,e.j),b(e.a,e.b.a)&&console.warn("Sides of the same polygon overlap",e),n.m=t.m=e.m,0<y(t,e.b)&&(e.b.left=!0,t.left=!1),e.b.b=t,e.b=n,r.push(t),r.push(n),r}function a(e,t,r,n,i,s){var a,h;r=new p(v),t=[];let u=0;for(i=w(n[2],i[2]);e.length;){if(u++,u>1e4){console.warn("Bad bug here");break}var c=e.pop();if(t.push(c),0===s&&c.a[0]>i||2===s&&c.a[0]>n[2])break;if(c.left){if(r.W(c),h=r.w(c),a=r.w(c),c.iterator=r.w(c),!a||!h){a=(d=r).iterator(),h=d.iterator();for(var f,d=d.iterator();null!==(f=d.next())&&(a.next(),h.next(),f!==event););a=(h=[a,h])[0],h=h[1]}a.data()!==r.min()?a.F():((a=r.iterator()).F(),a.next()),h.next(),o(c,a.data(),0,s),h.data()&&2===l(c,h.data(),e)&&(o(c,a.data(),0,s),o(c,h.data(),0,s)),a.data()&&2===l(a.data(),c,e)&&((h=r.w(a.data())).data()!==r.min()?h.F():(h=r.w(r.max())).next(),o(a.data(),h.data(),0,s),o(c,a.data(),0,s))}else c=c.b,h=r.w(c),(a=r.w(c))&&h&&(a.data()!==r.min()?a.F():((a=r.iterator()).F(),a.next()),h.next(),r.remove(c),h.data()&&a.data()&&l(a.data(),h.data(),e))}return t}function h(e,t){"[object Array]"===Object.prototype.toString.call(e[0][0])||(e=[e]),e[t]=[]}function u(e,t,r){var o,i=null;if(0==e.length*t.length&&(0===r?i=c:2===r?i=e:1!==r&&3!==r||(i=0===e.length?t:e)),o=i)return o===c?null:o;var l=[1/0,1/0,-1/0,-1/0],s=n(e,t,i=[1/0,1/0,-1/0,-1/0],l);if(o=null,(i[0]>l[2]||l[0]>i[2]||i[1]>l[3]||l[1]>i[3])&&(0===r?o=c:2===r?o=e:1!==r&&3!==r||(o=e.concat(t))),o)return o===c?null:o;for(e=[],t=0,r=(i=a(s,0,0,i,l,r)).length;t<r;t++)event=i[t],(event.left&&event.K||!event.left&&event.b.K)&&e.push(event);let u=0;for(i=!1;!i&&(u++,!(u>2e3));){for(i=!0,t=0,r=e.length;t<r;t++)t+1<r&&1===y(e[t],e[t+1])&&(l=t+1,s=(i=e)[t],i[t]=i[l],i[l]=s,i=!1);t=0}for(r=e.length;t<r;t++)e[t].A=t;for(t=0,r=e.length;t<r;t++)e[t].left||(i=e[t].A,e[t].A=e[t].b.A,e[t].b.A=i);i=Array(e.length),l=[],s=[],o=[];var f={};for(t=0,r=e.length;t<r;t++)if(!i[t]){var d=[];l.push(d);var p=l.length-1;if(s.push(0),o.push(-1),e[t].G){var g=e[t].G.m;e[t].G.I?f[g]&&(h(l[o[g]],p),o[p]=o[g],s[p]=s[g],f[p]=!0):(h(l[g],p),o[p]=g,s[p]=s[g]+1,f[p]=!0)}for(g=t,d.push(e[t].a);g>=t;){i[g]=!0,e[g].left?(e[g].I=!1,e[g].m=p):(e[g].b.I=!0,e[g].b.m=p),i[g=e[g].A]=!0,d.push(e[g].a);e:{for(var v=e,x=i,m=g+1,w=v.length;m<w&&b(v[m].a,v[g].a);){if(!x[m]){g=m;break e}m+=1}for(m=g-1;x[m];)--m;g=m}}i[g=-1===g?t:g]=i[e[g].A]=!0,e[g].b.I=!0,e[g].b.m=p,1&s[p]&&d.reverse()}return l}var c=[],f=e("./edge_type"),d=e("tinyqueue"),p=e("bintrees").ca,g=e("./sweep_event"),y=e("./compare_events"),v=e("./compare_segments"),x=e("./segment_intersection"),b=e("./equals"),m=Math.max,w=Math.min,P=0;t.exports=u,t.exports.union=function(e,t){return u(e,t,1)},t.exports.diff=function(e,t){return u(e,t,2)},t.exports.wa=function(e,t){return u(e,t,3)},t.exports.intersection=function(e,t){return u(e,t,0)},t.exports.ta={ma:0,la:2,na:1,oa:3},t.exports.sa=n,t.exports.qa=o,t.exports.va=a,t.exports.ra=s,t.exports.ua=l},{"./compare_events":6,"./compare_segments":7,"./edge_type":8,"./equals":9,"./segment_intersection":11,"./sweep_event":13,bintrees:1,tinyqueue:14}],11:[function(e,t){function r(e,t){return e[0]*t[1]-e[1]*t[0]}function n(e,t){return e[0]*t[0]+e[1]*t[1]}t.exports=function(e,t,o,i,l){function s(e,t,r){return[e[0]+t*r[0],e[1]+t*r[1]]}t=[t[0]-e[0],t[1]-e[1]],i=[i[0]-o[0],i[1]-o[1]],o=[o[0]-e[0],o[1]-e[1]];var a=r(t,i),h=n(t,t);if(a*a>1e-9*h*n(i,i))return 0>(i=r(o,i)/a)||1<i||0>(o=r(o,t)/a)||1<o||l?null:[s(e,i,t)];var u=n(o,o);return(a=r(o,t))*a>1e-9*h*u?null:(a=(o=n(t,o)/h)+n(t,i)/h,i=Math.min(o,a),o=Math.max(o,a),1>=i&&0<=o?1===i?l?null:[s(e,0<i?i:0,t)]:0===o?l?null:[s(e,1>o?o:1,t)]:l&&0===i&&1===o?null:[s(e,0<i?i:0,t),s(e,1>o?o:1,t)]:null)}},{}],12:[function(e,t){t.exports=function(e,t,r){return(e[0]-r[0])*(t[1]-r[1])-(t[0]-r[0])*(e[1]-r[1])}},{}],13:[function(e,t){function r(e,t,r,n,i){this.left=t,this.a=e,this.b=r,this.j=n,this.type=i||o.M,this.u=this.v=!1,this.G=null,this.I=this.K=!1}var n=e("./signed_area"),o=e("./edge_type");r.prototype={H:function(e){return this.left?0<n(this.a,this.b.a,e):0<n(this.b.a,this.a,e)},ia:function(e){return!this.H(e)},Y:function(){return this.a[0]===this.b.a[0]}},t.exports=r},{"./edge_type":8,"./signed_area":12}],14:[function(e,t){function r(e,t){if(!(this instanceof r))return new r(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||n,e)for(var o=Math.floor(this.length/2);0<=o;o--)this.O(o)}function n(e,t){return e<t?-1:e>t?1:0}t.exports=r,r.prototype={push:function(e){this.data.push(e),this.length++,this.ea(this.length-1)},pop:function(){var e=this.data[0];return this.data[0]=this.data[this.length-1],this.length--,this.data.pop(),this.O(0),e},ea:function(e){for(var t=this.data,r=this.compare;0<e;){var n=Math.floor((e-1)/2);if(!(0>r(t[e],t[n])))break;var o=t,i=o[n];o[n]=o[e],o[e]=i,e=n}},O:function(e){for(var t=this.data,r=this.compare,n=this.length;;){var o=2*e+1,i=o+1,l=e;if(o<n&&0>r(t[o],t[l])&&(l=o),i<n&&0>r(t[i],t[l])&&(l=i),l===e)break;i=(o=t)[l],o[l]=o[e],o[e]=i,e=l}}}},{}],15:[function(e,t){function r(e,t){this.current=e,this.next=t,this.P=this.X(),this.T=this.ja()}r.prototype.ja=function(){var e=this.X();return[-e[0],-e[1]]},r.prototype.X=function(){var e=this.next[0]-this.current[0],t=this.next[1]-this.current[1],r=Math.sqrt(e*e+t*t);if(0===r)throw Error("Vertices overlap");return[-t/r,e/r]},r.prototype.offset=function(e,t){return r.Z(this.current,this.next,e,t)},r.prototype.ha=function(e,t){return r.Z(this.next,this.current,e,t)},r.Z=function(e,t,n,o){return new r([e[0]+n,e[1]+o],[t[0]+n,t[1]+o])},r.prototype.inverse=function(){return new r(this.next,this.current)},t.exports=r},{}],16:[function(e,t){function r(e,t){this.h=null,this.o=0,e&&this.data(e),this.J=void 0!==t?t:5}var n=e("./edge"),o=e("martinez-polygon-clipping"),i=e("./utils"),l=i.isArray,s=i.ga,a=i.aa;r.prototype.data=function(e){if(this.B=[],!l(e))throw Error("Offset requires at least one coodinate to work with");return l(e)&&"number"==typeof e[0]?this.h=e:(this.h=a(e),this.U(this.h,this.B)),this},r.prototype.getMartinez=function(){return o},r.prototype.U=function(e,t){var r,o;if(l(e[0])&&"number"==typeof e[0][0])for(o=e.length,s(e[0],e[o-1])&&--o,r=0;r<o;r++)t.push(new n(e[r],e[(r+1)%o]));else for(r=0,o=e.length;r<o;r++)t.push([]),this.U(e[r],t[t.length-1])},r.prototype.arcSegments=function(e){return this.J=e,this},r.prototype.fa=function(e,t,r,n,o,i){var l=2*Math.PI,s=Math.atan2(n[1]-t[1],n[0]-t[0]),a=Math.atan2(o[1]-t[1],o[0]-t[0]);for(0==i%2&&--i,0>s&&(s+=l),0>a&&(a+=l),l=-(s>a?s-a:s+l-a)/i,e.push(n),a=1;a<i;++a)n=s+l*a,e.push([t[0]+Math.cos(n)*r,t[1]+Math.sin(n)*r]);e.push(o)},r.prototype.distance=function(e){return this.o=e||0,this},r.degreesToUnits=function(e,t){switch(t){case"miles":e/=69.047;break;case"feet":e/=364568;break;case"kilometers":e/=111.12;break;case"meters":case"metres":e/=111120}return e},r.prototype.C=function(e){return s(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e},r.prototype.offset=function(e){return this.distance(e),0===this.o?this.h:0<this.o?this.margin(this.o):this.padding(-this.o)},r.prototype.da=function(e,t,r,n){var o=[];r=[r.offset(r.P[0]*n,r.P[1]*n),r.ha(r.T[0]*n,r.T[1]*n)];for(var i=0;2>i;i++)this.fa(o,0===i?e:t,n,r[(i+2-1)%2].next,r[i].current,this.J);return o},r.prototype.margin=function(e){return this.distance(e),"number"==typeof this.h[0]?this.$(this.o):0===e?this.h:(e=this.offsetLines(this.o),e=o.union(this.h,e),a(e))},r.prototype.padding=function(e){return this.distance(e),0===this.o?this.C(this.h):2===this.h.length&&"number"==typeof this.h[0]?this.h:(e=this.offsetLines(this.o),e=o.diff(this.h,e),a(e))},r.prototype.offsetLines=function(e){if(0>e)throw Error("Cannot apply negative margin to the line");var t;if(this.distance(e),l(this.h[0])&&"number"!=typeof this.h[0][0]){e=0;for(var r=this.B.length;e<r;e++)t=0===e?this.D(this.h[e],this.B[e]):o.union(t,this.D(this.h[e],this.B[e]))}else t=1===this.h.length?this.$():this.D(this.h,this.B);return t},r.prototype.D=function(e,t){var r,n,i;if(l(e[0])&&"number"==typeof e[0][0])for(n=0,i=e.length-1;n<i;n++){var s=this.C(this.da(e[n],e[n+1],t[n],this.o));r=0===n?[this.C(s)]:o.union(r,this.C(s))}else for(n=0,i=t.length;n<i;n++)r=0===n?this.D(e[n],t[n]):o.union(r,this.D(e[n],t[n]));return r},r.prototype.$=function(e){this.distance(e),e=2*this.J;var t=[],r=this.h,n=this.o,o=0;0==e%2&&e++;for(var i=0;i<e;i++)o+=2*Math.PI/e,t.push([r[0]+n*Math.cos(o),r[1]+n*Math.sin(o)]);return a([this.C(t)])},r.aa=a,t.exports=r},{"./edge":15,"./utils":17,"martinez-polygon-clipping":5}],17:[function(e,t){var r=t.exports.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports.ga=function(e,t){return e[0]===t[0]&&e[1]===t[1]},t.exports.aa=function e(t,n,o){var i,l;if(n=n||0,r(t)&&"number"==typeof t[0][0]){for(i=n=0,l=t.length;i<l;i++){var s=t[i],a=t[(i+1)%l];n+=s[0]*a[1],n-=a[0]*s[1]}(!o&&0<n||o&&0>n)&&t.reverse()}else for(i=0,l=t.length;i<l;i++)e(t[i],n+1,0<i);return t}},{}]},{},[16])(16)})),function(){if(Se=performance.now(),!1===Ar.isWebGL2Available())return document.body.appendChild(Ar.getWebGL2ErrorMessage()),void(jt=!0);c&&function(e){let t;e%2==0?(tokenData.tokenId=100,t=0):(tokenData.tokenId=600,t=-1);let r=e+t,hash="0x";for(var n=0;n<64;n++)hash+=Math.floor(16*ke(r+n)).toString(16);tokenData.hash=hash}(Math.round(Me.e));let q=Me.r,V=!1;null==q||isNaN(q)||(Y=q,V=!0);let X=Me.f,J=!1;null==X||isNaN(X)||(Ut=Math.floor(dr().clamp(X,1,20)),J=!0);let tokenId=tokenData.tokenId;subIdInt=tokenId%1e6,subIdInt>=500?(console.log("IRL mint: "+subIdInt),d=!0):(d=!1,console.log("Online mint: "+subIdInt)),0!=subIdInt&&500!=subIdInt||(tokenData.hash=Ee+Be+Le),console.log(tokenData),h=new e,_r(ar(0,64e3)),m=fr(ar(-1e3,1e3)),w=ar(0,2*F),f=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),f&&(Y=.5),y=1800*Y,v=2700*Y,g=v/y,b=g,Q=[];for(let e=0;e<7;e++)Q.push(ar());if(u=new Offset,P=Math.pow(.007,2),W=new Yr,W.enqueue(le),se+=le,c){let e=document.createElement("a");e.href="data:application/octet-stream,"+encodeURIComponent(ce),e.download=tokenData.hash+".txt",e.click()}x=new br,x.splitPalette(1),p=new Yr;const K=new Uint8Array(1);k=new t3.DataTexture(K,1,1),k.format=t3.RedFormat,k.wrapS=t3.ClampToEdgeWrapping,k.wrapT=t3.ClampToEdgeWrapping;const ee=new Uint8Array(1);ee[0]=255,T=new t3.DataTexture(ee,1,1),T.format=t3.RedFormat,T.wrapS=t3.ClampToEdgeWrapping,T.wrapT=t3.ClampToEdgeWrapping,i=new t3.OrthographicCamera(-G,G,b,-b,-1,10),s=new t3.WebGLRenderer({powerPreference:"high-performance",stencil:!1}),s.setClearColor(16777198,1),s.autoClear=!1,s.setPixelRatio(1),s.setSize(y,v),s.outputEncoding=t3.sRGBEncoding,document.body.appendChild(s.domElement),l=new t3.Scene,j={normal:{randomAmount:.002,brushWidth:.128,brushFrequency:4.4,offsetSpeed:7},messy:{randomAmount:.002,brushWidth:.128,brushFrequency:1.3,offsetSpeed:20},waterColor:{randomAmount:.002,brushWidth:.128,brushFrequency:10,offsetSpeed:3},thin:{randomAmount:.002,brushWidth:.002,brushFrequency:60.2,offsetSpeed:10},sigThin:{randomAmount:.002,brushWidth:.0013,brushFrequency:8.8,offsetSpeed:10},sortOfThin:{randomAmount:.002,brushWidth:.005,brushFrequency:60.2,offsetSpeed:10},sigThick:{randomAmount:.002,brushWidth:.005,brushFrequency:0,offsetSpeed:0}},ar()<.85&&d&&(oe=-1),R=new r(s,{width:y,height:v}),C=new r(s,{width:y,height:v}),L=new r(s,{width:y,height:v});const te=new t3.Vector3(y,v,window.devicePixelRatio);N={sCurrent:fr(-100,-100),sPrevious:fr(-101,-101),sVel:fr(.01,.01),sColor1:z,sColor2:z,randomAmount:.001,brushWidth:.01,brushFrequency:1,offsetSpeed:10,bL:D,tR:_,rV:O,dataTexIndex:0},E=new t(ye,{iResolution:{value:te},resFactor:{value:Y},iFrame:{value:0},iChannel0:{value:null},dataTex0:{value:T},dataTex1:{value:T},dataTex2:{value:T},iChannel2:{value:Yt(128,100,1)},brushes:{value:[N,N,N]},isWaterColor:{value:0},isSig:{value:0},uvFlip:{value:oe},softenEdges:{value:0}});let ie=x.getRandomColor();B=new t(ve,{iResolution:{value:te},resFactor:{value:Y},iChannel0:{value:null},bgCol:{value:ie},isWaterColor:{value:0},blackAndWhite:{value:0},blackPaper:{value:0},isDone:{value:0},randomTime:{value:0},randomRot:{value:Q[2]}}),S=new t(me,{iResolution:{value:fr(y,v)},randomPos:{value:fr(ar(-.4,-.2),ar(-.4,-.2))},