@pixi/utils
Advanced tools
Comparing version 5.0.4 to 5.1.0
/*! | ||
* @pixi/utils - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* @pixi/utils - v5.1.0 | ||
* Compiled Fri, 19 Jul 2019 21:54:36 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/utils is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{},this.PIXI.utils=this.PIXI.utils||{};var _pixi_utils=function(t,e,n){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function i(t,e,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||t,s),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,o=[];if(0===this._eventsCount)return o;for(r in t=this._events)e.call(t,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,s=new Array(i);o<i;o++)s[o]=r[o].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,o,i,s){var a=arguments,h=n?n+t:t;if(!this._events[h])return!1;var u,c,f=this._events[h],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,o),!0;case 5:return f.fn.call(f.context,e,r,o,i),!0;case 6:return f.fn.call(f.context,e,r,o,i,s),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=a[c];f.fn.apply(f.context,u)}else{var p,v=f.length;for(c=0;c<v;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,r);break;case 4:f[c].fn.call(f[c].context,e,r,o);break;default:if(!u)for(p=1,u=new Array(l-1);p<l;p++)u[p-1]=a[p];f[c].fn.apply(f[c].context,u)}}return!0},a.prototype.on=function(t,e,n){return i(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return i(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,r,o){var i=n?n+t:t;if(!this._events[i])return this;if(!e)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==e||o&&!a.once||r&&a.context!==r||s(this,i);else{for(var h=0,u=[],c=a.length;h<c;h++)(a[h].fn!==e||o&&!a[h].once||r&&a[h].context!==r)&&u.push(a[h]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}),s=h,a=h;function h(t,e,n){n=n||2;var r,o,i,s,a,h,l,p=e&&e.length,v=p?e[0]*n:t.length,x=u(t,0,v,n,!0),g=[];if(!x||x.next===x.prev)return g;if(p&&(x=function(t,e,n,r){var o,i,s,a,h,f=[];for(o=0,i=e.length;o<i;o++)s=e[o]*r,a=o<i-1?e[o+1]*r:t.length,(h=u(t,s,a,r,!1))===h.next&&(h.steiner=!0),f.push(m(h));for(f.sort(d),o=0;o<f.length;o++)y(f[o],n),n=c(n,n.next);return n}(t,e,x,n)),t.length>80*n){r=i=t[0],o=s=t[1];for(var b=n;b<v;b+=n)(a=t[b])<r&&(r=a),(h=t[b+1])<o&&(o=h),a>i&&(i=a),h>s&&(s=h);l=0!==(l=Math.max(i-r,s-o))?1/l:0}return f(x,g,n,r,o,l),g}function u(t,e,n,r,o){var i,s;if(o===N(t,e,n,r)>0)for(i=e;i<n;i+=r)s=I(i,t[i],t[i+1],s);else for(i=n-r;i>=e;i-=r)s=I(i,t[i],t[i+1],s);return s&&C(s,s.next)&&(A(s),s=s.next),s}function c(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!C(r,r.next)&&0!==O(r.prev,r,r.next))r=r.next;else{if(A(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function f(t,e,n,r,o,i,s){if(t){!s&&i&&function(t,e,n,r){var o=t;do{null===o.z&&(o.z=g(o.x,o.y,e,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,n,r,o,i,s,a,h,u=1;do{for(n=t,t=null,i=null,s=0;n;){for(s++,r=n,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(h=u;a>0||h>0&&r;)0!==a&&(0===h||!r||n.z<=r.z)?(o=n,n=n.nextZ,a--):(o=r,r=r.nextZ,h--),i?i.nextZ=o:t=o,o.prevZ=i,i=o;n=r}i.nextZ=null,u*=2}while(s>1)}(o)}(t,r,o,i);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,i?p(t,r,o,i):l(t))e.push(a.i/n),e.push(t.i/n),e.push(h.i/n),A(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?f(t=v(t,e,n),e,n,r,o,i,2):2===s&&x(t,e,n,r,o,i):f(c(t),e,n,r,o,i,1);break}}}function l(t){var e=t.prev,n=t,r=t.next;if(O(e,n,r)>=0)return!1;for(var o=t.next.next;o!==t.prev;){if(b(e.x,e.y,n.x,n.y,r.x,r.y,o.x,o.y)&&O(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function p(t,e,n,r){var o=t.prev,i=t,s=t.next;if(O(o,i,s)>=0)return!1;for(var a=o.x<i.x?o.x<s.x?o.x:s.x:i.x<s.x?i.x:s.x,h=o.y<i.y?o.y<s.y?o.y:s.y:i.y<s.y?i.y:s.y,u=o.x>i.x?o.x>s.x?o.x:s.x:i.x>s.x?i.x:s.x,c=o.y>i.y?o.y>s.y?o.y:s.y:i.y>s.y?i.y:s.y,f=g(a,h,e,n,r),l=g(u,c,e,n,r),p=t.prevZ,v=t.nextZ;p&&p.z>=f&&v&&v.z<=l;){if(p!==t.prev&&p!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,p.x,p.y)&&O(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,v.x,v.y)&&O(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,p.x,p.y)&&O(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,v.x,v.y)&&O(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function v(t,e,n){var r=t;do{var o=r.prev,i=r.next.next;!C(o,i)&&_(o,r,r.next,i)&&E(o,i)&&E(i,o)&&(e.push(o.i/n),e.push(r.i/n),e.push(i.i/n),A(r),A(r.next),r=t=i),r=r.next}while(r!==t);return r}function x(t,e,n,r,o,i){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&w(s,a)){var h=j(s,a);return s=c(s,s.next),h=c(h,h.next),f(s,e,n,r,o,i),void f(h,e,n,r,o,i)}a=a.next}s=s.next}while(s!==t)}function d(t,e){return t.x-e.x}function y(t,e){if(e=function(t,e){var n,r=e,o=t.x,i=t.y,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=o&&a>s){if(s=a,a===o){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(o===s)return n.prev;var h,u=n,c=n.x,f=n.y,l=1/0;r=n.next;for(;r!==u;)o>=r.x&&r.x>=c&&o!==r.x&&b(i<f?o:s,i,c,f,i<f?s:o,i,r.x,r.y)&&((h=Math.abs(i-r.y)/(o-r.x))<l||h===l&&r.x>n.x)&&E(r,t)&&(n=r,l=h),r=r.next;return n}(t,e)){var n=j(e,t);c(n,n.next)}}function g(t,e,n,r,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function b(t,e,n,r,o,i,s,a){return(o-s)*(e-a)-(t-s)*(i-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(i-a)-(o-s)*(r-a)>=0}function w(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&_(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&E(t,e)&&E(e,t)&&function(t,e){var n=t,r=!1,o=(t.x+e.x)/2,i=(t.y+e.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}function O(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function C(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,n,r){return!!(C(t,e)&&C(n,r)||C(t,r)&&C(n,e))||O(t,e,n)>0!=O(t,e,r)>0&&O(n,r,t)>0!=O(n,r,e)>0}function E(t,e){return O(t.prev,t,t.next)<0?O(t,e,t.next)>=0&&O(t,t.prev,e)>=0:O(t,e,t.prev)<0||O(t,t.next,e)<0}function j(t,e){var n=new D(t.i,t.x,t.y),r=new D(e.i,e.x,e.y),o=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function I(t,e,n,r){var o=new D(t,e,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function D(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function N(t,e,n,r){for(var o=0,i=e,s=n-r;i<n;i+=r)o+=(t[s]-t[i])*(t[i+1]+t[s+1]),s=i;return o}h.deviation=function(t,e,n,r){var o=e&&e.length,i=o?e[0]*n:t.length,s=Math.abs(N(t,0,i,n));if(o)for(var a=0,h=e.length;a<h;a++){var u=e[a]*n,c=a<h-1?e[a+1]*n:t.length;s-=Math.abs(N(t,u,c,n))}var f=0;for(a=0;a<r.length;a+=3){var l=r[a]*n,p=r[a+1]*n,v=r[a+2]*n;f+=Math.abs((t[l]-t[v])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[v+1]-t[l+1]))}return 0===s&&0===f?0:Math.abs((f-s)/s)},h.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,o=0;o<t.length;o++){for(var i=0;i<t[o].length;i++)for(var s=0;s<e;s++)n.vertices.push(t[o][i][s]);o>0&&(r+=t[o-1].length,n.holes.push(r))}return n},s.default=a;var L=o(function(t,e){!function(n){var o=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var a,h,u=2147483647,c=36,f=1,l=26,p=38,v=700,x=72,d=128,y="-",g=/^xn--/,m=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=c-f,C=Math.floor,_=String.fromCharCode;function E(t){throw RangeError(w[t])}function j(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function I(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+j((t=t.replace(b,".")).split("."),e).join(".")}function A(t){for(var e,n,r=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(n=t.charCodeAt(o++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--):r.push(e);return r}function D(t){return j(t,function(t){var e="";return t>65535&&(e+=_((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=_(t)}).join("")}function N(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function L(t,e,n){var r=0;for(t=n?C(t/v):t>>1,t+=C(t/e);t>O*l>>1;r+=c)t=C(t/O);return C(r+(O+1)*t/(t+p))}function M(t){var e,n,r,o,i,s,a,h,p,v,g,m=[],b=t.length,w=0,O=d,_=x;for((n=t.lastIndexOf(y))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&E("not-basic"),m.push(t.charCodeAt(r));for(o=n>0?n+1:0;o<b;){for(i=w,s=1,a=c;o>=b&&E("invalid-input"),((h=(g=t.charCodeAt(o++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:c)>=c||h>C((u-w)/s))&&E("overflow"),w+=h*s,!(h<(p=a<=_?f:a>=_+l?l:a-_));a+=c)s>C(u/(v=c-p))&&E("overflow"),s*=v;_=L(w-i,e=m.length+1,0==i),C(w/e)>u-O&&E("overflow"),O+=C(w/e),w%=e,m.splice(w++,0,O)}return D(m)}function S(t){var e,n,r,o,i,s,a,h,p,v,g,m,b,w,O,j=[];for(m=(t=A(t)).length,e=d,n=0,i=x,s=0;s<m;++s)(g=t[s])<128&&j.push(_(g));for(r=o=j.length,o&&j.push(y);r<m;){for(a=u,s=0;s<m;++s)(g=t[s])>=e&&g<a&&(a=g);for(a-e>C((u-n)/(b=r+1))&&E("overflow"),n+=(a-e)*b,e=a,s=0;s<m;++s)if((g=t[s])<e&&++n>u&&E("overflow"),g==e){for(h=n,p=c;!(h<(v=p<=i?f:p>=i+l?l:p-i));p+=c)O=h-v,w=c-v,j.push(_(N(v+O%w,0))),h=C(O/w);j.push(_(N(h,0))),i=L(n,b,r==o),n=0,++r}++n,++e}return j.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:D},decode:M,encode:S,toASCII:function(t){return I(t,function(t){return m.test(t)?"xn--"+S(t):t})},toUnicode:function(t){return I(t,function(t){return g.test(t)?M(t.slice(4).toLowerCase()):t})}},o&&i)if(t.exports==o)i.exports=a;else for(h in a)a.hasOwnProperty(h)&&(o[h]=a[h]);else n.punycode=a}(r)}),M={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};M.isString,M.isObject,M.isNull,M.isNullOrUndefined;function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var P=function(t,e,n,r){e=e||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var i=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h<a;++h){var u,c,f,l,p=t[h].replace(i,"%20"),v=p.indexOf(n);v>=0?(u=p.substr(0,v),c=p.substr(v+1)):(u=p,c=""),f=decodeURIComponent(u),l=decodeURIComponent(c),S(o,f)?Array.isArray(o[f])?o[f].push(l):o[f]=[o[f],l]:o[f]=l}return o},R=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,n,r){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var o=encodeURIComponent(R(r))+n;return Array.isArray(t[r])?t[r].map(function(t){return o+encodeURIComponent(R(t))}).join(e):o+encodeURIComponent(R(t[r]))}).join(e):r?encodeURIComponent(R(r))+n+encodeURIComponent(R(t)):""},k=o(function(t,e){e.decode=e.parse=P,e.encode=e.stringify=Z}),T=(k.decode,k.parse,k.encode,k.stringify,nt),U=function(t,e){return nt(t,!1,!0).resolve(e)},q=function(t,e){if(!t)return e;return nt(t,!1,!0).resolveObject(e)},B=function(t){M.isString(t)&&(t=nt(t));if(!(t instanceof F))return F.prototype.format.call(t);return t.format()},z=F;function F(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var X=/^([a-z0-9.+-]+:)/i,W=/:[0-9]*$/,J=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,H=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),$=["'"].concat(H),G=["%","/","?",";","#"].concat($),K=["/","?","#"],Q=/^[+a-z0-9A-Z_-]{0,63}$/,V=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Y={javascript:!0,"javascript:":!0},tt={javascript:!0,"javascript:":!0},et={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function nt(t,e,n){if(t&&M.isObject(t)&&t instanceof F)return t;var r=new F;return r.parse(t,e,n),r}F.prototype.parse=function(t,e,n){if(!M.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),o=-1!==r&&r<t.indexOf("#")?"?":"#",i=t.split(o);i[0]=i[0].replace(/\\/g,"/");var s=t=i.join(o);if(s=s.trim(),!n&&1===t.split("#").length){var a=J.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?k.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=X.exec(s);if(h){var u=(h=h[0]).toLowerCase();this.protocol=u,s=s.substr(h.length)}if(n||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||h&&tt[h]||(s=s.substr(2),this.slashes=!0)}if(!tt[h]&&(c||h&&!et[h])){for(var f,l,p=-1,v=0;v<K.length;v++){-1!==(x=s.indexOf(K[v]))&&(-1===p||x<p)&&(p=x)}-1!==(l=-1===p?s.lastIndexOf("@"):s.lastIndexOf("@",p))&&(f=s.slice(0,l),s=s.slice(l+1),this.auth=decodeURIComponent(f)),p=-1;for(v=0;v<G.length;v++){var x;-1!==(x=s.indexOf(G[v]))&&(-1===p||x<p)&&(p=x)}-1===p&&(p=s.length),this.host=s.slice(0,p),s=s.slice(p),this.parseHost(),this.hostname=this.hostname||"";var d="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!d)for(var y=this.hostname.split(/\./),g=(v=0,y.length);v<g;v++){var m=y[v];if(m&&!m.match(Q)){for(var b="",w=0,O=m.length;w<O;w++)m.charCodeAt(w)>127?b+="x":b+=m[w];if(!b.match(Q)){var C=y.slice(0,v),_=y.slice(v+1),E=m.match(V);E&&(C.push(E[1]),_.unshift(E[2])),_.length&&(s="/"+_.join(".")+s),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),d||(this.hostname=L.toASCII(this.hostname));var j=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+j,this.href+=this.host,d&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Y[u])for(v=0,g=$.length;v<g;v++){var A=$[v];if(-1!==s.indexOf(A)){var D=encodeURIComponent(A);D===A&&(D=escape(A)),s=s.split(A).join(D)}}var N=s.indexOf("#");-1!==N&&(this.hash=s.substr(N),s=s.slice(0,N));var S=s.indexOf("?");if(-1!==S?(this.search=s.substr(S),this.query=s.substr(S+1),e&&(this.query=k.parse(this.query)),s=s.slice(0,S)):e&&(this.search="",this.query={}),s&&(this.pathname=s),et[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var P=this.search||"";this.path=j+P}return this.href=this.format(),this},F.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&M.isObject(this.query)&&Object.keys(this.query).length&&(i=k.stringify(this.query));var s=this.search||i&&"?"+i||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||et[e])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(n=n.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+r},F.prototype.resolve=function(t){return this.resolveObject(nt(t,!1,!0)).format()},F.prototype.resolveObject=function(t){if(M.isString(t)){var e=new F;e.parse(t,!1,!0),t=e}for(var n=new F,r=Object.keys(this),o=0;o<r.length;o++){var i=r[o];n[i]=this[i]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var h=s[a];"protocol"!==h&&(n[h]=t[h])}return et[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!et[t.protocol]){for(var u=Object.keys(t),c=0;c<u.length;c++){var f=u[c];n[f]=t[f]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||tt[t.protocol])n.pathname=t.pathname;else{for(var l=(t.pathname||"").split("/");l.length&&!(t.host=l.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==l[0]&&l.unshift(""),l.length<2&&l.unshift(""),n.pathname=l.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var p=n.pathname||"",v=n.search||"";n.path=p+v}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var x=n.pathname&&"/"===n.pathname.charAt(0),d=t.host||t.pathname&&"/"===t.pathname.charAt(0),y=d||x||n.host&&t.pathname,g=y,m=n.pathname&&n.pathname.split("/")||[],b=(l=t.pathname&&t.pathname.split("/")||[],n.protocol&&!et[n.protocol]);if(b&&(n.hostname="",n.port=null,n.host&&(""===m[0]?m[0]=n.host:m.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===l[0]?l[0]=t.host:l.unshift(t.host)),t.host=null),y=y&&(""===l[0]||""===m[0])),d)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,m=l;else if(l.length)m||(m=[]),m.pop(),m=m.concat(l),n.search=t.search,n.query=t.query;else if(!M.isNullOrUndefined(t.search)){if(b)n.hostname=n.host=m.shift(),(E=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=E.shift(),n.host=n.hostname=E.shift());return n.search=t.search,n.query=t.query,M.isNull(n.pathname)&&M.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!m.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var w=m.slice(-1)[0],O=(n.host||t.host||m.length>1)&&("."===w||".."===w)||""===w,C=0,_=m.length;_>=0;_--)"."===(w=m[_])?m.splice(_,1):".."===w?(m.splice(_,1),C++):C&&(m.splice(_,1),C--);if(!y&&!g)for(;C--;C)m.unshift("..");!y||""===m[0]||m[0]&&"/"===m[0].charAt(0)||m.unshift(""),O&&"/"!==m.join("/").substr(-1)&&m.push("");var E,j=""===m[0]||m[0]&&"/"===m[0].charAt(0);b&&(n.hostname=n.host=j?"":m.length?m.shift():"",(E=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=E.shift(),n.host=n.hostname=E.shift()));return(y=y||n.host&&m.length)&&!j&&m.unshift(""),m.length?n.pathname=m.join("/"):(n.pathname=null,n.path=null),M.isNull(n.pathname)&&M.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},F.prototype.parseHost=function(){var t=this.host,e=W.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var rt={parse:T,resolve:U,resolveObject:q,format:B,Url:z};e.settings.RETINA_PREFIX=/@([0-9\.]+)x/;var ot,it=!1,st="5.0.4";var at=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,t[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,t[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,e[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,e[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,e[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var o=[];return o.push(e),o.push(t),o}();var ht=0;var ut=Object.create(null),ct=Object.create(null);var ft=function(t,n,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||e.settings.RESOLUTION,this.resize(t,n)},lt={width:{configurable:!0},height:{configurable:!0}};ft.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},ft.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},ft.prototype.destroy=function(){this.context=null,this.canvas=null},lt.width.get=function(){return this.canvas.width},lt.width.set=function(t){this.canvas.width=t},lt.height.get=function(){return this.canvas.height},lt.height.set=function(t){this.canvas.height=t},Object.defineProperties(ft.prototype,lt);var pt,vt=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;var xt={};return Object.defineProperty(t,"isMobile",{enumerable:!0,get:function(){return e.isMobile}}),t.BaseTextureCache=ct,t.CanvasRenderTarget=ft,t.DATA_URI=vt,t.EventEmitter=i,t.ProgramCache={},t.TextureCache=ut,t.clearTextureCache=function(){var t;for(t in ut)delete ut[t];for(t in ct)delete ct[t]},t.correctBlendMode=function(t,e){return at[e?1:0][t]},t.createIndicesForQuads=function(t){for(var e=6*t,n=new Uint16Array(e),r=0,o=0;r<e;r+=6,o+=4)n[r+0]=o+0,n[r+1]=o+1,n[r+2]=o+2,n[r+3]=o+0,n[r+4]=o+2,n[r+5]=o+3;return n},t.decomposeDataUri=function(t){var e=vt.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}},t.deprecation=function(t,e,n){if(void 0===n&&(n=3),!xt[e]){var r=(new Error).stack;void 0===r?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(r=r.split("\n").splice(n).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(r))),xt[e]=!0}},t.destroyTextureCache=function(){var t;for(t in ut)ut[t].destroy();for(t in ct)ct[t].destroy()},t.determineCrossOrigin=function(t,e){if(void 0===e&&(e=window.location),0===t.indexOf("data:"))return"";e=e||window.location,pt||(pt=document.createElement("a")),pt.href=t;var n=!(t=rt.parse(pt.href)).port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&n&&t.protocol===e.protocol?"":"anonymous"},t.earcut=s,t.getResolutionOfUrl=function(t,n){var r=e.settings.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==n?n:1},t.hex2rgb=function(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},t.hex2string=function(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)},t.isPow2=function(t){return!(t&t-1||!t)},t.isWebGLSupported=function(){return void 0===ot&&(ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!n||!n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,r}catch(t){return!1}}()),ot},t.log2=function(t){var e=(t>65535)<<4,n=((t>>>=e)>255)<<3;return e|=n,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1},t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},t.premultiplyBlendMode=at,t.premultiplyRgba=function(t,e,n,r){return n=n||new Float32Array(4),r||void 0===r?(n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e):(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=e,n},t.premultiplyTint=function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var n=t>>16&255,r=t>>8&255,o=255&t;return(255*e<<24)+((n=n*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(o=o*e+.5|0)},t.premultiplyTintToRgba=function(t,e,n,r){return(n=n||new Float32Array(4))[0]=(t>>16&255)/255,n[1]=(t>>8&255)/255,n[2]=(255&t)/255,(r||void 0===r)&&(n[0]*=e,n[1]*=e,n[2]*=e),n[3]=e,n},t.removeItems=function(t,e,n){var r,o=t.length;if(!(e>=o||0===n)){var i=o-(n=e+n>o?o-e:n);for(r=e;r<i;++r)t[r]=t[r+n];t.length=i}},t.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},t.sayHello=function(t){if(!it){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+st+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+st+" - "+t+" - http://www.pixijs.com/");it=!0}},t.sign=function(t){return 0===t?0:t<0?-1:1},t.skipHello=function(){it=!0},t.string2hex=function(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)},t.trimCanvas=function(t){var e,n,r,o=t.width,i=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,o,i).data,h=a.length,u={top:null,left:null,right:null,bottom:null},c=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(n=e/4%o,r=~~(e/4/o),null===u.top&&(u.top=r),null===u.left?u.left=n:n<u.left&&(u.left=n),null===u.right?u.right=n+1:u.right<n&&(u.right=n+1),null===u.bottom?u.bottom=r:u.bottom<r&&(u.bottom=r));return null!==u.top&&(o=u.right-u.left,i=u.bottom-u.top+1,c=s.getImageData(u.left,u.top,o,i)),{height:i,width:o,data:c}},t.uid=function(){return++ht},t.url=rt,t}({},PIXI,PIXI);Object.assign(this.PIXI.utils,_pixi_utils); | ||
this.PIXI=this.PIXI||{},this.PIXI.utils=this.PIXI.utils||{};var _pixi_utils=function(t,e,n){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function i(t,e,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||t,s),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,o=[];if(0===this._eventsCount)return o;for(r in t=this._events)e.call(t,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,s=new Array(i);o<i;o++)s[o]=r[o].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,o,i,s){var a=arguments,h=n?n+t:t;if(!this._events[h])return!1;var u,c,f=this._events[h],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,o),!0;case 5:return f.fn.call(f.context,e,r,o,i),!0;case 6:return f.fn.call(f.context,e,r,o,i,s),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=a[c];f.fn.apply(f.context,u)}else{var p,v=f.length;for(c=0;c<v;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,r);break;case 4:f[c].fn.call(f[c].context,e,r,o);break;default:if(!u)for(p=1,u=new Array(l-1);p<l;p++)u[p-1]=a[p];f[c].fn.apply(f[c].context,u)}}return!0},a.prototype.on=function(t,e,n){return i(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return i(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,r,o){var i=n?n+t:t;if(!this._events[i])return this;if(!e)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==e||o&&!a.once||r&&a.context!==r||s(this,i);else{for(var h=0,u=[],c=a.length;h<c;h++)(a[h].fn!==e||o&&!a[h].once||r&&a[h].context!==r)&&u.push(a[h]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}),s=h,a=h;function h(t,e,n){n=n||2;var r,o,i,s,a,h,l,p=e&&e.length,v=p?e[0]*n:t.length,x=u(t,0,v,n,!0),g=[];if(!x||x.next===x.prev)return g;if(p&&(x=function(t,e,n,r){var o,i,s,a,h,f=[];for(o=0,i=e.length;o<i;o++)s=e[o]*r,a=o<i-1?e[o+1]*r:t.length,(h=u(t,s,a,r,!1))===h.next&&(h.steiner=!0),f.push(m(h));for(f.sort(d),o=0;o<f.length;o++)y(f[o],n),n=c(n,n.next);return n}(t,e,x,n)),t.length>80*n){r=i=t[0],o=s=t[1];for(var b=n;b<v;b+=n)(a=t[b])<r&&(r=a),(h=t[b+1])<o&&(o=h),a>i&&(i=a),h>s&&(s=h);l=0!==(l=Math.max(i-r,s-o))?1/l:0}return f(x,g,n,r,o,l),g}function u(t,e,n,r,o){var i,s;if(o===N(t,e,n,r)>0)for(i=e;i<n;i+=r)s=I(i,t[i],t[i+1],s);else for(i=n-r;i>=e;i-=r)s=I(i,t[i],t[i+1],s);return s&&_(s,s.next)&&(j(s),s=s.next),s}function c(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_(r,r.next)&&0!==O(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function f(t,e,n,r,o,i,s){if(t){!s&&i&&function(t,e,n,r){var o=t;do{null===o.z&&(o.z=g(o.x,o.y,e,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,n,r,o,i,s,a,h,u=1;do{for(n=t,t=null,i=null,s=0;n;){for(s++,r=n,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(h=u;a>0||h>0&&r;)0!==a&&(0===h||!r||n.z<=r.z)?(o=n,n=n.nextZ,a--):(o=r,r=r.nextZ,h--),i?i.nextZ=o:t=o,o.prevZ=i,i=o;n=r}i.nextZ=null,u*=2}while(s>1)}(o)}(t,r,o,i);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,i?p(t,r,o,i):l(t))e.push(a.i/n),e.push(t.i/n),e.push(h.i/n),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?f(t=v(t,e,n),e,n,r,o,i,2):2===s&&x(t,e,n,r,o,i):f(c(t),e,n,r,o,i,1);break}}}function l(t){var e=t.prev,n=t,r=t.next;if(O(e,n,r)>=0)return!1;for(var o=t.next.next;o!==t.prev;){if(b(e.x,e.y,n.x,n.y,r.x,r.y,o.x,o.y)&&O(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function p(t,e,n,r){var o=t.prev,i=t,s=t.next;if(O(o,i,s)>=0)return!1;for(var a=o.x<i.x?o.x<s.x?o.x:s.x:i.x<s.x?i.x:s.x,h=o.y<i.y?o.y<s.y?o.y:s.y:i.y<s.y?i.y:s.y,u=o.x>i.x?o.x>s.x?o.x:s.x:i.x>s.x?i.x:s.x,c=o.y>i.y?o.y>s.y?o.y:s.y:i.y>s.y?i.y:s.y,f=g(a,h,e,n,r),l=g(u,c,e,n,r),p=t.prevZ,v=t.nextZ;p&&p.z>=f&&v&&v.z<=l;){if(p!==t.prev&&p!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,p.x,p.y)&&O(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,v.x,v.y)&&O(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,p.x,p.y)&&O(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&b(o.x,o.y,i.x,i.y,s.x,s.y,v.x,v.y)&&O(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function v(t,e,n){var r=t;do{var o=r.prev,i=r.next.next;!_(o,i)&&C(o,r,r.next,i)&&E(o,i)&&E(i,o)&&(e.push(o.i/n),e.push(r.i/n),e.push(i.i/n),j(r),j(r.next),r=t=i),r=r.next}while(r!==t);return r}function x(t,e,n,r,o,i){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&w(s,a)){var h=A(s,a);return s=c(s,s.next),h=c(h,h.next),f(s,e,n,r,o,i),void f(h,e,n,r,o,i)}a=a.next}s=s.next}while(s!==t)}function d(t,e){return t.x-e.x}function y(t,e){if(e=function(t,e){var n,r=e,o=t.x,i=t.y,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=o&&a>s){if(s=a,a===o){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(o===s)return n.prev;var h,u=n,c=n.x,f=n.y,l=1/0;r=n.next;for(;r!==u;)o>=r.x&&r.x>=c&&o!==r.x&&b(i<f?o:s,i,c,f,i<f?s:o,i,r.x,r.y)&&((h=Math.abs(i-r.y)/(o-r.x))<l||h===l&&r.x>n.x)&&E(r,t)&&(n=r,l=h),r=r.next;return n}(t,e)){var n=A(e,t);c(n,n.next)}}function g(t,e,n,r,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function b(t,e,n,r,o,i,s,a){return(o-s)*(e-a)-(t-s)*(i-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(i-a)-(o-s)*(r-a)>=0}function w(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&C(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&E(t,e)&&E(e,t)&&function(t,e){var n=t,r=!1,o=(t.x+e.x)/2,i=(t.y+e.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}function O(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function C(t,e,n,r){return!!(_(t,e)&&_(n,r)||_(t,r)&&_(n,e))||O(t,e,n)>0!=O(t,e,r)>0&&O(n,r,t)>0!=O(n,r,e)>0}function E(t,e){return O(t.prev,t,t.next)<0?O(t,e,t.next)>=0&&O(t,t.prev,e)>=0:O(t,e,t.prev)<0||O(t,t.next,e)<0}function A(t,e){var n=new D(t.i,t.x,t.y),r=new D(e.i,e.x,e.y),o=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function I(t,e,n,r){var o=new D(t,e,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function j(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function D(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function N(t,e,n,r){for(var o=0,i=e,s=n-r;i<n;i+=r)o+=(t[s]-t[i])*(t[i+1]+t[s+1]),s=i;return o}h.deviation=function(t,e,n,r){var o=e&&e.length,i=o?e[0]*n:t.length,s=Math.abs(N(t,0,i,n));if(o)for(var a=0,h=e.length;a<h;a++){var u=e[a]*n,c=a<h-1?e[a+1]*n:t.length;s-=Math.abs(N(t,u,c,n))}var f=0;for(a=0;a<r.length;a+=3){var l=r[a]*n,p=r[a+1]*n,v=r[a+2]*n;f+=Math.abs((t[l]-t[v])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[v+1]-t[l+1]))}return 0===s&&0===f?0:Math.abs((f-s)/s)},h.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,o=0;o<t.length;o++){for(var i=0;i<t[o].length;i++)for(var s=0;s<e;s++)n.vertices.push(t[o][i][s]);o>0&&(r+=t[o-1].length,n.holes.push(r))}return n},s.default=a;var M=o(function(t,e){!function(n){var o=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var a,h,u=2147483647,c=36,f=1,l=26,p=38,v=700,x=72,d=128,y="-",g=/^xn--/,m=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=c-f,_=Math.floor,C=String.fromCharCode;function E(t){throw RangeError(w[t])}function A(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function I(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+A((t=t.replace(b,".")).split("."),e).join(".")}function j(t){for(var e,n,r=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(n=t.charCodeAt(o++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--):r.push(e);return r}function D(t){return A(t,function(t){var e="";return t>65535&&(e+=C((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=C(t)}).join("")}function N(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,n){var r=0;for(t=n?_(t/v):t>>1,t+=_(t/e);t>O*l>>1;r+=c)t=_(t/O);return _(r+(O+1)*t/(t+p))}function R(t){var e,n,r,o,i,s,a,h,p,v,g,m=[],b=t.length,w=0,O=d,C=x;for((n=t.lastIndexOf(y))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&E("not-basic"),m.push(t.charCodeAt(r));for(o=n>0?n+1:0;o<b;){for(i=w,s=1,a=c;o>=b&&E("invalid-input"),((h=(g=t.charCodeAt(o++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:c)>=c||h>_((u-w)/s))&&E("overflow"),w+=h*s,!(h<(p=a<=C?f:a>=C+l?l:a-C));a+=c)s>_(u/(v=c-p))&&E("overflow"),s*=v;C=M(w-i,e=m.length+1,0==i),_(w/e)>u-O&&E("overflow"),O+=_(w/e),w%=e,m.splice(w++,0,O)}return D(m)}function L(t){var e,n,r,o,i,s,a,h,p,v,g,m,b,w,O,A=[];for(m=(t=j(t)).length,e=d,n=0,i=x,s=0;s<m;++s)(g=t[s])<128&&A.push(C(g));for(r=o=A.length,o&&A.push(y);r<m;){for(a=u,s=0;s<m;++s)(g=t[s])>=e&&g<a&&(a=g);for(a-e>_((u-n)/(b=r+1))&&E("overflow"),n+=(a-e)*b,e=a,s=0;s<m;++s)if((g=t[s])<e&&++n>u&&E("overflow"),g==e){for(h=n,p=c;!(h<(v=p<=i?f:p>=i+l?l:p-i));p+=c)O=h-v,w=c-v,A.push(C(N(v+O%w,0))),h=_(O/w);A.push(C(N(h,0))),i=M(n,b,r==o),n=0,++r}++n,++e}return A.join("")}if(a={version:"1.3.2",ucs2:{decode:j,encode:D},decode:R,encode:L,toASCII:function(t){return I(t,function(t){return m.test(t)?"xn--"+L(t):t})},toUnicode:function(t){return I(t,function(t){return g.test(t)?R(t.slice(4).toLowerCase()):t})}},o&&i)if(t.exports==o)i.exports=a;else for(h in a)a.hasOwnProperty(h)&&(o[h]=a[h]);else n.punycode=a}(r)}),R={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};R.isString,R.isObject,R.isNull,R.isNullOrUndefined;function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var P=function(t,e,n,r){e=e||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var i=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h<a;++h){var u,c,f,l,p=t[h].replace(i,"%20"),v=p.indexOf(n);v>=0?(u=p.substr(0,v),c=p.substr(v+1)):(u=p,c=""),f=decodeURIComponent(u),l=decodeURIComponent(c),L(o,f)?Array.isArray(o[f])?o[f].push(l):o[f]=[o[f],l]:o[f]=l}return o},S=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,n,r){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var o=encodeURIComponent(S(r))+n;return Array.isArray(t[r])?t[r].map(function(t){return o+encodeURIComponent(S(t))}).join(e):o+encodeURIComponent(S(t[r]))}).join(e):r?encodeURIComponent(S(r))+n+encodeURIComponent(S(t)):""},k=o(function(t,e){e.decode=e.parse=P,e.encode=e.stringify=Z}),T=(k.decode,k.parse,k.encode,k.stringify,nt),U=function(t,e){return nt(t,!1,!0).resolve(e)},q=function(t,e){if(!t)return e;return nt(t,!1,!0).resolveObject(e)},F=function(t){R.isString(t)&&(t=nt(t));if(!(t instanceof z))return z.prototype.format.call(t);return t.format()},B=z;function z(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var X=/^([a-z0-9.+-]+:)/i,J=/:[0-9]*$/,W=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,H=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),$=["'"].concat(H),G=["%","/","?",";","#"].concat($),K=["/","?","#"],V=/^[+a-z0-9A-Z_-]{0,63}$/,Q=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Y={javascript:!0,"javascript:":!0},tt={javascript:!0,"javascript:":!0},et={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function nt(t,e,n){if(t&&R.isObject(t)&&t instanceof z)return t;var r=new z;return r.parse(t,e,n),r}z.prototype.parse=function(t,e,n){if(!R.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),o=-1!==r&&r<t.indexOf("#")?"?":"#",i=t.split(o);i[0]=i[0].replace(/\\/g,"/");var s=t=i.join(o);if(s=s.trim(),!n&&1===t.split("#").length){var a=W.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?k.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=X.exec(s);if(h){var u=(h=h[0]).toLowerCase();this.protocol=u,s=s.substr(h.length)}if(n||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||h&&tt[h]||(s=s.substr(2),this.slashes=!0)}if(!tt[h]&&(c||h&&!et[h])){for(var f,l,p=-1,v=0;v<K.length;v++){-1!==(x=s.indexOf(K[v]))&&(-1===p||x<p)&&(p=x)}-1!==(l=-1===p?s.lastIndexOf("@"):s.lastIndexOf("@",p))&&(f=s.slice(0,l),s=s.slice(l+1),this.auth=decodeURIComponent(f)),p=-1;for(v=0;v<G.length;v++){var x;-1!==(x=s.indexOf(G[v]))&&(-1===p||x<p)&&(p=x)}-1===p&&(p=s.length),this.host=s.slice(0,p),s=s.slice(p),this.parseHost(),this.hostname=this.hostname||"";var d="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!d)for(var y=this.hostname.split(/\./),g=(v=0,y.length);v<g;v++){var m=y[v];if(m&&!m.match(V)){for(var b="",w=0,O=m.length;w<O;w++)m.charCodeAt(w)>127?b+="x":b+=m[w];if(!b.match(V)){var _=y.slice(0,v),C=y.slice(v+1),E=m.match(Q);E&&(_.push(E[1]),C.unshift(E[2])),C.length&&(s="/"+C.join(".")+s),this.hostname=_.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),d||(this.hostname=M.toASCII(this.hostname));var A=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+A,this.href+=this.host,d&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Y[u])for(v=0,g=$.length;v<g;v++){var j=$[v];if(-1!==s.indexOf(j)){var D=encodeURIComponent(j);D===j&&(D=escape(j)),s=s.split(j).join(D)}}var N=s.indexOf("#");-1!==N&&(this.hash=s.substr(N),s=s.slice(0,N));var L=s.indexOf("?");if(-1!==L?(this.search=s.substr(L),this.query=s.substr(L+1),e&&(this.query=k.parse(this.query)),s=s.slice(0,L)):e&&(this.search="",this.query={}),s&&(this.pathname=s),et[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){A=this.pathname||"";var P=this.search||"";this.path=A+P}return this.href=this.format(),this},z.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&R.isObject(this.query)&&Object.keys(this.query).length&&(i=k.stringify(this.query));var s=this.search||i&&"?"+i||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||et[e])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(n=n.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+r},z.prototype.resolve=function(t){return this.resolveObject(nt(t,!1,!0)).format()},z.prototype.resolveObject=function(t){if(R.isString(t)){var e=new z;e.parse(t,!1,!0),t=e}for(var n=new z,r=Object.keys(this),o=0;o<r.length;o++){var i=r[o];n[i]=this[i]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var h=s[a];"protocol"!==h&&(n[h]=t[h])}return et[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!et[t.protocol]){for(var u=Object.keys(t),c=0;c<u.length;c++){var f=u[c];n[f]=t[f]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||tt[t.protocol])n.pathname=t.pathname;else{for(var l=(t.pathname||"").split("/");l.length&&!(t.host=l.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==l[0]&&l.unshift(""),l.length<2&&l.unshift(""),n.pathname=l.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var p=n.pathname||"",v=n.search||"";n.path=p+v}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var x=n.pathname&&"/"===n.pathname.charAt(0),d=t.host||t.pathname&&"/"===t.pathname.charAt(0),y=d||x||n.host&&t.pathname,g=y,m=n.pathname&&n.pathname.split("/")||[],b=(l=t.pathname&&t.pathname.split("/")||[],n.protocol&&!et[n.protocol]);if(b&&(n.hostname="",n.port=null,n.host&&(""===m[0]?m[0]=n.host:m.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===l[0]?l[0]=t.host:l.unshift(t.host)),t.host=null),y=y&&(""===l[0]||""===m[0])),d)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,m=l;else if(l.length)m||(m=[]),m.pop(),m=m.concat(l),n.search=t.search,n.query=t.query;else if(!R.isNullOrUndefined(t.search)){if(b)n.hostname=n.host=m.shift(),(E=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=E.shift(),n.host=n.hostname=E.shift());return n.search=t.search,n.query=t.query,R.isNull(n.pathname)&&R.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!m.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var w=m.slice(-1)[0],O=(n.host||t.host||m.length>1)&&("."===w||".."===w)||""===w,_=0,C=m.length;C>=0;C--)"."===(w=m[C])?m.splice(C,1):".."===w?(m.splice(C,1),_++):_&&(m.splice(C,1),_--);if(!y&&!g)for(;_--;_)m.unshift("..");!y||""===m[0]||m[0]&&"/"===m[0].charAt(0)||m.unshift(""),O&&"/"!==m.join("/").substr(-1)&&m.push("");var E,A=""===m[0]||m[0]&&"/"===m[0].charAt(0);b&&(n.hostname=n.host=A?"":m.length?m.shift():"",(E=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=E.shift(),n.host=n.hostname=E.shift()));return(y=y||n.host&&m.length)&&!A&&m.unshift(""),m.length?n.pathname=m.join("/"):(n.pathname=null,n.path=null),R.isNull(n.pathname)&&R.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},z.prototype.parseHost=function(){var t=this.host,e=J.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var rt={parse:T,resolve:U,resolveObject:q,format:F,Url:B};e.settings.RETINA_PREFIX=/@([0-9\.]+)x/,e.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var ot,it=!1,st="5.1.0";var at=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,t[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,t[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,e[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,e[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,e[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var o=[];return o.push(e),o.push(t),o}();var ht=0;var ut=Object.create(null),ct=Object.create(null);var ft=function(t,n,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||e.settings.RESOLUTION,this.resize(t,n)},lt={width:{configurable:!0},height:{configurable:!0}};ft.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},ft.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},ft.prototype.destroy=function(){this.context=null,this.canvas=null},lt.width.get=function(){return this.canvas.width},lt.width.set=function(t){this.canvas.width=t},lt.height.get=function(){return this.canvas.height},lt.height.set=function(t){this.canvas.height=t},Object.defineProperties(ft.prototype,lt);var pt,vt=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;var xt={};return Object.defineProperty(t,"isMobile",{enumerable:!0,get:function(){return e.isMobile}}),t.BaseTextureCache=ct,t.CanvasRenderTarget=ft,t.DATA_URI=vt,t.EventEmitter=i,t.ProgramCache={},t.TextureCache=ut,t.clearTextureCache=function(){var t;for(t in ut)delete ut[t];for(t in ct)delete ct[t]},t.correctBlendMode=function(t,e){return at[e?1:0][t]},t.createIndicesForQuads=function(t,e){void 0===e&&(e=null);var n=6*t;if((e=e||new Uint16Array(n)).length!==n)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+n);for(var r=0,o=0;r<n;r+=6,o+=4)e[r+0]=o+0,e[r+1]=o+1,e[r+2]=o+2,e[r+3]=o+0,e[r+4]=o+2,e[r+5]=o+3;return e},t.decomposeDataUri=function(t){var e=vt.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}},t.deprecation=function(t,e,n){if(void 0===n&&(n=3),!xt[e]){var r=(new Error).stack;void 0===r?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(r=r.split("\n").splice(n).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(r))),xt[e]=!0}},t.destroyTextureCache=function(){var t;for(t in ut)ut[t].destroy();for(t in ct)ct[t].destroy()},t.determineCrossOrigin=function(t,e){if(void 0===e&&(e=window.location),0===t.indexOf("data:"))return"";e=e||window.location,pt||(pt=document.createElement("a")),pt.href=t;var n=!(t=rt.parse(pt.href)).port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&n&&t.protocol===e.protocol?"":"anonymous"},t.earcut=s,t.getResolutionOfUrl=function(t,n){var r=e.settings.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==n?n:1},t.hex2rgb=function(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},t.hex2string=function(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)},t.isPow2=function(t){return!(t&t-1||!t)},t.isWebGLSupported=function(){return void 0===ot&&(ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:e.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var n=document.createElement("canvas"),r=n.getContext("webgl",t)||n.getContext("experimental-webgl",t),o=!(!r||!r.getContextAttributes().stencil);if(r){var i=r.getExtension("WEBGL_lose_context");i&&i.loseContext()}return r=null,o}catch(t){return!1}}()),ot},t.log2=function(t){var e=(t>65535)<<4,n=((t>>>=e)>255)<<3;return e|=n,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1},t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},t.premultiplyBlendMode=at,t.premultiplyRgba=function(t,e,n,r){return n=n||new Float32Array(4),r||void 0===r?(n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e):(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=e,n},t.premultiplyTint=function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var n=t>>16&255,r=t>>8&255,o=255&t;return(255*e<<24)+((n=n*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(o=o*e+.5|0)},t.premultiplyTintToRgba=function(t,e,n,r){return(n=n||new Float32Array(4))[0]=(t>>16&255)/255,n[1]=(t>>8&255)/255,n[2]=(255&t)/255,(r||void 0===r)&&(n[0]*=e,n[1]*=e,n[2]*=e),n[3]=e,n},t.removeItems=function(t,e,n){var r,o=t.length;if(!(e>=o||0===n)){var i=o-(n=e+n>o?o-e:n);for(r=e;r<i;++r)t[r]=t[r+n];t.length=i}},t.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},t.sayHello=function(t){if(!it){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+st+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+st+" - "+t+" - http://www.pixijs.com/");it=!0}},t.sign=function(t){return 0===t?0:t<0?-1:1},t.skipHello=function(){it=!0},t.string2hex=function(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)},t.trimCanvas=function(t){var e,n,r,o=t.width,i=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,o,i).data,h=a.length,u={top:null,left:null,right:null,bottom:null},c=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(n=e/4%o,r=~~(e/4/o),null===u.top&&(u.top=r),null===u.left?u.left=n:n<u.left&&(u.left=n),null===u.right?u.right=n+1:u.right<n&&(u.right=n+1),null===u.bottom?u.bottom=r:u.bottom<r&&(u.bottom=r));return null!==u.top&&(o=u.right-u.left,i=u.bottom-u.top+1,c=s.getImageData(u.left,u.top,o,i)),{height:i,width:o,data:c}},t.uid=function(){return++ht},t.url=rt,t}({},PIXI,PIXI);Object.assign(this.PIXI.utils,_pixi_utils); | ||
//# sourceMappingURL=utils.min.js.map |
/*! | ||
* @pixi/utils - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* @pixi/utils - v5.1.0 | ||
* Compiled Fri, 19 Jul 2019 21:54:36 UTC | ||
* | ||
@@ -28,4 +28,17 @@ * @pixi/utils is licensed under the MIT License. | ||
/** | ||
* Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported` function. | ||
* For most scenarios this should be left as true, as otherwise the user may have a poor experience. | ||
* However, it can be useful to disable under certain scenarios, such as headless unit tests. | ||
* | ||
* @static | ||
* @name FAIL_IF_MAJOR_PERFORMANCE_CAVEAT | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
* @default true | ||
*/ | ||
settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = true; | ||
var saidHello = false; | ||
var VERSION = '5.0.4'; | ||
var VERSION = '5.1.0'; | ||
@@ -46,3 +59,3 @@ /** | ||
* If you don't want to see this message you can run `PIXI.utils.skipHello()` before | ||
* creating your renderer. Keep in mind that doing that will forever makes you a jerk face. | ||
* creating your renderer. Keep in mind that doing that will forever make you a jerk face. | ||
* | ||
@@ -100,3 +113,6 @@ * @static | ||
{ | ||
var contextOptions = { stencil: true, failIfMajorPerformanceCaveat: true }; | ||
var contextOptions = { | ||
stencil: true, | ||
failIfMajorPerformanceCaveat: settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT, | ||
}; | ||
@@ -365,28 +381,34 @@ try | ||
* | ||
* @memberof PIXI | ||
* @memberof PIXI.utils | ||
* @function createIndicesForQuads | ||
* @private | ||
* @param {number} size - Number of quads | ||
* @return {Uint16Array} indices | ||
* @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size` | ||
* @return {Uint16Array|Uint32Array} - Resulting index buffer | ||
*/ | ||
function createIndicesForQuads(size) | ||
function createIndicesForQuads(size, outBuffer) | ||
{ | ||
if ( outBuffer === void 0 ) outBuffer = null; | ||
// the total number of indices in our array, there are 6 points per quad. | ||
var totalIndices = size * 6; | ||
var indices = new Uint16Array(totalIndices); | ||
outBuffer = outBuffer || new Uint16Array(totalIndices); | ||
if (outBuffer.length !== totalIndices) | ||
{ | ||
throw new Error(("Out buffer length is incorrect, got " + (outBuffer.length) + " and expected " + totalIndices)); | ||
} | ||
// fill the indices with the quads to draw | ||
for (var i = 0, j = 0; i < totalIndices; i += 6, j += 4) | ||
{ | ||
indices[i + 0] = j + 0; | ||
indices[i + 1] = j + 1; | ||
indices[i + 2] = j + 2; | ||
indices[i + 3] = j + 0; | ||
indices[i + 4] = j + 2; | ||
indices[i + 5] = j + 3; | ||
outBuffer[i + 0] = j + 0; | ||
outBuffer[i + 1] = j + 1; | ||
outBuffer[i + 2] = j + 2; | ||
outBuffer[i + 3] = j + 0; | ||
outBuffer[i + 4] = j + 2; | ||
outBuffer[i + 5] = j + 3; | ||
} | ||
return indices; | ||
return outBuffer; | ||
} | ||
@@ -393,0 +415,0 @@ |
/*! | ||
* @pixi/utils - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* @pixi/utils - v5.1.0 | ||
* Compiled Fri, 19 Jul 2019 21:54:36 UTC | ||
* | ||
@@ -32,4 +32,17 @@ * @pixi/utils is licensed under the MIT License. | ||
/** | ||
* Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported` function. | ||
* For most scenarios this should be left as true, as otherwise the user may have a poor experience. | ||
* However, it can be useful to disable under certain scenarios, such as headless unit tests. | ||
* | ||
* @static | ||
* @name FAIL_IF_MAJOR_PERFORMANCE_CAVEAT | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
* @default true | ||
*/ | ||
settings.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = true; | ||
var saidHello = false; | ||
var VERSION = '5.0.4'; | ||
var VERSION = '5.1.0'; | ||
@@ -50,3 +63,3 @@ /** | ||
* If you don't want to see this message you can run `PIXI.utils.skipHello()` before | ||
* creating your renderer. Keep in mind that doing that will forever makes you a jerk face. | ||
* creating your renderer. Keep in mind that doing that will forever make you a jerk face. | ||
* | ||
@@ -104,3 +117,6 @@ * @static | ||
{ | ||
var contextOptions = { stencil: true, failIfMajorPerformanceCaveat: true }; | ||
var contextOptions = { | ||
stencil: true, | ||
failIfMajorPerformanceCaveat: settings.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT, | ||
}; | ||
@@ -369,28 +385,34 @@ try | ||
* | ||
* @memberof PIXI | ||
* @memberof PIXI.utils | ||
* @function createIndicesForQuads | ||
* @private | ||
* @param {number} size - Number of quads | ||
* @return {Uint16Array} indices | ||
* @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size` | ||
* @return {Uint16Array|Uint32Array} - Resulting index buffer | ||
*/ | ||
function createIndicesForQuads(size) | ||
function createIndicesForQuads(size, outBuffer) | ||
{ | ||
if ( outBuffer === void 0 ) outBuffer = null; | ||
// the total number of indices in our array, there are 6 points per quad. | ||
var totalIndices = size * 6; | ||
var indices = new Uint16Array(totalIndices); | ||
outBuffer = outBuffer || new Uint16Array(totalIndices); | ||
if (outBuffer.length !== totalIndices) | ||
{ | ||
throw new Error(("Out buffer length is incorrect, got " + (outBuffer.length) + " and expected " + totalIndices)); | ||
} | ||
// fill the indices with the quads to draw | ||
for (var i = 0, j = 0; i < totalIndices; i += 6, j += 4) | ||
{ | ||
indices[i + 0] = j + 0; | ||
indices[i + 1] = j + 1; | ||
indices[i + 2] = j + 2; | ||
indices[i + 3] = j + 0; | ||
indices[i + 4] = j + 2; | ||
indices[i + 5] = j + 3; | ||
outBuffer[i + 0] = j + 0; | ||
outBuffer[i + 1] = j + 1; | ||
outBuffer[i + 2] = j + 2; | ||
outBuffer[i + 3] = j + 0; | ||
outBuffer[i + 4] = j + 2; | ||
outBuffer[i + 5] = j + 3; | ||
} | ||
return indices; | ||
return outBuffer; | ||
} | ||
@@ -397,0 +419,0 @@ |
{ | ||
"name": "@pixi/utils", | ||
"version": "5.0.4", | ||
"version": "5.1.0", | ||
"main": "lib/utils.js", | ||
@@ -23,5 +23,2 @@ "module": "lib/utils.es.js", | ||
}, | ||
"scripts": { | ||
"test": "floss --path test" | ||
}, | ||
"files": [ | ||
@@ -32,4 +29,4 @@ "lib", | ||
"dependencies": { | ||
"@pixi/constants": "^5.0.4", | ||
"@pixi/settings": "^5.0.4", | ||
"@pixi/constants": "^5.1.0", | ||
"@pixi/settings": "^5.1.0", | ||
"earcut": "^2.1.5", | ||
@@ -39,6 +36,3 @@ "eventemitter3": "^3.1.0", | ||
}, | ||
"devDependencies": { | ||
"floss": "^2.2.0" | ||
}, | ||
"gitHead": "7a771ca5f05eeba62222b53446d0c2bdfcac37f7" | ||
"gitHead": "05c5e0e0beba56e886c74f201bf7efe576612570" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
591265
0
4866
Updated@pixi/constants@^5.1.0
Updated@pixi/settings@^5.1.0