1/*! For license information please see 53.a31d8470c27bd6a41b32.js.LICENSE.txt */ 2(self.webpackChunkmy_webpack_project=self.webpackChunkmy_webpack_project||[]).push([[53],{592(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)([(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3.2"},"0"),(0,n.jsx)("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt")},82368(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1z"}),"ClosedCaption")},23760(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M6.83 4H19c1.1 0 2 .9 2 2v12c0 .05-.01.1-.02.16l-3.38-3.38c.24-.19.4-.46.4-.78v-1h-1.5v.5h-.17l-1.83-1.83V10.5h2v.5H18v-1c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1v.17zm12.95 18.61L17.17 20H5c-1.11 0-2-.9-2-2V6c0-.05.02-.1.02-.15L1.39 4.22 2.8 2.81l18.38 18.38zM11 13.83l-.83-.83H9.5v.5h-2v-3h.17L6.4 9.22c-.24.19-.4.46-.4.78v4c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z"}),"ClosedCaptionDisabled")},94459(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete")},67808(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M15 16h4v2h-4zm0-8h7v2h-7zm0 4h6v2h-6zM3 18c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V8H3zM14 5h-3l-1-1H6L5 5H2v2h12z"}),"DeleteSweep")},55834(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutlineOutlined")},37539(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2m-11-4 2.03 2.71L16 11l4 5H8zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6z"}),"PhotoLibrary")},62781(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh")},56525(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.11-.9-2-2-2H4c-1.11 0-2 .89-2 2v10c0 1.1.89 2 2 2H0v2h24v-2zm-7-3.53v-2.19c-2.78 0-4.61.85-6 2.72.56-2.67 2.11-5.33 6-5.87V7l4 3.73z"}),"ScreenShare")},67717(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"m21.22 18.02 2 2H24v-2zm.77-2 .01-10c0-1.11-.9-2-2-2H7.22l5.23 5.23c.18-.04.36-.07.55-.1V7.02l4 3.73-1.58 1.47 5.54 5.54c.61-.33 1.03-.99 1.03-1.74M2.39 1.73 1.11 3l1.54 1.54c-.4.36-.65.89-.65 1.48v10c0 1.1.89 2 2 2H0v2h18.13l2.71 2.71 1.27-1.27zM7 15.02c.31-1.48.92-2.95 2.07-4.06l1.59 1.59c-1.54.38-2.7 1.18-3.66 2.47"}),"StopScreenShare")},91236(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"m12.87 15.07-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2zm-2.62 7 1.62-4.33L19.12 17z"}),"Translate")},86746(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam")},44257(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"m21 6.5-4 4V7c0-.55-.45-1-1-1H9.82L21 17.18zM3.27 2 2 3.27 4.73 6H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.21 0 .39-.08.54-.18L19.73 21 21 19.73z"}),"VideocamOff")},17072(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility")},62087(t,e,r){"use strict";var i=r(88569);e.A=void 0;var s=i(r(89987)),n=r(47671);e.A=(0,s.default)((0,n.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},53637(t,e,r){"use strict";r.d(e,{A:()=>_});
2var i=r(21098),s=r(82195),n=r(39471),o=r(34164),a=r(88094),h=r(26946),l=r(58659),u=r(55072),c=r(26896);function d(t){return(0,c.Ay)("MuiCardMedia",t)}(0,u.A)("MuiCardMedia",["root","media","img"]);var p=r(47671);const f=["children","className","component","image","src","style"],m=(0,l.Ay)("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t,{isMediaComponent:i,isImageComponent:s}=r;return[e.root,i&&e.media,s&&e.img]}})(({ownerState:t})=>(0,s.A)({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},t.isMediaComponent&&{width:"100%"},t.isImageComponent&&{objectFit:"cover"})),g=["video","audio","picture","iframe","img"],y=["picture","img"],_=n.forwardRef(function(t,e){const r=(0,h.b)({props:t,name:"MuiCardMedia"}),{children:n,className:l,component:u="div",image:c,src:_,style:v}=r,x=(0,i.A)(r,f),b=-1!==g.indexOf(u),E=!b&&c?(0,s.A)({backgroundImage:`url("${c}")`},v):v,T=(0,s.A)({},r,{component:u,isMediaComponent:b,isImageComponent:-1!==y.indexOf(u)}),A=(t=>{const{classes:e,isMediaComponent:r,isImageComponent:i}=t,s={root:["root",r&&"media",i&&"img"]};return(0,a.A)(s,d,e)})(T);return(0,p.jsx)(m,(0,s.A)({className:(0,o.A)(A.root,l),as:u,role:!b&&c?"img":void 0,ref:e,style:E,ownerState:T,src:b?c||_:void 0},x,{children:n}))})},17679(t,e,r){"use strict";var i=r(59932),s=r(19289),n=r(7901),o=r(71906);t.exports=o||i.call(n,s)},19289(t){"use strict";t.exports=Function.prototype.apply},7901(t){"use strict";t.exports=Function.prototype.call},85953(t,e,r){"use strict";var i=r(59932),s=r(14114),n=r(7901),o=r(17679);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new s("a function is required");return o(i,n,t)}},71906(t){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},4449(t,e,r){"use strict";var i=r(9718),s=r(85953),n=s([i("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&n(t,".prototype.")>-1?s([r]):r}},89677(t,e,r){"use strict";var i,s=r(85953),n=r(47570);try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!i&&n&&n(Object.prototype,"__proto__"),a=Object,h=a.getPrototypeOf;t.exports=o&&"function"==typeof o.get?s([o.get]):"function"==typeof h&&function(t){return h(null==t?t:a(t))}},13513(t){"use strict";function e(t,e,i){i=i||2;var n,o,a,h,c,d,f,m=e&&e.length,g=m?e[0]*i:t.length,y=r(t,0,g,i,!0),_=[];if(!y||y.next===y.prev)return _;if(m&&(y=function(t,e,i,s){var n,o,a,h=[];for(n=0,o=e.length;n<o;n++)(a=r(t,e[n]*s,n<o-1?e[n+1]*s:t.length,s,!1))===a.next&&(a.steiner=!0),h.push(p(a));for(h.sort(l),n=0;n<h.length;n++)i=u(h[n],i);return i}(t,e,y,i)),t.length>80*i){n=a=t[0],o=h=t[1];for(var v=i;v<g;v+=i)(c=t[v])<n&&(n=c),(d=t[v+1])<o&&(o=d),c>a&&(a=c),d>h&&(h=d);f=0!==(f=Math.max(a-n,h-o))?32767/f:0}return s(y,_,i,n,o,f,0),_}function r(t,e,r,i,s){var n,o;if(s===S(t,e,r,i)>0)for(n=e;n<r;n+=i)o=T(n,t[n],t[n+1],o);else for(n=r-i;n>=e;n-=i)o=T(n,t[n],t[n+1],o);return o&&y(o,o.next)&&(A(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!y(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(A(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function s(t,e,r,l,u,c,p){if(t){!p&&c&&function(t,e,r,i){var s=t;do{0===s.z&&(s.z=d(s.x,s.y,e,r,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,r,i,s,n,o,a,h,l=1;do{for(r=t,t=null,n=null,o=0;r;){for(o++,i=r,a=0,e=0;e<l&&(a++,i=i.nextZ);e++);for(h=l;a>0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(s=r,r=r.nextZ,a--):(s=i,i=i.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;r=i}n.nextZ=null,l*=2}while(o>1)}(s)}(t,l,u,c);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(f.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),A(t),t=m.next,g=m.next;else if((t=m)===g){p?1===p?s(t=a(i(t),e,r),e,r,l,u,c,2):2===p&&h(t,e,r,l,u,c):s(i(t),e,r,l,u,c,1);break}}}function n(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var s=e.x,n=r.x,o=i.x,a=e.y,h=r.y,l=i.y,u=s<n?s<o?s:o:n<o?n:o,c=a<h?a<l?a:l:h<l?h:l,d=s>
vendor: 2,713 bytes, line 2
2n?s>o?s:o:n>o?n:o,p=a>h?a>l?a:l:h>l?h:l,m=i.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=p&&f(s,a,n,h,o,l,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,r,i){var s=t.prev,n=t,o=t.next;if(g(s,n,o)>=0)return!1;for(var a=s.x,h=n.x,l=o.x,u=s.y,c=n.y,p=o.y,m=a<h?a<l?a:l:h<l?h:l,y=u<c?u<p?u:p:c<p?c:p,_=a>h?a>l?a:l:h>l?h:l,v=u>c?u>p?u:p:c>p?c:p,x=d(m,y,e,r,i),b=d(_,v,e,r,i),E=t.prevZ,T=t.nextZ;E&&E.z>=x&&T&&T.z<=b;){if(E.x>=m&&E.x<=_&&E.y>=y&&E.y<=v&&E!==s&&E!==o&&f(a,u,h,c,l,p,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;if(E=E.prevZ,T.x>=m&&T.x<=_&&T.y>=y&&T.y<=v&&T!==s&&T!==o&&f(a,u,h,c,l,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;E&&E.z>=x;){if(E.x>=m&&E.x<=_&&E.y>=y&&E.y<=v&&E!==s&&E!==o&&f(a,u,h,c,l,p,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;T&&T.z<=b;){if(T.x>=m&&T.x<=_&&T.y>=y&&T.y<=v&&T!==s&&T!==o&&f(a,u,h,c,l,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function a(t,e,r){var s=t;do{var n=s.prev,o=s.next.next;!y(n,o)&&_(n,s,s.next,o)&&b(n,o)&&b(o,n)&&(e.push(n.i/r|0),e.push(s.i/r|0),e.push(o.i/r|0),A(s),A(s.next),s=t=o),s=s.next}while(s!==t);return i(s)}function h(t,e,r,n,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=E(h,l);return h=i(h,h.next),u=i(u,u.next),s(h,e,r,n,o,a,0),void s(u,e,r,n,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var r=function(t,e){var r,i=e,s=t.x,n=t.y,o=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){var a=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=s&&a>o&&(o=a,r=i.x<i.next.x?i:i.next,a===s))return r}i=i.next}while(i!==e);if(!r)return null;var h,l=r,u=r.x,d=r.y,p=1/0;i=r;do{s>=i.x&&i.x>=u&&s!==i.x&&f(n<d?s:o,n,u,d,n<d?o:s,n,i.x,i.y)&&(h=Math.abs(n-i.y)/(s-i.x),b(i,t)&&(h<p||h===p&&(i.x>r.x||i.x===r.x&&c(r,i)))&&(r=i,p=h)),i=i.next}while(i!==l);return r}(t,e);if(!r)return e;var s=E(r,t);return i(s,s.next),i(r,r.next)}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,r,i,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function f(t,e,r,i,s,n,o,a){return(s-o)*(e-a)>=(t-o)*(n-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(n-a)>=(s-o)*(i-a)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,i=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{r.y>n!=r.next.y>
vendor: 4,270 bytes, line 2
2n&&r.next.y!==r.y&&s<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||y(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,r,i){var s=x(g(t,e,r)),n=x(g(t,e,i)),o=x(g(r,i,t)),a=x(g(r,i,e));return s!==n&&o!==a||!(0!==s||!v(t,r,e))||!(0!==n||!v(t,i,e))||!(0!==o||!v(r,t,i))||!(0!==a||!v(r,e,i))}function v(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function x(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function E(t,e){var r=new w(t.i,t.x,t.y),i=new w(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=s,s.prev=r,i.next=r,r.prev=i,n.next=i,i.prev=n,i}function T(t,e,r,i){var s=new w(t,e,r);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}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 w(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,r,i){for(var s=0,n=e,o=r-i;n<r;n+=i)s+=(t[o]-t[n])*(t[n+1]+t[o+1]),o=n;return s}t.exports=e,t.exports.default=e,e.deviation=function(t,e,r,i){var s=e&&e.length,n=s?e[0]*r:t.length,o=Math.abs(S(t,0,n,r));if(s)for(var a=0,h=e.length;a<h;a++){var l=e[a]*r,u=a<h-1?e[a+1]*r:t.length;o-=Math.abs(S(t,l,u,r))}var c=0;for(a=0;a<i.length;a+=3){var d=i[a]*r,p=i[a+1]*r,f=i[a+2]*r;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},e.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,s=0;s<t.length;s++){for(var n=0;n<t[s].length;n++)for(var o=0;o<e;o++)r.vertices.push(t[s][n][o]);s>0&&(i+=t[s-1].length,r.holes.push(i))}return r}},30070(t){"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},98208(t){"use strict";t.exports=EvalError},66788(t){"use strict";t.exports=Error},85785(t){"use strict";t.exports=RangeError},57369(t){"use strict";t.exports=ReferenceError},74121(t){"use strict";t.exports=SyntaxError},14114(t){"use strict";t.exports=TypeError},59394(t){"use strict";t.exports=URIError},53095(t){"use strict";t.exports=Object},84143(t){"use strict";var e=Object.prototype.hasOwnProperty,r="~";function i(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(t,e,i,n,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new s(i,n||t,o),h=r?r+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 o(t,e){0===--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,s=[];if(0===this._eventsCount)return s;for(i in t=this._events)e.call(t,i)&&s.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,n=i.length,o=new Array(n);s<n;s++)o[s]=i[s].fn;return o},a.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,s,n,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,s),!0;case 5:return u.fn.call(u.context,e,i,s,n),!0;case 6:return u.fn.call(u.context,e,i,s,n,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;
2case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,s);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},a.prototype.on=function(t,e,r){return n(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return n(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,i,s){var n=r?r+t:t;if(!this._events[n])return this;if(!e)return o(this,n),this;var a=this._events[n];if(a.fn)a.fn!==e||s&&!a.once||i&&a.context!==i||o(this,n);else{for(var h=0,l=[],u=a.length;h<u;h++)(a[h].fn!==e||s&&!a[h].once||i&&a[h].context!==i)&&l.push(a[h]);l.length?this._events[n]=1===l.length?l[0]:l:o(this,n)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},75712(t){"use strict";var e=Object.prototype.toString,r=Math.max,i=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var s=0;s<e.length;s+=1)r[s+t.length]=e[s];return r};t.exports=function(t){var s=this;if("function"!=typeof s||"[object Function]"!==e.apply(s))throw new TypeError("Function.prototype.bind called on incompatible "+s);for(var n,o=function(t){for(var e=[],r=1,i=0;r<t.length;r+=1,i+=1)e[i]=t[r];return e}(arguments),a=r(0,s.length-o.length),h=[],l=0;l<a;l++)h[l]="$"+l;if(n=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(h)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var e=s.apply(this,i(o,arguments));return Object(e)===e?e:this}return s.apply(t,i(o,arguments))}),s.prototype){var u=function(){};u.prototype=s.prototype,n.prototype=new u,u.prototype=null}return n}},59932(t,e,r){"use strict";var i=r(75712);t.exports=Function.prototype.bind||i},9718(t,e,r){"use strict";var i,s=r(53095),n=r(66788),o=r(98208),a=r(85785),h=r(57369),l=r(74121),u=r(14114),c=r(59394),d=r(35577),p=r(22411),f=r(62715),m=r(23289),g=r(79411),y=r(70333),_=r(35020),v=Function,x=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},b=r(47570),E=r(30070),T=function(){throw new u},A=b?function(){try{return T}catch(t){try{return b(arguments,"callee").get}catch(t){return T}}}():T,w=r(41064)(),S=r(32175),R=r(26031),I=r(55817),C=r(19289),P=r(7901),M={},D="undefined"!=typeof Uint8Array&&S?S(Uint8Array):i,O={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":w&&S?S([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":M,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
2IteratorPrototype%":w&&S?S(S([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&w&&S?S((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":s,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":a,"%ReferenceError%":h,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&w&&S?S((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&S?S(""[Symbol.iterator]()):i,"%Symbol%":w?Symbol:i,"%SyntaxError%":l,"%ThrowTypeError%":A,"%TypedArray%":D,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":C,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":R,"%Math.abs%":d,"%Math.floor%":p,"%Math.max%":f,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":I};if(S)try{null.error}catch(t){var B=S(S(t));O["%Error.prototype%"]=B}var N=function t(e){var r;if("%AsyncFunction%"===e)r=x("async function () {}");else if("%GeneratorFunction%"===e)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=x("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var s=t("%AsyncGenerator%");s&&S&&(r=S(s.prototype))}return O[e]=r,r},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=r(59932),k=r(18396),U=F.call(P,Array.prototype.concat),G=F.call(C,Array.prototype.splice),H=F.call(P,String.prototype.replace),j=F.call(P,String.prototype.slice),W=F.call(P,RegExp.prototype.exec),X=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,z=function(t,e){var r,i=t;
vendor: 6,082 bytes, line 2
2if(k(L,i)&&(i="%"+(r=L[i])[0]+"%"),k(O,i)){var s=O[i];if(s===M&&(s=N(i)),void 0===s&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===W(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=j(t,0,1),r=j(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var i=[];return H(t,X,function(t,e,r,s){i[i.length]=r?H(s,V,"$1"):e||t}),i}(t),i=r.length>0?r[0]:"",s=z("%"+i+"%",e),n=s.name,o=s.value,a=!1,h=s.alias;h&&(i=h[0],G(r,U([0,1],h)));for(var c=1,d=!0;c<r.length;c+=1){var p=r[c],f=j(p,0,1),m=j(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&d||(a=!0),k(O,n="%"+(i+="."+p)+"%"))o=O[n];else if(null!=o){if(!(p in o)){if(!e)throw new u("base intrinsic for "+t+" exists, but the property is not available.");return}if(b&&c+1>=r.length){var g=b(o,p);o=(d=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[p]}else d=k(o,p),o=o[p];d&&!a&&(O[n]=o)}}return o}},26031(t,e,r){"use strict";var i=r(53095);t.exports=i.getPrototypeOf||null},55817(t){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},32175(t,e,r){"use strict";var i=r(55817),s=r(26031),n=r(89677);t.exports=i?function(t){return i(t)}:s?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return s(t)}:n?function(t){return n(t)}:null},278(t){"use strict";t.exports=Object.getOwnPropertyDescriptor},47570(t,e,r){"use strict";var i=r(278);if(i)try{i([],"length")}catch(t){i=null}t.exports=i},41064(t,e,r){"use strict";var i="undefined"!=typeof Symbol&&Symbol,s=r(92698);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&s()}},92698(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var s=Object.getOwnPropertySymbols(t);if(1!==s.length||s[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},18396(t,e,r){"use strict";var i=Function.prototype.call,s=Object.prototype.hasOwnProperty,n=r(59932);t.exports=n.call(i,s)},35577(t){"use strict";t.exports=Math.abs},22411(t){"use strict";t.exports=Math.floor},58228(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},62715(t){"use strict";t.exports=Math.max},23289(t){"use strict";t.exports=Math.min},79411(t){"use strict";t.exports=Math.pow},70333(t){"use strict";t.exports=Math.round},35020(t,e,r){"use strict";var i=r(58228);t.exports=function(t){return i(t)||0===t?t:t<0?-1:1}},56410(t,e,r){var i="function"==typeof Map&&Map.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=i&&s&&"function"==typeof s.get?s.get:null,o=i&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,h=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&h&&"function"==typeof h.get?h.get:null,u=a&&Set.prototype.forEach,c="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,v=String.prototype.replace,x=String.prototype.toUpperCase,b=String.prototype.toLowerCase,E=RegExp.prototype.test,T=Array.prototype.concat,A=Array.prototype.join,w=Array.prototype.slice,S=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,M="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,D=Object.prototype.propertyIsEnumerable,O=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function B(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||E.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var i=t<0?-S(-t):S(t);if(i!==t){var s=String(i),n=_.call(e,s.length+1);return v.call(s,r,"$&_")+"."+v.call(v.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var N=r(42634),L=N.custom,F=V(L)?L:null,k={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function G(t,e,r){var i=r.quoteStyle||e,s=k[i];return s+t+s}function H(t){return v.call(String(t),/"/g,""")}function j(t){return!M||!("object"==typeof t&&(M in t||void 0!==t[M]))}function W(t){return"[object Array]"===Y(t)&&j(t)}function X(t){return"[object RegExp]"===Y(t)&&j(t)}function V(t){if(P)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;
vendor: 3,371 bytes, line 2
2if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,i,s,a){var h=i||{};if($(h,"quoteStyle")&&!$(k,h.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if($(h,"maxStringLength")&&("number"==typeof h.maxStringLength?h.maxStringLength<0&&h.maxStringLength!==1/0:null!==h.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!$(h,"customInspect")||h.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($(h,"indent")&&null!==h.indent&&"\t"!==h.indent&&!(parseInt(h.indent,10)===h.indent&&h.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if($(h,"numericSeparator")&&"boolean"!=typeof h.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var x=h.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return K(e,h);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var E=String(e);return x?B(e,E):E}if("bigint"==typeof e){var S=String(e)+"n";return x?B(e,S):S}var I=void 0===h.depth?5:h.depth;if(void 0===s&&(s=0),s>=I&&I>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var L,U=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(h,s);if(void 0===a)a=[];else if(q(a,e)>=0)return"[Circular]";function z(e,r,i){if(r&&(a=w.call(a)).push(r),i){var n={depth:h.depth};return $(h,"quoteStyle")&&(n.quoteStyle=h.quoteStyle),t(e,n,s+1,a)}return t(e,h,s+1,a)}if("function"==typeof e&&!X(e)){var Q=function(t){if(t.name)return t.name;var e=y.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),it=rt(e,z);return"[Function"+(Q?": "+Q:" (anonymous)")+"]"+(it.length>0?" { "+A.call(it,", ")+" }":"")}if(V(e)){var st=P?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||P?st:Z(st)}if((L=e)&&"object"==typeof L&&("undefined"!=typeof HTMLElement&&L instanceof HTMLElement||"string"==typeof L.nodeName&&"function"==typeof L.getAttribute)){for(var nt="<"+b.call(String(e.nodeName)),ot=e.attributes||[],at=0;at<ot.length;at++)nt+=" "+ot[at].name+"="+G(H(ot[at].value),"double",h);return nt+=">",e.childNodes&&e.childNodes.length&&(nt+="..."),nt+"</"+b.call(String(e.nodeName))+">"}if(W(e)){if(0===e.length)return"[]";var ht=rt(e,z);return U&&!function(t){for(var e=0;e<t.length;e++)if(q(t[e],"\n")>=0)return!1;return!0}(ht)?"["+et(ht,U)+"]":"[ "+A.call(ht,", ")+" ]"}if(function(t){return"[object Error]"===Y(t)&&j(t)}(e)){var lt=rt(e,z);return"cause"in Error.prototype||!("cause"in e)||D.call(e,"cause")?0===lt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(lt,", ")+" }":"{ ["+String(e)+"] "+A.call(T.call("[cause]: "+z(e.cause),lt),", ")+" }"}if("object"==typeof e&&m){if(F&&"function"==typeof e[F]&&N)return N(e,{depth:I-s});if("symbol"!==m&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!n||!t||"object"!=typeof t)return!1;try{n.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ut=[];
vendor: 3,157 bytes, line 2
2return o&&o.call(e,function(t,r){ut.push(z(r,e,!0)+" => "+z(t,e))}),tt("Map",n.call(e),ut,U)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{n.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return u&&u.call(e,function(t){ct.push(z(t,e))}),tt("Set",l.call(e),ct,U)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t,c);try{d.call(t,d)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return J("WeakMap");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{d.call(t,d);try{c.call(t,c)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return J("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return J("WeakRef");if(function(t){return"[object Number]"===Y(t)&&j(t)}(e))return Z(z(Number(e)));if(function(t){if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}(e))return Z(z(R.call(e)));if(function(t){return"[object Boolean]"===Y(t)&&j(t)}(e))return Z(f.call(e));if(function(t){return"[object String]"===Y(t)&&j(t)}(e))return Z(z(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===Y(t)&&j(t)}(e)&&!X(e)){var dt=rt(e,z),pt=O?O(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",mt=!pt&&M&&Object(e)===e&&M in e?_.call(Y(e),8,-1):ft?"Object":"",gt=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(mt||ft?"["+A.call(T.call([],mt||[],ft||[]),": ")+"] ":"");return 0===dt.length?gt+"{}":U?gt+"{"+et(dt,U)+"}":gt+"{ "+A.call(dt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function $(t,e){return z.call(t,e)}function Y(t){return m.call(t)}function q(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}function K(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return K(_.call(t,0,e.maxStringLength),e)+i}var s=U[e.quoteStyle||"single"];return s.lastIndex=0,G(v.call(v.call(t,s,"\\$1"),/[\x00-\x1f]/g,Q),"single",e)}function Q(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+x.call(e.toString(16))}function Z(t){return"Object("+t+")"}function J(t){return t+" { ? }"}function tt(t,e,r,i){return t+" ("+e+") {"+(i?et(r,i):A.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=W(t),i=[];if(r){i.length=t.length;for(var s=0;s<t.length;s++)i[s]=$(t,s)?e(t[s],t):""}var n,o="function"==typeof I?I(t):[];if(P){n={};for(var a=0;a<o.length;a++)n["$"+o[a]]=o[a]}for(var h in t)$(t,h)&&(r&&String(Number(h))===h&&h<t.length||P&&n["$"+h]instanceof Symbol||(E.call(/[^\w$]/,h)?i.push(e(h,t)+": "+e(t[h],t)):i.push(h+": "+e(t[h],t))));if("function"==typeof I)for(var l=0;l<o.length;
vendor: 4,700 bytes, line 2
2l++)D.call(t,o[l])&&i.push("["+e(o[l])+"]: "+e(t[o[l]],t));return i}},75248(t){"use strict";var e=String.prototype.replace,r=/%20/g,i="RFC3986";t.exports={default:i,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:i}},71792(t,e,r){"use strict";var i=r(53725),s=r(27539),n=r(75248);t.exports={formats:n,parse:s,stringify:i}},27539(t,e,r){"use strict";var i=r(8905),s=Object.prototype.hasOwnProperty,n=Array.isArray,o={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},h=function(t,e,r,i){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1){if(i&&e.throwOnLimitExceeded)for(var s=0,n=t.indexOf(",");n>-1;){if((s+=1)>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");n=t.indexOf(",",n+1)}return t.split(",")}if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},l=function(t,e,r,n){if(t){var o=function(t,e){var r=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(e.depth<=0){if(!e.plainObjects&&s.call(Object.prototype,r)&&!e.allowPrototypes)return;return[r]}var i=[],n=r.indexOf("["),o=n>=0?r.slice(0,n):r;if(o){if(!e.plainObjects&&s.call(Object.prototype,o)&&!e.allowPrototypes)return;i[i.length]=o}for(var a=r.length,h=n,l=0;h>=0&&l<e.depth;){for(var u=1,c=h+1,d=-1;c<a&&d<0;){var p=r.charCodeAt(c);91===p?u+=1:93===p&&0==(u-=1)&&(d=c),c+=1}if(d<0)return i[i.length]="["+r.slice(h)+"]",i;var f=r.slice(h,d+1),m=f.slice(1,-1);if(!e.plainObjects&&s.call(Object.prototype,m)&&!e.allowPrototypes)return;i[i.length]=f,l+=1,h=r.indexOf("[",d+1)}if(h>=0){if(!0===e.strictDepth)throw new RangeError("Input depth exceeded depth option of "+e.depth+" and strictDepth is true");i[i.length]="["+r.slice(h)+"]"}return i}(t,r);if(o)return function(t,e,r,s){var n=0;if(t.length>0&&"[]"===t[t.length-1]){var o=t.slice(0,-1).join("");n=Array.isArray(e)&&e[o]?e[o].length:0}for(var a=s?e:h(e,r,n),l=t.length-1;l>=0;--l){var u,c=t[l];if("[]"===c&&r.parseArrays)u=i.isOverflow(a)?a:r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:i.combine([],a,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{u=r.plainObjects?{__proto__:null}:{};var d="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,p=r.decodeDotInKeys?d.replace(/%2E/g,"."):d,f=parseInt(p,10),m=!isNaN(f)&&c!==p&&String(f)===p&&f>=0&&r.parseArrays;if(r.parseArrays||""!==p)if(m&&f<r.arrayLimit)(u=[])[f]=a;else{if(m&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");m?(u[f]=a,i.markOverflow(u,f)):"__proto__"!==p&&(u[p]=a)}else u={0:a}}a=u}return a}(o,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return o;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?o.charset:t.charset,r=void 0===t.duplicates?o.duplicates:t.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||o.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:o.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:o.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,charset
vendor: 1,911 bytes, line 2
2:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:o.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:o.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:o.decoder,delimiter:"string"==typeof t.delimiter||i.isRegExp(t.delimiter)?t.delimiter:o.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:o.depth,duplicates:r,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:o.strictDepth,strictMerge:"boolean"==typeof t.strictMerge?!!t.strictMerge:o.strictMerge,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return r.plainObjects?{__proto__:null}:{};for(var u="string"==typeof t?function(t,e){var r={__proto__:null},l=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=e.parameterLimit===1/0?void 0:e.parameterLimit,c=l.split(e.delimiter,e.throwOnLimitExceeded&&void 0!==u?u+1:u);if(e.throwOnLimitExceeded&&void 0!==u&&c.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var d,p=-1,f=e.charset;if(e.charsetSentinel)for(d=0;d<c.length;++d)0===c[d].indexOf("utf8=")&&("utf8=%E2%9C%93"===c[d]?f="utf-8":"utf8=%26%2310003%3B"===c[d]&&(f="iso-8859-1"),p=d,d=c.length);for(d=0;d<c.length;++d)if(d!==p){var m,g,y=c[d],_=y.indexOf("]="),v=-1===_?y.indexOf("="):_+1;
vendor: 15,523 bytes, line 2
2if(-1===v?(m=e.decoder(y,o.decoder,f,"key"),g=e.strictNullHandling?null:""):null!==(m=e.decoder(y.slice(0,v),o.decoder,f,"key"))&&(g=i.maybeMap(h(y.slice(v+1),e,n(r[m])?r[m].length:0,-1===y.indexOf("[]=")),function(t){return e.decoder(t,o.decoder,f,"value")})),g&&e.interpretNumericEntities&&"iso-8859-1"===f&&(g=a(String(g))),y.indexOf("[]=")>-1&&(g=n(g)?[g]:g),e.comma&&n(g)&&g.length>e.arrayLimit&&(g=i.combine([],g,e.arrayLimit,e.plainObjects,e.throwOnLimitExceeded)),null!==m){var x=s.call(r,m);x&&("combine"===e.duplicates||y.indexOf("[]=")>-1)?r[m]=i.combine(r[m],g,e.arrayLimit,e.plainObjects,e.throwOnLimitExceeded):x&&"last"!==e.duplicates||(r[m]=g)}}return r}(t,r):t,c=r.plainObjects?{__proto__:null}:{},d=Object.keys(u),p=0;p<d.length;++p){var f=d[p],m=l(f,u[f],r,"string"==typeof t);c=i.merge(c,m,r)}return!0===r.allowSparse?c:i.compact(c)}},53725(t,e,r){"use strict";var i=r(11233),s=r(8905),n=r(75248),o=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},h=Array.isArray,l=Array.prototype.push,u=function(t,e){l.apply(t,h(e)?e:[e])},c=Date.prototype.toISOString,d=n.default,p={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:s.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:n.formatters[d],indices:!1,serializeDate:function(t){return c.call(t)},skipNulls:!1,strictNullHandling:!1},f={},m=function t(e,r,n,o,a,l,c,d,m,g,y,_,v,x,b,E,T,A){for(var w,S=e,R=A,I=0,C=!1;void 0!==(R=R.get(f))&&!C;){var P=R.get(e);if(I+=1,void 0!==P){if(P===I)throw new RangeError("Cyclic object value");C=!0}void 0===R.get(f)&&(I=0)}if("function"==typeof g?S=g(r,S):S instanceof Date?S=v(S):"comma"===n&&h(S)&&(S=s.maybeMap(S,function(t){return t instanceof Date?v(t):t})),null===S){if(l)return b(m&&!E?m(r,p.encoder,T,"key",x):r);S=""}if("string"==typeof(w=S)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||s.isBuffer(S))return m?[b(E?r:m(r,p.encoder,T,"key",x))+"="+b(m(S,p.encoder,T,"value",x))]:[b(r)+"="+b(String(S))];var M,D=[];if(void 0===S)return D;if("comma"===n&&h(S))E&&m&&(S=s.maybeMap(S,function(t){return null==t?t:m(t)})),M=[{value:S.length>0?S.join(",")||null:void 0}];else if(h(g))M=g;else{var O=Object.keys(S);M=y?O.sort(y):O}var B=d?String(r).replace(/\./g,"%2E"):String(r),N=o&&h(S)&&1===S.length?B+"[]":B;if(a&&h(S)&&0===S.length)return N+"[]";for(var L=0;L<M.length;++L){var F=M[L],k="object"==typeof F&&F&&void 0!==F.value?F.value:S[F];if(!c||null!==k){var U=_&&d?String(F).replace(/\./g,"%2E"):String(F),G=h(S)?"function"==typeof n?n(N,U):N:N+(_?"."+U:"["+U+"]");A.set(e,I);var H=i();H.set(f,A),u(D,t(k,G,n,o,a,l,c,d,"comma"===n&&E&&h(S)?null:m,g,y,_,v,x,b,E,T,H))}}return D};t.exports=function(t,e){var r,s=t,l=function(t){if(!t)return p;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||p.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=n.default;if(void 0!==t.format){if(!o.call(n.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var i,s=n.formatters[r],l=p.filter;if(("function"==typeof t.filter||h(t.filter))&&(l=t.filter),i=t.arrayFormat in a?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":p.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===t.allowDots?!0===t.encodeDotInKeys||p.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:p.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:i,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:p.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?p.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:p.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:p.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:p.encodeValuesOnly,filter:l,format:r,formatter:s,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:p.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:p.strictNullHandling}}(e);"function"==typeof l.filter?s=(0,l.filter)("",s):h(l.filter)&&(r=l.filter);var c=[];if("object"!=typeof s||null===s)return"";var d=a[l.arrayFormat],f="comma"===d&&l.commaRoundTrip;r||(r=Object.keys(s)),l.sort&&r.sort(l.sort);for(var g=i(),y=0;y<r.length;++y){var _=r[y];if(null!=_){var v=s[_];l.skipNulls&&null===v||u(c,m(v,_,d,f,l.allowEmptyArrays,l.strictNullHandling,l.skipNulls,l.encodeDotInKeys,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,g))}}var x=c.join(l.delimiter),b=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?b+="utf8=%26%2310003%3B"+l.delimiter:b+="utf8=%E2%9C%93"+l.delimiter),x.length>0?b+x:""}},8905(t,e,r){"use strict";var i=r(75248),s=r(11233),n=r(30070),o=Object.prototype.hasOwnProperty,a=Array.isArray,h=s(),l=function(t,e){return h.set(t,e),t},u=function(t){return h.has(t)},c=function(t){return h.get(t)},d=function(t,e){h.set(t,e)},p=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),f=function(t,e){for(var r=e&&e.plainObjects?{__proto__:null}:{},i=0;i<t.length;++i)void 0!==t[i]&&(r[i]=t[i]);return r},m=function(t,e,r){"__proto__"===e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r},g=1024;t.exports={arrayToObject:f,assign:function(t,e){return Object.keys(e).reduce(function(t,r){return m(t,r,e[r]),t},t)},combine:function(t,e,r,i,s){if(u(t)){if(s)throw new RangeError("Array limit exceeded. Only "+r+" element"+(1===r?"":"s")+" allowed in an array.");var n=c(t)+1;return t[n]=e,d(t,n),t}var o=[].concat(t,e);if(o.length>r){if(s)throw new RangeError("Array limit exceeded. Only "+r+" element"+(1===r?"":"s")+" allowed in an array.");return l(f(o,{plainObjects:i}),o.length-1)}return o},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=s(),i=0;i<e.length;++i)for(var n=e[i],o=n.obj[n.prop],h=Object.keys(o),l=0;l<h.length;++l){var u=h[l],c=o[u];"object"!=typeof c||null===c||r.has(c)||(e[e.length]={obj:o,prop:u},r.set(c,!0))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(a(r)){for(var i=[],s=0;s<r.length;++s)void 0!==r[s]&&(i[i.length]=r[s]);e.obj[e.prop]=i}}}(e),t},decode:function(t,e,r){var i=t.replace(/\+/g," ");if("iso-8859-1"===r)return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch(t){return i}},encode:function(t,e,r,s,n){if(0===t.length)return t;var o=t;if("symbol"==typeof t?o=Symbol.prototype.toString.call(t):"string"!=typeof t&&(o=String(t)),"iso-8859-1"===r)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var a="",h=0;h<o.length;h+=g){var l=o.length>=g?o.slice(h,h+g):o;if(h+g<o.length){var u=l.charCodeAt(l.length-1);u>=55296&&u<=56319&&(l=l.slice(0,-1),h-=1)}for(var c=[],d=0;d<l.length;++d){var f=l.charCodeAt(d);45===f||46===f||95===f||126===f||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||n===i.RFC1738&&(40===f||41===f)?c[c.length]=l.charAt(d):f<128?c[c.length]=p[f]:f<2048?c[c.length]=p[192|f>>6]+p[128|63&f]:f<55296||f>=57344?c[c.length]=p[224|f>>12]+p[128|f>>6&63]+p[128|63&f]:(d+=1,f=65536+((1023&f)<<10|1023&l.charCodeAt(d)),c[c.length]=p[240|f>>18]+p[128|f>>12&63]+p[128|f>>6&63]+p[128|63&f])}a+=c.join("")}return a},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isOverflow:u,isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},markOverflow:l,maybeMap:function(t,e){if(a(t)){for(var r=[],i=0;i<t.length;i+=1)r[r.length]=e(t[i]);return r}return e(t)},merge:function t(e,r,i){if(!r)return e;if("object"!=typeof r&&"function"!=typeof r){if(a(e)){var s=e.length;if(i&&"number"==typeof i.arrayLimit&&s>=i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");return l(f(e.concat(r),i),s)}e[s]=r}else{if(!e||"object"!=typeof e)return[e,r];if(u(e)){var n=c(e)+1;e[n]=r,d(e,n)}else{if(i&&i.strictMerge)return[e,r];(i&&(i.plainObjects||i.allowPrototypes)||!o.call(Object.prototype,r))&&(e[r]=!0)}}return e}if(!e||"object"!=typeof e){if(u(r)){for(var h=Object.keys(r),p=i&&i.plainObjects?{__proto__:null,0:e}:{0:e},g=0;g<h.length;g++)p[parseInt(h[g],10)+1]=r[h[g]];return l(p,c(r)+1)}var y=[e].concat(r);if(i&&"number"==typeof i.arrayLimit&&y.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");return l(f(y,i),y.length-1)}return y}var _=e;if(a(e)&&!a(r)&&(_=f(e,i)),a(e)&&a(r)){if(r.forEach(function(r,s){if(o.call(e,s)){var n=e[s];n&&"object"==typeof n&&r&&"object"==typeof r?e[s]=t(n,r,i):e[e.length]=r}else e[s]=r}),i&&"number"==typeof i.arrayLimit&&e.length>i.arrayLimit){if(i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");return l(f(e,i),e.length-1)}return e}return Object.keys(r).reduce(function(e,s){var n=r[s];if(o.call(e,s)?m(e,s,t(e[s],n,i)):m(e,s,n),u(r)&&!u(e)&&l(e,c(r)),u(e)){var a=parseInt(s,10);String(a)===s&&a>=0&&a>c(e)&&d(e,a)}return e},_)}}},13364(t,e,r){"use strict";var i=r(56410),s=r(14114),n=function(t,e,r){for(var i,s=t;null!=(i=s.next);s=i)if(i.key===e)return s.next=i.next,r||(i.next=t.next,t.next=i),i};t.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new s("Side channel does not contain "+i(t))},delete:function(e){var r=function(t,e){if(t)return n(t,e,!0)}(t,e);return r&&t&&!t.next&&(t=void 0),!!r},get:function(e){return function(t,e){if(t){var r=n(t,e);return r&&r.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!n(t,e)}(t,e)},set:function(e,r){t||(t={next:void 0}),function(t,e,r){var i=n(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}}(t,e,r)}};return e}},40958(t,e,r){"use strict";var i=r(9718),s=r(4449),n=r(56410),o=r(14114),a=i("%Map%",!0),h=s("Map.prototype.get",!0),l=s("Map.prototype.set",!0),u=s("Map.prototype.has",!0),c=s("Map.prototype.delete",!0),d=s("Map.prototype.size",!0);t.exports=!!a&&function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){if(t){var r=c(t,e);return 0===d(t)&&(t=void 0),r}return!1},get:function(e){if(t)return h(t,e)},has:function(e){return!!t&&u(t,e)},set:function(e,r){t||(t=new a),l(t,e,r)}};return e}},41926(t,e,r){"use strict";var i=r(9718),s=r(4449),n=r(56410),o=r(40958),a=r(14114),h=i("%WeakMap%",!0),l=s("WeakMap.prototype.get",!0),u=s("WeakMap.prototype.set",!0),c=s("WeakMap.prototype.has",!0),d=s("WeakMap.prototype.delete",!0);t.exports=h?function(){var t,e,r={assert:function(t){if(!r.has(t))throw new a("Side channel does not contain "+n(t))},delete:function(r){if(h&&r&&("object"==typeof r||"function"==typeof r)){if(t)return d(t,r)}else if(o&&e)return e.delete(r);return!1},get:function(r){return h&&r&&("object"==typeof r||"function"==typeof r)&&t?l(t,r):e&&e.get(r)},has:function(r){return h&&r&&("object"==typeof r||"function"==typeof r)&&t?c(t,r):!!e&&e.has(r)},set:function(r,i){h&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new h),u(t,r,i)):o&&(e||(e=o()),e.set(r,i))}};return r}:o},11233(t,e,r){"use strict";var i=r(14114),s=r(56410),n=r(13364),o=r(40958),a=r(41926)||o||n;t.exports=function(){var t,e={assert:function(t){if(!e.has(t)){var r=t&&Object(t)===t?"the given object key":s(t);throw new i("Side channel does not contain "+r)}},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,r){t||(t=a()),t.set(e,r)}};return e}},85975(t,e,r){var i;t=r.nmd(t),function(){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r.g&&r.g;s.global!==s&&s.window!==s&&s.self;var n,o=2147483647,a=36,h=/^xn--/,l=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function f(t){throw new RangeError(c[t])}function m(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function g(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+m((t=t.replace(u,".")).split("."),e).join(".")}function y(t){for(var e,r,i=[],s=0,n=t.length;s<n;)(e=t.charCodeAt(s++))>=55296&&e<=56319&&s<n?56320==(64512&(r=t.charCodeAt(s++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),s--):i.push(e);return i}function _(t){return m(t,function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)}).join("")}function v(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:a}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,r){var i=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;i+=a)t=d(t/35);return d(i+36*t/(t+38))}function E(t){var e,r,i,s,n,h,l,u,c,p,m=[],g=t.length,y=0,x=128,E=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&f("not-basic"),m.push(t.charCodeAt(i));for(s=r>0?r+1:0;s<g;){for(n=y,h=1,l=a;s>=g&&f("invalid-input"),((u=v(t.charCodeAt(s++)))>=a||u>d((o-y)/h))&&f("overflow"),y+=u*h,!(u<(c=l<=E?1:l>=E+26?26:l-E));l+=a)h>d(o/(p=a-c))&&f("overflow"),h*=p;E=b(y-n,e=m.length+1,0==n),d(y/e)>o-x&&f("overflow"),x+=d(y/e),y%=e,m.splice(y++,0,x)}return _(m)}function T(t){var e,r,i,s,n,h,l,u,c,m,g,_,v,E,T,A=[];for(_=(t=y(t)).length,e=128,r=0,n=72,h=0;h<_;++h)(g=t[h])<128&&A.push(p(g));for(i=s=A.length,s&&A.push("-");i<_;){for(l=o,h=0;h<_;++h)(g=t[h])>=e&&g<l&&(l=g);for(l-e>d((o-r)/(v=i+1))&&f("overflow"),r+=(l-e)*v,e=l,h=0;h<_;++h)if((g=t[h])<e&&++r>o&&f("overflow"),g==e){for(u=r,c=a;!(u<(m=c<=n?1:c>=n+26?26:c-n));c+=a)T=u-m,E=a-m,A.push(p(x(m+T%E,0))),u=d(T/E);A.push(p(x(u,0))),n=b(r,v,i==s),r=0,++i}++r,++e}return A.join("")}n={version:"1.4.1",ucs2:{decode:y,encode:_},decode:E,encode:T,toASCII:function(t){return g(t,function(t){return l.test(t)?"xn--"+T(t):t})},toUnicode:function(t){return g(t,function(t){return h.test(t)?E(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return n}.call(e,r,e,t))||(t.exports=i)}()},900(t,e,r){"use strict";var i=r(85975);function s(){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}
vendor: 9,684 bytes, line 2
2var n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,h=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(h),u=["%","/","?",";","#"].concat(l),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(71792);function _(t,e,r){if(t&&"object"==typeof t&&t instanceof s)return t;var i=new s;return i.parse(t,e,r),i}s.prototype.parse=function(t,e,r){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),o=-1!==s&&s<t.indexOf("#")?"?":"#",h=t.split(o);h[0]=h[0].replace(/\\/g,"/");var _=t=h.join(o);if(_=_.trim(),!r&&1===t.split("#").length){var v=a.exec(_);if(v)return this.path=_,this.href=_,this.pathname=v[1],v[2]?(this.search=v[2],this.query=e?y.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var x=n.exec(_);if(x){var b=(x=x[0]).toLowerCase();this.protocol=b,_=_.substr(x.length)}if(r||x||_.match(/^\/\/[^@/]+@[^@/]+/)){var E="//"===_.substr(0,2);!E||x&&m[x]||(_=_.substr(2),this.slashes=!0)}if(!m[x]&&(E||x&&!g[x])){for(var T,A,w=-1,S=0;S<c.length;S++)-1!==(R=_.indexOf(c[S]))&&(-1===w||R<w)&&(w=R);for(-1!==(A=-1===w?_.lastIndexOf("@"):_.lastIndexOf("@",w))&&(T=_.slice(0,A),_=_.slice(A+1),this.auth=decodeURIComponent(T)),w=-1,S=0;S<u.length;S++){var R;-1!==(R=_.indexOf(u[S]))&&(-1===w||R<w)&&(w=R)}-1===w&&(w=_.length),this.host=_.slice(0,w),_=_.slice(w),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var C=this.hostname.split(/\./),P=(S=0,C.length);S<P;S++){var M=C[S];if(M&&!M.match(d)){for(var D="",O=0,B=M.length;O<B;O++)M.charCodeAt(O)>127?D+="x":D+=M[O];if(!D.match(d)){var N=C.slice(0,S),L=C.slice(S+1),F=M.match(p);F&&(N.push(F[1]),L.unshift(F[2])),L.length&&(_="/"+L.join(".")+_),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=i.toASCII(this.hostname));var k=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+k,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!f[b])for(S=0,P=l.length;S<P;S++){var G=l[S];if(-1!==_.indexOf(G)){var H=encodeURIComponent(G);H===G&&(H=escape(G)),_=_.split(G).join(H)}}var j=_.indexOf("#");-1!==j&&(this.hash=_.substr(j),_=_.slice(0,j));var W=_.indexOf("?");if(-1!==W?(this.search=_.substr(W),this.query=_.substr(W+1),e&&(this.query=y.parse(this.query)),_=_.slice(0,W)):e&&(this.search="",this.query={}),_&&(this.pathname=_),g[b]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){k=this.pathname||"";var X=this.search||"";this.path=k+X}return this.href=this.format(),this},s.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",s=!1,n="";this.host?s=t+this.host:this.hostname&&(s=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(n=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var o=this.search||n&&"?"+n||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==s?(s="//"+(s||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):s||(s=""),i&&"#"!==i.charAt(0)&&(i="#"+i),o&&"?"!==o.charAt(0)&&(o="?"+o),e+s+(r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(o=o.replace("#","%23"))+i},s.prototype.resolve=function(t){return this.resolveObject(_(t,!1,!0)).format()},s.prototype.resolveObject=function(t){if("string"==typeof t){var e=new s;e.parse(t,!1,!0),t=e}for(var r=new s,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),h=0;h<a.length;h++){var l=a[h];"protocol"!==l&&(r[l]=t[l])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!g[t.protocol]){for(var u=Object.keys(t),c=0;c<u.length;c++){var d=u[c];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||m[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var f=r.pathname||"",y=r.search||"";r.path=f+y}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=v||_||r.host&&t.pathname,b=x,E=r.pathname&&r.pathname.split("/")||[],T=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),x=x&&(""===p[0]||""===E[0])),v)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),r.search=t.search,r.query=t.query;else if(null!=t.search)return T&&(r.host=E.shift(),r.hostname=r.host,(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.hostname=I.shift(),r.host=r.hostname)),r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=E.slice(-1)[0],w=(r.host||t.host||E.length>1)&&("."===A||".."===A)||""===A,S=0,R=E.length;R>=0;R--)"."===(A=E[R])?E.splice(R,1):".."===A?(E.splice(R,1),S++):S&&(E.splice(R,1),S--);if(!x&&!b)for(;S--;S)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),w&&"/"!==E.join("/").substr(-1)&&E.push("");var I,C=""===E[0]||E[0]&&"/"===E[0].charAt(0);return T&&(r.hostname=C?"":E.length?E.shift():"",r.host=r.hostname,(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.hostname=I.shift(),r.host=r.hostname)),(x=x||r.host&&E.length)&&!C&&E.unshift(""),E.length>0?r.pathname=E.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},s.prototype.parseHost=function(){var t=this.host,e=o.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},e.qg=_,e.hd=function(t,e){return _(t,!1,!0).resolve(e)},e.GP=function(t){return"string"==typeof t&&(t=_(t)),t instanceof s?t.format():s.prototype.format.call(t)}},23005(t,e,r){"use strict";r.d(e,{Gk:()=>g,B9:()=>a,t5:()=>Me,hq:()=>De,JH:()=>He,cc:()=>Tr,hp:()=>Be,dZ:()=>Ie,fr:()=>y,jl:()=>qe,Q1:()=>Ot,Td:()=>Xe,_4:()=>h,Pp:()=>Ke,Ag:()=>ge,hR:()=>l,dJ:()=>Ir,V2:()=>Ge,vg:()=>x,E8:()=>m,uq:()=>Je,Pt:()=>Ar,oA:()=>hr,TO:()=>je,bR:()=>ze,tS:()=>Qe,BP:()=>_r,X1:()=>Xr,bO:()=>We,M_:()=>Ye,Y7:()=>Hr,TE:()=>Ze,HY:()=>Ve,$f:()=>ms,Mt:()=>br,Uw:()=>Te,QE:()=>c,gP:()=>Gr,NW:()=>ei,Rv:()=>Zi,dL:()=>ur,dQ:()=>qi,k2:()=>xr,A5:()=>ys,u3:()=>xe,uR:()=>f,q5:()=>es,Eo:()=>is,MT:()=>rs,XO:()=>ve,W0:()=>A,Wp:()=>i});var i={};r.r(i),r.d(i,{BaseTextureCache:()=>ne,BoundingBox:()=>re,CanvasRenderTarget:()=>he,DATA_URI:()=>Wt,EventEmitter:()=>W,ProgramCache:()=>ie,TextureCache:()=>se,clearTextureCache:()=>ae,correctBlendMode:()=>Ut,createIndicesForQuads:()=>Xt,decomposeDataUri:()=>pe,deprecation:()=>$,destroyTextureCache:()=>oe,detectVideoAlphaMode:()=>tt,determineCrossOrigin:()=>fe,earcut:()=>X,getBufferType:()=>Vt,getCanvasBoundingBox:()=>ce,getResolutionOfUrl:()=>me,hex2rgb:()=>Bt,hex2string:()=>Nt,interleaveTypedArrays:()=>$t,isMobile:()=>j,isPow2:()=>qt,isWebGLSupported:()=>it,log2:()=>Kt,nextPow2:()=>Yt,path:()=>Q,premultiplyBlendMode:()=>kt,premultiplyRgba:()=>Gt,premultiplyTint:()=>Ht,premultiplyTintToRgba:()=>jt,removeItems:()=>Qt,rgb2hex:()=>Ft,sayHello:()=>rt,sign:()=>Zt,skipHello:()=>et,string2hex:()=>Lt,trimCanvas:()=>de,uid:()=>te,url:()=>Y});var s=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(s||{}),n=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(n||{}),o=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(o||{}),a=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERA
2SE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(a||{}),h=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(h||{}),l=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(l||{}),u=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(u||{}),c=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(c||{}),d=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(d||{}),p=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(p||{}),f=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(f||{}),m=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(m||{}),g=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(g||{}),y=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(y||{}),_=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(_||{}),v=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(v||{}),x=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(x||{}),b=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(b||{}),E=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(E||{});const T={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")},A={ADAPTER:T,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var w=/iPhone/i,S=/iPod/i,R=/iPad/i,I=/\biOS-universal(?:.+)Mac\b/i,C=/\bAndroid(?:.+)Mobile\b/i,P=/Android/i,M=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,D=/Silk/i,O=/Windows Phone/i,B=/\bWindows(?:.+)ARM\b/i,N=/BlackBerry/i,L=/BB10/i,F=/Opera Mini/i,k=/\b(CriOS|Chrome)(?:.+)Mobile/i,U=/Mobile(?:.+)Firefox\b/i,G=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function H(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,i=r.split("[FBAN");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("Twitter"))[1]&&(r=i[0]);var s=function(t){return function(e){return e.test(t)}}(r),n={apple:{phone:s(w)&&!s(O),ipod:s(S),tablet:!s(w)&&(s(R)||G(e))&&!s(O),universal:s(I),device:(s(w)||s(S)||s(R)||s(I)||G(e))&&!s(O)},amazon:{phone:s(M),tablet:!s(M)&&s(D),device:s(M)||s(D)},android:{phone:!s(O)&&s(M)||!s(O)&&s(C),tablet:!s(O)&&!s(M)&&!s(C)&&(s(D)||s(P)),device:!s(O)&&(s(M)||s(D)||s(C)||s(P))||s(/\bokhttp\b/i)}
2,windows:{phone:s(O),tablet:s(B),device:s(O)||s(B)},other:{blackberry:s(N),blackberry10:s(L),opera:s(F),firefox:s(U),chrome:s(k),device:s(N)||s(L)||s(F)||s(U)||s(k)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const j=(H.default??H)(globalThis.navigator);A.RETINA_PREFIX=/@([0-9\.]+)x/,A.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var W=r(84143),X=r(13513),V=r(900);const z={};function $(t,e,r=3){if(z[e])return;let i=(new Error).stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`):(i=i.split("\n").splice(r).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(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`),console.warn(i))),z[e]=!0}const Y={get parse(){return $("7.3.0","utils.url.parse is deprecated, use native URL API instead."),V.qg},get format(){return $("7.3.0","utils.url.format is deprecated, use native URL API instead."),V.GP},get resolve(){return $("7.3.0","utils.url.resolve is deprecated, use native URL API instead."),V.hd}};function q(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function K(t){return t.split("?")[0].split("#")[0]}const Q={toPosix:t=>t.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/"),isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){q(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(q(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const i=K(this.toPosix(e??A.ADAPTER.getBaseUrl())),s=K(this.toPosix(r??this.rootname(i)));return(t=this.toPosix(t)).startsWith("/")?Q.join(s,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(q(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return t=function(t){let e="",r=0,i=-1,s=0,n=-1;for(let o=0;o<=t.length;++o){if(o<t.length)n=t.charCodeAt(o);else{if(47===n)break;n=47}if(47===n){if(i!==o-1&&1!==s)if(i!==o-1&&2===s){if(e.length<2||2!==r||46!==e.charCodeAt(e.length-1)||46!==e.charCodeAt(e.length-2))if(e.length>2){const t=e.lastIndexOf("/");if(t!==e.length-1){-1===t?(e="",r=0):(e=e.slice(0,t),r=e.length-1-e.lastIndexOf("/")),i=o,s=0;continue}}else if(2===e.length||1===e.length){e="",r=0,i=o,s=0;continue}}else e.length>0?e+=`/${t.slice(i+1,o)}`:e=t.slice(i+1,o),r=o-i-1;i=o,s=0}else 46===n&&-1!==s?++s:s=-1}return e}(t),t.length>0&&i&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return q(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const i=t[r];if(q(i),i.length>0)if(void 0===e)e=i;else{const s=t[r-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(q(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let i=-1,s=!0;const n=this.getProtocol(t),o=t;for(let r=(t=t.slice(n.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!s){i=r;break}}else s=!1;return-1===i?r?"/":this.isUrl(o)?n+t:n:r&&1===i?"//":n+t.slice(0,i)},rootname(t){q(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){q(t),e&&q(e),t=K(this.toPosix(t));let r,i=0,s=-1,n=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){const h=t.charCodeAt(r);
2if(47===h){if(!n){i=r+1;break}}else-1===a&&(n=!1,a=r+1),o>=0&&(h===e.charCodeAt(o)?-1===--o&&(s=r):(o=-1,s=a))}return i===s?s=a:-1===s&&(s=t.length),t.slice(i,s)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!n){i=r+1;break}}else-1===s&&(n=!1,s=r+1);return-1===s?"":t.slice(i,s)},extname(t){q(t);let e=-1,r=0,i=-1,s=!0,n=0;for(let o=(t=K(this.toPosix(t))).length-1;o>=0;--o){const a=t.charCodeAt(o);if(47!==a)-1===i&&(s=!1,i=o+1),46===a?-1===e?e=o:1!==n&&(n=1):-1!==e&&(n=-1);else if(!s){r=o+1;break}}return-1===e||-1===i||0===n||1===n&&e===i-1&&e===r+1?"":t.slice(e,i)},parse(t){q(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=K(this.toPosix(t))).charCodeAt(0);const i=this.isAbsolute(t);let s;e.root=this.rootname(t),s=i||this.hasProtocol(t)?1:0;let n=-1,o=0,a=-1,h=!0,l=t.length-1,u=0;for(;l>=s;--l)if(r=t.charCodeAt(l),47!==r)-1===a&&(h=!1,a=l+1),46===r?-1===n?n=l:1!==u&&(u=1):-1!==n&&(u=-1);else if(!h){o=l+1;break}return-1===n||-1===a||0===u||1===u&&n===a-1&&n===o+1?-1!==a&&(e.base=e.name=0===o&&i?t.slice(1,a):t.slice(o,a)):(0===o&&i?(e.name=t.slice(1,n),e.base=t.slice(1,a)):(e.name=t.slice(o,n),e.base=t.slice(o,a)),e.ext=t.slice(n,a)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Z,J;async function tt(){return Z??(Z=(async()=>{const t=document.createElement("canvas").getContext("webgl");if(!t)return g.UNPACK;const e=await new Promise(t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()});if(!e)return g.UNPACK;const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const s=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,s),t.deleteFramebuffer(i),t.deleteTexture(r),t.getExtension("WEBGL_lose_context")?.loseContext(),s[0]<=s[3]?g.PMA:g.UNPACK})()),Z}function et(){$("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")}function rt(){$("7.0.0",'sayHello is deprecated, please use Renderer\'s "hello" option')}function it(){return typeof J>"u"&&(J=function(){const t={stencil:!0,failIfMajorPerformanceCaveat:A.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!A.ADAPTER.getWebGLRenderingContext())return!1;const e=A.ADAPTER.createCanvas();let r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const i=!!r?.getContextAttributes()?.stencil;if(r){const t=r.getExtension("WEBGL_lose_context");t&&t.loseContext()}return r=null,i}catch{return!1}}()),J}var st={grad:.9,turn:360,rad:360/(2*Math.PI)},nt=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},ot=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},at=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},ht=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},lt=function(t){return{r:at(t.r,0,255),g:at(t.g,0,255),b:at(t.b,0,255),a:at(t.a)}},ut=function(t){return{r:ot(t.r),g:ot(t.g),b:ot(t.b),a:ot(t.a,3)}},ct=/^#([0-9a-f]{3,8})$/i,dt=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},pt=function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=Math.max(e,r,i),o=n-Math.min(e,r,i),a=o?n===e?(r-i)/o:n===r?2+(i-e)/o:4+(e-r)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}}
vendor: 7,710 bytes, line 2
2,ft=function(t){var e=t.h,r=t.s,i=t.v,s=t.a;e=e/360*6,r/=100,i/=100;var n=Math.floor(e),o=i*(1-r),a=i*(1-(e-n)*r),h=i*(1-(1-e+n)*r),l=n%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:s}},mt=function(t){return{h:ht(t.h),s:at(t.s,0,100),l:at(t.l,0,100),a:at(t.a)}},gt=function(t){return{h:ot(t.h),s:ot(t.s),l:ot(t.l),a:ot(t.a,3)}},yt=function(t){return ft((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},_t=function(t){return{h:(e=pt(t)).h,s:(s=(200-(r=e.s))*(i=e.v)/100)>0&&s<200?r*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,r,i,s},vt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Et=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Tt={string:[[function(t){var e=ct.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?ot(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?ot(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=bt.exec(t)||Et.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:lt({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=vt.exec(t)||xt.exec(t);if(!e)return null;var r,i,s=mt({h:(r=e[1],i=e[2],void 0===i&&(i="deg"),Number(r)*(st[i]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return yt(s)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=void 0===s?1:s;return nt(e)&&nt(r)&&nt(i)?lt({r:Number(e),g:Number(r),b:Number(i),a:Number(n)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,s=t.a,n=void 0===s?1:s;if(!nt(e)||!nt(r)||!nt(i))return null;var o=mt({h:Number(e),s:Number(r),l:Number(i),a:Number(n)});return yt(o)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,s=t.a,n=void 0===s?1:s;if(!nt(e)||!nt(r)||!nt(i))return null;var o=function(t){return{h:ht(t.h),s:at(t.s,0,100),v:at(t.v,0,100),a:at(t.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(n)});return ft(o)},"hsv"]]},At=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},wt=function(t,e){var r=_t(t);return{h:r.h,s:at(r.s+100*e,0,100),l:r.l,a:r.a}},St=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},Rt=function(t,e){var r=_t(t);return{h:r.h,s:r.s,l:at(r.l+100*e,0,100),a:r.a}},It=function(){function t(t){this.parsed=function(t){return"string"==typeof t?At(t.trim(),Tt.string):"object"==typeof t&&null!==t?At(t,Tt.object):[null,void 0]}(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return ot(St(this.rgba),2)},t.prototype.isDark=function(){return St(this.rgba)<.5},t.prototype.isLight=function(){return St(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=ut(this.rgba)).r,r=t.g,i=t.b,n=(s=t.a)<1?dt(ot(255*s)):"","#"+dt(e)+dt(r)+dt(i)+n;var t,e,r,i,s,n},t.prototype.toRgb=function(){return ut(this.rgba)},t.prototype.toRgbString=function(){return e=(t=ut(this.rgba)).r,r=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+r+", "+i+", "+s+")":"rgb("+e+", "+r+", "+i+")";var t,e,r,i,s},t.prototype.toHsl=function(){return gt(_t(this.rgba))},t.prototype.toHslString=function(){return e=(t=gt(_t(this.rgba))).h,r=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+r+"%, "+i+"%, "+s+")":"hsl("+e+", "+r+"%, "+i+"%)";var t,e,r,i,s},t.prototype.toHsv=function(){return t=pt(this.rgba),{h:ot(t.h),s:ot(t.s),v:ot(t.v),a:ot(t.a,3)};var t},t.prototype.invert=function(){return Ct({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),Ct(wt(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),Ct(wt(this.rgba,-t))},t.prototype.grayscale=function(){return Ct(wt(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),Ct(Rt(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),Ct(Rt(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?Ct({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):ot(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=_t(this.rgba);return"number"==typeof t?Ct({h:t,s:e.s,l:e.l,a:e.a}):ot(e.h)},t.prototype.isEqual=function(t){return this.toHex()===Ct(t).toHex()},t}(),Ct=function(t){return t instanceof It?t:new It(t)},Pt=[];function Mt(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",s
2andybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in r)i[r[s]]=s;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,o,a=i[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var h=this.toRgb(),l=1/0,u="black";if(!n.length)for(var c in r)n[c]=new t(r[c]).toRgb();for(var d in r){var p=(s=h,o=n[d],Math.pow(s.r-o.r,2)+Math.pow(s.g-o.g,2)+Math.pow(s.b-o.b,2));p<l&&(l=p,u=d)}return u}},e.string.push([function(e){var i=e.toLowerCase(),s="transparent"===i?"#0000":r[i];return s?new t(s).toRgb():null},"name"])}r.dn(Mt),function(t){t.forEach(function(t){Pt.indexOf(t)<0&&(t(It,Tt),Pt.push(t))})}([Mt]);const Dt=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set PIXI.Color#value to null");(null===this._value||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if("number"===r||"string"===r||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every((t,r)=>t===e[r]);if(null!==t&&null!==e){const r=Object.keys(t),i=Object.keys(e);return r.length===i.length&&r.every(r=>t[r]===e[r])}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return(t=t??[])[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*i),t}toRgbArray(t){t=t??[];const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[r,i,s,n]=t.temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,i=this._int>>8&255,s=255&this._int;return e&&(r=r*t+.5|0,i=i*t+.5|0,s=s*t+.5|0),(255*t<<24)+(r<<16)+(i<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,i,s]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=s,t}normalize(e){let r,i,s,n;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215)r=(e>>16&255)/255,i=(e>>8&255)/255,s=(255&e)/255,n=1;else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,i,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,i,s,n=255]=e,r/=255,i/=255,s/=255,n/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const r=t.HEX_PATTERN.exec(e);r&&(e=`#${r[2]}
2`)}const o=Ct(e);o.isValid()&&(({r,g:i,b:s,a:n}=o.rgba),r/=255,i/=255,s/=255)}if(void 0===r)throw new Error(`Unable to convert color ${e}`);this._components[0]=r,this._components[1]=i,this._components[2]=s,this._components[3]=n,this.refreshInt()}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach((i,s)=>{t[s]=Math.min(Math.max(i,e),r)}),t)}};Dt.shared=new Dt,Dt.temp=new Dt,Dt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Ot=Dt;function Bt(t,e=[]){return $("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),Ot.shared.setValue(t).toRgbArray(e)}function Nt(t){return $("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Ot.shared.setValue(t).toHex()}function Lt(t){return $("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),Ot.shared.setValue(t).toNumber()}function Ft(t){return $("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Ot.shared.setValue(t).toNumber()}const kt=function(){const t=[],e=[];for(let r=0;r<32;r++)t[r]=r,e[r]=r;t[a.NORMAL_NPM]=a.NORMAL,t[a.ADD_NPM]=a.ADD,t[a.SCREEN_NPM]=a.SCREEN,e[a.NORMAL]=a.NORMAL_NPM,e[a.ADD]=a.ADD_NPM,e[a.SCREEN]=a.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}();function Ut(t,e){return kt[e?1:0][t]}function Gt(t,e,r,i=!0){return $("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),Ot.shared.setValue(t).premultiply(e,i).toArray(r??new Float32Array(4))}function Ht(t,e){return $("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),Ot.shared.setValue(t).toPremultiplied(e)}function jt(t,e,r,i=!0){return $("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),Ot.shared.setValue(t).premultiply(e,i).toArray(r??new Float32Array(4))}const Wt=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function Xt(t,e=null){const r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${r}`);for(let t=0,i=0;t<r;t+=6,i+=4)e[t+0]=i+0,e[t+1]=i+1,e[t+2]=i+2,e[t+3]=i+0,e[t+4]=i+2,e[t+5]=i+3;return e}function Vt(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}const zt={Float32Array,Uint32Array,Int32Array,Uint8Array};function $t(t,e){let r=0,i=0;const s={};for(let s=0;s<t.length;s++)i+=e[s],r+=t[s].length;const n=new ArrayBuffer(4*r);let o=null,a=0;for(let r=0;r<t.length;r++){const h=e[r],l=t[r],u=Vt(l);s[u]||(s[u]=new zt[u](n)),o=s[u];for(let t=0;t<l.length;t++)o[(t/h|0)*i+a+t%h]=l[t];a+=h}return new Float32Array(n)}function Yt(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function qt(t){return!(t&t-1||!t)}function Kt(t){let e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,r=((t>>>=r)>15?1:0)<<2,e|=r,r=((t>>>=r)>3?1:0)<<1,e|=r,e|(t>>>=r)>>1}function Qt(t,e,r){const i=t.length;let s;if(e>=i||0===r)return;const n=i-(r=e+r>i?i-e:r);for(s=e;s<n;++s)t[s]=t[s+r];t.length=n}function Zt(t){return 0===t?0:t<0?-1:1}let Jt=0;function te(){return++Jt}const ee=class{constructor(t,e,r,i){this.left=t,this.top=e,this.right=r,this.bottom=i}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};ee.EMPTY=new ee(0,0,0,0);let re=ee;const ie={},se=Object.create(null),ne=Object.create(null);function oe(){let t;for(t in se)se[t].destroy();for(t in ne)ne[t].destroy()}function ae(){let t;for(t in se)delete se[t];for(t in ne)delete ne[t]}class he{constructor(t,e,r){this._canvas=A.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=r||A.RESOLUTION,this.resize(t,e)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(t,e){this._checkDestroyed(),this._canvas.width=Math.round(t*this.resolution),this._canvas.height=Math.round(e*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(t){this._checkDestroyed(),this._canvas.width=Math.round(t)}get height(){return this._checkDestroyed(),this._canvas.height}set height(t){this._checkDestroyed(),this._canvas.height=Math.round(t)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(null===this._canvas)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}function le(t,e,r){for(let i=0,s=4*r*e;i<e;++i,s+=4)if(0!==t[s+3])return!1;return!0}function ue(t,e,r,i,s){const n=4*e;for(let e=i,o=i*n+4*r;e<=s;++e,o+=n)if(0!==t[o+3])return!1;return!0}function ce(t){const{width:e,height:r}=t,i=t.getContext("2d",{willReadFrequently:!0});if(null===i)throw new TypeError("Failed to get canvas 2D context");const s=i.getImageData(0,0,e,r).data;let n=0,o=0,a=e-1,h=r-1;for(;o<r&&le(s,e,o);)++o;if(o===r)return re.EMPTY;for(;le(s,e,h);)--h;for(;ue(s,e,n,o,h);)++n;for(;ue(s,e,a,o,h);)--a;return++a,++h,new re(n,o,a,h)}function de(t){const e=ce(t),{width:r,height:i}=e;let s=null;if(!e.isEmpty()){const n=t.getContext("2d");if(null===n)throw new TypeError("Failed to get canvas 2D context");s=n.getImageData(e.left,e.top,r,i)}return{width:r,height:i,data:s}}function pe(t){const e=Wt.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]}}function fe(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location;
2const r=new URL(t,document.baseURI);return r.hostname!==e.hostname||r.port!==e.port||r.protocol!==e.protocol?"anonymous":""}function me(t,e=1){const r=A.RETINA_PREFIX?.exec(t);return r?parseFloat(r[1]):e}var ge=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(ge||{});const ye=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},_e=(t,e)=>ye(t).priority??e,ve={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(ye).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...t){return t.map(ye).forEach(t=>{t.type.forEach(e=>{const r=this._addHandlers,i=this._queue;r[e]?r[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))})}),this},handle(t,e,r){const i=this._addHandlers,s=this._removeHandlers;if(i[t]||s[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,s[t]=r;const n=this._queue;return n[t]&&(n[t]?.forEach(t=>e(t)),delete n[t]),this},handleByMap(t,e){return this.handle(t,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByList(t,e,r=-1){return this.handle(t,t=>{e.includes(t.ref)||(e.push(t.ref),e.sort((t,e)=>_e(e,r)-_e(t,r)))},t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)})}};class xe{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const be=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function Ee(t){let e="";for(let r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}class Te{constructor(){this.data=0,this.blendMode=a.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==a.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}static for2d(){const t=new Te;return t.depthTest=!1,t.blend=!0,t}}Te.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const Ae=[];function we(t,e){if(!t)return null;let r="";if("string"==typeof t){const e=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);e&&(r=e[1].toLowerCase())}for(let i=Ae.length-1;i>=0;--i){const s=Ae[i];if(s.test&&s.test(t,r))return new s(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Se{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,r,i,s,n,o,a){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:l}=this;this._aliasCount++;for(let u=0,c=l.length;u<c;u++)l[u][h](t,e,r,i,s,n,o,a);return l===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return 0===this.items.length}get name(){return this._name}}Object.defineProperties(Se.prototype,{dispatch:{value:Se.prototype.emit},run:{value:Se.prototype.emit}});class Re{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Se("setRealSize"),this.onUpdate=new Se("update"),this.onError=ne
2w Se("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,r){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class Ie extends Re{constructor(t,e){const{width:r,height:i}=e||{};if(!r||!i)throw new Error("BufferResource width or height invalid");super(r,i),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,r){const i=t.gl;i.pixelStorei(i.UNPACK_ALIGNMENT,this.unpackAlignment),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===g.UNPACK);const s=e.realWidth,n=e.realHeight;return r.width===s&&r.height===n?i.texSubImage2D(e.target,0,0,0,s,n,e.format,r.type,this.data):(r.width=s,r.height=n,i.texImage2D(e.target,0,r.internalFormat,s,n,0,e.format,r.type,this.data)),!0}dispose(){this.data=null}static test(t){return null===t||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const Ce={scaleMode:p.NEAREST,alphaMode:g.NPM},Pe=class t extends W{constructor(e=null,r=null){super(),r=Object.assign({},t.defaultOptions,r);const{alphaMode:i,mipmap:s,anisotropicLevel:n,scaleMode:o,width:a,height:h,wrapMode:l,format:u,type:c,target:d,resolution:p,resourceOptions:f}=r;e&&!(e instanceof Re)&&((e=we(e,f)).internal=!0),this.resolution=p||A.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=s,this.anisotropicLevel=n,this._wrapMode=l,this._scaleMode=o,this.format=u,this.type=c,this.target=d,this.alphaMode=i,this.uid=te(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)}setResolution(t){const e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete ne[this.cacheId],delete se[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit
2("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,r,i=A.STRICT_TEXTURE_CACHE){const s="string"==typeof e;let n=null;if(s)n=e;else{if(!e._pixiId){const t=r?.pixiIdPrefix||"pixiid";e._pixiId=`${t}_${te()}`}n=e._pixiId}let o=ne[n];if(s&&i&&!o)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return o||(o=new t(e,r),o.cacheId=n,t.addToCache(o,n)),o}static fromBuffer(e,r,i,s){e=e||new Float32Array(r*i*4);const n=new Ie(e,{width:r,height:i,...s?.resourceOptions});let o,a;return e instanceof Float32Array?(o=l.RGBA,a=c.FLOAT):e instanceof Int32Array?(o=l.RGBA_INTEGER,a=c.INT):e instanceof Uint32Array?(o=l.RGBA_INTEGER,a=c.UNSIGNED_INT):e instanceof Int16Array?(o=l.RGBA_INTEGER,a=c.SHORT):e instanceof Uint16Array?(o=l.RGBA_INTEGER,a=c.UNSIGNED_SHORT):e instanceof Int8Array?(o=l.RGBA,a=c.BYTE):(o=l.RGBA,a=c.UNSIGNED_BYTE),n.internal=!0,new t(n,Object.assign({},Ce,{type:a,format:o},s))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),ne[e]&&ne[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),ne[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=ne[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete ne[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete ne[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};Pe.defaultOptions={mipmap:m.POW2,anisotropicLevel:0,scaleMode:p.LINEAR,wrapMode:f.CLAMP,alphaMode:g.UNPACK,target:u.TEXTURE_2D,format:l.RGBA,type:c.UNSIGNED_BYTE},Pe._globalBatch=0;let Me=Pe;class De{constructor(){this.texArray=null,this.blend=0,this.type=h.TRIANGLES,this.start=0,this.size=0,this.data=null}}let Oe=0;class Be{constructor(t,e=!0,r=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Oe++,this.disposeRunner=new Se("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?E.ELEMENT_ARRAY_BUFFER:E.ARRAY_BUFFER}get index(){return this.type===E.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new Be(t)}}class Ne{constructor(t,e=0,r=!1,i=c.FLOAT,s,n,o,a=1){this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=s,this.start=n,this.instance=o,this.divisor=a}destroy(){this.buffer=null}static from(t,e,r,i,s){return new Ne(t,e,r,i,s)}}const Le={Float32Array,Uint32Array,Int32Array,Uint8Array},Fe={5126:4,5123:2,5121:1};let ke=0;const Ue={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Ge{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=ke++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Se("disposeGeometry"),this.refCount=0}addAttribute(t,e,r=0,i=!1,s,n,o,a=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof Be||(e instanceof Array&&(e=new Float32Array(e)),e=new Be(e));const h=t.split("|");if(h.length>1){for(let t=0;t<h.length;t++)this.addAttribute(h[t],e,r,i,s);return this}let l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new Ne(l,r,i,s,n,o,a),this.instanced=this.instanced||a,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof Be||(t instanceof Array&&(t=new Uint16Array(t)),t=new Be(t)),t.type=E.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;const t=[],e=[],r=new Be;let i;for(i in this.attributes){const r=this.attributes[i],s=this.buffers[r.buffer];t.push(s.data),e.push(r.size*Fe[r.type]/4),r.buffer=0}for(r.data=function(t,e){let r=0,i=0;const s={};for(let s=0;s<t.length;s++)i+=e[s],r+=t[s].length;const n=new ArrayBuffer(4*r);let o=null,a=0;for(let r=0;r<t.length;r++){const h=e[r],l=t[r],u=Vt(l);s[u]||(s[u]=new Le[u](n)),o=s[u];for(let t=0;t<l.length;t++)o[(t/h|0)*i+a+t%h]=l[t];a+=h}return new Float32Array(n)}(t,e),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new Ge;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new Be(this.buffers[e].data.slice(0));for(const e in this.attributes){const r=this.attributes[e];t.attributes[e]=new Ne(r.buffer,r.size,r.normalized,r.type,r.stride,r.start,r.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=E.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new Ge,r=[],i=[],s=[];let n;for(let e=0;e<t.length;e++){n=t[e];for(let t=0;t<n.buffers.length;t++)i[t]=i[t]||0,i[t]+=n.buffers[t].data.length,s[t]=0}for(let t=0;t<n.buffers.length;t++)r[t]=new(Ue[Vt(n.buffers[t].data)])(i[t]),e.buffers[t]=new Be(r[t]);for(let e=0;e<t.length;e++){n=t[e];for(let t=0;t<n.buffers.length;t++)r[t].set(n.buffers[t].data,s[t]),s[t]+=n.buffers[t].data.length}if(e.attributes=n.attributes,n.indexBuffer){e.indexBuffer=e.buffers[n.buffers.indexOf(n.indexBuffer)],e.indexBuffer.type=E.ELEMENT_ARRAY_BUFFER;let r=0,i=0,s=0,o=0;for(let t=0;t<n.buffers.length;t++)if(n.buffers[t]!==n.indexBuffer){o=t;break}for(const t in n.attributes){const e=n.attributes[t];(0|e.buffer)===o&&(i+=e.size*Fe[e.type]/4)}for(let n=0;n<t.length;n++){const a=t[n].indexBuffer.data;for(let t=0;t<a.length;t++)e.indexBuffer.data[t+s]+=r;r+=t[n].buffers[o].data.length/i,s+=a.length}}return e}}class He extends Ge{constructor(t=!1){super(),this._buffer=new Be(null,t,!1),this._indexBuffer=new Be(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,c.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,c.FLOAT).addAttribute("aColor",this._buffer,4,!0,c.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,c.FLOAT).addIndex(this._indexBuffer)}}const je=2*Math.PI,We=180/Math.PI,Xe=Math.PI/180;var Ve=(t=>
2(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(Ve||{});class ze{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new ze(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}ze.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const $e=[new ze,new ze,new ze,new ze];class Ye{constructor(t=0,e=0,r=0,i=0){this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=Ve.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Ye(0,0,0,0)}clone(){return new Ye(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}const r=this.left,i=this.right,s=this.top,n=this.bottom;if(i<=r||n<=s)return!1;const o=$e[0].set(t.left,t.top),a=$e[1].set(t.left,t.bottom),h=$e[2].set(t.right,t.top),l=$e[3].set(t.right,t.bottom);if(h.x<=o.x||a.y<=o.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(0===u||(e.apply(o,o),e.apply(a,a),e.apply(h,h),e.apply(l,l),Math.max(o.x,a.x,h.x,l.x)<=r||Math.min(o.x,a.x,h.x,l.x)>=i||Math.max(o.y,a.y,h.y,l.y)<=s||Math.min(o.y,a.y,h.y,l.y)>=n))return!1;const c=u*(a.y-o.y),d=u*(o.x-a.x),p=c*r+d*s,f=c*i+d*s,m=c*r+d*n,g=c*i+d*n;if(Math.max(p,f,m,g)<=c*o.x+d*o.y||Math.min(p,f,m,g)>=c*l.x+d*l.y)return!1;const y=u*(o.y-h.y),_=u*(h.x-o.x),v=y*r+_*s,x=y*i+_*s,b=y*r+_*n,E=y*i+_*n;return!(Math.max(v,x,b,E)<=y*o.x+_*o.y||Math.min(v,x,b,E)>=y*l.x+_*l.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(t=1,e=.001){const r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=s-i,this}}Ye.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class qe{constructor(t=0,e=0,r=0){this.x=t,this.y=e,this.radius=r,this.type=Ve.CIRC}clone(){return new qe(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let i=this.x-t,s=this.y-e;return i*=i,s*=s,i+s<=r}getBounds(){return new Ye(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}}qe.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class Ke{constructor(t=0,e=0,r=0,i=0){this.x=t,this.y=e,this.width=r,this.height=i,this.type=Ve.ELIP}clone(){return new Ke(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,r+i<=1}getBounds(){return new Ye(this.x-this.width,this.y-this.height,this.width,this.height)}}Ke.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Qe{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,i=e.length;r<i;r++)t.push(e[r].x,e[r].y);e=t}this.points=e,this.type=Ve.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new Qe(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let r=!1;const i=this.points.length/2;for(let s=0,n=i-1;s<i;n=s++){const i=this.points[2*s],o=this.points[2*s+1],a=this.points[2*n],h=this.points[2*n+1];o>e!=h>e&&t<(e-o)/(h-o)*(a-i)+i&&(r=!r)}return r}}Qe.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`};class Ze{constructor(t=0,e=0,r=0,i=0,s=20){this.x=t,this.y=e,this.width=r,this.height=i,this.radius=s,this.type=Ve.RREC}clone(){return new Ze(this.x,this.y,this.width,this.height,this.radius)}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;let i=t-(this.x+r),s=e-(this.y+r);const n=r*r;if(i*i+s*s<=n||(i=t-(this.x+this.width-r),i*i+s*s<=n)||(s=e-(this.y+this.height-r),i*i+s*s<=n)||(i=t-(this.x+r),i*i+s*s<=n))return!0}return!1}}Ze.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class Je{constructor(t=1,e=0,r=0,i=1,s=0,n=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,r,i,s,n){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(t,e){e=e||new ze;
2const r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e}applyInverse(t,e){e=e||new ze;const r=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return e.x=this.d*r*i+-this.c*r*s+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*s+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.a,s=this.c,n=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=s*e-this.d*r,this.d=s*r+this.d*e,this.tx=n*e-this.ty*r,this.ty=n*r+this.ty*e,this}append(t){const e=this.a,r=this.b,i=this.c,s=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*s,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*s,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*s+this.ty,this}setTransform(t,e,r,i,s,n,o,a,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-a)*n,this.d=Math.cos(o-a)*n,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,r=this.b,i=this.c,s=this.d,n=t.pivot,o=-Math.atan2(-i,s),a=Math.atan2(r,e),h=Math.abs(o+a);return h<1e-5||Math.abs(je-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+s*s),t.position.x=this.tx+(n.x*e+n.y*i),t.position.y=this.ty+(n.x*r+n.y*s),t}invert(){const t=this.a,e=this.b,r=this.c,i=this.d,s=this.tx,n=t*i-e*r;return this.a=i/n,this.b=-e/n,this.c=-r/n,this.d=t/n,this.tx=(r*this.ty-i*s)/n,this.ty=-(t*this.ty-e*s)/n,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new Je;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new Je}static get TEMP_MATRIX(){return new Je}}Je.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const tr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],er=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],rr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ir=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],sr=[],nr=[],or=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];sr.push(e);for(let r=0;r<16;r++){const i=or(tr[t]*tr[r]+rr[t]*er[r]),s=or(er[t]*tr[r]+ir[t]*er[r]),n=or(tr[t]*rr[r]+rr[t]*ir[r]),o=or(er[t]*rr[r]+ir[t]*ir[r]);for(let t=0;t<16;t++)if(tr[t]===i&&er[t]===s&&rr[t]===n&&ir[t]===o){e.push(t);break}}}for(let t=0;t<16;t++){const e=new Je;e.set(tr[t],er[t],rr[t],ir[t],0,0),nr.push(e)}}();const ar={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>tr[t],uY:t=>er[t],vX:t=>rr[t],vY:t=>ir[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>sr[t][e],sub:(t,e)=>sr[t][ar.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?ar.S:ar.N:2*Math.abs(e)<=Math.abs(t)?t>0?ar.E:ar.W:e>0?t>0?ar.SE:ar.SW:t>0?ar.NE:ar.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const s=nr[ar.inv(e)];s.tx=r,s.ty=i,t.append(s)}};class hr{constructor(t,e,r=0,i=0){this._x=r,this._y=i,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new hr(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}hr.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const lr=class{constructor(){this.worldTransform=new Je,this.localTransform=new Je,this.position=new hr(this.onChange,this,0,0),this.scale=new hr(this.onChange,this,1,1),this.pivot=new hr(this.onChange,this,0,0),this.skew=new hr(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};lr.IDENTITY=new lr;let ur=lr;ur.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};const cr={};let dr,pr=cr;function fr(t,e,r){if("precision"!==t.substring(0,9)){let i=e;return e===v.HIGH&&r!==v.HIGH&&(i=v.MEDIUM),`precision ${i} float;\n${t}`}return r!==v.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}let mr=0;const gr={},yr=class t{constructor(e,r,i="pixi-shader",n={}){this.extra={},this.id=mr++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=n,"#version"!==this.vertexSrc.substring(0,8)&&(i=i.replace(/\s+/g,"-"),gr[i]?(gr[i]++,i+=`-${gr[i]}`):gr[i]=1,this.vertexSrc=`#define SHADER_NAME ${i}\n${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${i}\n${this.fragmentSrc}`,this.vertexSrc=fr(this.vertexSrc,t.defaultVertexPrecision,v.HIGH),this.fragmentSrc=fr(this.fragmentSrc,t.defaultFragmentPrecision,function(){if(!dr){dr=v.MEDIUM;const t=function(){if(pr===cr||pr?.isContextLost()){const t=A.ADAPTER.createCanvas();let e;A.PREFER_ENV>=s.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),pr=e}return pr}();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);e&&(dr=e.precision?v.HIGH:v.MEDIUM)}}return dr}())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
2)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"}static from(e,r,i){const s=e+r;let n=ie[s];return n||(ie[s]=n=new t(e,r,i)),n}};yr.defaultVertexPrecision=v.HIGH,yr.defaultFragmentPrecision=j.apple.device?v.HIGH:v.MEDIUM;let _r=yr,vr=0;class xr{constructor(t,e,r){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=vr++,this.static=!!e,this.ubo=!!r,t instanceof Be?(this.buffer=t,this.buffer.type=E.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Be(new Float32Array(1)),this.buffer.type=E.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,e,r){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[t]=new xr(e,r)}static from(t,e,r){return new xr(t,e,r)}static uboFrom(t,e){return new xr(t,e??!0,!0)}}class br{constructor(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof xr?e:new xr(e):new xr({}),this.disposeRunner=new Se("disposeShader")}checkUniformExists(t,e){if(e.uniforms[t])return!0;for(const r in e.uniforms){const i=e.uniforms[r];if(!0===i.group&&this.checkUniformExists(t,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,e,r){const i=_r.from(t,e);return new br(i,r)}}class Er{constructor(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},!e.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!e.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const e=new Int32Array(t);for(let r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=xr.from({uSamplers:e},!0);let r=this.fragTemplate;r=r.replace(/%count%/gi,`${t}`),r=r.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new _r(this.vertexSrc,r)}const e={tint:new Float32Array([1,1,1,1]),translationMatrix:new Je,default:this.defaultGroupCache[t]};return new br(this.programCache[t],e)}generateSampleSrc(t){let e="";e+="\n",e+="\n";for(let r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(vTextureId < ${r}.5)`),e+="\n{",e+=`\n\tcolor = texture2D(uSamplers[${r}], vTextureCoord);`,e+="\n}";return e+="\n",e+="\n",e}}class Tr{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}class Ar{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}const wr=class t extends Ar{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=He,this.vertexSize=6,this.state=Te.for2d(),this.size=4*t.defaultBatchSize,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??function(){let t=!0;const e=A.ADAPTER.getNavigator();if(j.tablet||j.phone){if(j.apple.device){const r=e.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)<11&&(t=!1)}if(j.android.device){const r=e.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)<7&&(t=!1)}}return t?32:4}(),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??!j.apple.device,this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return $("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return"precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
2)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n"}static get defaultFragmentTemplate(){return"varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n"}setShaderGenerator({vertex:e=t.defaultVertexSrc,fragment:r=t.defaultFragmentTemplate}={}){this.shaderGenerator=new Er(e,r)}contextChange(){const e=this.renderer.gl;A.PREFER_ENV===s.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),t.defaultMaxTextures),this.maxTextures=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const i=be.replace(/%forloop%/gi,Ee(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:r}=t,i=this.size/4,s=Math.floor(i/this.maxTextures)+1;for(;e.length<i;)e.push(new De);for(;r.length<s;)r.push(new Tr);for(let t=0;t<this.maxTextures;t++)this._tempBoundTextures[t]=null}onPrerender(){this._flushId=0}render(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:r}=this,i=t._textureArrayPool,s=this.renderer.batch,n=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++Me._globalBatch,h=0,l=i[0],u=0;s.copyBoundTextures(n,r);for(let t=0;t<this._bufferSize;++t){const c=e[t];e[t]=null,c._batchEnabled!==a&&(l.count>=r&&(s.boundArray(l,n,a,r),this.buildDrawCalls(l,u,t),u=t,l=i[++h],++a),c._batchEnabled=a,c.touched=o,l.elements[l.count++]=c)}l.count>0&&(s.boundArray(l,n,a,r),this.buildDrawCalls(l,u,this._bufferSize),++h,++a);for(let t=0;t<n.length;t++)n[t]=null;Me._globalBatch=a}buildDrawCalls(e,r,i){const{_bufferedElements:s,_attributeBuffer:n,_indexBuffer:o,vertexSize:a}=this,h=t._drawCallPool;let l=this._dcIndex,u=this._aIndex,c=this._iIndex,d=h[l];d.start=this._iIndex,d.texArray=e;for(let t=r;t<i;++t){const i=s[t],p=i._texture.baseTexture,f=kt[p.alphaMode?1:0][i.blendMode];s[t]=null,r<t&&d.blend!==f&&(d.size=c-d.start,r=t,d=h[++l],d.texArray=e,d.start=c),this.packInterleavedGeometry(i,n,o,u,c),u+=i.vertexData.length/2*a,c+=i.indices.length,d.blend=f}r<i&&(d.size=c-d.start,++l),this._dcIndex=l,this._aIndex=u,this._iIndex=c}bindAndClearTexArray(t){const e=this.renderer.texture;for(let r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:r,_indexBuffer:i}=this;t.canUploadSameBuffer?(e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const e=this._dcIndex,{gl:r,state:i}=this.renderer,s=t._drawCallPool;let n=null;for(let t=0;t<e;t++){const{texArray:e,type:o,size:a,start:h,blend:l}=s[t];n!==e&&(n=e,this.bindAndClearTexArray(e)),this.state.blendMode=l,i.set(this.state),r.drawElements(o,a,r.UNSIGNED_SHORT,2*h)}}flush(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),t.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=Yt(Math.ceil(t/8)),r=Kt(e),i=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let s=this._aBuffers[i];return s||(this._aBuffers[i]=s=new xe(i*this.vertexSize*4)),s}getIndexBuffer(t){const e=Yt(Math.ceil(t/12)),r=Kt(e),i=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let s=this._iBuffers[r];return s||(this._iBuffers[r]=s=new Uint16Array(i)),s}packInterleavedGeometry(t,e,r,i,s){const{uint32View:n,float32View:o}=e,a=i/this.vertexSize,h=t.uvs,l=t.indices,u=t.vertexData,c=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),p=Ot.shared.setValue(t._tintRGB).toPremultiplied(d,t._texture.baseTexture.alphaMode>0);for(let t=0;t<u.length;t+=2)o[i++]=u[t],o[i++]=u[t+1],o[i++]=h[t],o[i++]=h[t+1],n[i++]=p,o[i++]=c;for(let t=0;t<l.length;t++)r[s++]=a+l[t]}};wr.defaultBatchSize=4096,wr.extension={name:"batch",type:ge.RendererPlugin},wr._drawCallPool=[],wr._textureArrayPool=[];let Sr=wr;ve.add(Sr);const Rr=class t extends br{constructor(e,r,i){super(_r.from(e||t.defaultVertexSrc,r||t.defaultFragmentSrc),i),this.padding=0,this.resolution=t.defaultResolution,this.multisample=t.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Te}apply(t,e,r,i,s){t.applyFilter(this,e,r,i)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
2\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"}};Rr.defaultResolution=1,Rr.defaultMultisample=b.NONE;let Ir=Rr;class Cr{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Ot(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:r,backgroundAlpha:i}=t,s=r??e;void 0!==s&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}Cr.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},Cr.extension={type:[ge.RendererSystem,ge.CanvasRendererSystem],name:"background"},ve.add(Cr);class Pr{constructor(t){this.renderer=t,this.emptyRenderer=new Ar(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,e){const{boundTextures:r}=this.renderer.texture;for(let i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,e,r,i){const{elements:s,ids:n,count:o}=t;let a=0;for(let t=0;t<o;t++){const o=s[t],h=o._batchLocation;if(h>=0&&h<i&&e[h]===o)n[t]=h;else for(;a<i;){const i=e[a];if(!i||i._batchEnabled!==r||i._batchLocation!==a){n[t]=a,o._batchLocation=a,e[a]=o;break}a++}}}destroy(){this.renderer=null}}Pr.extension={type:ge.RendererSystem,name:"batch"},ve.add(Pr);let Mr=0;class Dr{constructor(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Mr++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,r=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:r,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=Mr++,this.renderer.runners.contextChange.emit(t);const e=this.renderer.view;void 0!==e.addEventListener&&(e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const e=this.createContext(this.renderer.view,t);this.initFromContext(e)}createContext(t,e){let r;if(A.PREFER_ENV>=s.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!r)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,void 0!==t.removeEventListener&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Dr.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Dr.extension={type:ge.RendererSystem,name:"context"},ve.add(Dr);class Or{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Se("disposeFramebuffer"),this.multisample=b.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new Me(null,{scaleMode:p.NEAREST,resolution:1,mipmap:m.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new Me(null,{scaleMode:p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:m.OFF,format:l.DEPTH_COMPONENT,type:c.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let r=0;r<this.colorTextures.length;r++){const i=this.colorTextures[r],s=i.resolution;i.setSize(t/s,e/s)}if(this.depthTexture){const r=this.depthTexture.resolution;this.depthTexture.setSize(t/r,e/r)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class Br extends Me{constructor(t={}){"number"==typeof t&&(t={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),t.width=t.width??100,t.height=t.height??100,t.multisample??(t.multisample=b.NONE),super(null,t),this.mipmap=m.OFF,this.valid=!0,this._clear=new Ot([0,0,0,0]),this.framebuffer=new Or(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.he
2ight)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class Nr extends Re{constructor(t){const e=t;super(e.naturalWidth||e.videoWidth||e.displayWidth||e.width,e.naturalHeight||e.videoHeight||e.displayHeight||e.height),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,r){void 0!==r||e.startsWith("data:")?!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous"):t.crossOrigin=fe(e)}upload(t,e,r,i){const s=t.gl,n=e.realWidth,o=e.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||0===i.naturalWidth)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===g.UNPACK),this.noSubImage||e.target!==s.TEXTURE_2D||r.width!==n||r.height!==o?(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,e.format,r.type,i)):s.texSubImage2D(s.TEXTURE_2D,0,0,0,e.format,r.type,i),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,r=t.naturalHeight||t.videoHeight||t.height;this.resize(e,r),super.update()}dispose(){this.source=null}}class Lr extends Nr{constructor(t,e){if(e=e||{},"string"==typeof t){const r=new Image;Nr.crossOrigin(r,t,e.crossorigin),r.src=t,t=r}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(e.createBitmap??A.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.bitmap=null,this._load=null,!1!==e.autoLoad&&this.load()}load(t){return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((t,e)=>{const r=this.source;this.url=r.src;const i=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};r.complete&&r.src?i():(r.onload=i,r.onerror=t=>{e(t),this.onError.emit(t)})})),this._load}process(){const t=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,r=!t.crossOrigin||"anonymous"===t.crossOrigin;return this._process=fetch(t.src,{mode:r?"cors":"no-cors"}).then(t=>t.blob()).then(r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===g.UNPACK?"premultiply":"none"})).then(t=>this.destroyed?Promise.reject():(this.bitmap=t,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,e,r){if("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,r,this.bitmap),!this.preserveBitmap){let t=!0;const i=e._glTextures;for(const s in i){const n=i[s];if(n!==r&&n.dirtyId!==e.dirtyId){t=!1;break}}t&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&("string"==typeof t||t instanceof HTMLImageElement)}}class Fr{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,r){const i=e.width,s=e.height;if(r){const e=t.width/2/i,n=t.height/2/s,o=t.x/i+e,a=t.y/s+n;r=ar.add(r,ar.NW),this.x0=o+e*ar.uX(r),this.y0=a+n*ar.uY(r),r=ar.add(r,2),this.x1=o+e*ar.uX(r),this.y1=a+n*ar.uY(r),r=ar.add(r,2),this.x2=o+e*ar.uX(r),this.y2=a+n*ar.uY(r),r=ar.add(r,2),this.x3=o+e*ar.uX(r),this.y3=a+n*ar.uY(r)}else this.x0=t.x/i,this.y0=t.y/s,this.x1=(t.x+t.width)/i,this.y1=t.y/s,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/s,this.x3=t.x/i,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}Fr.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const kr=new Fr;function Ur(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class Gr extends W{constructor(t,e,r,i,s,n,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new Ye(0,0,1,1)),t instanceof Gr&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this.destroyed=!1,this._uvs=kr,this.uvMatrix=null,this.orig=r||e,this._rotate=Number(s||0),!0===s)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=n?new ze(n.x,n.y):new ze(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update(
2)}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:t}=this.baseTexture;t?.url&&se[t.url]&&Gr.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Gr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),r=new Gr(this.baseTexture,!this.noFrame&&t,e,this.trim?.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(r._frame=t),r}updateUvs(){this._uvs===kr&&(this._uvs=new Fr),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},r=A.STRICT_TEXTURE_CACHE){const i="string"==typeof t;let s=null;if(i)s=t;else if(t instanceof Me){if(!t.cacheId){const r=e?.pixiIdPrefix||"pixiid";t.cacheId=`${r}-${te()}`,Me.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const r=e?.pixiIdPrefix||"pixiid";t._pixiId=`${r}_${te()}`}s=t._pixiId}let n=se[s];if(i&&r&&!n)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return n||t instanceof Me?!n&&t instanceof Me&&(n=new Gr(t),Gr.addToCache(n,s)):(e.resolution||(e.resolution=me(t)),n=new Gr(new Me(t,e)),n.baseTexture.cacheId=s,Me.addToCache(n.baseTexture,s),Gr.addToCache(n,s)),n}static fromURL(t,e){const r=Object.assign({autoLoad:!1},e?.resourceOptions),i=Gr.from(t,Object.assign({resourceOptions:r},e),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then(()=>Promise.resolve(i))}static fromBuffer(t,e,r,i){return new Gr(Me.fromBuffer(t,e,r,i))}static fromLoader(t,e,r,i){const s=new Me(t,Object.assign({scaleMode:Me.defaultOptions.scaleMode,resolution:me(e)},i)),{resource:n}=s;n instanceof Lr&&(n.url=e);const o=new Gr(s);return r||(r=e),Me.addToCache(o.baseTexture,r),Gr.addToCache(o,r),r!==e&&(Me.addToCache(o.baseTexture,e),Gr.addToCache(o,e)),o.baseTexture.valid?Promise.resolve(o):new Promise(t=>{o.baseTexture.once("loaded",()=>t(o))})}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),se[e]&&se[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),se[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=se[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete se[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)se[t.textureCacheIds[e]]===t&&delete se[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:e,y:r,width:i,height:s}=t,n=e+i>this.baseTexture.width,o=r+s>this.baseTexture.height;if(n||o){const t=n&&o?"and":"or",a=`X: ${e} + ${i} = ${e+i} > ${this.baseTexture.width}`,h=`Y: ${r} + ${s} = ${r+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${a} ${t} ${h}`)}this.valid=i&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Gr._EMPTY||(Gr._EMPTY=new Gr(new Me),Ur(Gr._EMPTY),Ur(Gr._EMPTY.baseTexture)),Gr._EMPTY}static get WHITE(){if(!Gr._WHITE){const t=A.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),Gr._WHITE=new Gr(Me.from(t)),Ur(Gr._WHITE),Ur(Gr._WHITE.baseTexture)}return Gr._WHITE}}class Hr extends Gr{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,r=!0){const i=this.baseTexture.resolution,s=Math.round(t*i)/i,n=Math.round(e*i)/i;this.valid=s>0&&n>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=n,r&&this.baseTexture.resize(s,n),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new Hr(new Br(t))}}class jr{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,r=b.NONE){const i=new Br(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new Hr(i)}getOptimalTexture(t,e,r=1,i=b.NONE){let s;t=Math.max(Math.ceil(t*r-1e-6),1),e=Math.max(Math.ceil(e*r-1e-6),1),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?s=i>1?-i:-1:(s=((65535&(t=Yt(t)))<<16|65535&(e=Yt(e)))>>>0,i>1&&(s+=4294967296*i)),this.texturePool[s]||(this.texturePool[s]=[]);let n=this.texturePool[s].pop();return n||(n=this.createTexture(t,e,i)),n.filterPoolKey=s,n.setResolution(r),n}getFilterTexture(t,e,r){const i=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||b.NONE);return i.filterFrame=t.filterFrame,i}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=!1!==t)for(const t in this.texturePool){const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this.texturePool={}}setScreenSize(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){this.enableFullScreen=t.width>0&&t.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}jr.SCREEN_KEY=-1;class Wr extends Ge{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class Xr extends Ge{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Be(this.vertices),this.uvBuffer=new Be(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class Vr{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=b.NONE,this.sourceFrame=new Ye,this.destinationFrame=new Ye,this.bindingSourceFrame=new Ye,this.bindingDestinationFrame=new Ye,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const zr=[new ze,new ze,new ze,new ze],$r=new Je;class Yr{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new jr,this.statePool=[],this.quad=new Wr,this.quadUv=new Xr,this.tempRect=new Ye,this.activeState={},this.globalUniforms=new xr({outputFrame:new Ye,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}
2init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,e){const r=this.renderer,i=this.defaultFilterStack,s=this.statePool.pop()||new Vr,n=r.renderTexture;let o,a;if(n.current){const t=n.current;o=t.resolution,a=t.multisample}else o=r.resolution,a=r.multisample;let h=e[0].resolution||o,l=e[0].multisample??a,u=e[0].padding,c=e[0].autoFit,d=e[0].legacy??!0;for(let t=1;t<e.length;t++){const r=e[t];h=Math.min(h,r.resolution||o),l=Math.min(l,r.multisample??a),u=this.useMaxPadding?Math.max(u,r.padding):u+r.padding,c=c&&r.autoFit,d=d||(r.legacy??!0)}1===i.length&&(this.defaultFilterStack[0].renderTexture=n.current),i.push(s),s.resolution=h,s.multisample=l,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(u);const p=this.tempRect.copyFrom(n.sourceFrame);r.projection.transform&&this.transformAABB($r.copyFrom(r.projection.transform).invert(),p),c?(s.sourceFrame.fit(p),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(p)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,n.current?n.current.resolution:r.resolution,n.sourceFrame,n.destinationFrame,r.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,h,l),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const f=this.tempRect;f.x=0,f.y=0,f.width=s.sourceFrame.width,f.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(n.sourceFrame),s.bindingDestinationFrame.copyFrom(n.destinationFrame),s.transform=r.projection.transform,r.projection.transform=null,n.bind(s.renderTexture,s.sourceFrame,f),r.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;const i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;const s=i.inputSize,n=i.inputPixel,o=i.inputClamp;if(s[0]=e.destinationFrame.width,s[1]=e.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],n[0]=Math.round(s[0]*e.resolution),n[1]=Math.round(s[1]*e.resolution),n[2]=1/n[0],n[3]=1/n[1],o[0]=.5*n[2],o[1]=.5*n[3],o[2]=e.sourceFrame.width*s[2]-.5*n[2],o[3]=e.sourceFrame.height*s[3]-.5*n[3],e.legacy){const t=i.filterArea;t[0]=e.destinationFrame.width,t[1]=e.destinationFrame.height,t[2]=e.sourceFrame.x,t[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const a=t[t.length-1];if(this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,a.renderTexture,y.BLEND,e),this.returnFilterTexture(e.renderTexture);else{let t=e.renderTexture,i=this.getOptimalFilterTexture(t.width,t.height,e.resolution);i.filterFrame=t.filterFrame;let s=0;for(s=0;s<r.length-1;++s){1===s&&e.multisample>1&&(i=this.getOptimalFilterTexture(t.width,t.height,e.resolution),i.filterFrame=t.filterFrame),r[s].apply(this,t,i,y.CLEAR,e);const n=t;t=i,i=n}r[s].apply(this,t,a.renderTexture,y.BLEND,e),s>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(t),this.returnFilterTexture(i)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=y.CLEAR){const{renderTexture:r,state:i}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t?.filterFrame){const e=this.tempRect;e.x=0,e.y=0,e.width=t.filterFrame.width,e.height=t.filterFrame.height,r.bind(t,t.filterFrame,e)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=1&i.stateId||this.forceClear;(e===y.CLEAR||e===y.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,r,i){const s=this.renderer;s.state.set(t.state),this.bindAndClear(r,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(h.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(h.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:r,destinationFrame:i}=this.activeState,{orig:s}=e._texture,n=t.set(i.width,0,0,i.height,r.x,r.y),o=e.worldTransform.copyTo(Je.TEMP_MATRIX);return o.invert(),n.prepend(o),n.scale(1/s.width,1/s.height),n.translate(e.anchor.x,e.anchor.y),n}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,r=1,i=b.NONE){return this.texturePool.getOptimalTexture(t,e,r,i)}getFilterTexture(t,e,r){if("number"==typeof t){const r=t;t=e,e=r}t=t||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||b.NONE);return i.filterFrame=t.filterFrame,i}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}
vendor: 4,509 bytes, line 2
2resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const r=zr[0],i=zr[1],s=zr[2],n=zr[3];r.set(e.left,e.top),i.set(e.left,e.bottom),s.set(e.right,e.top),n.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(s,s),t.apply(n,n);const o=Math.min(r.x,i.x,s.x,n.x),a=Math.min(r.y,i.y,s.y,n.y),h=Math.max(r.x,i.x,s.x,n.x),l=Math.max(r.y,i.y,s.y,n.y);e.x=o,e.y=a,e.width=h-o,e.height=l-a}roundFrame(t,e,r,i,s){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(s){const{a:t,b:e,c:r,d:i}=s;if((Math.abs(e)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4))return}(s=s?$r.copyFrom(s):$r.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}}}Yr.extension={type:ge.RendererSystem,name:"filter"},ve.add(Yr);class qr{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=b.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Kr=new Ye;class Qr{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Or(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ye,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){let e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;A.PREFER_ENV===s.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=t=>e.drawBuffersWEBGL(t):(this.hasMRT=!1,t.drawBuffers=()=>{}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,r=0){const{gl:i}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=r),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let e=0;e<t.colorTextures.length;e++){const r=t.colorTextures[e];this.renderer.texture.unbind(r.parentTextureArray||r)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){const t=e.width>>r,i=e.height>>r,s=t/e.width;this.setViewport(e.x*s,e.y*s,t,i)}else{const e=t.width>>r,i=t.height>>r;this.setViewport(0,0,e,i)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,r,i){const s=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),(s.width!==r||s.height!==i||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=r,s.height=i,this.gl.viewport(t,e,r,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,r,i,s=o.COLOR|o.DEPTH){const{gl:n}=this;n.clearColor(t,e,r,i),n.clear(s)}initFramebuffer(t){const{gl:e}=this,r=new qr(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r}resizeFramebuffer(t){const{gl:e}=this,r=t.glFramebuffers[this.CONTEXT_UID];if(r.stencil){let i;e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),i=1===this.renderer.context.webGLVersion?e.DEPTH_STENCIL:t.depth&&t.stencil?e.DEPTH24_STENCIL8:t.depth?e.DEPTH_COMPONENT24:e.STENCIL_INDEX8,r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,i,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,i,t.width,t.height)}const i=t.colorTextures;let s=i.length;e.drawBuffers||(s=Math.min(s,1));for(let n=0;n<s;n++){const s=i[n],o=s.parentTextureArray||s;this.renderer.texture.bind(o,0),0===n&&r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,o._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,e){const{gl:r}=this,i=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures;let n=s.length;r.drawBuffers||(n=Math.min(n,1)),i.multisample>
21&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer():i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const o=[];for(let a=0;a<n;a++){const n=s[a],h=n.parentTextureArray||n;this.renderer.texture.bind(h,0),0===a&&i.msaaBuffer?(r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+a,n.target,h._glTextures[this.CONTEXT_UID].texture,e),o.push(r.COLOR_ATTACHMENT0+a))}if(o.length>1&&r.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const i=t.depthTexture;this.renderer.texture.bind(i,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,i._glTextures[this.CONTEXT_UID].texture,e)}if(!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture)i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null);else{let e,s;i.stencil=i.stencil||r.createRenderbuffer(),1===this.renderer.context.webGLVersion?(e=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH_STENCIL):t.depth&&t.stencil?(e=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH24_STENCIL8):t.depth?(e=r.DEPTH_ATTACHMENT,s=r.DEPTH_COMPONENT24):(e=r.STENCIL_ATTACHMENT,s=r.STENCIL_INDEX8),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,s,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,s,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,e,r.RENDERBUFFER,i.stencil)}}canMultisampleFramebuffer(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let r=b.NONE;if(t<=1||null===e)return r;for(let i=0;i<e.length;i++)if(e[i]<=t){r=e[i];break}return 1===r&&(r=b.NONE),r}blit(t,e,r){const{current:i,renderer:s,gl:n,CONTEXT_UID:o}=this;if(2!==s.context.webGLVersion||!i)return;const a=i.glFramebuffers[o];if(!a)return;if(!t){if(!a.msaaBuffer)return;const e=i.colorTextures[0];if(!e)return;a.blitFramebuffer||(a.blitFramebuffer=new Or(i.width,i.height),a.blitFramebuffer.addColorTexture(0,e)),(t=a.blitFramebuffer).colorTextures[0]!==e&&(t.colorTextures[0]=e,t.dirtyId++,t.dirtyFormat++),(t.width!==i.width||t.height!==i.height)&&(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}e||((e=Kr).width=i.width,e.height=i.height),r||(r=e);const h=e.width===r.width&&e.height===r.height;this.bind(t),n.bindFramebuffer(n.READ_FRAMEBUFFER,a.framebuffer),n.blitFramebuffer(e.left,e.top,e.right,e.bottom,r.left,r.top,r.right,r.bottom,n.COLOR_BUFFER_BIT,h?n.NEAREST:n.LINEAR),n.bindFramebuffer(n.READ_FRAMEBUFFER,t.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(t,e){const r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!r)return;delete t.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(t);s>
2=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&this.disposeFramebuffer(r.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)}forceStencil(){const t=this.current;if(!t)return;const e=t.glFramebuffers[this.CONTEXT_UID];if(!e||e.stencil&&t.stencil)return;t.stencil=!0;const r=t.width,i=t.height,s=this.gl,n=e.stencil=s.createRenderbuffer();let o,a;s.bindRenderbuffer(s.RENDERBUFFER,n),1===this.renderer.context.webGLVersion?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH_STENCIL):t.depth?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH24_STENCIL8):(o=s.STENCIL_ATTACHMENT,a=s.STENCIL_INDEX8),e.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,e.multisample,a,r,i):s.renderbufferStorage(s.RENDERBUFFER,a,r,i),s.framebufferRenderbuffer(s.FRAMEBUFFER,o,s.RENDERBUFFER,n)}reset(){this.current=this.unknownFramebuffer,this.viewport=new Ye}destroy(){this.renderer=null}}Qr.extension={type:ge.RendererSystem,name:"framebuffer"},ve.add(Qr);const Zr={5126:4,5123:2,5121:1};class Jr{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){let e=this.renderer.context.extensions.vertexArrayObject;A.PREFER_ENV===s.WEBGL_LEGACY&&(e=null),e?(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(2!==e.webGLVersion){const e=t.getExtension("ANGLE_instanced_arrays");e?(t.vertexAttribDivisor=(t,r)=>e.vertexAttribDivisorANGLE(t,r),t.drawElementsInstanced=(t,r,i,s,n)=>e.drawElementsInstancedANGLE(t,r,i,s,n),t.drawArraysInstanced=(t,r,i,s)=>e.drawArraysInstancedANGLE(t,r,i,s)):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:r}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const n=i[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?r.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let r=0;r<t.buffers.length;r++){const i=t.buffers[r];e.update(i)}}checkCompatibility(t,e){const r=t.attributes,i=e.attributeData;for(const t in i)if(!r[t])throw new Error(`shader and geometry incompatible, geometry missing the "${t}" attribute`)}getSignature(t,e){const r=t.attributes,i=e.attributeData,s=["g",t.id];for(const t in r)i[t]&&s.push(t,i[t].location);return s.join("-")}initGeometryVao(t,e,r=!0){const i=this.gl,s=this.CONTEXT_UID,n=this.renderer.buffer,o=e.program;o.glPrograms[s]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,o);const a=this.getSignature(t,o),h=t.glVertexArrayObjects[this.CONTEXT_UID];let l=h[a];if(l)return h[o.id]=l,l;const u=t.buffers,c=t.attributes,d={},p={};for(const t in u)d[t]=0,p[t]=0;for(const t in c)!c[t].size&&o.attributeData[t]?c[t].size=o.attributeData[t].size:c[t].size||console.warn(`PIXI Geometry attribute '${t}' size cannot be determined (likely the bound shader does not have the attribute)`),d[c[t].buffer]+=c[t].size*Zr[c[t].type];for(const t in c){const e=c[t],r=e.size;void 0===e.stride&&(d[e.buffer]===r*Zr[e.type]?e.stride=0:e.stride=d[e.buffer]),void 0===e.start&&(e.start=p[e.buffer],p[e.buffer]+=r*Zr[e.type])}l=i.createVertexArray(),i.bindVertexArray(l);for(let t=0;t<u.length;t++){const e=u[t];n.bind(e),r&&e._glBuffers[s].refCount++}return this.activateVao(t,o),h[o.id]=l,h[a]=l,i.bindVertexArray(null),n.unbind(E.ARRAY_BUFFER),l}disposeGeometry(t,e){if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const r=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=t.buffers,n=this.renderer?.buffer;if(t.disposeRunner.remove(this),r){if(n)for(let t=0;t<s.length;t++){const r=s[t]._glBuffers[this.CONTEXT_UID];r&&(r.refCount--,0===r.refCount&&!e&&n.dispose(s[t],e))}if(!e)for(const t in r)if("g"===t[0]){const e=r[t];this._activeVao===e&&this.unbind(),i.deleteVertexArray(e)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const e=Object.keys(this.managedGeometries);for(let r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t)}activateVao(t,e){const r=this.gl,i=this.CONTEXT_UID,s=this.renderer.buffer,n=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let a=null;for(const t in o){const h=o[t],l=n[h.buffer],u=l._glBuffers[i];if(e.attributeData[t]){a!==u&&(s.bind(l),a=u);const i=e.attributeData[t].location;if(r.enableVertexAttribArray(i),r.vertexAttribPointer(i,h.size,h.type||r.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(i,h.divisor)}}}}draw(t,e,r,i){const{gl:s}=this,n=this._activeGeometry;if(n.indexBuffer){const o=n.indexBuffer.data.BYTES_PER_ELEMENT,a=2===o?s.UNSIGNED_SHORT:s.UNSIGNED_INT;2===o||4===o&&this.canUseUInt32ElementIndex?n.instanced?s.drawElementsInstanced(t,e||n.indexBuffer.data.length,a,(r||0)*o,i||1):s.drawElements(t,e||n.indexBuffer.data.length,a,(r||0)*o):console.warn("unsupported index buffer type: uint32")}else n.instanced?s.drawArraysInstanced(t,r,e||n.getSize(),i||1):s.drawArrays(t,r,e||n.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}Jr.extension={type:ge.RendererSystem,name:"geometry"},ve.add(Jr);const ti=new Je;class ei{constructor(t,e){this._texture=t,this.mapCoord=new Je,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e>"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){void 0===e&&(e=t);const r=this.mapCoord;for(let i=0;i<t.length;i+=2){const s=t[i],n=t[i+1];e[i]=s*r.a+n*r.c+r.tx,e[i+1]=s*r.b+n*r.d+r.ty}return e}update(t){const e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;const r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);const i=e.orig,s=e.trim;s&&(ti.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(ti));const n=e.baseTexture,o=this.uClampFrame,a=this.clampMargin/n.resolution,h=this.clampOffset;return o[0]=(e._frame.x+a+h)/n.width,o[1]=(e._frame.y+a+h)/n.height,o[2]=(e._frame.x+e._frame.width-a+h)/n.width,o[3]=(e._frame.y+e._frame.height-a+h)/n.height,this.uClampOffset[0]=h/n.realWidth,this.uClampOffset[1]=h/n.realHeight,this.isSimple=e._frame.width===n.width&&e._frame.height===n.height&&0===e.rotate,!0}}class ri extends Ir{constructor(t,e,r){let i=null;"string"!=typeof t&&void 0===e&&void 0===r&&(i=t,t=void 0,e=void 0,r=void 0),super(t||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
2)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n",e||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n",r),this.maskSprite=i,this.maskMatrix=new Je}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,r,i){const s=this._maskSprite,n=s._texture;n.valid&&(n.uvMatrix||(n.uvMatrix=new ei(n,0)),n.uvMatrix.update(),this.uniforms.npmAlpha=n.baseTexture.alphaMode?0:1,this.uniforms.mask=n,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(n.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=n.uvMatrix.uClampFrame,t.applyFilter(this,e,r,i))}}class ii{constructor(t=null){this.type=x.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Ir.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=x.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class si{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,e){let r=e;if(!r.isMaskData){const t=this.maskDataPool.pop()||new ii;t.pooled=!0,t.maskObject=e,r=t}const i=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(i),r._colorMask=i?i._colorMask:15,r.autoDetect&&this.detect(r),r._target=t,r.type!==x.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case x.SCISSOR:this.renderer.scissor.push(r);break;case x.STENCIL:this.renderer.stencil.push(r);break;case x.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r);break;case x.COLOR:this.pushColorMask(r)}r.type===x.SPRITE&&this.maskStack.push(r)}pop(t){const e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case x.SCISSOR:this.renderer.scissor.pop(e);break;case x.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case x.SPRITE:this.popSpriteMask(e);break;case x.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){const t=this.maskStack[this.maskStack.length-1];t.type===x.SPRITE&&t._filters&&(t._filters[0].maskSprite=t.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=x.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=x.SCISSOR:t.type=x.STENCIL:t.type=x.COLOR}pushSpriteMask(t){const{maskObject:e}=t,r=t._target;let i=t._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new ri])),i[0].resolution=t.resolution,i[0].multisample=t.multisample,i[0].maskSprite=e;const s=r.filterArea;r.filterArea=e.getBounds(!0),this.renderer.filter.push(r,i),r.filterArea=s,t._filters||this.alphaMaskIndex++}
2popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const e=t._colorMask,r=t._colorMask=e&t.colorMask;r!==e&&this.renderer.gl.colorMask(!!(1&r),!!(2&r),!!(4&r),!!(8&r))}popColorMask(t){const e=t._colorMask,r=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==e&&this.renderer.gl.colorMask(!!(1&r),!!(2&r),!!(4&r),!!(8&r))}destroy(){this.renderer=null}}si.extension={type:ge.RendererSystem,name:"mask"},ve.add(si);class ni{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,r=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const oi=new Je,ai=[],hi=class t extends ni{constructor(t){super(t),this.glConst=A.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:r}=t,{renderer:i}=this,s=i.renderTexture,n=r.getBounds(!0,ai.pop()??new Ye);this.roundFrameToPixels(n,s.current?s.current.resolution:i.resolution,s.sourceFrame,s.destinationFrame,i.projection.transform),e&&n.fit(e),t._scissorRectLocal=n}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:i,d:s}=t;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(s)>1e-4)}testScissor(e){const{maskObject:r}=e;if(!r.isFastRect||!r.isFastRect()||t.isMatrixRotated(r.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,r,i,s,n){t.isMatrixRotated(n)||((n=n?oi.copyFrom(n):oi.identity()).translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.renderer.filter.transformAABB(n,e),e.fit(s),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&ai.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};hi.extension={type:ge.RendererSystem,name:"scissor"};let li=hi;ve.add(li);class ui extends ni{constructor(t){super(t),this.glConst=A.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:r}=this.renderer,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),t._stencilCounter++;const s=t._colorMask;0!==s&&(t._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilFunc(r.EQUAL,i,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==s&&(t._colorMask=s,r.colorMask(!!(1&s),!!(2&s),!!(4&s),!!(8&s))),this._useCurrent()}pop(t){const e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{const r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,i=r?r._colorMask:15;0!==i&&(r._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==i&&(r._colorMask=i,e.colorMask(!!(1&i),!!(2&i),!!(4&i),!!(8&i))),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}ui.extension={type:ge.RendererSystem,name:"stencil"},ve.add(ui);class ci{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:()=>($("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract)},prepare:{enumerable:!1,get:()=>($("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare)},interaction:{enumerable:!1,get:()=>($("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events)}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}ci.extension={type:[ge.RendererSystem,ge.CanvasRendererSystem],name:"_plugin"},ve.add(ci);class di{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Je,this.transform=null}update(t,e,r,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,i),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,e,r,i){const s=this.projectionMatrix,n=i?-1:1;s.identity(),s.a=1/e.width*2,s.d=n*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-n-e.y*s.d}setTransform(t){}destroy(){this.renderer=null}}di.extension={type:ge.RendererSystem,name:"projection"},ve.add(di);const pi=new ur,fi=new Ye;class mi{constructor(t){this.renderer=t,this._tempMatrix=new Je}generateTexture(t,e){const{region:r,...i}=e||{},s=r?.copyTo(fi)||t.getLocalBounds(fi,!0),n=i.resolution||this.renderer.resolution;s.width=Math.max(s.width,1/n),s.height=Math.max(s.height,1/n),i.width=s.width,i.height=s.height,i.resolution=n,i.multisample??(i.multisample=this.renderer.multisample);const o=Hr.create(i);this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const a=t.transform;return t.transform=pi,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=a,o}destroy(){}}mi.extension={type:[ge.RendererSystem,ge.CanvasRendererSystem],name:"textureGenerator"},ve.add(mi);const gi=new Ye,yi=new Ye;class _i{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Ye,this.destinationFrame=new Ye,this.viewportFrame=new Ye}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,r){const i=this.renderer;let s,n,o;this.current=t,t?(s=t.baseTexture,o=s.resolution,e||(gi.width=t.frame.width,gi.height=t.frame.height,e=gi),r||(yi.x=t.frame.x,yi.y=t.frame.y,yi.width=e.width,yi.height=e.height,r=yi),n=s.framebuffer):(o=i.resolution,e||(gi.width=i._view.screen.width,gi.height=i._view.screen.height,e=gi),r||((r=gi).width=e.width,r.height=e.height));const a=this.viewportFrame;a.x=r.x*o,a.y=r.y*o,a.width=r.width*o,a.height=r.height*o,t||(a.y=i.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(r,e,o,!n),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)}clear(t,e){const r=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=Ot.shared.setValue(t||r);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&i.premultiply(i.alpha);const s=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==n.width||s.height!==n.height;if(o){let{x:t,y:e,width:r,height:i}=this.viewportFrame;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(t,e,r,i)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,e),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}_i.extension={type:ge.RendererSystem,name:"renderTexture"},ve.add(_i);class vi{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function xi(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function bi(t){const e=new Array(t);for(let t=0;t<e.length;t++)e[t]=!1;return e}function Ei(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return bi(2*e);case"bvec3":return bi(3*e);case"bvec4":return bi(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Ti={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Ai(t){return Ti[t]}let wi=null;const Si={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Ri(t,e){if(!wi){const e=Object.keys(Si);wi={};for(let r=0;r<e.length;++r){const i=e[r];wi[t[i]]=Si[i]}}return wi[e]}function Ii(t,e){const r=t.getShaderSource(e).split("\n").map((t,e)=>`${e}: ${t}`),i=t.getShaderInfoLog(e),s=i.split("\n"),n={},o=s.map(t=>
2parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(t=>!(!t||n[t]||(n[t]=!0,0))),a=[""];o.forEach(t=>{r[t-1]=`%c${r[t-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=r.join("\n");a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}const Ci=[{test:t=>"float"===t.type&&1===t.size&&!t.isArray,code:t=>`\n if(uv["${t}"] !== ud["${t}"].value)\n {\n ud["${t}"].value = uv["${t}"]\n gl.uniform1f(ud["${t}"].location, uv["${t}"])\n }\n `},{test:(t,e)=>!("sampler2D"!==t.type&&"samplerCube"!==t.type&&"sampler2DArray"!==t.type||1!==t.size||t.isArray||null!=e&&void 0===e.castToBaseTexture),code:t=>`t = syncData.textureCount++;\n\n renderer.texture.bind(uv["${t}"], t);\n\n if(ud["${t}"].value !== t)\n {\n ud["${t}"].value = t;\n gl.uniform1i(ud["${t}"].location, t);\n; // eslint-disable-line max-len\n }`},{test:(t,e)=>"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a,code:t=>`\n gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));\n `,codeUbo:t=>`\n var ${t}_matrix = uv.${t}.toArray(true);\n\n data[offset] = ${t}_matrix[0];\n data[offset+1] = ${t}_matrix[1];\n data[offset+2] = ${t}_matrix[2];\n \n data[offset + 4] = ${t}_matrix[3];\n data[offset + 5] = ${t}_matrix[4];\n data[offset + 6] = ${t}_matrix[5];\n \n data[offset + 8] = ${t}_matrix[6];\n data[offset + 9] = ${t}_matrix[7];\n data[offset + 10] = ${t}_matrix[8];\n `},{test:(t,e)=>"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["${t}"].location, v.x, v.y);\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n `},{test:t=>"vec2"===t.type&&1===t.size&&!t.isArray,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["${t}"].location, v[0], v[1]);\n }\n `},{test:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["${t}"].location, v.x, v.y, v.width, v.height)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n `},{test:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n data[offset+3] = v.alpha;\n `},{test:(t,e)=>"vec3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n \n gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n `},{test:t=>"vec4"===t.type&&1===t.size&&!t.isArray,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])\n }`}];function Pi(t,e,r,i,s){r.buffer.update(s)}const Mi={float:"\n data[offset] = v;
2\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},Di={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};let Oi;const Bi={float:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }",vec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",int:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",ivec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",ivec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",ivec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",uint:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }",uvec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }",uvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",uvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }",bvec2:"\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",bvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",bvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",samplerCube:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",sampler2DArray:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }"},Ni={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};let Li=0;const Fi={textureCount:0,uboCount:0};class ki{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Li++}systemCheck(){if(!function(){if("boolean"==typeof Oi)return Oi;try{Oi=!0===new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")}catch{Oi=!1}return Oi}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const r=t.program,i=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(i.program)),e||(Fi.textureCount=0,Fi.uboCount=0,this.syncUniformGroup(t.uniformGroup,Fi)),i}setUniforms(t){const e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)}syncUniformGroup(t,e){const r=this.getGlProgram();(!t.static||t.dirtyId!==r.uniformDirtyGroups[t.id])&&(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))}syncUniforms(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){const r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(const i in t.uniforms){const s=e[i];if(!s){!0===t.uniforms[i]?.group&&(t.uniforms[i].ubo?r.push(`\n renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');\n `):r.push(`\n renderer.shader.syncUniformGroup(uv.${i}, syncData);\n `));continue}const n=t.uniforms[i];let o=!1;for(let t=0;t<Ci.length;t++)if(Ci[t].test(s,n)){r.push(Ci[t].code(i,n)),o=!0;break}if(!o){const t=(1!==s.size||s.isArray?Ni:Bi)[s.type].replace("location",`ud["${i}"].location`);r.push(`\n cu = ud["${i}"];\n cv = cu.value;\n v = uv["${i}"];\n ${t};`)}}return new Function("ud","uv","renderer","syncData",r.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const r=this.getGlProgram();if(!t.static||0!==t.dirtyId||!r.uniformGroups[t.id]){t.dirtyId=0;const i=r.uniformGroups[t.id]||this.createSyncBufferGroup(t,r,e);
2t.buffer.update(),i(r.uniformData,t.uniforms,this.renderer,Fi,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,r.uniformBufferBindings[e])}createSyncBufferGroup(t,e,r){const{gl:i}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(e.program,r);e.uniformBufferBindings[r]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const n=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[n];if(o||(o=this._uboCache[n]=function(t,e){if(!t.autoManage)return{size:0,syncFunc:Pi};const r=function(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort((t,e)=>t.index-e.index),r}(t.uniforms,e),{uboElements:i,size:s}=function(t){const e=t.map(t=>({data:t,offset:0,dataLen:0,dirty:0}));let r=0,i=0,s=0;for(let t=0;t<e.length;t++){const n=e[t];if(r=Di[n.data.type],n.data.size>1&&(r=Math.max(r,16)*n.data.size),n.dataLen=r,i%r!==0&&i<16){const t=i%r%16;i+=t,s+=t}i+r>16?(s=16*Math.ceil(s/16),n.offset=s,s+=r,i=r):(n.offset=s,i+=r,s+=r)}return s=16*Math.ceil(s/16),{uboElements:e,size:s}}(r),n=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "];for(let e=0;e<i.length;e++){const r=i[e],s=t.uniforms[r.data.name],o=r.data.name;let a=!1;for(let t=0;t<Ci.length;t++){const e=Ci[t];if(e.codeUbo&&e.test(r.data,s)){n.push(`offset = ${r.offset/4};`,Ci[t].codeUbo(r.data.name,s)),a=!0;break}}if(!a)if(r.data.size>1){const t=Ai(r.data.type),e=Math.max(Di[r.data.type]/16,1),i=t/e,s=(4-i%4)%4;n.push(`\n cv = ud.${o}.value;\n v = uv.${o};\n offset = ${r.offset/4};\n\n t = 0;\n\n for(var i=0; i < ${r.data.size*e}; i++)\n {\n for(var j = 0; j < ${i}; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ${s};\n }\n\n `)}else{const t=Mi[r.data.type];n.push(`\n cv = ud.${o}.value;\n v = uv.${o};\n offset = ${r.offset/4};\n ${t};\n `)}}return n.push("\n renderer.buffer.update(buffer);\n "),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join("\n"))}}(t,this.shader.program.uniformData)),t.autoManage){const e=new Float32Array(o.size/4);t.buffer.update(e)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,r){const i=t.uniforms,s=[`${r}-`];for(const t in i)s.push(t),e[t]&&s.push(e[t].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,r=t.program,i=function(t,e){const r=xi(t,t.VERTEX_SHADER,e.vertexSrc),i=xi(t,t.FRAGMENT_SHADER,e.fragmentSrc),s=t.createProgram();t.attachShader(s,r),t.attachShader(s,i);const n=e.extra?.transformFeedbackVaryings;if(n&&("function"!=typeof t.transformFeedbackVaryings?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(s,n.names,"separate"===n.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Ii(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Ii(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,s,r,i),e.attributeData=function(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;s<i;s++){const i=e.getActiveAttrib(t,s);if(i.name.startsWith("gl_"))continue;const n=Ri(e,i.type),o={type:n,name:i.name,size:Ai(n),location:e.getAttribLocation(t,i.name)};r[i.name]=o}return r}(s,t),e.uniformData=function(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<i;s++){const i=e.getActiveUniform(t,s),n=i.name.replace(/\[.*?\]$/,""),o=!!i.name.match(/\[.*?\]$/),a=Ri(e,i.type);r[n]={name:n,index:s,type:a,size:i.size,isArray:o,value:Ei(a,i.size)}}return r}(s,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const r=Object.keys(e.attributeData);r.sort((t,e)=>t>e?1:-1);for(let i=0;i<r.length;i++)e.attributeData[r[i]].location=i,t.bindAttribLocation(s,i,r[i]);t.linkProgram(s)}t.deleteShader(r),t.deleteShader(i);const o={};for(const r in e.uniformData){const i=e.uniformData[r];o[r]={location:t.getUniformLocation(s,r),value:Ei(i.type,i.size)}}return new vi(s,o)}(e,r);return r.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}ki.extension={type:ge.RendererSystem,name:"shader"},ve.add(ki);class Ui{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.3 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}Ui.defaultOptions={hello:!1},Ui.extension={type:[ge.RendererSystem,ge.CanvasRendererSystem],name:"startup"},ve.add(Ui);const Gi=class t{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=a.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new Te,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=function(t,e=[]){return e[a.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.ADD]=[t.ONE,t.ONE],e[a.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.NONE]=[0,0],e[a.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[a.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[a.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[a.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[a.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[a.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[a.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[a.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[a.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[a.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[a.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):!e&&-1!==r&&this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};Gi.extension={type:ge.RendererSystem,name:"state"};let Hi=Gi;ve.add(Hi);
vendor: 1,282 bytes, line 2
2class ji extends W{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const e=(t.priority??[]).filter(e=>t.systems[e]),r=[...e,...Object.keys(t.systems).filter(t=>!e.includes(t))];for(const e of r)this.addSystem(t.systems[e],e)}addRunners(...t){t.forEach(t=>{this.runners[t]=new Se(t)})}addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}emitWithCustomOptions(t,e){const r=Object.keys(this._systemsHash);t.items.forEach(i=>{const s=r.find(t=>this._systemsHash[t]===i);i[t.name](e[s])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const Wi=class t{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=t.defaultMaxIdle,this.checkCountMax=t.defaultCheckCountMax,this.mode=t.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==_.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let i=0;i<e.length;i++){const s=e[i];s.resource&&this.count-s.touched>
2this.maxIdle&&(t.destroyTexture(s,!0),e[i]=null,r=!0)}if(r){let t=0;for(let r=0;r<e.length;r++)null!==e[r]&&(e[t++]=e[r]);e.length=t}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let e=t.children.length-1;e>=0;e--)this.unload(t.children[e])}destroy(){this.renderer=null}};Wi.defaultMode=_.AUTO,Wi.defaultMaxIdle=3600,Wi.defaultCheckCountMax=600,Wi.extension={type:ge.RendererSystem,name:"textureGC"};let Xi=Wi;ve.add(Xi);class Vi{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=c.UNSIGNED_BYTE,this.internalFormat=l.RGBA,this.samplerType=0}}class zi{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Me,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[c.UNSIGNED_BYTE]:{[l.RGBA]:t.RGBA8,[l.RGB]:t.RGB8,[l.RG]:t.RG8,[l.RED]:t.R8,[l.RGBA_INTEGER]:t.RGBA8UI,[l.RGB_INTEGER]:t.RGB8UI,[l.RG_INTEGER]:t.RG8UI,[l.RED_INTEGER]:t.R8UI,[l.ALPHA]:t.ALPHA,[l.LUMINANCE]:t.LUMINANCE,[l.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[c.BYTE]:{[l.RGBA]:t.RGBA8_SNORM,[l.RGB]:t.RGB8_SNORM,[l.RG]:t.RG8_SNORM,[l.RED]:t.R8_SNORM,[l.RGBA_INTEGER]:t.RGBA8I,[l.RGB_INTEGER]:t.RGB8I,[l.RG_INTEGER]:t.RG8I,[l.RED_INTEGER]:t.R8I},[c.UNSIGNED_SHORT]:{[l.RGBA_INTEGER]:t.RGBA16UI,[l.RGB_INTEGER]:t.RGB16UI,[l.RG_INTEGER]:t.RG16UI,[l.RED_INTEGER]:t.R16UI,[l.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[c.SHORT]:{[l.RGBA_INTEGER]:t.RGBA16I,[l.RGB_INTEGER]:t.RGB16I,[l.RG_INTEGER]:t.RG16I,[l.RED_INTEGER]:t.R16I},[c.UNSIGNED_INT]:{[l.RGBA_INTEGER]:t.RGBA32UI,[l.RGB_INTEGER]:t.RGB32UI,[l.RG_INTEGER]:t.RG32UI,[l.RED_INTEGER]:t.R32UI,[l.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[c.INT]:{[l.RGBA_INTEGER]:t.RGBA32I,[l.RGB_INTEGER]:t.RGB32I,[l.RG_INTEGER]:t.RG32I,[l.RED_INTEGER]:t.R32I},[c.FLOAT]:{[l.RGBA]:t.RGBA32F,[l.RGB]:t.RGB32F,[l.RG]:t.RG32F,[l.RED]:t.R32F,[l.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[c.HALF_FLOAT]:{[l.RGBA]:t.RGBA16F,[l.RGB]:t.RGB16F,[l.RG]:t.RG16F,[l.RED]:t.R16F},[c.UNSIGNED_SHORT_5_6_5]:{[l.RGB]:t.RGB565},[c.UNSIGNED_SHORT_4_4_4_4]:{[l.RGBA]:t.RGBA4},[c.UNSIGNED_SHORT_5_5_5_1]:{[l.RGBA]:t.RGB5_A1},[c.UNSIGNED_INT_2_10_10_10_REV]:{[l.RGBA]:t.RGB10_A2,[l.RGBA_INTEGER]:t.RGB10_A2UI},[c.UNSIGNED_INT_10F_11F_11F_REV]:{[l.RGB]:t.R11F_G11F_B10F},[c.UNSIGNED_INT_5_9_9_9_REV]:{[l.RGB]:t.RGB9_E5},[c.UNSIGNED_INT_24_8]:{[l.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[c.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[l.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:{[c.UNSIGNED_BYTE]:{[l.RGBA]:t.RGBA,[l.RGB]:t.RGB,[l.ALPHA]:t.ALPHA,[l.LUMINANCE]:t.LUMINANCE,[l.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[c.UNSIGNED_SHORT_5_6_5]:{[l.RGB]:t.RGB},[c.UNSIGNED_SHORT_4_4_4_4]:{[l.RGBA]:t.RGBA},[c.UNSIGNED_SHORT_5_5_5_1]:{[l.RGBA]:t.RGBA}},e}(t),this.samplerTypes=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[t.RGB]:d.FLOAT,[t.RGBA]:d.FLOAT,[t.ALPHA]:d.FLOAT,[t.LUMINANCE]:d.FLOAT,[t.LUMINANCE_ALPHA]:d.FLOAT,[t.R8]:d.FLOAT,[t.R8_SNORM]:d.FLOAT,[t.RG8]:d.FLOAT,[t.RG8_SNORM]:d.FLOAT,[t.RGB8]:d.FLOAT,[t.RGB8_SNORM]:d.FLOAT,[t.RGB565]:d.FLOAT,[t.RGBA4]:d.FLOAT,[t.RGB5_A1]:d.FLOAT,[t.RGBA8]:d.FLOAT,[t.RGBA8_SNORM]:d.FLOAT,[t.RGB10_A2]:d.FLOAT,[t.RGB10_A2UI]:d.FLOAT,[t.SRGB8]:d.FLOAT,[t.SRGB8_ALPHA8]:d.FLOAT,[t.R16F]:d.FLOAT,[t.RG16F]:d.FLOAT,[t.RGB16F]:d.FLOAT,[t.RGBA16F]:d.FLOAT,[t.R32F]:d.FLOAT,[t.RG32F]:d.FLOAT,[t.RGB32F]:d.FLOAT,[t.RGBA32F]:d.FLOAT,[t.R11F_G11F_B10F]:d.FLOAT,[t.RGB9_E5]:d.FLOAT,[t.R8I]:d.INT,[t.R8UI]:d.UINT,[t.R16I]:d.INT,[t.R16UI]:d.UINT,[t.R32I]:d.INT,[t.R32UI]:d.UINT,[t.RG8I]:d.INT,[t.RG8UI]:d.UINT,[t.RG16I]:d.INT,[t.RG16UI]:d.UINT,[t.RG32I]:d.INT,[t.RG32UI]:d.UINT,[t.RGB8I]:d.INT,[t.RGB8UI]:d.UINT,[t.RGB16I]:d.INT,[t.RGB16UI]:d.UINT,[t.RGB32I]:d.INT,[t.RGB32UI]:d.UINT,[t.RGBA8I]:d.INT,[t.RGBA8UI]:d.UINT,[t.RGBA16I]:d.INT,[t.RGBA16UI]:d.UINT,[t.RGBA32I]:d.INT,[t.RGBA32UI]:d.UINT,[t.DEPTH_COMPONENT16]:d.FLOAT,[t.DEPTH_COMPONENT24]:d.FLOAT,[t.DEPTH_COMPONENT32F]:d.FLOAT,[t.DEPTH_STENCIL]:d.FLOAT,[t.DEPTH24_STENCIL8]:d.FLOAT,[t.DEPTH32F_STENCIL8]:d.FLOAT}:{[t.RGB]:d.FLOAT,[t.RGBA]:d.FLOAT,[t.ALPHA]:d.FLOAT,[t.LUMINANCE]:d.FLOAT,[t.LUMINANCE_ALPHA]:d.FLOAT,[t.DEPTH_STENCIL]:d.FLOAT},e}(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let t=0;t<e;t++)this.boundTextures[t]=null;this.emptyTextures={};const r=new Vi(t.createTexture());t.bindTexture(t.TEXTURE_2D,r.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=r,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Vi(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let e=0;e<6;e++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let t=0;t<this.boundTextures.length;t++)this.bind(null,t)}bind(t,e=0){const{gl:r}=this;if(t=t?.castToBaseTexture(),t?.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.updateTexture(t)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:e,boundTextures:r}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let t=0;t<r.length;t++)r[t]===this.unknownTexture&&this.bind(null,t)}for(let i=0;i<r.length;i++)r[i]===t&&(this.currentLocation!==i&&(e.activeTexture(e.TEXTURE0+i),this.currentLocation=i),e.bindTexture(t.target,this.emptyTextures[t.target].texture),r[i]=null)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:r,CONTEXT_UID:i}=this;if(r)for(let r=t-1;r>=0;--r){const t=e[r];t&&t._glTextures[i].samplerType!==d.FLOAT&&this.renderer.texture.unbind(t)}}initTexture(t){const e=new Vi(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){e.internalFormat=this.internalFormats[t.type]?.[t.format]??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??d.FLOAT,2===this.webGLVersion&&t.type===c.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const r=this.renderer;if(this.initTextureType(t,e),t.resource?.upload(r,t,e))e.samplerType!==d.FLOAT&&(this.hasIntegerTextures=!0);else{const i=t.realWidth,s=t.realHeight,n=r.gl;(e.width!==i||e.height!==s||e.dirtyId<0)&&(e.width=i,e.height=s,n.texImage2D(t.target,0,e.internalFormat,i,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:r}=this;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const e=this.managedTextures.indexOf(t);-1!==e&&Qt(this.managedTextures,e,1)}}updateTextureStyle(t){const e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==m.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=f.CLAMP,t.resource?.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const r=this.gl;if(e.mipmap&&t.mipmap!==m.ON_MANUAL&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===p.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);const e=this.renderer.context.extensions.anisotropicFiltering;if(e&&t.anisotropicLevel>0&&t.scaleMode===p.LINEAR){const i=Math.min(t.anisotropicLevel,r.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===p.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===p.LINEAR?r.LINEAR:r.NEAREST)}destroy(){this.renderer=null}}zi.extension={type:ge.RendererSystem,name:"texture"},ve.add(zi);class $i{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glTransformFeedbacks[r]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:r,renderer:i}=this;e&&i.shader.bind(e),r.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:r,CONTEXT_UID:i}=this,s=e.createTransformFeedback();t._glTransformFeedbacks[i]=s,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,s);for(let s=0;s<t.buffers.length;s++){const n=t.buffers[s];n&&(r.buffer.update(n),n._glBuffers[i].refCount++,e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,s,n._glBuffers[i].buffer||null))}return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),s}disposeTransformFeedback(t,e){const r=t._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;
2t.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let r=0;r<t.buffers.length;r++){const i=t.buffers[r];if(!i)continue;const n=i._glBuffers[this.CONTEXT_UID];n&&(n.refCount--,0===n.refCount&&!e&&s.dispose(i,e))}r&&(e||i.deleteTransformFeedback(r),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}$i.extension={type:ge.RendererSystem,name:"transformFeedback"},ve.add($i);class Yi{constructor(t){this.renderer=t}init(t){this.screen=new Ye(0,0,t.width,t.height),this.element=t.view||A.ADAPTER.createCanvas(),this.resolution=t.resolution||A.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,e){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(e*this.resolution);const r=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${r}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",r,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){t&&this.element.parentNode?.removeChild(this.element),this.renderer=null,this.element=null,this.screen=null}}Yi.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},Yi.extension={type:[ge.RendererSystem,ge.CanvasRendererSystem],name:"_view"},ve.add(Yi),A.PREFER_ENV=s.WEBGL2,A.STRICT_TEXTURE_CACHE=!1,A.RENDER_OPTIONS={...Dr.defaultOptions,...Cr.defaultOptions,...Yi.defaultOptions,...Ui.defaultOptions},Object.defineProperties(A,{WRAP_MODE:{get:()=>Me.defaultOptions.wrapMode,set(t){$("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),Me.defaultOptions.wrapMode=t}},SCALE_MODE:{get:()=>Me.defaultOptions.scaleMode,set(t){$("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),Me.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get:()=>Me.defaultOptions.mipmap,set(t){$("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),Me.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get:()=>Me.defaultOptions.anisotropicLevel,set(t){$("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),Me.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get:()=>($("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Ir.defaultResolution),set(t){Ir.defaultResolution=t}},FILTER_MULTISAMPLE:{get:()=>($("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Ir.defaultMultisample),set(t){Ir.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get:()=>Sr.defaultMaxTextures,set(t){$("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),Sr.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get:()=>Sr.defaultBatchSize,set(t){$("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),Sr.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get:()=>Sr.canUploadSameBuffer,set(t){$("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),Sr.canUploadSameBuffer=t}},GC_MODE:{get:()=>Xi.defaultMode,set(t){$("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),Xi.defaultMode=t}},GC_MAX_IDLE:{get:()=>Xi.defaultMaxIdle,set(t){$("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),Xi.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get:()=>Xi.defaultCheckCountMax,set(t){$("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),Xi.defaultCheckCountMax=t}},PRECISION_VERTEX:{get:()=>_r.defaultVertexPrecision,set(t){$("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),_r.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get:()=>_r.defaultFragmentPrecision,set(t){$("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),_r.defaultFragmentPrecision=t}}});var qi=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(qi||{});class Ki{constructor(t,e=null,r=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.
2next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const Qi=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Ki(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=qi.NORMAL){return this._addListener(new Ki(t,e,r))}addOnce(t,e,r=qi.NORMAL){return this._addListener(new Ki(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*t.targetFPMS;const i=this._head;let s=i.next;for(;s;)s=s.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const r=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,r)/1e3,t.targetFPMS);this._maxElapsedMS=1/i}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(0===t)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};Qi.targetFPMS=.06;let Zi=Qi;Object.defineProperties(A,{TARGET_FPMS:{get:()=>Zi.targetFPMS,set(t){$("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Zi.targetFPMS=t}}});class Ji{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,qi.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Zi.shared:new Zi,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Ji.extension=ge.Application,ve.add(Ji);const ts=[];function es(t){for(const e of ts)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}ve.handleByList(ge.Renderer,ts);const rs="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
2)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",is="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n";class ss{constructor(t){this.renderer=t}contextChange(t){let e;if(1===this.renderer.context.webGLVersion){const r=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,r)}else{const r=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,r)}e>=b.HIGH?this.multisample=b.HIGH:e>=b.MEDIUM?this.multisample=b.MEDIUM:e>=b.LOW?this.multisample=b.LOW:this.multisample=b.NONE}destroy(){}}ss.extension={type:ge.RendererSystem,name:"_multisample"},ve.add(ss);class ns{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class os{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:r,CONTEXT_UID:i}=this;if(this.boundBufferBases[e]!==t){const s=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,s.buffer)}}bindBufferRange(t,e,r){const{gl:i,CONTEXT_UID:s}=this;r=r||0;const n=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,n.buffer,256*r,256)}update(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);if(t._updateID!==i.updateID)if(i.updateID=t._updateID,e.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const r=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,r)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let r=0;r<e.length;r++)this.dispose(this.managedBuffers[e[r]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:r}=this;return t._glBuffers[e]=new ns(r.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}os.extension={type:ge.RendererSystem,name:"buffer"},ve.add(os);class as{constructor(t){this.renderer=t}render(t,e){const r=this.renderer;let i,s,n,o;if(e&&(i=e.renderTexture,s=e.clear,n=e.transform,o=e.skipUpdateTransform),this.renderingToScreen=!i,r.runners.prerender.emit(),r.emit("prerender"),r.projection.transform=n,!r.context.isLost){if(i||(this.lastObjectRendered=t),!o){const e=t.enableTempParent();t.updateTransform(),t.disableTempParent(e)}r.renderTexture.bind(i),r.batch.currentRenderer.start(),(s??r.background.clearBeforeRender)&&r.renderTexture.clear(),t.render(r),r.batch.currentRenderer.flush(),i&&(e.blit&&r.framebuffer.blit(),i.baseTexture.update()),r.runners.postrender.emit(),r.projection.transform=null,r.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}as.extension={type:ge.RendererSystem,name:"objectRenderer"},ve.add(as);const hs=class t extends ji{constructor(e){super(),this.type=n.WEBGL,e=Object.assign({},A.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new xr({projectionMatrix:new Je},!0);const r={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:t.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};
2this.setup(r),"useContextAlpha"in e&&($("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&"notMultiplied"!==e.useContextAlpha,e.backgroundAlpha=!1===e.useContextAlpha?1:e.backgroundAlpha),this._plugin.rendererPlugins=t.__plugins,this.options=e,this.startup.run(this.options)}static test(t){return!t?.forceCanvas&&it()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return $("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return $("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return $("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return $("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){$("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return $("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){$("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return $("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};hs.extension={type:ge.Renderer,priority:1},hs.__plugins={},hs.__systems={};let ls=hs;ve.handleByMap(ge.RendererPlugin,ls.__plugins),ve.handleByMap(ge.RendererSystem,ls.__systems),ve.add(ls);class us extends Re{constructor(t,e){const{width:r,height:i}=e||{};super(r,i),this.items=[],this.itemDirtyIds=[];for(let e=0;e<t;e++){const t=new Me;this.items.push(t),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof Re?this.addResourceAt(t[r],r):this.addResourceAt(we(t[r],e),r))}dispose(){for(let t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(t,e){if(!this.items[e])throw new Error(`Index ${e} is out of bounds`);return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this}bind(t){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=t,this.items[e].on("update",t.update,t)}unbind(t){super.unbind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=null,this.items[e].off("update",t.update,t)}load(){if(this._load)return this._load;const t=this.items.map(t=>t.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(t).then(()=>{const{realWidth:t,realHeight:e}=this.items[0];return this.resize(t,e),this.update(),Promise.resolve(this)}),this._load}}const cs=class t extends us{constructor(e,r){const{width:i,height:s,autoLoad:n,linkBaseTexture:o}=r||{};if(e&&e.length!==t.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:i,height:s});for(let e=0;e<t.SIDES;e++)this.items[e].target=u.TEXTURE_CUBE_MAP_POSITIVE_X+e;this.linkBaseTexture=!1!==o,e&&this.initFromArray(e,r),!1!==n&&this.load()}bind(t){super.bind(t),t.target=u.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(void 0===r&&(r=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=u.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}
2upload(e,r,i){const s=this.itemDirtyIds;for(let n=0;n<t.SIDES;n++){const t=this.items[n];(s[n]<t.dirtyId||i.dirtyId<r.dirtyId)&&(t.valid&&t.resource?(t.resource.upload(e,t,i),s[n]=t.dirtyId):s[n]<-1&&(e.gl.texImage2D(t.target,0,i.internalFormat,r.realWidth,r.realHeight,0,r.format,i.type,null),s[n]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===t.SIDES}};cs.SIDES=6;let ds=cs;class ps extends Nr{constructor(t,e){let r,i,s;e=e||{},"string"==typeof t?(r=ps.EMPTY,i=t,s=!0):(r=t,i=null,s=!1),super(r),this.url=i,this.crossOrigin=e.crossOrigin??!0,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.ownsImageBitmap=e.ownsImageBitmap??s,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise(async(t,e)=>{if(null!==this.url)try{const e=await A.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await e.blob();if(this.destroyed)return;const i=await createImageBitmap(r,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===g.UNPACK?"premultiply":"none"});if(this.destroyed)return void i.close();this.source=i,this.update(),t(this)}catch(t){if(this.destroyed)return;e(t),this.onError.emit(t)}else t(this)})),this._load}upload(t,e,r){return this.source instanceof ImageBitmap?("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),super.upload(t,e,r)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&("string"==typeof t||t instanceof ImageBitmap)}static get EMPTY(){return ps._EMPTY=ps._EMPTY??A.ADAPTER.createCanvas(0,0),ps._EMPTY}}const fs=class t extends Nr{constructor(t,e){e=e||{},super(A.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},t.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()})),this._load}_loadSvg(){const t=new Image;Nr.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,s=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/r*e,s=this._overrideHeight||this._overrideWidth/e*r),i=Math.round(i),s=Math.round(s);const n=this.source;n.width=i,n.height=s,n._pixiId=`canvas_${te()}`,n.getContext("2d").drawImage(t,0,0,e,r,0,0,i,s),this._resolve(),this._resolve=null}}static getSize(e){const r=t.SVG_SIZE.exec(e),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,r){return"svg"===r||"string"==typeof e&&e.startsWith("data:image/svg+xml")||"string"==typeof e&&t.SVG_XML.test(e)}};fs.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,fs.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let ms=fs;const gs=class t extends Nr{constructor(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");!1!==r.autoLoad&&i.setAttribute("preload","auto"),!1!==r.playsinline&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),!0===r.muted&&(i.setAttribute("muted",""),i.muted=!0),!0===r.loop&&i.setAttribute("loop",""),!1!==r.autoPlay&&i.setAttribute("autoplay",""),"string"==typeof e&&(e=[e]);const s=e[0].src||e[0];Nr.crossOrigin(i,s,r.crossorigin);for(let r=0;r<e.length;++r){const s=document.createElement("source");let{src:n,mime:o}=e[r];if(n=n||e[r],n.startsWith("data:"))o=n.slice(5,n.indexOf(";"));else if(!n.startsWith("blob:")){const e=n.split("?").shift().toLowerCase(),r=e.slice(e.lastIndexOf(".")+1);o=o||t.MIME_TYPES[r]||`video/${r}`}s.src=n,o&&(s.type=o),i.appendChild(s)}e=i}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=r.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==r.autoPlay,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==r.autoLoad&&this.load()}
2update(t=0){if(!this.destroyed){if(this._updateFPS){const t=Zi.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise((e,r)=>{this.valid?e(this):(this._resolve=e,this._reject=r,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Zi.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Zi.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Zi.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.includes(r)}};gs.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],gs.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let ys=gs;Ae.push(ps,Lr,class extends Nr{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}},ys,class extends Nr{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}},ms,Ie,ds,class extends us{constructor(t,e){const{width:r,height:i}=e||{};let s,n;Array.isArray(t)?(s=t,n=t.length):n=t,super(n,{width:r,height:i}),s&&this.initFromArray(s,e)}
2addBaseTextureAt(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this}bind(t){super.bind(t),t.target=u.TEXTURE_2D_ARRAY}upload(t,e,r){const{length:i,itemDirtyIds:s,items:n}=this,{gl:o}=t;r.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,i,0,e.format,r.type,null);for(let t=0;t<i;t++){const i=n[t];s[t]<i.dirtyId&&(s[t]=i.dirtyId,i.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,t,i.resource.width,i.resource.height,1,e.format,r.type,i.resource.source))}return!0}})},13511(t,e,r){"use strict";var i=r(23005);const s=class extends i.dJ{constructor(t){const e=Object.assign({},s.defaults,t),{outerStrength:r,innerStrength:i,color:n,knockout:o,quality:a,alpha:h}=e,l=Math.round(e.distance);super("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nuniform float outerStrength;\nuniform float innerStrength;\n\nuniform vec4 glowColor;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform bool knockout;\nuniform float alpha;\n\nconst float PI = 3.14159265358979323846264;\n\nconst float DIST = __DIST__;\nconst float ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.0);\nconst float ANGLE_STEP_NUM = ceil(PI * 2.0 / ANGLE_STEP_SIZE);\n\nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM * DIST * (DIST + 1.0) / 2.0;\n\nvoid main(void) {\n vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y);\n\n float totalAlpha = 0.0;\n\n vec2 direction;\n vec2 displaced;\n vec4 curColor;\n\n for (float angle = 0.0; angle < PI * 2.0; angle += ANGLE_STEP_SIZE) {\n direction = vec2(cos(angle), sin(angle)) * px;\n\n for (float curDistance = 0.0; curDistance < DIST; curDistance++) {\n displaced = clamp(vTextureCoord + direction * \n (curDistance + 1.0), filterClamp.xy, filterClamp.zw);\n\n curColor = texture2D(uSampler, displaced);\n\n totalAlpha += (DIST - curDistance) * curColor.a;\n }\n }\n \n curColor = texture2D(uSampler, vTextureCoord);\n\n float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA);\n\n float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * curColor.a;\n float innerGlowStrength = min(1.0, innerGlowAlpha);\n \n vec4 innerColor = mix(curColor, glowColor, innerGlowStrength);\n\n float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a);\n float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);\n\n if (knockout) {\n float resultAlpha = (outerGlowAlpha + innerGlowAlpha) * alpha;\n gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);\n }\n else {\n vec4 outerGlowColor = outerGlowStrength * glowColor.rgba * alpha;\n gl_FragColor = innerColor + outerGlowColor;\n }\n}\n".replace(/__ANGLE_STEP_SIZE__/gi,`${(1/a/l).toFixed(7)}`).replace(/__DIST__/gi,`${l.toFixed(0)}.0`)),this.uniforms.glowColor=new Float32Array([0,0,0,1]),this.uniforms.alpha=1,Object.assign(this,{color:n,outerStrength:r,innerStrength:i,padding:l,knockout:o,alpha:h})}get color(){return i.Wp.rgb2hex(this.uniforms.glowColor)}set color(t){i.Wp.hex2rgb(t,this.uniforms.glowColor)}get outerStrength(){return this.uniforms.outerStrength}set outerStrength(t){this.uniforms.outerStrength=t}get innerStrength(){return this.uniforms.innerStrength}set innerStrength(t){this.uniforms.innerStrength=t}get knockout(){return this.uniforms.knockout}set knockout(t){this.uniforms.knockout=t}get alpha(){return this.uniforms.alpha}set alpha(t){this.uniforms.alpha=t}};s.defaults={distance:10,outerStrength:4,innerStrength:0,color:16777215,quality:.1,knockout:!1,alpha:1}},15564(t,e,r){"use strict";r.d(e,{lgM:()=>H,sP:()=>wt,mcf:()=>u,A1g:()=>Le});var i=r(23005);class s{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?i.M_.EMPTY:((t=t||new i.M_(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:r,b:i,c:s,d:n,tx:o,ty:a}=t,h=r*e.x+s*e.y+o,l=i*e.x+n*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)}addQuad(t){let e=this.minX,r=this.minY,i=this.maxX,s=this.maxY,n=t[0],o=t[1];
vendor: 5,562 bytes, line 2
2e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[2],o=t[3],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[4],o=t[5],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[6],o=t[7],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,this.minX=e,this.minY=r,this.maxX=i,this.maxY=s}addFrame(t,e,r,i,s){this.addFrameMatrix(t.worldTransform,e,r,i,s)}addFrameMatrix(t,e,r,i,s){const n=t.a,o=t.b,a=t.c,h=t.d,l=t.tx,u=t.ty;let c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,m=n*e+a*r+l,g=o*e+h*r+u;c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*i+a*r+l,g=o*i+h*r+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*e+a*s+l,g=o*e+h*s+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*i+a*s+l,g=o*i+h*s+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,this.minX=c,this.minY=d,this.maxX=p,this.maxY=f}addVertexData(t,e,r){let i=this.minX,s=this.minY,n=this.maxX,o=this.maxY;for(let a=e;a<r;a+=2){const e=t[a],r=t[a+1];i=e<i?e:i,s=r<s?r:s,n=e>n?e:n,o=r>o?r:o}this.minX=i,this.minY=s,this.maxX=n,this.maxY=o}addVertices(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)}addVerticesMatrix(t,e,r,i,s=0,n=s){const o=t.a,a=t.b,h=t.c,l=t.d,u=t.tx,c=t.ty;let d=this.minX,p=this.minY,f=this.maxX,m=this.maxY;for(let t=r;t<i;t+=2){const r=e[t],i=e[t+1],g=o*r+h*i+u,y=l*i+a*r+c;d=Math.min(d,g-s),f=Math.max(f,g+s),p=Math.min(p,y-n),m=Math.max(m,y+n)}this.minX=d,this.minY=p,this.maxX=f,this.maxY=m}addBounds(t){const e=this.minX,r=this.minY,i=this.maxX,s=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,e){const r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,s=t.maxX<e.maxX?t.maxX:e.maxX,n=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=s&&i<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=r<t?r:t,this.minY=i<e?i:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,s=t.maxX<e.x+e.width?t.maxX:e.x+e.width,n=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=s&&i<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=r<t?r:t,this.minY=i<e?i:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,r,i,s,n){t-=s,e-=n,r+=s,i+=n,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>r?this.maxX:r,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>i?this.maxY:i}}class n extends i.Wp.EventEmitter{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new i.dL,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new s,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let r=0;r<e.length;++r){const i=e[r];Object.defineProperty(n.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new i.M_),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new i.M_),t=this._localBoundsRect),this._localBounds||(this._localBounds=new s);const e=this.transform,r=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=r?.worldAlpha??1,this.transform=this._tempDisplayObjectParent.transform;const n=this._bounds,o=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=n,this._bounds.updateID+=this._boundsID-o,a}toGlobal(t,e,r=!1){return r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){this.parent?.removeChild(this)}setTransform(t=0,e=0,r=1,i=1,s=0,n=0,o=0,a=0,h=0){return this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=s,this.skew.x=n,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this}destroy(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit
2("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new o),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*i.bO}set angle(t){this.transform.rotation=t*i.Td}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(t._maskRefCount--,0===t._maskRefCount&&(t.renderable=!0,t.isMask=!1))}if(this._mask=t,this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(0===t._maskRefCount&&(t.renderable=!1,t.isMask=!0),t._maskRefCount++)}}}}class o extends n{constructor(){super(...arguments),this.sortDirty=null}}n.prototype.displayObjectUpdateTransform=n.prototype.updateTransform;const a=new i.uq;function h(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const l=class t extends n{constructor(){super(),this.children=[],this.sortableChildren=t.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);i.Wp.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(-1===r)return null;e.parent=null,e.transform._parentID=-1,i.Wp.removeItems(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,i.Wp.removeItems(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,i=e-r;let s;if(i>0&&i<=e){s=this.children.splice(r,i);for(let t=0;t<s.length;++t)s[t].parent=null,s[t].transform&&(s[t].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let t=0;t<s.length;
2++t)s[t].emit("removed",this),this.emit("childRemoved",s[t],this,t);return s}if(0===i&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const r=this.children[e];r._lastSortedIndex=e,!t&&0!==r.zIndex&&(t=!0)}t&&this.children.length>1&&this.children.sort(h),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){const t=e._mask.isMaskData?e._mask.maskObject:e._mask;t?(t.calculateBounds(),this._bounds.addBoundsMask(e._bounds,t._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(e){const r=e.renderTexture.sourceFrame;if(!(r.width>0&&r.height>0))return;let i,s;this.cullArea?(i=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(i=this.getBounds(!0));const n=e.projection.transform;if(n&&(s?(s=a.copyFrom(s),s.prepend(n)):s=n),i&&r.intersects(i,s))this._render(e);else if(this.cullArea)return;for(let t=0,r=this.children.length;t<r;++t){const r=this.children[t],i=r.cullable;r.cullable=i||!this.cullArea,r.render(e),r.cullable=i}}render(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters?.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}}renderAdvanced(t){const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let t=0;t<e.length;t++)e[t].enabled&&this._enabledFilters.push(e[t])}const s=e&&this._enabledFilters?.length||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==i.vg.NONE));if(s&&t.batch.flush(),e&&this._enabledFilters?.length&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}s&&t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters?.length&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e="boolean"==typeof t?t:t?.children,r=this.removeChildren(0,this.children.length);if(e)for(let e=0;e<r.length;++e)r[e].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}};l.defaultSortableChildren=!1;let u=l;u.prototype.containerUpdateTransform=u.prototype.updateTransform,Object.defineProperties(i.W0,{SORTABLE_CHILDREN:{get:()=>u.defaultSortableChildren,set(t){i.Wp.deprecation("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),u.defaultSortableChildren=t}}});const c=new i.bR,d=new Uint16Array([0,1,2,0,2,3]);class p extends u{constructor(t){super(),this._anchor=new i.oA(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new i.Q1(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=i.B9.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||i.gP.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=d,this.pluginName="batch",this.isSprite=!0,this._roundPixels=i.W0.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=i.Wp.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=i.Wp.sign(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,r=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,h=e.ty,l=this.vertexData,u=t.trim,c=t.orig,d=this._anchor;let p=0,f=0,m=0,g=0;if(u?(f=u.x-d._x*c.width,p=f+u.width,g=u.y-d._y*c.height,m=g+u.height):(f=-d._x*c.width,p=f+c.width,g=-d._y*c.height,m=g+c.height),l[0]=r*f+n*g+a,l[1]=o*g+s*f+h,l[2]=r*p+n*g+a,l[3]=o*g+s*p+h,l[4]=r*p+n*m+a,l[5]=o*m+s*p+h,l[6]=r*f+n*m+a,l[7]=o*m+s*f+h,this._roundPixels){const t=i.W0.RESOLUTION;for(let e=0;e<l.length;++e)l[e]=Math.round(l[e]*t)/t}}
2calculateTrimmedVertices(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const t=this._texture,e=this.vertexTrimmedData,r=t.orig,s=this._anchor,n=this.transform.worldTransform,o=n.a,a=n.b,h=n.c,l=n.d,u=n.tx,c=n.ty,d=-s._x*r.width,p=d+r.width,f=-s._y*r.height,m=f+r.height;if(e[0]=o*d+h*f+u,e[1]=l*f+a*d+c,e[2]=o*p+h*f+u,e[3]=l*f+a*p+c,e[4]=o*p+h*m+u,e[5]=l*m+a*p+c,e[6]=o*d+h*m+u,e[7]=l*m+a*d+c,this._roundPixels){const t=i.W0.RESOLUTION;for(let r=0;r<e.length;++r)e[r]=Math.round(e[r]*t)/t}}_render(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)}_calculateBounds(){const t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(t){return 0===this.children.length?(this._localBounds||(this._localBounds=new s),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new i.M_),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,c);const e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x;let s=0;return c.x>=i&&c.x<i+e&&(s=-r*this.anchor.y,c.y>=s&&c.y<s+r)}destroy(t){if(super.destroy(t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.baseTexture;this._texture.destroy(!!e)}this._texture=null}static from(t,e){const r=t instanceof i.gP?t:i.gP.from(t,e);return new p(r)}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){const e=i.Wp.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){const e=i.Wp.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||i.gP.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}const f=new i.uq;n.prototype._cacheAsBitmap=!1,n.prototype._cacheData=null,n.prototype._cacheAsBitmapResolution=null,n.prototype._cacheAsBitmapMultisample=null;class m{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}Object.defineProperties(n.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(t){if(this._cacheAsBitmap===t)return;let e;this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new m),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}),n.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},n.prototype._initCachedDisplayObject=function(t){if(this._cacheData?.sprite)return;const e=this.alpha;this.alpha=1,t.batch.flush();const r=this.getLocalBounds(new i.M_,!0);if(this.filters?.length){const t=this.filters[0].padding;r.pad(t)}const s=this.cacheAsBitmapResolution||t.resolution;r.ceil(s),r.width=Math.max(r.width,1/s),r.height=Math.max(r.height,1/s);const n=t.renderTexture.current,o=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),h=t.projection.transform,l=i.Y7.create({width:r.width,height:r.height,resolution:s,multisample:this.cacheAsBitmapMultisample??t.multisample}),u=`cacheAsBitmap_${i.Wp.uid()}`;this._cacheData.textureCacheId=u,i.t5.addToCache(l.baseTexture,u),i.gP.addToCache(l,u);const c=this.transform.localTransform.copyTo(f).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:l,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=h,t.renderTexture.bind(n,o,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e;const d=new p(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-r.x/r.width,d.anchor.y=-r.y/r.height,d.alpha=e,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)},n.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},n.prototype._initCachedDisplayObjectCanvas=function(t){if(this._cacheData?.sprite)return;const e=this.getLocalBounds(new i.M_,!0),r=this.alpha;this.alpha=1;const s=t.canvasContext.activeContext,n=t._projTransform,o=this.cacheAsBitmapResolution||t.resolution;e.ceil(o),e.width=Math.max(e.width,1/o),e.height=Math.max(e.height,1/o);const a=i.Y7.create({width:e.width,height:e.height,resolution:o}),h=`cacheAsBitmap_${i.Wp.uid()}`;this._cacheData.textureCacheId=h,i.t5.addToCache(a.baseTexture,h),i.gP.addToCache(a,h);const l=f;this.transform.localTransform.copyTo(l),l.invert(),l.tx-=e.x,l.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:a,clear:!0,transform:l,ski
2pUpdateTransform:!1}),t.canvasContext.activeContext=s,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;const u=new p(a);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-e.x/e.width,u.anchor.y=-e.y/e.height,u.alpha=r,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)},n.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},n.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},n.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,i.t5.removeFromCache(this._cacheData.textureCacheId),i.gP.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},n.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},n.prototype.name=null,u.prototype.getChildByName=function(t,e){for(let e=0,r=this.children.length;e<r;e++)if(this.children[e].name===t)return this.children[e];if(e)for(let e=0,r=this.children.length;e<r;e++){const r=this.children[e];if(!r.getChildByName)continue;const i=r.getChildByName(t,!0);if(i)return i}return null},n.prototype.getGlobalPosition=function(t=new i.bR,e=!1){return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};class g extends i.dJ{constructor(t=1){super(i.MT,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1}),this.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}const y={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},_=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");class v extends i.dJ{constructor(t,e=8,r=4,s=i.dJ.defaultResolution,n=5){const o=function(t,e){const r=Math.ceil(t/2);let i,s="\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",n="";i=e?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let e=0;e<t;e++){let t=i.replace("%index%",e.toString());t=t.replace("%sampleIndex%",e-(r-1)+".0"),n+=t,n+="\n"}return s=s.replace("%blur%",n),s=s.replace("%size%",t.toString()),s}(n,t),a=function(t){const e=y[t],r=e.length;let i,s=_,n="";for(let s=0;s<t;s++){let o="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s.toString());i=s,s>=r&&(i=t-s-1),o=o.replace("%value%",e[i].toString()),n+=o,n+="\n"}return s=s.replace("%blur%",n),s=s.replace("%size%",t.toString()),s}(n);super(o,a),this.horizontal=t,this.resolution=s,this._quality=0,this.qual
2ity=r,this.blur=e}apply(t,e,r,s){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,s);else{const n=t.getFilterTexture(),o=t.renderer;let a=e,h=n;this.state.blend=!1,t.applyFilter(this,a,h,i.fr.CLEAR);for(let e=1;e<this.passes-1;e++){t.bindAndClear(a,i.fr.BLIT),this.uniforms.uSampler=h;const e=h;h=a,a=e,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,h,r,s),t.returnFilterTexture(n)}}get blur(){return this.strength}set blur(t){this.padding=1+2*Math.abs(t),this.strength=t}get quality(){return this._quality}set quality(t){this._quality=t,this.passes=t}}class x extends i.dJ{constructor(t=8,e=4,r=i.dJ.defaultResolution,s=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new v(!0,t,e,r,s),this.blurYFilter=new v(!1,t,e,r,s),this.resolution=r,this.quality=e,this.blur=t,this.repeatEdgePixels=!1}apply(t,e,r,s){const n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){const n=t.getFilterTexture();this.blurXFilter.apply(t,e,n,i.fr.CLEAR),this.blurYFilter.apply(t,n,r,s),t.returnFilterTexture(n)}else o?this.blurYFilter.apply(t,e,r,s):this.blurXFilter.apply(t,e,r,s)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}get blur(){return this.blurXFilter.blur}set blur(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(t){this.blurXFilter.quality=this.blurYFilter.quality=t}get blurX(){return this.blurXFilter.blur}set blurX(t){this.blurXFilter.blur=t,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(t){this.blurYFilter.blur=t,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(t){this.blurYFilter.blendMode=t}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(t){this._repeatEdgePixels=t,this.updatePadding()}}class b extends i.dJ{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(i.Eo,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",t),this.alpha=1}_loadMatrix(t,e=!1){let r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r}_multiply(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10
2]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)}tint(t,e){const[r,s,n]=i.Q1.shared.setValue(t).toArray(),o=[r,0,0,0,0,0,s,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,e)}greyscale(t,e){const r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)}blackAndWhite(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)}hue(t,e){t=(t||0)/180*Math.PI;const r=Math.cos(t),i=Math.sin(t),s=1/3,n=(0,Math.sqrt)(s),o=[r+(1-r)*s,s*(1-r)-n*i,s*(1-r)+n*i,0,0,s*(1-r)+n*i,r+s*(1-r),s*(1-r)-n*i,0,0,s*(1-r)-n*i,s*(1-r)+n*i,r+s*(1-r),0,0,0,0,0,1,0];this._loadMatrix(o,e)}contrast(t,e){const r=(t||0)+1,i=-.5*(r-1),s=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(s,e)}saturate(t=0,e){const r=2*t/3+1,i=-.5*(r-1),s=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(s,e)}desaturate(){this.saturate(-1)}negative(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)}sepia(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)}technicolor(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)}polaroid(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)}toBGR(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)}kodachrome(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)}browni(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)}vintage(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)}colorTone(t,e,r,s,n){t=t||.2,e=e||.15,r=r||16770432,s=s||3375104;const o=i.Q1.shared,[a,h,l]=o.setValue(r).toArray(),[u,c,d]=o.setValue(s).toArray(),p=[.3,.59,.11,0,0,a,h,l,t,0,u,c,d,e,0,a-u,h-c,l-d,0,0];this._loadMatrix(p,n)}night(t,e){const r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)}predator(t,e){const r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)}lsd(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)}reset(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}b.prototype.grayscale=b.prototype.greyscale;class E extends i.dJ{constructor(t,e){const r=new i.uq;t.renderable=!1,super("attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
2\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=r,null==e&&(e=20),this.scale=new i.bR(e,e)}apply(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const s=this.maskSprite.worldTransform,n=Math.sqrt(s.a*s.a+s.b*s.b),o=Math.sqrt(s.c*s.c+s.d*s.d);0!==n&&0!==o&&(this.uniforms.rotation[0]=s.a/n,this.uniforms.rotation[1]=s.b/n,this.uniforms.rotation[2]=s.c/o,this.uniforms.rotation[3]=s.d/o),t.applyFilter(this,e,r,i)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}class T extends i.dJ{constructor(){super("\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (
2INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')}}class A extends i.dJ{constructor(t=.5,e=Math.random()){super(i.Eo,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const w={AlphaFilter:g,BlurFilter:x,BlurFilterPass:v,ColorMatrixFilter:b,DisplacementFilter:E,FXAAFilter:T,NoiseFilter:A};Object.entries(w).forEach(([t,e])=>{Object.defineProperty(w,t,{get:()=>(i.Wp.deprecation("7.1.0",`filters.${t} has moved to ${t}`),e)})});const S=new class{constructor(){this.interactionFrequency=10,this._deltaT
2ime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(i.Rv.system.add(this.tickerUpdate,this,i.dQ.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(i.Rv.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}};class R{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=R.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new i.bR,this.page=new i.bR,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,r){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,r,i,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class I extends R{constructor(){super(...arguments),this.client=new i.bR,this.movement=new i.bR,this.offset=new i.bR,this.global=new i.bR,this.screen=new i.bR}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,r,i,s,n,o,a,h,l,u,c,d,p,f){throw new Error("Method not implemented.")}}class C extends I{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class P extends I{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}P.DOM_DELTA_PIXEL=0,P.DOM_DELTA_LINE=1,P.DOM_DELTA_PAGE=2;const M=new i.bR,D=new i.bR;class O{constructor(t){this.dispatch=new i.Wp.EventEmitter,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((t,e)=>t.priority-e.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.prop
2agate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let r=0,i=e.length;r<i;r++)e[r].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){S.pauseUpdate=!0;const r=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,M.set(t,e),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(t,e){if(!t.target)return;const r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,s=r.length-1;i<s;i++)if(t.currentTarget=r[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=r.length-2;i>=0;i--)if(t.currentTarget=r[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,r=this._allInteractiveElements){if(0===r.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=r.length-1;e>=0;e--)i.forEach(i=>{t.currentTarget=r[e],this.notifyTarget(t,i)})}propagationPath(t){const e=[t];for(let r=0;r<2048&&t!==this.rootTarget;r++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,r,i,s,n=!1){let o=!1;if(this._interactivePrune(t))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(S.pauseUpdate=!1),t.interactiveChildren&&t.children){const a=t.children;for(let h=a.length-1;h>=0;h--){const l=a[h],u=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,r,i,s,n||s(t,r));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const e=t.isInteractive();(u.length>0||e)&&(e&&this._allInteractiveElements.push(t),u.push(t)),0===this._hitElements.length&&(this._hitElements=u),o=!0}}}const a=this._isInteractive(e),h=t.isInteractive();return a&&h&&this._allInteractiveElements.push(t),n||this._hitElements.length>0?null:o?this._hitElements:a&&!s(t,r)&&i(t,r)?h?[t]:[]:null}hitTestRecursive(t,e,r,i,s){if(this._interactivePrune(t)||s(t,r))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(S.pauseUpdate=!1),t.interactiveChildren&&t.children){const n=t.children;for(let o=n.length-1;o>=0;o--){const a=n[o],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,r,i,s);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();
2return(h.length>0||e)&&h.push(t),h}}}const n=this._isInteractive(e),o=t.isInteractive();return n&&i(t,r)?o?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&!t.isMask&&t.visible&&t.renderable&&"none"!==t.eventMode&&("passive"!==t.eventMode||t.interactiveChildren)&&!t.isMask)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,D),!t.hitArea.contains(D.x,D.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!r.containsPoint?.(e))return!0}return!1}hitTestFn(t,e){return"passive"!==t.eventMode&&(!!t.hitArea||!!t.containsPoint&&t.containsPoint(e))}notifyTarget(t,e){const r=`on${e=e??t.type}`;t.currentTarget[r]?.(t);const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof C))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof C))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const r="mouse"===e.pointerType||"pen"===e.pointerType,i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.overTargets);if(i.overTargets?.length>0&&s!==e.target){const i="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,i,s);if(this.dispatchEvent(n,"pointerout"),r&&this.dispatchEvent(n,"mouseout"),!e.composedPath().includes(s)){const i=this.createPointerEvent(t,"pointerleave",s);for(i.eventPhase=i.AT_TARGET;i.target&&!e.composedPath().includes(i.target);)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseleave"),i.target=i.target.parent;this.freeEvent(i)}this.freeEvent(n)}if(s!==e.target){const i="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(e,i);this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover");let o=s?.parent;for(;o&&o!==this.rootTarget.parent&&o!==e.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const t=this.clonePointerEvent(e,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==s&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const n=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?n.push("pointermove"):this.dispatchEvent(e,"pointermove"),o&&n.push("globalpointermove"),"touch"===e.pointerType&&(this.moveOnAll?n.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),o&&n.push("globaltouchmove")),r&&(this.moveOnAll?n.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),o&&n.push("globalmousemove"),this.cursor=e.target?.cursor),n.length>0&&this.all(e,n),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof C))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;this.dispatchEvent(r,"pointerover"),i&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursor=r.target?.cursor);const s=this.clonePointerEvent(r,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),i&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;e.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof C))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId);if(e.overTargets){const r="mouse"===t.pointerType||"pen"===t.pointerType,i=this.findMountedTarget(e.overTargets),s=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(s),r&&this.dispatchEvent(s,"mouseout");const n=this.createPointerEvent(t,"pointerleave",i);for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseleave"),n.target=n.target.parent;e.overTargets=null,this.freeEvent(s),this.freeEvent(n)}this.cursor=null}mapPointerUp(t){if(!(t instanceof C))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=performance.now(),r=this.createPointerEvent(t);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]);let n=s;if(s&&!r.composedPath().includes(s)){let e=s;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete i.pressTargetsByButton[t.button],n=e}if(n){const s=this.clonePointerEvent(r,"click");s.target=n,s.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:s.target,timeStamp:e});const o=i.clicksByButton[t.button];if(o.target===s.target&&e-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=s.target,o.timeStamp=e,s.detail=o.clickCount,"mouse"===s.pointerType){const t=2===s.button;this.dispatchEvent(s,t?"rightclick":"click")}else"touch"===s.pointerType&&this.dispatchEvent(s,"tap");this.dispatchEvent(s,"pointertap"),this.freeEvent(s)}this.freeEvent(r)}mapPointerUpOutside(t){if(!(t instanceof C))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.findMountedTarget(e.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(r){let s=r;for(;s;)i.currentTarget=s,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?this.notifyTarget(i,"touchendoutside"):("mouse"===i.pointerType||"pen"===i.pointerType)&&this.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),s=s.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(i)}mapWheel(t){if(!(t instanceof P))return void console.warn("EventBoundary cannot map a non-wheel event as a wheel event");const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let r=1;r<t.length&&t[r].parent===e;r++)e=t[r];return e}createPointerEvent(t,e,r){const i=this.allocateEvent(C);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=r??this.hitTest(i.global.x,i.global.y)??this._hitElements[0],"string"==typeof e&&(i.type=e),i}createWheelEvent(t){const e=this.allocateEvent(P);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const r=this.allocateEvent(C);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=e??r.type,r}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof C&&e instanceof C&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.t
vendor: 8,033 bytes, line 2
2iltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof I&&e instanceof I&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}notifyListeners(t,e){const r=t.currentTarget._events[e];if(r&&t.currentTarget.isInteractive())if("fn"in r)r.once&&t.currentTarget.removeListener(e,r.fn,void 0,!0),r.fn.call(r.context,t);else for(let i=0,s=r.length;i<s&&!t.propagationImmediatelyStopped;i++)r[i].once&&t.currentTarget.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(r[i].context,t)}}const B={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},N=class t{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new O(null),S.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new C(null),this.rootWheelEvent=new P(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...t.defaultEventFeatures},{set:(t,e,r)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=r),t[e]=r,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:r,resolution:i}=this.renderer;this.setTargetElement(r),this.resolution=i,t._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];if(r)switch(typeof r){case"string":e&&(this.domElement.style.cursor=r);break;case"function":r(t);break;case"object":e&&Object.assign(this.domElement.style,r)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,r=e.length;t<r;t++){const r=e[t],i=this.bootstrapEvent(this.rootPointerEvent,r);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,S.pointerMoved();const e=this.normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const r=e!==this.domElement?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,e=i.length;t<e;t++){const e=this.bootstrapEvent(this.rootPointerEvent,i[t]);e.type+=r,this.rootBoundary.mapEvent(e)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this.removeEvents(),this.domElement=t,S.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;S.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;S.removeTickerListener();const t=this.domElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(t,e,r){const i=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*s,t.y=(r-i.top)*(this.domElement.height/i.height)*s}normalizeToPointerData(t){const e=[];
2if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let r=0,i=t.changedTouches.length;r<i;r++){const i=t.changedTouches[r];typeof i.button>"u"&&(i.button=0),typeof i.buttons>"u"&&(i.buttons=1),typeof i.isPrimary>"u"&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),typeof i.width>"u"&&(i.width=i.radiusX||1),typeof i.height>"u"&&(i.height=i.radiusY||1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="touch"),typeof i.pointerId>"u"&&(i.pointerId=i.identifier||0),typeof i.pressure>"u"&&(i.pressure=i.force||.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),typeof i.layerX>"u"&&(i.layerX=i.offsetX=i.clientX),typeof i.layerY>"u"&&(i.layerY=i.offsetY=i.clientY),i.isNormalized=!0,i.type=t.type,e.push(i)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof globalThis.PointerEvent)){const r=t;typeof r.isPrimary>"u"&&(r.isPrimary=!0),typeof r.width>"u"&&(r.width=1),typeof r.height>"u"&&(r.height=1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="mouse"),typeof r.pointerId>"u"&&(r.pointerId=1),typeof r.pressure>"u"&&(r.pressure=.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),r.isNormalized=!0,e.push(r)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=B[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};N.extension={name:"events",type:[i.Ag.RendererSystem,i.Ag.CanvasRendererSystem]},N.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let L=N;function F(t){return"dynamic"===t||"static"===t}i.XO.add(L);const k={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??F(L.defaultEventMode)},set interactive(t){i.Wp.deprecation("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??L.defaultEventMode},set eventMode(t){this._internalInteractive=F(t),this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,r){const i="boolean"==typeof r&&r||"object"==typeof r&&r.capture,s="object"==typeof r?r.signal:void 0,n="object"==typeof r&&!0===r.once,o="function"==typeof e?void 0:e;t=i?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;s&&s.addEventListener("abort",()=>{h.off(t,a,o)}),n?h.once(t,a,o):h.on(t,a,o)},removeEventListener(t,e,r){const i="function"==typeof e?void 0:e;t="boolean"==typeof r&&r||"object"==typeof r&&r.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof R))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};n.mixin(k),n.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});class U{constructor(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(i.Wp.isMobile.tablet||i.Wp.isMobile.phone)&&this.createTouchHook();const e=document.createElement("div");
2e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode?.appendChild(this.div))}deactivate(){!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode?.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let t=0;t<e.length;t++)this.updateAccessibleObjects(e[t])}update(){const t=performance.now();if(i.Wp.isMobile.android.device&&t<this.androidUpdateCount||(this.androidUpdateCount=t+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:e,y:r,width:s,height:n}=this.renderer.view.getBoundingClientRect(),{width:o,height:a,resolution:h}=this.renderer,l=s/o*h,u=n/a*h;let c=this.div;c.style.left=`${e}px`,c.style.top=`${r}px`,c.style.width=`${o}px`,c.style.height=`${a}px`;for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.renderId!==this.renderId)e._accessibleActive=!1,i.Wp.removeItems(this.children,t,1),this.div.removeChild(e._accessibleDiv),this.pool.push(e._accessibleDiv),e._accessibleDiv=null,t--;else{c=e._accessibleDiv;let t=e.hitArea;const r=e.worldTransform;e.hitArea?(c.style.left=(r.tx+t.x*r.a)*l+"px",c.style.top=(r.ty+t.y*r.d)*u+"px",c.style.width=t.width*r.a*l+"px",c.style.height=t.height*r.d*u+"px"):(t=e.getBounds(),this.capHitArea(t),c.style.left=t.x*l+"px",c.style.top=t.y*u+"px",c.style.width=t.width*l+"px",c.style.height=t.height*u+"px",c.title!==e.accessibleTitle&&null!==e.accessibleTitle&&(c.title=e.accessibleTitle),c.getAttribute("aria-label")!==e.accessibleHint&&null!==e.accessibleHint&&c.setAttribute("aria-label",e.accessibleHint)),(e.accessibleTitle!==c.title||e.tabIndex!==c.tabIndex)&&(c.title=e.accessibleTitle,c.tabIndex=e.tabIndex,this.debug&&this.updateDebugHTML(c))}}this.renderId++}updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:r}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>r&&(t.height=r-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:(!t.accessibleHint||null===t.accessibleHint)&&(e.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,e){const{displayObject:r}=t.target,i=this.renderer.events.rootBoundary,s=Object.assign(new R(i),{target:r});i.rootTarget=this.renderer.lastObjectRendered,e.forEach(t=>i.dispatchEvent(s,t))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){9===t.keyCode&&this.activate()}_onMouseMove(t){0===t.movementX&&0===t.movementY||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}U.extension={name:"accessibility",type:[i.Ag.RendererPlugin,i.Ag.CanvasRendererPlugin]},i.XO.add(U);const G=class t{constructor(e){this.stage=new u,e=Object.assign({forceCanvas:!1},e),this.renderer=(0,i.q5)(e),t._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){return this.renderer?.view}get screen(){return this.renderer?.screen}destroy(e,r){const i=t._plugins.slice(0);
2i.reverse(),i.forEach(t=>{t.destroy.call(this)}),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};G._plugins=[];let H=G;i.XO.handleByList(i.Ag.Application,H._plugins);class j{static init(t){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this.cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:i}=this._resizeTo;t=r,e=i}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}j.extension=i.Ag.Application,i.XO.add(j);const W={loader:i.Ag.LoadParser,resolver:i.Ag.ResolveParser,cache:i.Ag.CacheParser,detection:i.Ag.DetectionParser};i.XO.handle(i.Ag.Asset,t=>{const e=t.ref;Object.entries(W).filter(([t])=>!!e[t]).forEach(([t,r])=>i.XO.add(Object.assign(e[t],{extension:e[t].extension??r})))},t=>{const e=t.ref;Object.keys(W).filter(t=>!!e[t]).forEach(t=>i.XO.remove(e[t]))});class X{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let r=0;r<e;r++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}function V(t,e){const r=t.split("?")[0],s=i.Wp.path.extname(r).toLowerCase();return Array.isArray(e)?e.includes(s):s===e}const z=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(t=>"string"==typeof t||r?e(t):t):t),$=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const r=z(t);let s;for(let t=0;t<this.parsers.length;t++){const i=this.parsers[t];if(i.test(e)){s=i.getCacheableAssets(r,e);break}}s||(s={},r.forEach(t=>{s[t]=e}));const n=Object.keys(s),o={cacheKeys:n,keys:r};if(r.forEach(t=>{this._cacheMap.set(t,o)}),n.forEach(t=>{const r=s?s[t]:e;this._cache.has(t)&&this._cache.get(t)!==r&&console.warn("[Cache] already has key:",t),this._cache.set(t,s[t])}),e instanceof i.gP){const t=e;r.forEach(e=>{t.baseTexture!==i.gP.EMPTY.baseTexture&&i.t5.addToCache(t.baseTexture,e),i.gP.addToCache(t,e)})}}remove(t){if(!this._cacheMap.has(t))return void console.warn(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach(t=>{this._cache.delete(t)}),e.keys.forEach(t=>{this._cacheMap.delete(t)})}get parsers(){return this._parsers}},Y=t=>!Array.isArray(t);class q{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,r)=>(this._parsersValidated=!1,t[e]=r,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const r={promise:null,parser:null};return r.promise=(async()=>{let i=null,s=null;if(e.loadParser&&(s=this._parserHash[e.loadParser],s||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!s){for(let r=0;r<this.parsers.length;r++){const i=this.parsers[r];if(i.load&&i.test?.(t,e,this)){s=i;break}}if(!s)return console.warn(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await s.load(t,e,this),r.parser=s;for(let t=0;t<this.parsers.length;t++){const s=this.parsers[t];s.parse&&s.parse&&await(s.testParse?.(i,e,this))&&(i=await s.parse(i,e,this)||i,r.parser=s)}return i})(),r}
2async load(t,e){this._parsersValidated||this._validateParsers();let r=0;const s={},n=Y(t),o=z(t,t=>({alias:[t],src:t})),a=o.length,h=o.map(async t=>{const n=i.Wp.path.toAbsolute(t.src);if(!s[t.src])try{this.promiseCache[n]||(this.promiseCache[n]=this._getLoadPromiseAndParser(n,t)),s[t.src]=await this.promiseCache[n].promise,e&&e(++r/a)}catch(e){throw delete this.promiseCache[n],delete s[t.src],new Error(`[Loader.load] Failed to load ${n}.\n${e}`)}});return await Promise.all(h),n?s[o[0].src]:s}async unload(t){const e=z(t,t=>({alias:[t],src:t})).map(async t=>{const e=i.Wp.path.toAbsolute(t.src),r=this.promiseCache[e];if(r){const i=await r.promise;delete this.promiseCache[e],r.parser?.unload?.(i,t,this)}});await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e}),{})}}function K(t,e){if(Array.isArray(e)){for(const r of e)if(t.startsWith(`data:${r}`))return!0;return!1}return t.startsWith(`data:${e}`)}var Q=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(Q||{});const Z={extension:{type:i.Ag.LoadParser,priority:Q.Low},name:"loadJson",test:t=>K(t,"application/json")||V(t,".json"),load:async t=>await(await i.W0.ADAPTER.fetch(t)).json()};i.XO.add(Z);const J={name:"loadTxt",extension:{type:i.Ag.LoadParser,priority:Q.Low},test:t=>K(t,"text/plain")||V(t,".txt"),load:async t=>await(await i.W0.ADAPTER.fetch(t)).text()};i.XO.add(J);const tt=["normal","bold","100","200","300","400","500","600","700","800","900"],et=[".ttf",".otf",".woff",".woff2"],rt=["font/ttf","font/otf","font/woff","font/woff2"],it=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i,st=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function nt(t){return st.test(t)?t:encodeURI(t)}const ot={extension:{type:i.Ag.LoadParser,priority:Q.Low},name:"loadWebFont",test:t=>K(t,rt)||V(t,et),async load(t,e){const r=i.W0.ADAPTER.getFontFaceSet();if(r){const s=[],n=e.data?.family??function(t){const e=i.Wp.path.extname(t),r=i.Wp.path.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1));let s=r.length>0;for(const t of r)if(!t.match(it)){s=!1;break}let n=r.join(" ");return s||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}(t),o=e.data?.weights?.filter(t=>tt.includes(t))??["normal"],a=e.data??{};for(let e=0;e<o.length;e++){const i=o[e],h=new FontFace(n,`url(${nt(t)})`,{...a,weight:i});await h.load(),r.add(h),s.push(h)}return 1===s.length?s[0]:s}return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){(Array.isArray(t)?t:[t]).forEach(t=>i.W0.ADAPTER.getFontFaceSet().delete(t))}};i.XO.add(ot);let at=null;class ht{constructor(){at||(at=URL.createObjectURL(new Blob(['(function() {\n "use strict";\n const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap != "function")\n return !1;\n const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch {\n return !1;\n }\n }\n checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(at)}}ht.revokeObjectURL=function(){at&&(URL.revokeObjectURL(at),at=null)};let lt=null;class ut{constructor(){lt||(lt=URL.createObjectURL(new Blob(['(function() {\n "use strict";\n async function loadImageBitmap(url) {\n const response = await fetch(url);\n if (!response.ok)\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n const imageBlob = await response.blob();\n return await createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(lt)}}ut.revokeObjectURL=function(){lt&&(URL.revokeObjectURL(lt),lt=null)};let ct,dt=0;const pt=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise(t=>{const{worker:e}=new ht;e.addEventListener("message",r=>{e.terminate(),ht.revokeObjectURL(),t(r.data)})})),this._isImageBitmapSupported}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){void 0===ct&&(ct=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<ct&&(this._createdWorkers++,t=(new ut).worker,t.addEventListener("message",t=>{this.complete(t.data),this.returnWorker(t.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){void 0!==t.error?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const r=new Promise((r,i)=>{this.queue.push({id:t,arguments:e,resolve:r,reject:i})});return this.next(),r}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),r=e.id;this.resolveHash[dt]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:dt++,id:r})}};function ft(t,e,r){t.resource.internal=!0;const s=new i.gP(t),n=()=>{delete e.promiseCache[r],$.has(r)&&$.remove(r)};return s.baseTexture.once("destroyed",()=>{r in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),s.once("destroyed",()=>{t.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),s}const mt=[".jpeg",".jpg",".png",".webp",".avif"],gt=["image/jpeg","image/png","image/webp","image/avif"],yt={name:"loadTextures",extension:{type:i.Ag.LoadParser,priority:Q.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test:t=>K(t,gt)||V(t,mt),async load(t,e,r){const s=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;n=s?this.config.preferWorkers&&await pt.isImageBitmapSupported()?await pt.loadImageBitmap(t):await async function(t){const e=await i.W0.ADAPTER.fetch(t);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${e.status} ${e.statusText}`);const r=await e.blob();return await createImageBitmap(r)}(t):await new Promise((e,r)=>{const i=new Image;i.crossOrigin=this.config.crossOrigin,i.src=t,i.complete?e(i):(i.onload=()=>e(i),i.onerror=t=>r(t))});const o={...e.data};o.resolution??(o.resolution=i.Wp.getResolutionOfUrl(t)),s&&void 0===o.resourceOptions?.ownsImageBitmap&&(o.resourceOptions={...o.resourceOptions},o.resourceOptions.ownsImageBitmap=!0);const a=new i.t5(n,o);return a.resource.src=t,ft(a,r,t)},unload(t){t.destroy(!0)}};i.XO.add(yt);const _t={extension:{type:i.Ag.LoadParser,priority:Q.High},name:"loadSVG",test:t=>K(t,"image/svg+xml")||V(t,".svg"),testParse:async t=>i.$f.test(t),async parse(t,e,r){const s=new i.$f(t,e?.data?.resourceOptions);await s.load();const n=new i.t5(s,{resolution:i.Wp.getResolutionOfUrl(t),...e?.data});return n.resource.src=e.src,ft(n,r,e.src)},load:async(t,e)=>(await i.W0.ADAPTER.fetch(t)).text(),unload:yt.unload};i.XO.add(_t);const vt=[".mp4",".m4v",".webm",".ogv"],xt=["video/mp4","video/webm","video/ogg"],bt={name:"loadVideo",extension:{type:i.Ag.LoadParser,priority:Q.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test:t=>K(t,xt)||V(t,vt),async load(t,e,r){let s;const n=await(await i.W0.ADAPTER.fetch(t)).blob(),o=URL.createObjectURL(n);try{const n={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...e?.data?.resourceOptions,autoLoad:!0},a=new i.A5(o,n);await a.load();const h=new i.t5(a,{alphaMode:await i.Wp.detectVideoAlphaMode(),resolution:i.Wp.getResolutionOfUrl(t),...e?.data});h.resource.src=t,s=ft(h,r,t),s.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(o)})}catch(t){throw URL.revokeObjectURL(o),t}return s},unload(t){t.destroy(!0)}};function Et(t,e,r,i,s){const n=e[r];for(let o=0;o<n.length;o++){const a=n[o];r<e.length-1?Et(t.replace(i[r],a),e,r+1,i,s):s.push(t.replace(i[r],a))}}function Tt(t){const e=t.match(/\{(.*?)\}/g),r=[];if(e){const i=[];e.forEach(t=>{const e=t.substring(1,t.length-1).split(",");i.push(e)}),Et(t,i,0,e,r)}else r.push(t);return r}i.XO.add(bt);class At{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}}getAlias(t){const{alias:e,name:r,src:i,srcs:s}=t;return z(e||r||i||s,t=>"string"==typeof t?t:Array.isArray(t)?t.map(t=>t?.src??t?.srcs??t):t?.src||t?.srcs?t.src??t.srcs:t,!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEac
2h(t=>{this.addBundle(t.name,t.assets)})}addBundle(t,e){const r=[];Array.isArray(e)?e.forEach(e=>{const i=e.src??e.srcs,s=e.alias??e.name;let n;if("string"==typeof s){const e=this._createBundleAssetId(t,s);r.push(e),n=[s,e]}else{const e=s.map(e=>this._createBundleAssetId(t,e));r.push(...e),n=[...s,...e]}this.add({...e,alias:n,src:i})}):Object.keys(e).forEach(i=>{const s=[i,this._createBundleAssetId(t,i)];if("string"==typeof e[i])this.add({alias:s,src:e[i]});else if(Array.isArray(e[i]))this.add({alias:s,src:e[i]});else{const t=e[i],r=t.src??t.srcs;this.add({...t,alias:s,src:Array.isArray(r)?r:[r]})}r.push(...s)}),this._bundles[t]=r}add(t,e,r,s,n){const o=[];let a;"string"==typeof t||Array.isArray(t)&&"string"==typeof t[0]?(i.Wp.deprecation("7.2.0","Assets.add now uses an object instead of individual parameters.\nPlease use Assets.add({ alias, src, data, format, loadParser }) instead."),o.push({alias:t,src:e,data:r,format:s,loadParser:n})):Array.isArray(t)?o.push(...t):o.push(t),a=t=>{this.hasKey(t)&&console.warn(`[Resolver] already has key: ${t} overwriting`)},z(o).forEach(t=>{const{src:e,srcs:r}=t;let{data:i,format:s,loadParser:n}=t;const o=z(e||r).map(t=>"string"==typeof t?Tt(t):Array.isArray(t)?t:[t]),h=this.getAlias(t);Array.isArray(h)?h.forEach(a):a(h);const l=[];o.forEach(t=>{t.forEach(t=>{let e={};if("object"!=typeof t){e.src=t;for(let r=0;r<this._parsers.length;r++){const i=this._parsers[r];if(i.test(t)){e=i.parse(t);break}}}else i=t.data??i,s=t.format??s,n=t.loadParser??n,e={...e,...t};if(!h)throw new Error(`[Resolver] alias is undefined for this asset: ${e.src}`);e=this.buildResolvedAsset(e,{aliases:h,data:i,format:s,loadParser:n}),l.push(e)})}),h.forEach(t=>{this._assetMap[t]=l})})}resolveBundle(t){const e=Y(t);t=z(t);const r={};return t.forEach(t=>{const e=this._bundles[t];if(e){const i=this.resolve(e),s={};for(const e in i){const r=i[e];s[this._extractAssetIdFromBundle(t,e)]=r}r[t]=s}}),e?r[t[0]]:r}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const r in e)t[r]=e[r].src;return t}return e.src}resolve(t){const e=Y(t);t=z(t);const r={};return t.forEach(t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const r=e[0],i=this._getPreferredOrder(e);i?.priority.forEach(t=>{i.params[t].forEach(r=>{const i=e.filter(e=>!!e[t]&&e[t]===r);i.length&&(e=i)})}),this._resolverHash[t]=e[0]??r}else this._resolverHash[t]=this.buildResolvedAsset({alias:[t],src:t},{});r[t]=this._resolverHash[t]}),e?r[t[0]]:r}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const e=t[0],r=this._preferredOrder.find(t=>t.params.format.includes(e.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){return this._defaultSearchParams?`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`:t}buildResolvedAsset(t,e){const{aliases:r,data:s,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=i.Wp.path.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=r??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...s||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??i.Wp.path.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}const wt=new class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new At,this.loader=new q,this.cache=$,this._backgroundLoader=new X(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized)return void console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let e=t.manifest;"string"==typeof e&&(e=await this.load(e)),this.resolver.addManifest(e)}const e=t.texturePreference?.resolution??1,r="number"==typeof e?[e]:e,i=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:r}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,r,i,s){this.resolver.add(t,e,r,i,s)}async load(t,e){this._initialized||await this.init();const r=Y(t),i=z(t).map(t=>{if("string"!=typeof t){const e=this.resolver.getAlias(t);return e.some(t=>!this.resolver.hasKey(t))&&this.add(t),Array.isArray(e)?e[0]:e}return this.resolver.hasKey(t)||this.add({alias:t,src:t}),t}),s=this.resolver.resolve(i),n=await this._mapLoadToResolve(s,e);return r?n[i[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let r=!1;"string"==typeof t&&(r=!0,t=[t]);const i=this.resolver.resolveBundle(t),s={},n=Object.keys(i);let o=0,a=0;const h=()=>{e?.(++o/a)},l=n.map(t=>{const e=i[t];return a+=Object.keys(e).length,this._mapLoadToResolve(e,h).then(e=>{s[t]=e})});return await Promise.all(l),r?s[t[0]]:s}
2async backgroundLoad(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(t=>{this._backgroundLoader.add(Object.values(t))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if("string"==typeof t)return $.get(t);const e={};for(let r=0;r<t.length;r++)e[r]=$.get(t[r]);return e}async _mapLoadToResolve(t,e){const r=Object.values(t),i=Object.keys(t);this._backgroundLoader.active=!1;const s=await this.loader.load(r,e);this._backgroundLoader.active=!0;const n={};return r.forEach((t,e)=>{const r=s[t.src],o=[t.src];t.alias&&o.push(...t.alias),n[i[e]]=r,$.set(o,r)}),n}async unload(t){this._initialized||await this.init();const e=z(t).map(t=>"string"!=typeof t?t.src:t),r=this.resolver.resolve(e);await this._unloadFromResolved(r)}async unloadBundle(t){this._initialized||await this.init(),t=z(t);const e=this.resolver.resolveBundle(t),r=Object.keys(e).map(t=>this._unloadFromResolved(e[t]));await Promise.all(r)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(t=>{$.remove(t.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const r of t.detections)t.skipDetections||await r.test()?e=await r.add(e):t.skipDetections||(e=await r.remove(e));return e=e.filter((t,r)=>e.indexOf(t)===r),e}get detections(){return this._detections}get preferWorkers(){return yt.config.preferWorkers}set preferWorkers(t){i.Wp.deprecation("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(e=>e in t).forEach(r=>{e.config[r]=t[r]})})}};i.XO.handleByList(i.Ag.LoadParser,wt.loader.parsers).handleByList(i.Ag.ResolveParser,wt.resolver.parsers).handleByList(i.Ag.CacheParser,wt.cache.parsers).handleByList(i.Ag.DetectionParser,wt.detections);const St={extension:i.Ag.CacheParser,test:t=>Array.isArray(t)&&t.every(t=>t instanceof i.gP),getCacheableAssets:(t,e)=>{const r={};return t.forEach(t=>{e.forEach((e,i)=>{r[t+(0===i?"":i+1)]=e})}),r}};async function Rt(t){if("Image"in globalThis)return new Promise(e=>{const r=new Image;r.onload=()=>{e(!0)},r.onerror=()=>{e(!1)},r.src=t});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}i.XO.add(St);const It={extension:{type:i.Ag.DetectionParser,priority:1},test:async()=>Rt("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter(t=>"avif"!==t)};i.XO.add(It);const Ct={extension:{type:i.Ag.DetectionParser,priority:0},test:async()=>Rt("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter(t=>"webp"!==t)};i.XO.add(Ct);const Pt=["png","jpg","jpeg"],Mt={extension:{type:i.Ag.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...Pt],remove:async t=>t.filter(t=>!Pt.includes(t))};i.XO.add(Mt);const Dt="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Ot(t){return!Dt&&""!==document.createElement("video").canPlayType(t)}const Bt={extension:{type:i.Ag.DetectionParser,priority:0},test:async()=>Ot("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter(t=>"webm"!==t)};i.XO.add(Bt);const Nt={extension:{type:i.Ag.DetectionParser,priority:0},test:async()=>Ot("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter(t=>"mp4"!==t&&"m4v"!==t)};i.XO.add(Nt);const Lt={extension:{type:i.Ag.DetectionParser,priority:0},test:async()=>Ot("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter(t=>"ogv"!==t)};i.XO.add(Lt);const Ft={extension:i.Ag.ResolveParser,test:yt.test,parse:t=>({resolution:parseFloat(i.W0.RETINA_PREFIX.exec(t)?.[1]??"1"),format:i.Wp.path.extname(t).slice(1),src:t})};i.XO.add(Ft);const kt=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t};var Ut=(t=>(t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_
2EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t))(Ut||{});const Gt={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Ht,jt;function Wt(){jt={bptc:Ht.getExtension("EXT_texture_compression_bptc"),astc:Ht.getExtension("WEBGL_compressed_texture_astc"),etc:Ht.getExtension("WEBGL_compressed_texture_etc"),s3tc:Ht.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Ht.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Ht.getExtension("WEBGL_compressed_texture_pvrtc")||Ht.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Ht.getExtension("WEBGL_compressed_texture_etc1"),atc:Ht.getExtension("WEBGL_compressed_texture_atc")}}const Xt={extension:{type:i.Ag.DetectionParser,priority:2},test:async()=>{const t=i.W0.ADAPTER.createCanvas().getContext("webgl");return t?(Ht=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async t=>{jt||Wt();const e=[];for(const t in jt)jt[t]&&e.push(t);return[...e,...t]},remove:async t=>(jt||Wt(),t.filter(t=>!(t in jt)))};i.XO.add(Xt);class Vt extends i.dZ{constructor(t,e={width:1,height:1,autoLoad:!0}){let r,s;"string"==typeof t?(r=t,s=new Uint8Array):(r=null,s=t),super(s,e),this.origin=r,this.buffer=s?new i.u3(s):null,this._load=null,this.loaded=!1,null!==this.origin&&!1!==e.autoLoad&&this.load(),null===this.origin&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load||(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new i.u3(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this))),this._load}}class zt extends Vt{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=zt._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||zt._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,r){const i=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;i.pixelStorei(i.UNPACK_ALIGNMENT,4);for(let t=0,e=this.levels;t<e;t++){const{levelID:e,levelWidth:r,levelHeight:s,levelBuffer:n}=this._levelBuffers[t];i.compressedTexImage2D(i.TEXTURE_2D,e,this.format,r,s,0,n)}return!0}onBlobLoaded(){this._levelBuffers=zt._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=35916&&t<=35919)return"s3tc_sRGB";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(36196===t)return"etc1";
2if(35986===t||35987===t||34798===t)return"atc";if(t>=36492&&t<=36495)return"bptc";if(37808===t)return"astc";throw new Error(`Invalid (compressed) texture format given: ${t}`)}static _createLevelBuffers(t,e,r,i,s,n,o){const a=new Array(r);let h=t.byteOffset,l=n,u=o,c=l+i-1&~(i-1),d=u+s-1&~(s-1),p=c*d*Gt[e];for(let n=0;n<r;n++)a[n]={levelID:n,levelWidth:r>1?l:c,levelHeight:r>1?u:d,levelBuffer:new Uint8Array(t.buffer,h,p)},h+=p,l=l>>1||1,u=u>>1||1,c=l+i-1&~(i-1),d=u+s-1&~(s-1),p=c*d*Gt[e];return a}}const $t=827611204,Yt=861165636,qt=894720068,Kt={[$t]:Ut.COMPRESSED_RGBA_S3TC_DXT1_EXT,[Yt]:Ut.COMPRESSED_RGBA_S3TC_DXT3_EXT,[qt]:Ut.COMPRESSED_RGBA_S3TC_DXT5_EXT},Qt={70:Ut.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Ut.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Ut.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Ut.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Ut.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Ut.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Ut.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Ut.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Ut.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Ut.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Ut.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Ut.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Ut.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT},Zt=[171,75,84,88,32,49,49,187,13,10,26,10],Jt={[i.QE.UNSIGNED_BYTE]:1,[i.QE.UNSIGNED_SHORT]:2,[i.QE.INT]:4,[i.QE.UNSIGNED_INT]:4,[i.QE.FLOAT]:4,[i.QE.HALF_FLOAT]:8},te={[i.hR.RGBA]:4,[i.hR.RGB]:3,[i.hR.RG]:2,[i.hR.RED]:1,[i.hR.LUMINANCE]:1,[i.hR.LUMINANCE_ALPHA]:2,[i.hR.ALPHA]:1},ee={[i.QE.UNSIGNED_SHORT_4_4_4_4]:2,[i.QE.UNSIGNED_SHORT_5_5_5_1]:2,[i.QE.UNSIGNED_SHORT_5_6_5]:2};function re(t){switch(t){case i.hR.RGBA:return i.hR.RGBA_INTEGER;case i.hR.RGB:return i.hR.RGB_INTEGER;case i.hR.RG:return i.hR.RG_INTEGER;case i.hR.RED:return i.hR.RED_INTEGER;default:return t}}const ie={extension:{type:i.Ag.LoadParser,priority:Q.High},name:"loadDDS",test:t=>V(t,".dds"),async load(t,e,r){const s=function(t){const e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");const r=new Uint32Array(t,0,124/Uint32Array.BYTES_PER_ELEMENT),i=r[3],s=r[4],n=r[7],o=new Uint32Array(t,19*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),a=o[1];if(4&a){const r=o[2];if(808540228!==r){const e=Kt[r],o=new Uint8Array(t,128);return[new zt(o,{format:e,width:s,height:i,levels:n})]}const a=128,h=new Uint32Array(e.buffer,a,20/Uint32Array.BYTES_PER_ELEMENT),l=h[0],u=h[1],c=h[2],d=h[3],p=Qt[l];if(void 0===p)throw new Error(`DDSParser cannot parse texture data with DXGI format ${l}`);if(4===c)throw new Error("DDSParser does not support cubemap textures");if(6===u)throw new Error("DDSParser does not supported 3D texture data");const f=new Array,m=148;if(1===d)f.push(new Uint8Array(t,m));else{const e=Gt[p];let r=0,o=s,a=i;for(let t=0;t<n;t++)r+=Math.max(1,o+3&-4)*Math.max(1,a+3&-4)*e,o>>>=1,a>>>=1;let h=m;for(let e=0;e<d;e++)f.push(new Uint8Array(t,h,r)),h+=r}return f.map(t=>new zt(t,{format:p,width:s,height:i,levels:n}))}throw 64&a?new Error("DDSParser does not support uncompressed texture data."):512&a?new Error("DDSParser does not supported YUV uncompressed texture data."):131072&a?new Error("DDSParser does not support single-channel (lumninance) texture data!"):2&a?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}(await(await i.W0.ADAPTER.fetch(t)).arrayBuffer()).map(s=>ft(new i.t5(s,{mipmap:i.E8.OFF,alphaMode:i.Gk.NO_PREMULTIPLIED_ALPHA,resolution:i.Wp.getResolutionOfUrl(t),...e.data}),r,t));return 1===s.length?s[0]:s},unload(t){Array.isArray(t)?t.forEach(t=>t.destroy(!0)):t.destroy(!0)}};i.XO.add(ie);const se={extension:{type:i.Ag.LoadParser,priority:Q.High},name:"loadKTX",test:t=>V(t,".ktx"),async load(t,e,r){const s=await(await i.W0.ADAPTER.fetch(t)).arrayBuffer(),{compressed:n,uncompressed:o,kvData:a}=function(t,e,r=!1){const s=new DataView(e);if(!function(t,e){for(let r=0;r<Zt.length;r++)if(e.getUint8(r)!==Zt[r])return console.error(`${t} is not a valid *.ktx file!`),!1;return!0}(t,s))return null;const n=67305985===s.getUint32(12,!0),o=s.getUint32(16,n),a=s.getUint32(24,n),h=s.getUint32(28,n),l=s.getUint32(36,n),u=s.getUint32(40,n)||1,c=s.getUint32(44,n)||1,d=s.getUint32(48,n)||1,p=s.getUint32(52,n),f=s.getUint32(56,n),m=s.getUint32(60,n);if(0===u||1!==c)throw new Error("Only 2D textures are supported");if(1!==p)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==d)throw new Error("WebGL does not support array textures");const g=l+3&-4,y=u+3&-4,_=new Array(d);let v,x=l*u;if(0===o&&(x=g*y),v=0!==o?Jt[o]?Jt[o]*te[a]:ee[o]:Gt[h],void 0===v)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const b=r?function(t,e,r){const i=new Map;let s=0;for(;s<e;){const n=t.getUint32(64+s,r),o=64+s+4,a=3-(n+3)%4;if(0===n||n>e-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&0!==t.getUint8(o+h);h++);if(-1===h){console.error("KTXLoader: Failed to find null byte terminating
2kvData key");break}const l=(new TextDecoder).decode(new Uint8Array(t.buffer,o,h)),u=new DataView(t.buffer,o+h+1,n-h-1);i.set(l,u),s+=4+n+a}return i}(s,m,n):null;let E=x*v,T=l,A=u,w=g,S=y,R=64+m;for(let t=0;t<f;t++){const r=s.getUint32(R,n);let i=R+4;for(let r=0;r<d;r++){let s=_[r];s||(s=_[r]=new Array(f)),s[t]={levelID:t,levelWidth:f>1||0!==o?T:w,levelHeight:f>1||0!==o?A:S,levelBuffer:new Uint8Array(e,i,E)},i+=E}R+=r+4,R=R%4!=0?R+4-R%4:R,T=T>>1||1,A=A>>1||1,w=T+4-1&-4,S=A+4-1&-4,E=w*S*v}return 0!==o?{uncompressed:_.map(t=>{let e=t[0].levelBuffer,r=!1;return o===i.QE.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===i.QE.UNSIGNED_INT?(r=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===i.QE.INT&&(r=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new i.dZ(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:r?re(a):a}}),kvData:b}:{compressed:_.map(t=>new zt(null,{format:h,width:l,height:u,levels:f,levelBuffers:t})),kvData:b}}(t,s),h=n??o,l={mipmap:i.E8.OFF,alphaMode:i.Gk.NO_PREMULTIPLIED_ALPHA,resolution:i.Wp.getResolutionOfUrl(t),...e.data},u=h.map(e=>{h===o&&Object.assign(l,{type:e.type,format:e.format});const s=e.resource??e,n=new i.t5(s,l);return n.ktxKeyValueData=a,ft(n,r,t)});return 1===u.length?u[0]:u},unload(t){Array.isArray(t)?t.forEach(t=>t.destroy(!0)):t.destroy(!0)}};i.XO.add(se);const ne=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],oe={extension:i.Ag.ResolveParser,test:t=>{const e=i.Wp.path.extname(t).slice(1);return["basis","ktx","dds"].includes(e)},parse:t=>{const e=t.split("."),r=e.pop();if(["ktx","dds"].includes(r)){const r=e.pop();if(ne.includes(r))return{resolution:parseFloat(i.W0.RETINA_PREFIX.exec(t)?.[1]??"1"),format:r,src:t}}return{resolution:parseFloat(i.W0.RETINA_PREFIX.exec(t)?.[1]??"1"),format:r,src:t}}};i.XO.add(oe);const ae=new i.M_,he=class t{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,r,i){const s=new Image;return s.src=await this.base64(t,e,r,i),s}async base64(t,e,r,i){const s=this.canvas(t,i);if(void 0!==s.toBlob)return new Promise((t,i)=>{s.toBlob(e=>{if(!e)return void i(new Error("ICanvas.toBlob failed!"));const r=new FileReader;r.onload=()=>
2t(r.result),r.onerror=i,r.readAsDataURL(e)},e,r)});if(void 0!==s.toDataURL)return s.toDataURL(e,r);if(void 0!==s.convertToBlob){const t=await s.convertToBlob({type:e,quality:r});return new Promise((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r,i.readAsDataURL(t)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,r){const{pixels:s,width:n,height:o,flipY:a,premultipliedAlpha:h}=this._rawPixels(e,r);a&&t._flipY(s,n,o),h&&t._unpremultiplyAlpha(s);const l=new i.Wp.CanvasRenderTarget(n,o,1),u=new ImageData(new Uint8ClampedArray(s.buffer),n,o);return l.context.putImageData(u,0,0),l.canvas}pixels(e,r){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,r);return o&&t._flipY(i,s,n),a&&t._unpremultiplyAlpha(i),i}_rawPixels(t,e){const r=this.renderer;if(!r)throw new Error("The Extract has already been destroyed");let s,n,o=!1,a=!1,h=!1;t&&(t instanceof i.Y7?n=t:(n=r.generateTexture(t,{region:e,resolution:r.resolution,multisample:r.multisample}),h=!0,e&&(ae.width=e.width,ae.height=e.height,e=ae)));const l=r.gl;if(n){if(s=n.baseTexture.resolution,e=e??n.frame,o=!1,a=n.baseTexture.alphaMode>0&&n.baseTexture.format===i.hR.RGBA,!h){r.renderTexture.bind(n);const t=n.framebuffer.glFramebuffers[r.CONTEXT_UID];t.blitFramebuffer&&r.framebuffer.bind(t.blitFramebuffer)}}else s=r.resolution,e||((e=ae).width=r.width/s,e.height=r.height/s),o=!0,a=this._rendererPremultipliedAlpha,r.renderTexture.bind();const u=Math.max(Math.round(e.width*s),1),c=Math.max(Math.round(e.height*s),1),d=new Uint8Array(4*u*c);return l.readPixels(Math.round(e.x*s),Math.round(e.y*s),u,c,l.RGBA,l.UNSIGNED_BYTE,d),h&&n?.destroy(!0),{pixels:d,width:u,height:c,flipY:o,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(t,e,r){const i=e<<2,s=r>>1,n=new Uint8Array(i);for(let e=0;e<s;e++){const s=e*i,o=(r-e-1)*i;n.set(t.subarray(s,s+i)),t.copyWithin(s,o,o+i),t.set(n,o)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let r=0;r<e;r+=4){const e=t[r+3];if(0!==e){const i=255.001/e;t[r]=t[r]*i+.5,t[r+1]=t[r+1]*i+.5,t[r+2]=t[r+2]*i+.5}}}};he.extension={name:"extract",type:i.Ag.RendererSystem};let le=he;i.XO.add(le);const ue={build(t){const e=t.points;let r,s,n,o,a,h;if(t.type===i.HY.CIRC){const e=t.shape;r=e.x,s=e.y,a=h=e.radius,n=o=0}else if(t.type===i.HY.ELIP){const e=t.shape;r=e.x,s=e.y,a=e.width,h=e.height,n=o=0}else{const e=t.shape,i=e.width/2,l=e.height/2;r=e.x+i,s=e.y+l,a=h=Math.max(0,Math.min(e.radius,Math.min(i,l))),n=i-a,o=l-h}if(!(a>=0&&h>=0&&n>=0&&o>=0))return void(e.length=0);const l=Math.ceil(2.3*Math.sqrt(a+h)),u=8*l+(n?4:0)+(o?4:0);if(e.length=u,0===u)return;if(0===l)return e.length=8,e[0]=e[6]=r+n,e[1]=e[3]=s+o,e[2]=e[4]=r-n,void(e[5]=e[7]=s-o);let c=0,d=4*l+(n?2:0)+2,p=d,f=u;{const t=n+a,i=o,h=r+t,l=r-t,u=s+i;if(e[c++]=h,e[c++]=u,e[--d]=u,e[--d]=l,o){const t=s-i;e[p++]=l,e[p++]=t,e[--f]=t,e[--f]=h}}for(let t=1;t<l;t++){const i=Math.PI/2*(t/l),u=n+Math.cos(i)*a,m=o+Math.sin(i)*h,g=r+u,y=r-u,_=s+m,v=s-m;e[c++]=g,e[c++]=_,e[--d]=_,e[--d]=y,e[p++]=y,e[p++]=v,e[--f]=v,e[--f]=g}{const t=o+h,i=r+n,a=r-n,l=s+t,u=s-t;e[c++]=i,e[c++]=l,e[--f]=u,e[--f]=i,n&&(e[c++]=a,e[c++]=l,e[--f]=u,e[--f]=a)}},triangulate(t,e){const r=t.points,s=e.points,n=e.indices;if(0===r.length)return;let o=s.length/2;const a=o;let h,l;if(t.type!==i.HY.RREC){const e=t.shape;h=e.x,l=e.y}else{const e=t.shape;h=e.x+e.width/2,l=e.y+e.height/2}const u=t.matrix;s.push(t.matrix?u.a*h+u.c*l+u.tx:h,t.matrix?u.b*h+u.d*l+u.ty:l),o++,s.push(r[0],r[1]);for(let t=2;t<r.length;t+=2)s.push(r[t],r[t+1]),n.push(o++,a,o);n.push(a+1,a,o)}};function ce(t,e=!1){const r=t.length;if(r<6)return;let i=0;for(let e=0,s=t[r-2],n=t[r-1];e<r;e+=2){const r=t[e],o=t[e+1];i+=(r-s)*(o+n),s=r,n=o}if(!e&&i>0||e&&i<=0){const e=r/2;for(let i=e+e%2;i<r;i+=2){const e=r-i-2,s=r-i-1,n=i,o=i+1;[t[e],t[n]]=[t[n],t[e]],[t[s],t[o]]=[t[o],t[s]]}}}const de={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const s=t.holes,n=e.points,o=e.indices;if(r.length>=6){ce(r,!1);const t=[];for(let e=0;e<s.length;e++){const i=s[e];ce(i.points,!0),t.push(r.length/2),r=r.concat(i.points)}const e=i.Wp.earcut(r,t,2);if(!e)return;const a=n.length/2;for(let t=0;t<e.length;t+=3)o.push(e[t]+a),o.push(e[t+1]+a),o.push(e[t+2]+a);for(let t=0;t<r.length;t++)n.push(r[t])}}}
2,pe={build(t){const e=t.shape,r=e.x,i=e.y,s=e.width,n=e.height,o=t.points;o.length=0,s>=0&&n>=0&&o.push(r,i,r+s,i,r+s,i+n,r,i+n)},triangulate(t,e){const r=t.points,i=e.points;if(0===r.length)return;const s=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},fe={build(t){ue.build(t)},triangulate(t,e){ue.triangulate(t,e)}};var me=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(me||{}),ge=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(ge||{});const ye={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class _e{static curveTo(t,e,r,i,s,n){const o=n[n.length-2],a=n[n.length-1]-e,h=o-t,l=i-e,u=r-t,c=Math.abs(a*u-h*l);if(c<1e-8||0===s)return(n[n.length-2]!==t||n[n.length-1]!==e)&&n.push(t,e),null;const d=a*a+h*h,p=l*l+u*u,f=a*l+h*u,m=s*Math.sqrt(d)/c,g=s*Math.sqrt(p)/c,y=m*f/d,_=g*f/p,v=m*u+g*h,x=m*l+g*a,b=h*(g+y),E=a*(g+y),T=u*(m+_),A=l*(m+_);return{cx:v+t,cy:x+e,radius:s,startAngle:Math.atan2(E-x,b-v),endAngle:Math.atan2(A-x,T-v),anticlockwise:h*l>u*a}}static arc(t,e,r,s,n,o,a,h,l){const u=a-o,c=ye._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/i.TO)),d=u/(2*c),p=2*d,f=Math.cos(d),m=Math.sin(d),g=c-1,y=g%1/g;for(let t=0;t<=g;++t){const e=d+o+p*(t+y*t),i=Math.cos(e),a=-Math.sin(e);l.push((f*i+m*a)*n+r,(f*-a+m*i)*n+s)}}}function ve(t,e,r,i,s,n,o,a){let h,l;o?(h=i,l=-r):(h=-i,l=r);const u=t-r*s+h,c=e-i*s+l,d=t+r*n+h,p=e+i*n+l;return a.push(u,c,d,p),2}function xe(t,e,r,i,s,n,o,a){const h=r-t,l=i-e;let u=Math.atan2(h,l),c=Math.atan2(s-t,n-e);a&&u<c?u+=2*Math.PI:!a&&u>c&&(c+=2*Math.PI);let d=u;const p=c-u,f=Math.abs(p),m=Math.sqrt(h*h+l*l),g=1+(15*f*Math.sqrt(m)/Math.PI|0),y=p/g;if(d+=y,a){o.push(t,e,r,i);for(let r=1,i=d;r<g;r++,i+=y)o.push(t,e,t+Math.sin(i)*m,e+Math.cos(i)*m);o.push(t,e,s,n)}else{o.push(r,i,t,e);for(let r=1,i=d;r<g;r++,i+=y)o.push(t+Math.sin(i)*m,e+Math.cos(i)*m,t,e);o.push(s,n,t,e)}return 2*g}function be(t,e){t.lineStyle.native?function(t,e){let r=0;const s=t.shape,n=t.points||s.points,o=s.type!==i.HY.POLY||s.closeStroke;if(0===n.length)return;const a=e.points,h=e.indices,l=n.length/2,u=a.length/2;let c=u;for(a.push(n[0],n[1]),r=1;r<l;r++)a.push(n[2*r],n[2*r+1]),h.push(c,c+1),c++;o&&h.push(c,u)}(t,e):function(t,e){const r=t.shape;let s=t.points||r.points.slice();const n=e.closePointEps;if(0===s.length)return;const o=t.lineStyle,a=new i.bR(s[0],s[1]),h=new i.bR(s[s.length-2],s[s.length-1]),l=r.type!==i.HY.POLY||r.closeStroke,u=Math.abs(a.x-h.x)<n&&Math.abs(a.y-h.y)<n;if(l){s=s.slice(),u&&(s.pop(),s.pop(),h.set(s[s.length-2],s[s.length-1]));const t=.5*(a.x+h.x),e=.5*(h.y+a.y);s.unshift(t,e),s.push(t,e)}const c=e.points,d=s.length/2;let p=s.length;const f=c.length/2,m=o.width/2,g=m*m,y=o.miterLimit*o.miterLimit;let _=s[0],v=s[1],x=s[2],b=s[3],E=0,T=0,A=-(v-b),w=_-x,S=0,R=0,I=Math.sqrt(A*A+w*w);A/=I,w/=I,A*=m,w*=m;const C=o.alignment,P=2*(1-C),M=2*C;l||(o.cap===ge.ROUND?p+=xe(_-A*(P-M)*.5,v-w*(P-M)*.5,_-A*P,v-w*P,_+A*M,v+w*M,c,!0)+2:o.cap===ge.SQUARE&&(p+=ve(_,v,A,w,P,M,!0,c))),c.push(_-A*P,v-w*P,_+A*M,v+w*M);for(let t=1;t<d-1;++t){_=s[2*(t-1)],v=s[2*(t-1)+1],x=s[2*t],b=s[2*t+1],E=s[2*(t+1)],T=s[2*(t+1)+1],A=-(v-b),w=_-x,I=Math.sqrt(A*A+w*w),A/=I,w/=I,A*=m,w*=m,S=-(b-T),R=x-E,I=Math.sqrt(S*S+R*R),S/=I,R/=I,S*=m,R*=m;const e=x-_,r=v-b,i=x-E,n=T-b,a=e*i+r*n,h=r*i-n*e,l=h<0;if(Math.abs(h)<.001*Math.abs(a)){c.push(x-A*P,b-w*P,x+A*M,b+w*M),a>=0&&(o.join===me.ROUND?p+=xe(x,b,x-A*P,b-w*P,x-S*P,b-R*P,c,!1)+4:p+=2,c.push(x-S*M,b-R*M,x+S*P,b+R*P));continue}const u=(-A+_)*(-w+b)-(-A+x)*(-w+v),d=(-S+E)*(-R+b)-(-S+x)*(-R+T),f=(e*d-i*u)/h,C=(n*u-r*d)/h,D=(f-x)*(f-x)+(C-b)*(C-b),O=x+(f-x)*P,B=b+(C-b)*P,N=x-(f-x)*M,L=b-(C-b)*M,F=l?P:M,k=D<=Math.min(e*e+r*r,i*i+n*n)+F*F*g;let U=o.join;if(U===me.MITER&&D/g>y&&(U=me.BEVEL),k)switch(U){case me.MITER:c.push(O,B,N,L);break;case me.BEVEL:l?c.push(O,B,x+A*M,b+w*M,O,B,x+S*M,b+R*M):c.push(x-A*P,b-w*P,N,L,x-S*P,b-R*P,N,L),p+=2;break;case me.ROUND:l?(c.push(O,B,x+A*M,b+w*M),p+=xe(x,b,x+A*M,b+w*M,x+S*M,b+R*M,c,!0)+4,c.push(O,B,x+S*M,b+R*M)):(c.push(x-A*P,b-w*P,N,L),p+=xe(x,b,x-A*P,b-w*P,x-S*P,b-R*P,c,!1)+4,c.push(x-S*P,b-R*P,N,L))}else{switch(c.push(x-A*P,b-w*P,x+A*M,b+w*M),U){case me.MITER:l?c.push(N,L,N,L):c.push(O,B,O,B),p+=2;break;case me.ROUND:p+=l?xe(x,b,x+A*M,b+w*M,x+S*M,b+R*M,c,!0)+2:xe(x,b,x-A*P,b-w*P,x-S*P,b-R*P,c,!1)+2}c.push(x-S*P,b-R*P,x+S*M,b+R*M),p+=2}}_=s[2*(d-2)],v=s[2*(d-2)+1],x=s[2*(d-1)],b=s[2*(d-1)+1],A=-(v-b),w=_-x,I=Math.sqrt(A*A+w*w),A/=I,w/=I,A*=m,w*=m,c.push(x-A*P,b-w*P,x+A*M,b+w*M),l||(o.cap===ge.ROUND?p+=xe(x-A*(P-M)*.5,b-w*(P-M)*.5,x-A*P,b-w*P,x+A*M,b+w*M,c,!1)+2:o.cap===ge.SQUARE&&(p+=ve(x,b,A,w,P,M,!1,c)));const D=e.indices,O=ye.epsilon*ye.epsilon;for(let t=f;t<p+f-2;++t)_=c[2*t],v=c[2*t+1],x=c[2*(t+1)],b=c[2*(t+1)+1],E=c[2*(t+2)],T=c[2*(t+2)+1],!(Math.abs(_*(b-T)+x*(T-v)+E*(v-b))<O)&&D.push(t,t+1,t+2)}(t,e)}const Ee={[i.HY.POLY]:de,[i.HY.CIRC]:ue,[i.HY.ELIP]:ue,[i.HY.RECT]:pe,[i.HY.RREC]:fe},Te=[],Ae=[];class we{constructor(t,e=null,r=null,i=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type}clone(){return new we(this.shape,this.fillStyle,this.lineStyle,this.matrix
2)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}class Se{constructor(){this.reset()}begin(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}const Re=new i.bR,Ie=class t extends i.JH{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new s,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Ae.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),Te.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,i=null){const s=new we(t,e,r,i);return this.graphicsData.push(s),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new we(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const i=e[r];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,Re):Re.copyFrom(t),i.shape.contains(Re.x,Re.y))){let t=!1;if(i.holes)for(let e=0;e<i.holes.length;e++)if(i.holes[e].shape.contains(Re.x,Re.y)){t=!0;break}if(!t)return!0}}return!1}updateBatches(){if(!this.graphicsData.length)return void(this.batchable=!0);if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,s=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],s=r.style);for(let n=this.shapeIndex;n<e.length;n++){this.shapeIndex++;const o=e[n],a=o.fillStyle,h=o.lineStyle;Ee[o.type].build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(a.visible||h.visible)&&this.processHoles(o.holes);for(let e=0;e<2;e++){const n=0===e?a:h;if(!n.visible)continue;const l=n.texture.baseTexture,u=this.indices.length,c=this.points.length/2;l.wrapMode=i.uR.REPEAT,0===e?this.processFill(o):this.processLine(o);const d=this.points.length/2-c;0!==d&&(r&&!this._compareStyles(s,n)&&(r.end(u,c),r=null),r||(r=Te.pop()||new Se,r.begin(n,u,c),this.batches.push(r),s=n),this.addUvs(this.points,t,n.texture,c,d,n.matrix))}}const n=this.indices.length,o=this.points.length/2;if(r&&r.end(n,o),0===this.batches.length)return void(this.batchable=!0);const a=o>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const e=this.graphicsData[t],r=e.fillStyle,i=e.lineStyle;if(r&&!r.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const r=t[e];for(let t=0;t<r.size;t++){const e=r.start+t;this.indicesUint16[e]=this.indicesUint16[e]-r.attribStart}}}isBatchable(){if(this.points.length>131070)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<2*t.BATCHABLE_SIZE}buildDrawCalls(){let t=++i.t5._globalBatch;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Ae.push(this.drawCalls[t]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let s=Ae.pop();s||(s=new i.hq,s.texArray=new i.cc),s.texArray.count=0,s.start=0,s.size=0,s.type=i._4.TRIANGLES;let n=0,o=null,a=0,h=!1,l=i._4.TRIANGLES,u=0;this.drawCalls.push(s);for(let c=0;c<this.batches.length;c++){const d=this.batches[c],p=8,f=d.style,m=f.texture.baseTexture;h!==!!f.native&&(h=!!f.native,l=h?i._4.LINES:i._4.TRIANGLES,o=null,n=p,t++),o!==m&&(o=m,m._batchEnabled!==t&&(n===p&&(t++,n=0,s.size>0&&(s=Ae.pop(),s||(s=new i.hq,s.texArray=new i.cc),this.drawCalls.push(s)),s.start=u,s.size=0,s.texArray.count=0,s.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.
2wrapMode=i.uR.REPEAT,s.texArray.elements[s.texArray.count++]=m,n++)),s.size+=d.size,u+=d.size,a=m._batchLocation,this.addColors(e,f.color,f.alpha,d.attribSize,d.attribStart),this.addTextureIds(r,a,d.attribSize,d.attribStart)}i.t5._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,s=new ArrayBuffer(3*t.length*4),n=new Float32Array(s),o=new Uint32Array(s);let a=0;for(let s=0;s<t.length/2;s++)n[a++]=t[2*s],n[a++]=t[2*s+1],n[a++]=e[2*s],n[a++]=e[2*s+1],o[a++]=r[s],n[a++]=i[s];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?de.triangulate(t,this):Ee[t.type].triangulate(t,this)}processLine(t){be(t,this);for(let e=0;e<t.holes.length;e++)be(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];Ee[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const i=t[2*r],s=t[2*r+1];t[2*r]=e.a*i+e.c*s+e.tx,t[2*r+1]=e.b*i+e.d*s+e.ty}}addColors(t,e,r,s,n=0){const o=i.Q1.shared.setValue(e).toLittleEndianNumber(),a=i.Q1.shared.setValue(o).toPremultiplied(r);t.length=Math.max(t.length,n+s);for(let e=0;e<s;e++)t[n+e]=a}addTextureIds(t,e,r,i=0){t.length=Math.max(t.length,i+r);for(let s=0;s<r;s++)t[i+s]=e}addUvs(t,e,r,i,s,n=null){let o=0;const a=e.length,h=r.frame;for(;o<s;){let r=t[2*(i+o)],s=t[2*(i+o)+1];if(n){const t=n.a*r+n.c*s+n.tx;s=n.b*r+n.d*s+n.ty,r=t}o++,e.push(r/h.width,s/h.height)}const l=r.baseTexture;(h.width<l.width||h.height<l.height)&&this.adjustUvs(e,r,a,s)}adjustUvs(t,e,r,i){const s=e.baseTexture,n=1e-6,o=r+2*i,a=e.frame,h=a.width/s.width,l=a.height/s.height;let u=a.x/a.width,c=a.y/a.height,d=Math.floor(t[r]+n),p=Math.floor(t[r+1]+n);for(let e=r+2;e<o;e+=2)d=Math.min(d,Math.floor(t[e]+n)),p=Math.min(p,Math.floor(t[e+1]+n));u-=d,c-=p;for(let e=r;e<o;e+=2)t[e]=(t[e]+u)*h,t[e+1]=(t[e+1]+c)*l}};Ie.BATCHABLE_SIZE=100;let Ce=Ie;class Pe{constructor(){this.color=16777215,this.alpha=1,this.texture=i.gP.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new Pe;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=i.gP.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class Me extends Pe{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=ge.BUTT,this.join=me.MITER,this.miterLimit=10}clone(){const t=new Me;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=ge.BUTT,this.join=me.MITER,this.miterLimit=10}}class De{static curveLength(t,e,r,i,s,n){const o=t-2*r+s,a=e-2*i+n,h=2*r-2*t,l=2*i-2*e,u=4*(o*o+a*a),c=4*(o*h+a*l),d=h*h+l*l,p=2*Math.sqrt(u+c+d),f=Math.sqrt(u),m=2*u*f,g=2*Math.sqrt(d),y=c/f;return(m*p+f*c*(p-g)+(4*d*u-c*c)*Math.log((2*f+y+p)/(y+g)))/(4*m)}static curveTo(t,e,r,i,s){const n=s[s.length-2],o=s[s.length-1],a=ye._segmentsCount(De.curveLength(n,o,t,e,r,i));let h=0,l=0;for(let u=1;u<=a;++u){const c=u/a;h=n+(t-n)*c,l=o+(e-o)*c,s.push(h+(t+(r-t)*c-h)*c,l+(e+(i-e)*c-l)*c)}}}class Oe{static curveLength(t,e,r,i,s,n,o,a){let h=0,l=0,u=0,c=0,d=0,p=0,f=0,m=0,g=0,y=0,_=0,v=t,x=e;for(let b=1;b<=10;++b)l=b/10,u=l*l,c=u*l,d=1-l,p=d*d,f=p*d,m=f*t+3*p*l*r+3*d*u*s+c*o,g=f*e+3*p*l*i+3*d*u*n+c*a,y=v-m,_=x-g,v=m,x=g,h+=Math.sqrt(y*y+_*_);return h}static curveTo(t,e,r,i,s,n,o){const a=o[o.length-2],h=o[o.length-1];o.length-=2;const l=ye._segmentsCount(Oe.curveLength(a,h,t,e,r,i,s,n));let u=0,c=0,d=0,p=0,f=0;o.push(a,h);for(let m=1,g=0;m<=l;++m)g=m/l,u=1-g,c=u*u,d=c*u,p=g*g,f=p*g,o.push(d*a+3*c*g*t+3*u*p*r+f*s,d*h+3*c*g*e+3*u*p*i+f*n)}}const Be={},Ne=class t extends u{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new Pe,this._lineStyle=new Me,this._matrix=null,this._holeMode=!1,this.state=i.Uw.for2d(),this._geometry=t||new Ce,this._geometry.refCount++,this._transformID=-1,this._tintColor=new i.Q1(16777215),this.blendMode=i.B9.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new t(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,i=.5,s=!1){return"number"==typeof t&&(t={width:t,color:e,alpha:r,alignment:i,native:s}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:i.gP.WHITE,color:t?.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:ge.BUTT,join:me.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new i.tS,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new i.tS,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,i=r[r.length-2],s=r[r.length-1];return(i!==t||s!==e)&&r.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,r,i){this._initCurve();const s=this.currentPath.points;return 0===s.length&&this.moveTo(0,0),De.curveTo(t,e,r,i,s),this}bezierCurveTo(t,e,r,i,s,n){return this._initCurve(),Oe.curveTo(t,e,r,i,s,n,this.currentPath.points),this}arcTo(t,e,r,i,s){this._initCurve(t,e);const n=this.currentPath.points,o=_e.curveTo(t,e,r,i,s,n);
2if(o){const{cx:t,cy:e,radius:r,startAngle:i,endAngle:s,anticlockwise:n}=o;this.arc(t,e,r,i,s,n)}return this}arc(t,e,r,s,n,o=!1){if(s===n)return this;if(!o&&n<=s?n+=i.TO:o&&s<=n&&(s+=i.TO),n-s===0)return this;const a=t+Math.cos(s)*r,h=e+Math.sin(s)*r,l=this._geometry.closePointEps;let u=this.currentPath?this.currentPath.points:null;if(u){const t=Math.abs(u[u.length-2]-a),e=Math.abs(u[u.length-1]-h);t<l&&e<l||u.push(a,h)}else this.moveTo(a,h),u=this.currentPath.points;return _e.arc(a,h,t,e,r,s,n,o,u),this}beginFill(t=0,e){return this.beginTextureFill({texture:i.gP.WHITE,color:t,alpha:e})}normalizeColor(t){const e=i.Q1.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:i.gP.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,s){return this.drawShape(new i.M_(t,e,r,s))}drawRoundedRect(t,e,r,s,n){return this.drawShape(new i.TE(t,e,r,s,n))}drawCircle(t,e,r){return this.drawShape(new i.jl(t,e,r))}drawEllipse(t,e,r,s){return this.drawShape(new i.Pp(t,e,r,s))}drawPolygon(...t){let e,r=!0;const s=t[0];s.points?(r=s.closeStroke,e=s.points):e=Array.isArray(t[0])?t[0]:t;const n=new i.tS(e);return n.closeStroke=r,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==i.HY.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(let s=0;s<r;s++){const r=t.batches[s],n=r.style.color,o=new Float32Array(this.vertexData.buffer,4*r.attribStart*2,2*r.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*r.attribStart*2,2*r.attribSize),h={vertexData:o,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*r.start,r.size),uvs:a,_batchRGB:i.Q1.shared.setValue(n).toRgbArray(),_tintRGB:n,_texture:r.style.texture,alpha:r.style.alpha,worldAlpha:1};this.batches[s]=h}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,s=this.worldAlpha,n=e.uniforms,o=r.drawCalls;n.translationMatrix=this.transform.worldTransform,i.Q1.shared.setValue(this._tintColor).premultiply(s).toArray(n.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let e=0,i=o.length;e<i;e++)this._renderDrawCallDirect(t,r.drawCalls[e])}_renderDrawCallDirect(t,e){const{texArray:r,type:i,size:s,start:n}=e,o=r.count;for(let e=0;e<o;e++)t.texture.bind(r.elements[e],e);t.geometry.draw(i,s,n)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!Be[r]){const{maxTextures:e}=t.plugins[r],s=new Int32Array(e);for(let t=0;t<e;t++)s[t]=t;const n={tint:new Float32Array([1,1,1,1]),translationMatrix:new i.uq,default:i.k2.from({uSamplers:s},!0)},o=t.plugins[r]._shader.program;Be[r]=new i.Mt(o,n)}e=Be[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:i,maxY:s}=t.bounds;this._bounds.addFrame(this.transform,e,r,i,s)}containsPoint(e){return this.worldTransform.applyInverse(e,t._TEMP_POINT),this._geometry.containsPoint(t._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=i.Q1.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,h=this._geometry.points,l=this.vertexData;let u=0;for(let t=0;t<h.length;t+=2){const e=h[t],c=h[t+1];l[u++]=r*e+s*c+o,l[u++]=n*c+i*e+a}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,
2super.destroy(t)}};Ne.curves=ye,Ne._TEMP_POINT=new i.bR;let Le=Ne;class Fe{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}}const ke=new i.bR,Ue=new i.tS,Ge=class t extends u{constructor(t,e,r,s=i._4.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=r||i.Uw.for2d(),this.drawMode=s,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=i.W0.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(e){const r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===i._4.TRIANGLES&&r.length<2*t.BATCHABLE_SIZE?this._renderToBatch(e):this._renderDefault(e)}_renderDefault(t){const e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(t){const e=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=r._tintRGB,this._texture=r.texture;const i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const s=this.transform.worldTransform,n=s.a,o=s.b,a=s.c,h=s.d,l=s.tx,u=s.ty,c=this.vertexData;for(let t=0;t<c.length/2;t++){const r=e[2*t],i=e[2*t+1];c[2*t]=n*r+a*i+l,c[2*t+1]=o*r+h*i+u}if(this._roundPixels){const t=i.W0.RESOLUTION;for(let e=0;e<c.length;++e)c[e]=Math.round(c[e]*t)/t}this.vertexDirty=r}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new Fe(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,ke);const e=this.geometry.getBuffer("aVertexPosition").data,r=Ue.points,i=this.geometry.getIndex().data,s=i.length,n=4===this.drawMode?3:1;for(let t=0;t+2<s;t+=n){const s=2*i[t],n=2*i[t+1],o=2*i[t+2];if(r[0]=e[s],r[1]=e[s+1],r[2]=e[n],r[3]=e[n+1],r[4]=e[o],r[5]=e[o+1],Ue.contains(ke.x,ke.y))return!0}return!1}destroy(t){super.destroy(t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};Ge.BATCHABLE_SIZE=100;let He=Ge;class je extends i.V2{constructor(t,e,r){super();const s=new i.hp(t),n=new i.hp(e,!0),o=new i.hp(r,!0,!0);this.addAttribute("aVertexPosition",s,2,!1,i.QE.FLOAT).addAttribute("aTextureCoord",n,2,!1,i.QE.FLOAT).addIndex(o),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}class We extends i.Mt{constructor(t,e){const r={uSampler:t,alpha:1,uTextureMatrix:i.uq.IDENTITY,uColor:new Float32Array([1,1,1,1])};
2(e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e)).uniforms&&Object.assign(r,e.uniforms),super(e.program||i.BP.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),r),this._colorDirty=!1,this.uvMatrix=new i.NW(t),this.batchable=void 0===e.program,this.pluginName=e.pluginName,this._tintColor=new i.Q1(e.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=e.alpha}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const t=this.texture.baseTexture.alphaMode;i.Q1.shared.setValue(this._tintColor).premultiply(this._alpha,t).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class Xe{constructor(t,e,r){this.geometry=new i.V2,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(let r=0;r<t.length;++r){let s=t[r];s={attributeName:s.attributeName,size:s.size,uploadFunction:s.uploadFunction,type:s.type||i.QE.FLOAT,offset:s.offset},e[r]?this.dynamicProperties.push(s):this.staticProperties.push(s)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){const t=this.geometry;let e=0;this.indexBuffer=new i.hp(i.Wp.createIndicesForQuads(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(let t=0;t<this.dynamicProperties.length;++t){const r=this.dynamicProperties[t];r.offset=e,e+=r.size,this.dynamicStride+=r.size}const r=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(r),this.dynamicDataUint32=new Uint32Array(r),this.dynamicBuffer=new i.hp(this.dynamicData,!1,!1);let s=0;this.staticStride=0;for(let t=0;t<this.staticProperties.length;++t){const e=this.staticProperties[t];e.offset=s,s+=e.size,this.staticStride+=e.size}const n=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(n),this.staticDataUint32=new Uint32Array(n),this.staticBuffer=new i.hp(this.staticData,!0,!1);for(let e=0;e<this.dynamicProperties.length;++e){const r=this.dynamicProperties[e];t.addAttribute(r.attributeName,this.dynamicBuffer,0,r.type===i.QE.UNSIGNED_BYTE,r.type,4*this.dynamicStride,4*r.offset)}for(let e=0;e<this.staticProperties.length;++e){const r=this.staticProperties[e];t.addAttribute(r.attributeName,this.staticBuffer,0,r.type===i.QE.UNSIGNED_BYTE,r.type,4*this.staticStride,4*r.offset)}}uploadDynamic(t,e,r){for(let s=0;s<this.dynamicProperties.length;s++){const n=this.dynamicProperties[s];n.uploadFunction(t,e,r,n.type===i.QE.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,e,r){for(let s=0;s<this.staticProperties.length;s++){const n=this.staticProperties[s];n.uploadFunction(t,e,r,n.type===i.QE.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}}class Ve extends i.Pt{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new i.uq,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:i.QE.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=i.Mt.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",{}),this.state=i.Uw.for2d()}render(t){const e=t.children,r=t._maxSize,s=t._batchSize,n=this.renderer;let o=e.length;if(0===o)return;o>r&&!t.autoResize&&(o=r);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=i.Wp.correctBlendMode(t.blendMode,l),n.state.set(this.state);const u=n.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=i.Q1.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let r=0,i=0;r<o;r+=s,i+=1){let h=o-r;h>s&&(h=s),i>=a.length&&a.push(this._generateOneMoreBuffer(t));const l=a[i];l.uploadDynamic(e,r,h);const c=t._bufferUpdateIDs[i]||0;d=d||l._updateID<c,d&&(l._updateID=t._updateID,l.uploadStatic(e,r,h)),n.geometry.bind(l.geometry),u.drawElements(u.TRIANGLES,6*h,u.UNSIGNED_SHORT,0)}}generateBuffers(t){const e=[],r=t._maxSize,i=t._batchSize,s=t._properties;for(let t=0;t<r;t+=i)e.push(new Xe(this.properties,s,i));return e}_generateOneMoreBuffer(t){const e=t._batchSize,r=t._properties;return new Xe(this.properties,r,e)}uploadVertices(t,e,r,i,s,n){let o=0,a=0,h=0,l=0;for(let u=0;u<r;++u){const r=t[e+u],c=r._texture,d=r.scale.x,p=r.scale.y,f=c.trim,m=c.orig;f?(a=f.x-r.anchor.x*m.width,o=a+f.width,l=f.y-r.anchor.y*m.height,h=l+f.height):(o=m.width*(1-r.anchor.x),a=m.width*-r.anchor.x,h=m.height*(1-r.anchor.y),l=m.height*-r.anchor.y),i[n]=a*d,i[n+1]=l*p,i[n+s]=o*d,i[n+s+1]=l*p,i[n+2*s]=o*d,i[n+2*s+1]=h*p,i[n+3*s]=a*d,i[n+3*s+1]=h*p,n+=4*s}}uploadPosition(t,e,r,i,s,n){for(let o=0;o<r;o++){const r=t[e+o].position;i[n]=r.x,i[n+1]=r.y,i[n+s]=r.x,i[n+s+1]=r.y,i[n+2*s]=r.x,i[n+2*s+1]=r.y,i[n+3*s]=r.x,i[n+3*s+1]=r.y,n+=4*s}}uploadRotation(t,e,r,i,s,n){for(let o=0;o<r;o++){const r=t[e+o].rotation;i[n]=r,i[n+s]=r,i[n+2*s]=r,i[n+3*s]=r,n+=4*s}}uploadUvs(t,e,r,i,s,n){for(let o=0;o<r;++o){const r=t[e+o]._texture._uvs;r?(i[n]=r.x0,i[n+1]=r.y0,i[n+s]=r.x1,i[n+s+1]=r.y1,i[n+2*s]=r.x2,i[n+2*s+1]=r.y2,i[n+3*s]=r.x3,i[n+3*s+1]=r.y3,n+=4*s):(i[n]=0,i[n+1]=0,i[n+s]=0,i[n+s+1]=0,i[n+2*s]=0,i[n+2*s+1]=0,i[n+3*s]=0,i[n+3*s+1]=0,n+=4*s)}}uploadTint(t,e,r,s,n,o){for(let a=0;a<r;++a){const r=t[e+a],h=i.Q1.shared.setValue(r._tintRGB).toPremultiplied(r.alpha,r.texture.baseTexture.alphaMode>0);s[o]=h,s[o+n]=h,s[o+2*n]=h,s[o+3*n]=h,o+=4*n}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Ve.extension={name:"particle",type:i.Ag.RendererPlugin},i.XO.add(Ve);var ze=(t=>(t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t))(ze||{});const $e={willReadFrequently:!0},Ye=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0!==e){const r=i.W0.ADAPTER.getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(t,e,r,i,s,n,o,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=s,this.lineWidths=n,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}
2static measureText(e,r,i,s=t._canvas){i=i??r.wordWrap;const n=r.toFontString(),o=t.measureFont(n);0===o.fontSize&&(o.fontSize=r.fontSize,o.ascent=r.fontSize);const a=s.getContext("2d",$e);a.font=n;const h=(i?t.wordWrap(e,r,s):e).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let u=0;for(let e=0;e<h.length;e++){const i=t._measureText(h[e],r.letterSpacing,a);l[e]=i,u=Math.max(u,i)}let c=u+r.strokeThickness;r.dropShadow&&(c+=r.dropShadowDistance);const d=r.lineHeight||o.fontSize+r.strokeThickness;let p=Math.max(d,o.fontSize+2*r.strokeThickness)+r.leading+(h.length-1)*(d+r.leading);return r.dropShadow&&(p+=r.dropShadowDistance),new t(e,r,c,p,h,l,d+r.leading,u,o)}static _measureText(e,r,i){let s=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(i.letterSpacing=`${r}px`,i.textLetterSpacing=`${r}px`,s=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e).width;return n>0&&(s?n-=r:n+=(t.graphemeSegmenter(e).length-1)*r),n}static wordWrap(e,r,i=t._canvas){const s=i.getContext("2d",$e);let n=0,o="",a="";const h=Object.create(null),{letterSpacing:l,whiteSpace:u}=r,c=t.collapseSpaces(u),d=t.collapseNewlines(u);let p=!c;const f=r.wordWrapWidth+l,m=t.tokenize(e);for(let e=0;e<m.length;e++){let i=m[e];if(t.isNewline(i)){if(!d){a+=t.addLine(o),p=!c,o="",n=0;continue}i=" "}if(c){const e=t.isBreakingSpace(i),r=t.isBreakingSpace(o[o.length-1]);if(e&&r)continue}const u=t.getFromCache(i,l,h,s);if(u>f)if(""!==o&&(a+=t.addLine(o),o="",n=0),t.canBreakWords(i,r.breakWords)){const e=t.wordWrapSplit(i);for(let u=0;u<e.length;u++){let c=e[u],d=c,m=1;for(;e[u+m];){const s=e[u+m];if(t.canBreakChars(d,s,i,u,r.breakWords))break;c+=s,d=s,m++}u+=m-1;const g=t.getFromCache(c,l,h,s);g+n>f&&(a+=t.addLine(o),p=!1,o="",n=0),o+=c,n+=g}}else{o.length>0&&(a+=t.addLine(o),o="",n=0);const r=e===m.length-1;a+=t.addLine(i,!r),p=!1,o="",n=0}else u+n>f&&(p=!1,a+=t.addLine(o),o="",n=0),(o.length>0||!t.isBreakingSpace(i)||p)&&(o+=i,n+=u)}return a+=t.addLine(o,!1),a}static addLine(e,r=!0){return e=t.trimRight(e),r?`${e}\n`:e}static getFromCache(e,r,i,s){let n=i[e];return"number"!=typeof n&&(n=t._measureText(e,r,s)+r,i[e]=n),n}static collapseSpaces(t){return"normal"===t||"pre-line"===t}static collapseNewlines(t){return"normal"===t}static trimRight(e){if("string"!=typeof e)return"";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return"string"==typeof e&&t._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,r){return"string"==typeof e&&t._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const r=[];let i="";if("string"!=typeof e)return r;for(let s=0;s<e.length;s++){const n=e[s],o=e[s+1];t.isBreakingSpace(n,o)||t.isNewline(n)?(""!==i&&(r.push(i),i=""),r.push(n)):i+=n}return""!==i&&r.push(i),r}static canBreakWords(t,e){return e}static canBreakChars(t,e,r,i,s){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const r={ascent:0,descent:0,fontSize:0},i=t._canvas,s=t._context;s.font=e;const n=t.METRICS_STRING+t.BASELINE_SYMBOL,o=Math.ceil(s.measureText(n).width);let a=Math.ceil(s.measureText(t.BASELINE_SYMBOL).width);const h=Math.ceil(t.HEIGHT_MULTIPLIER*a);if(a=a*t.BASELINE_MULTIPLIER|0,0===o||0===h)return t._fonts[e]=r,r;i.width=o,i.height=h,s.fillStyle="#f00",s.fillRect(0,0,o,h),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(n,0,a);const l=s.getImageData(0,0,o,h).data,u=l.length,c=4*o;let d=0,p=0,f=!1;for(d=0;d<a;++d){for(let t=0;t<c;t+=4)if(255!==l[p+t]){f=!0;break}if(f)break;p+=c}for(r.ascent=a-d,p=u-c,f=!1,d=h;d>a;--d){for(let t=0;t<c;t+=4)if(255!==l[p+t]){f=!0;break}if(f)break;p-=c}return r.descent=d-a,r.fontSize=r.ascent+r.descent,t._fonts[e]=r,r}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const r=new OffscreenCanvas(0,0);if(r.getContext("2d",$e)?.measureText)return t.__canvas=r,r;e=i.W0.ADAPTER.createCanvas()}catch{e=i.W0.ADAPTER.createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",$e)),t.__context}};Ye.METRICS_STRING="|ÃqÃ
",Ye.BASELINE_SYMBOL="M",Ye.BASELINE_MULTIPLIER=1.4,Ye.HEIGHT_MULTIPLIER=2,Ye.graphemeSegmenter=(()=>
2{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>[...t.segment(e)].map(t=>t.segment)}return t=>[...t]})(),Ye.experimentalLetterSpacing=!1,Ye._fonts={},Ye._newlines=[10,13],Ye._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let qe=Ye;const Ke=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Qe=class t{constructor(t){this.styleID=0,this.reset(),tr(this,t,t)}clone(){const e={};return tr(e,this,t.defaultStyle),new t(e)}reset(){tr(this,t.defaultStyle,t.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=Je(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=Je(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=Je(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t="number"==typeof this.fontSize?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let t=e.length-1;t>=0;t--){let r=e[t].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!Ke.includes(r)&&(r=`"${r}"`),e[t]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};Qe.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:ze.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Ze=Qe;function Je(t){const e=i.Q1.shared,r=t=>{const r=e.setValue(t);return 1===r.alpha?r.toHex():r.toRgbaString()};return Array.isArray(t)?t.map(r):r(t)}function tr(t,e,r){for(const i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}const er={texture:!0,children:!1,baseTexture:!0},rr=class t extends p{constructor(e,r,s){let n=!1;s||(s=i.W0.ADAPTER.createCanvas(),n=!0),s.width=3,s.height=3;const o=i.gP.from(s);o.orig=new i.M_,o.trim=new i.M_,super(o),this._ownCanvas=n,this.canvas=s,this.context=s.getContext("2d",{willReadFrequently:!0}),this._resolution=t.defaultResolution??i.W0.RESOLUTION,this._autoResolution=t.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=r,this.localStyleID=-1}static get experimentalLetterSpacing(){return qe.experimentalLetterSpacing}static set experimentalLetterSpacing(t){i.Wp.deprecation("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),qe.experimentalLetterSpacing=t}updateText(t){const e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;this._font=this._style.toFontString();const r=this.context,s=qe.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),n=s.width,o=s.height,a=s.lines,h=s.lineHeight,l=s.lineWidths,u=s.maxLineWidth,c=s.fontProperties;let d,p;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,n)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+2*e.padding)*this._resolution),r.scale(this._resolution,this._resolution),r.clearRect(0,0,this.canvas.width,this.canvas.height),r.font=this._font,r.lineWidth=e.strokeThickness,r.textBaseline=e.textBaseline,r.lineJoin=e.lineJoin,r.miter
2Limit=e.miterLimit;const f=e.dropShadow?2:1;for(let t=0;t<f;++t){const n=e.dropShadow&&0===t,f=n?Math.ceil(Math.max(1,o)+2*e.padding):0,m=f*this._resolution;if(n){r.fillStyle="black",r.strokeStyle="black";const t=e.dropShadowColor,s=e.dropShadowBlur*this._resolution,n=e.dropShadowDistance*this._resolution;r.shadowColor=i.Q1.shared.setValue(t).setAlpha(e.dropShadowAlpha).toRgbaString(),r.shadowBlur=s,r.shadowOffsetX=Math.cos(e.dropShadowAngle)*n,r.shadowOffsetY=Math.sin(e.dropShadowAngle)*n+m}else r.fillStyle=this._generateFillStyle(e,a,s),r.strokeStyle=e.stroke,r.shadowColor="black",r.shadowBlur=0,r.shadowOffsetX=0,r.shadowOffsetY=0;let g=(h-c.fontSize)/2;h-c.fontSize<0&&(g=0);for(let t=0;t<a.length;t++)d=e.strokeThickness/2,p=e.strokeThickness/2+t*h+c.ascent+g,"right"===e.align?d+=u-l[t]:"center"===e.align&&(d+=(u-l[t])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(a[t],d+e.padding,p+e.padding-f,!0),e.fill&&this.drawLetterSpacing(a[t],d+e.padding,p+e.padding-f)}this.updateTexture()}drawLetterSpacing(t,e,r,i=!1){const s=this._style.letterSpacing;let n=!1;if(qe.experimentalLetterSpacingSupported&&(qe.experimentalLetterSpacing?(this.context.letterSpacing=`${s}px`,this.context.textLetterSpacing=`${s}px`,n=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),0===s||n)return void(i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r));let o=e;const a=qe.graphemeSegmenter(t);let h=this.context.measureText(t).width,l=0;for(let t=0;t<a.length;++t){const e=a[t];i?this.context.strokeText(e,o,r):this.context.fillText(e,o,r);let n="";for(let e=t+1;e<a.length;++e)n+=a[e];l=this.context.measureText(n).width,o+=h-l+s,h=l}}updateTexture(){const t=this.canvas;if(this._style.trim){const e=i.Wp.trimCanvas(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}const e=this._texture,r=this._style,s=r.trim?0:r.padding,n=e.baseTexture;e.trim.width=e._frame.width=t.width/this._resolution,e.trim.height=e._frame.height=t.height/this._resolution,e.trim.x=-s,e.trim.y=-s,e.orig.width=e._frame.width-2*s,e.orig.height=e._frame.height-2*s,this._onTextureUpdate(),n.setRealSize(t.width,t.height,this._resolution),e.updateUvs(),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(t,e){return this.updateText(!0),-1===this._textureID&&(t=!1),super.getBounds(t,e)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds.call(this,t)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(t,e,r){const i=t.fill;if(!Array.isArray(i))return i;if(1===i.length)return i[0];let s;const n=t.dropShadow?t.dropShadowDistance:0,o=t.padding||0,a=this.canvas.width/this._resolution-n-2*o,h=this.canvas.height/this._resolution-n-2*o,l=i.slice(),u=t.fillGradientStops.slice();if(!u.length){const t=l.length+1;for(let e=1;e<t;++e)u.push(e/t)}if(l.unshift(i[0]),u.unshift(0),l.push(i[i.length-1]),u.push(1),t.fillGradientType===ze.LINEAR_VERTICAL){s=this.context.createLinearGradient(a/2,o,a/2,h+o);const i=r.fontProperties.fontSize+t.strokeThickness;for(let t=0;t<e.length;t++){const n=r.lineHeight*(t-1)+i,o=r.lineHeight*t;let a=o;t>0&&n>o&&(a=(o+n)/2);const c=o+i,d=r.lineHeight*(t+1);let p=c;t+1<e.length&&d<c&&(p=(c+d)/2);const f=(p-a)/h;for(let t=0;t<l.length;t++){let e=0;e="number"==typeof u[t]?u[t]:t/l.length;let r=Math.min(1,Math.max(0,a/h+e*f));r=Number(r.toFixed(5)),s.addColorStop(r,l[t])}}}else{s=this.context.createLinearGradient(o,h/2,a+o,h/2);const t=l.length+1;let e=1;for(let r=0;r<l.length;r++){let i;i="number"==typeof u[r]?u[r]:e/t,s.addColorStop(i,l[r]),e++}}return s}destroy(t){"boolean"==typeof t&&(t={children:t}),t=Object.assign({},er,t),super.destroy(t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this.updateText(!0);const e=i.Wp.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this.updateText(!0);const e=i.Wp.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get style(){return this._style}set style(t){t=t||{},this._style=t instanceof Ze?t:new Ze(t),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}};rr.defaultAutoResolution=!0;let ir=rr;class sr{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function nr(t,e){let r=!1;if(t?._textures?.length)for(let s=0;s<t._textures.length;s++)if(t._textures[s]instanceof i.gP){const i=t._textures[s].baseTexture;e.includes(i)||(e.push(i),r=!0)}return r}function or(t,e){if(t.baseTexture instanceof i.t5){const r=t.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function ar(t,e){if(t._texture&&t._texture instanceof i.gP){const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function hr(t,e){return e instanceof ir&&(e.updateText(!0),!0)}function lr(t,e){if(e instanceof Ze){const t=e.toFontString();return qe.measureFont(t),!0}return!1}function ur(t,e){if(t instanceof ir){e.includes(t.style)||e.push(t.style),e.includes(t)||e.push(t);const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function cr(t,e){return t instanceof Ze&&(e.includes(t)||e.push(t),!0)}const dr=class t{constructor(e){this.limiter=new sr(t.uploadsPerFrame),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(ur),this.registerFindHook(cr),this.registerFindHook(nr),this.registerFindHook(or),this.registerFindHook(ar),this.registerUploadHook(hr),this.registerUploadHook(lr)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,i.Rv.system.addOnce(this.tick,this,i.dQ.UTILITY))):e()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed)for(let r=0,i=this.uploadHooks.length;r<i;r++)if(this.uploadHooks[r](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)i.Rv.system.addOnce(this.tick,this,i.dQ.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,r=t.length;e<r;e++)t[e]()}}registerFindHook(t){return t&&this.addHooks.push(t),this}registerUploadHook(t){return t&&this.uploadHooks.push(t),this}add(t){for(let e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof u)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&i.Rv.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};dr.uploadsPerFrame=4;let pr=dr;function fr(t,e){return e instanceof i.t5&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function mr(t,e){if(!(e instanceof Le))return!1;const{geometry:r}=e;e.finishPoly(),r.updateBatches();const{batches:i}=r;for(let e=0;e<i.length;e++){const{texture:r}=i[e].style;r&&fr(t,r.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function gr(t,e){return t instanceof Le&&(e.push(t),!0)}Object.defineProperties(i.W0,{UPLOADS_PER_FRAME:{get:()=>pr.uploadsPerFrame,set(t){i.Wp.deprecation("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),pr.uploadsPerFrame=t}}});class yr extends pr{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(gr),this.registerUploadHook(fr),this.registerUploadHook(mr)}}yr.extension={name:"prepare",type:i.Ag.RendererSystem},i.XO.add(yr),new i.bR;
2var _r="#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n";const vr=new i.uq;class xr extends i.Pt{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new i.X1,this.state=i.Uw.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=i.Mt.from(_r,"#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 texSample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = texSample * uColor;\n}\n",e),this.shader=t.context.webGLVersion>1?i.Mt.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
2)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",e):i.Mt.from(_r,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",e)}render(t){const e=this.renderer,r=this.quad;let s=r.vertices;s[0]=s[6]=t._width*-t.anchor.x,s[1]=s[3]=t._height*-t.anchor.y,s[2]=s[4]=t._width*(1-t.anchor.x),s[5]=s[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;s=r.uvs,s[0]=s[6]=-n,s[1]=s[3]=-o,s[2]=s[4]=1-n,s[5]=s[7]=1-o,r.invalidate();const a=t._texture,h=a.baseTexture,l=h.alphaMode>0,u=t.tileTransform.localTransform,c=t.uvMatrix;let d=h.isPowerOfTwo&&a.frame.width===h.width&&a.frame.height===h.height;d&&(h._glTextures[e.CONTEXT_UID]?d=h.wrapMode!==i.uR.CLAMP:h.wrapMode===i.uR.CLAMP&&(h.wrapMode=i.uR.REPEAT));const p=d?this.simpleShader:this.shader,f=a.width,m=a.height,g=t._width,y=t._height;vr.set(u.a*f/g,u.b*f/y,u.c*m/g,u.d*m/y,u.tx/g,u.ty/y),vr.invert(),d?vr.prepend(c.mapCoord):(p.uniforms.uMapCoord=c.mapCoord.toArray(!0),p.uniforms.uClampFrame=c.uClampFrame,p.uniforms.uClampOffset=c.uClampOffset),p.uniforms.uTransform=vr.toArray(!0),p.uniforms.uColor=i.Q1.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(p.uniforms.uColor),p.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),p.uniforms.uSampler=a,e.shader.bind(p),e.geometry.bind(r),this.state.blendMode=i.Wp.correctBlendMode(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}xr.extension={name:"tilingSprite",type:i.Ag.RendererPlugin},i.XO.add(xr);const br=class t{constructor(t,e,r){this.linkedSheets=[],(t instanceof i.t5||t instanceof i.gP)&&(t={texture:t,data:e,resolutionFilename:r});const{texture:s,data:n,resolutionFilename:o=null,cachePrefix:a=""}=t;this.cachePrefix=a,this._texture=s instanceof i.gP?s:null,this.baseTexture=s instanceof i.t5?s:this._texture.baseTexture,this.textures={},this.animations={},this.data=n;const h=this.baseTexture.resource;this.resolution=this._updateResolution(o||(h?h.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let r=i.Wp.getResolutionOfUrl(t,null);return null===r&&(r="number"==typeof e?e:parseFloat(e??"1")),1!==r&&this.baseTexture.setResolution(r),r}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let r=e;const s=t.BATCH_SIZE;for(;r-e<s&&r<this._frameKeys.length;){const t=this._frameKeys[r],e=this._frames[t],s=e.frame;if(s){let r=null,n=null;const o=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,a=new i.M_(0,0,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution);r=e.rotated?new i.M_(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):new i.M_(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(n=new i.M_(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[t]=new i.gP(this.baseTexture,r,a,n,e.rotated?2:0,e.anchor,e.borders),i.gP.addToCache(this.textures[t],this.cachePrefix+t.toString())}r++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let r=0;r<t[e].length;r++){const i=t[e][r];this.animations[e].push(this.textures[i])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};br.BATCH_SIZE=1e3;let Er=br;const Tr=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function Ar(t,e,r){const s={};if(t.forEach(t=>{s[t]=e}
2),Object.keys(e.textures).forEach(t=>{s[`${e.cachePrefix}${t}`]=e.textures[t]}),!r){const r=i.Wp.path.dirname(t[0]);e.linkedSheets.forEach((t,i)=>{Object.assign(s,Ar([`${r}/${e.data.meta.related_multi_packs[i]}`],t,!0))})}return s}const wr={extension:i.Ag.Asset,cache:{test:t=>t instanceof Er,getCacheableAssets:(t,e)=>Ar(t,e,!1)},resolver:{test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),i=e.pop();return"json"===r&&Tr.includes(i)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(i.W0.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:i.Ag.LoadParser,priority:Q.Normal},testParse:async(t,e)=>".json"===i.Wp.path.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,r){const{texture:s,imageFilename:n,cachePrefix:o}=e?.data??{};let a,h=i.Wp.path.dirname(e.src);if(h&&h.lastIndexOf("/")!==h.length-1&&(h+="/"),s&&s.baseTexture)a=s;else{const i=kt(h+(n??t.meta.image),e.src);a=(await r.load([i]))[i]}const l=new Er({texture:a.baseTexture,data:t,resolutionFilename:e.src,cachePrefix:o});await l.parse();const u=t?.meta?.related_multi_packs;if(Array.isArray(u)){const t=[];for(const i of u){if("string"!=typeof i)continue;let s=h+i;e.data?.ignoreMultiPack||(s=kt(s,e.src),t.push(r.load({src:s,data:{ignoreMultiPack:!0}})))}const i=await Promise.all(t);l.linkedSheets=i,i.forEach(t=>{t.linkedSheets=[l].concat(l.linkedSheets.filter(e=>e!==t))})}return l},unload(t){t.destroy(!0)}}};i.XO.add(wr);class Sr{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Rr{static test(t){return"string"==typeof t&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const t in e){const i=e[t].match(/^[a-z]+/gm)[0],s=e[t].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={};for(const t in s){const e=s[t].split("="),r=e[0],i=e[1].replace(/"/gm,""),o=parseFloat(i),a=isNaN(o)?i:o;n[r]=a}r[i].push(n)}const i=new Sr;return r.info.forEach(t=>i.info.push({face:t.face,size:parseInt(t.size,10)})),r.common.forEach(t=>i.common.push({lineHeight:parseInt(t.lineHeight,10)})),r.page.forEach(t=>i.page.push({id:parseInt(t.id,10),file:t.file})),r.char.forEach(t=>i.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})),r.kerning.forEach(t=>i.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})),r.distanceField.forEach(t=>i.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})),i}}class Ir{static test(t){const e=t;return"string"!=typeof t&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")}static parse(t){const e=new Sr,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),s=t.getElementsByTagName("page"),n=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField");for(let t=0;t<r.length;t++)e.info.push({face:r[t].getAttribute("face"),size:parseInt(r[t].getAttribute("size"),10)});for(let t=0;t<i.length;t++)e.common.push({lineHeight:parseInt(i[t].getAttribute("lineHeight"),10)});for(let t=0;t<s.length;t++)e.page.push({id:parseInt(s[t].getAttribute("id"),10)||0,file:s[t].getAttribute("file")});for(let t=0;t<n.length;t++){const r=n[t];e.char.push({id:parseInt(r.getAttribute("id"),10),page:parseInt(r.getAttribute("page"),10)||0,x:parseInt(r.getAttribute("x"),10),y:parseInt(r.getAttribute("y"),10),width:parseInt(r.getAttribute("width"),10),height:parseInt(r.getAttribute("height"),10),xoffset:parseInt(r.getAttribute("xoffset"),10),yoffset:parseInt(r.getAttribute("yoffset"),10),xadvance:parseInt(r.getAttribute("xadvance"),10)})}for(let t=0;t<o.length;t++)e.kerning.push({first:parseInt(o[t].getAttribute("first"),10),second:parseInt(o[t].getAttribute("second"),10),amount:parseInt(o[t].getAttribute("amount"),10)});for(let t=0;t<a.length;
2t++)e.distanceField.push({fieldType:a[t].getAttribute("fieldType"),distanceRange:parseInt(a[t].getAttribute("distanceRange"),10)});return e}}class Cr{static test(t){return!("string"!=typeof t||!t.includes("<font>"))&&Ir.test(i.W0.ADAPTER.parseXML(t))}static parse(t){return Ir.parse(i.W0.ADAPTER.parseXML(t))}}const Pr=[Rr,Ir,Cr];function Mr(t,e,r,s,n,o,a){const h=r.text,l=r.fontProperties;e.translate(s,n),e.scale(o,o);const u=a.strokeThickness/2,c=-a.strokeThickness/2;if(e.font=a.toFontString(),e.lineWidth=a.strokeThickness,e.textBaseline=a.textBaseline,e.lineJoin=a.lineJoin,e.miterLimit=a.miterLimit,e.fillStyle=function(t,e,r,i,s,n){const o=r.fill;if(!Array.isArray(o))return o;if(1===o.length)return o[0];let a;const h=r.dropShadow?r.dropShadowDistance:0,l=r.padding||0,u=t.width/i-h-2*l,c=t.height/i-h-2*l,d=o.slice(),p=r.fillGradientStops.slice();if(!p.length){const t=d.length+1;for(let e=1;e<t;++e)p.push(e/t)}if(d.unshift(o[0]),p.unshift(0),d.push(o[o.length-1]),p.push(1),r.fillGradientType===ze.LINEAR_VERTICAL){a=e.createLinearGradient(u/2,l,u/2,c+l);let t=0;const i=(n.fontProperties.fontSize+r.strokeThickness)/c;for(let e=0;e<s.length;e++){const r=n.lineHeight*e;for(let e=0;e<d.length;e++){let s=0;s="number"==typeof p[e]?p[e]:e/d.length;const n=r/c+s*i;let o=Math.max(t,n);o=Math.min(o,1),a.addColorStop(o,d[e]),t=o}}}else{a=e.createLinearGradient(l,c/2,u+l,c/2);const t=d.length+1;let r=1;for(let e=0;e<d.length;e++){let i;i="number"==typeof p[e]?p[e]:r/t,a.addColorStop(i,d[e]),r++}}return a}(t,e,a,o,[h],r),e.strokeStyle=a.stroke,a.dropShadow){const t=a.dropShadowColor,r=a.dropShadowBlur*o,s=a.dropShadowDistance*o;e.shadowColor=i.Q1.shared.setValue(t).setAlpha(a.dropShadowAlpha).toRgbaString(),e.shadowBlur=r,e.shadowOffsetX=Math.cos(a.dropShadowAngle)*s,e.shadowOffsetY=Math.sin(a.dropShadowAngle)*s}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;a.stroke&&a.strokeThickness&&e.strokeText(h,u,c+r.lineHeight-l.descent),a.fill&&e.fillText(h,u,c+r.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Dr(t){return Array.from?Array.from(t):t.split("")}function Or(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}const Br=class t{constructor(t,e,r){const[s]=t.info,[n]=t.common,[o]=t.page,[a]=t.distanceField,h=i.Wp.getResolutionOfUrl(o.file),l={};this._ownsTextures=r,this.font=s.face,this.size=s.size,this.lineHeight=n.lineHeight/h,this.chars={},this.pageTextures=l;for(let r=0;r<t.page.length;r++){const{id:s,file:n}=t.page[r];l[s]=e instanceof Array?e[r]:e[n],a?.fieldType&&"none"!==a.fieldType&&(l[s].baseTexture.alphaMode=i.Gk.NO_PREMULTIPLIED_ALPHA,l[s].baseTexture.mipmap=i.E8.OFF)}for(let e=0;e<t.char.length;e++){const{id:r,page:s}=t.char[e];let{x:n,y:o,width:a,height:u,xoffset:c,yoffset:d,xadvance:p}=t.char[e];n/=h,o/=h,a/=h,u/=h,c/=h,d/=h,p/=h;const f=new i.M_(n+l[s].frame.x/h,o+l[s].frame.y/h,a,u);this.chars[r]={xOffset:c,yOffset:d,xAdvance:p,kerning:{},texture:new i.gP(l[s].baseTexture,f),page:s}}for(let e=0;e<t.kerning.length;e++){let{first:r,second:i,amount:s}=t.kerning[e];r/=h,i/=h,s/=h,this.chars[i]&&(this.chars[i].kerning[r]=s)}this.distanceFieldRange=a?.distanceRange,this.distanceFieldType=a?.fieldType?.toLowerCase()??"none"}destroy(){for(const t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(const t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null}static install(e,r,s){let n;if(e instanceof Sr)n=e;else{const t=function(t){for(let e=0;e<Pr.length;e++)if(Pr[e].test(t))return Pr[e];return null}(e);if(!t)throw new Error("Unrecognized data format for font.");n=t.parse(e)}r instanceof i.gP&&(r=[r]);const o=new t(n,r,s);return t.available[o.font]=o,o}static uninstall(e){const r=t.available[e];if(!r)throw new Error(`No font found named '${e}'`);r.destroy(),delete t.available[e]}static from(e,r,s){if(!e)throw new Error("[BitmapFont] Property `name` is required.");const{chars:n,padding:o,resolution:a,textureWidth:h,textureHeight:l,...u}=Object.assign({},t.defaultOptions,s),c=function(t){"string"==typeof t&&(t=[t]);const e=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];
2if(Array.isArray(i)){if(2!==i.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);const t=i[0].charCodeAt(0),r=i[1].charCodeAt(0);if(r<t)throw new Error("[BitmapFont]: Invalid character range.");for(let i=t,s=r;i<=s;i++)e.push(String.fromCharCode(i))}else e.push(...Dr(i))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(n),d=r instanceof Ze?r:new Ze(r),p=h,f=new Sr;f.info[0]={face:d.fontFamily,size:d.fontSize},f.common[0]={lineHeight:d.fontSize};let m,g,y,_=0,v=0,x=0;const b=[],E=[];for(let t=0;t<c.length;t++){m||(m=i.W0.ADAPTER.createCanvas(),m.width=h,m.height=l,g=m.getContext("2d"),y=new i.t5(m,{resolution:a,...u}),b.push(y),E.push(new i.gP(y)),f.page.push({id:E.length-1,file:""}));const e=c[t],r=qe.measureText(e,d,!1,m),s=r.width,n=Math.ceil(r.height),T=Math.ceil(("italic"===d.fontStyle?2:1)*s);if(v>=l-n*a){if(0===v)throw new Error(`[BitmapFont] textureHeight ${l}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${e}')`);--t,m=null,g=null,y=null,v=0,_=0,x=0;continue}if(x=Math.max(n+r.fontProperties.descent,x),T*a+_>=p){if(0===_)throw new Error(`[BitmapFont] textureWidth ${h}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${e}')`);--t,v+=x*a,v=Math.ceil(v),_=0,x=0;continue}Mr(m,g,r,_,v,a,d);const A=Or(r.text);f.char.push({id:A,page:E.length-1,x:_/a,y:v/a,width:T,height:n,xoffset:0,yoffset:0,xadvance:s-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),_+=(T+2*o)*a,_=Math.ceil(_)}if(!s?.skipKerning)for(let t=0,e=c.length;t<e;t++){const r=c[t];for(let t=0;t<e;t++){const e=c[t],i=g.measureText(r).width,s=g.measureText(e).width,n=g.measureText(r+e).width-(i+s);n&&f.kerning.push({first:Or(r),second:Or(e),amount:n})}}const T=new t(f,E,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=T,T}};Br.ALPHA=[["a","z"],["A","Z"]," "],Br.NUMERIC=[["0","9"]],Br.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],Br.ASCII=[[" ","~"]],Br.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Br.ALPHANUMERIC},Br.available={};let Nr=Br;const Lr=[],Fr=[],kr=[];(class t extends u{constructor(e,r={}){super();const{align:s,tint:n,maxWidth:o,letterSpacing:a,fontName:h,fontSize:l}=Object.assign({},t.styleDefaults,r);if(!Nr.available[h])throw new Error(`Missing BitmapFont "${h}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new i.Q1(n),this._font=void 0,this._fontName=h,this._fontSize=l,this.text=e,this._maxWidth=o,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new i.oA(()=>{this.dirty=!0},this,0,0),this._roundPixels=i.W0.ROUND_PIXELS,this.dirty=!0,this._resolution=i.W0.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){const t=Nr.available[this._fontName],e=this.fontSize,r=e/t.size,s=new i.bR,n=[],o=[],a=[],h=Dr(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),l=this._maxWidth*t.size/e,u="none"===t.distanceFieldType?Lr:Fr;let c=null,d=0,p=0,f=0,m=-1,g=0,y=0,_=0,v=0;for(let e=0;e<h.length;e++){const r=h[e],u=Or(r);if(/(?:\s)/.test(r)&&(m=e,g=d,v++),"\r"===r||"\n"===r){o.push(d),a.push(-1),p=Math.max(p,d),++f,++y,s.x=0,s.y+=t.lineHeight,c=null,v=0;continue}const x=t.chars[u];if(!x)continue;c&&x.kerning[c]&&(s.x+=x.kerning[c]);const b=kr.pop()||{texture:i.gP.EMPTY,line:0,charCode:0,prevSpaces:0,position:new i.bR};b.texture=x.texture,b.line=f,b.charCode=u,b.position.x=Math.round(s.x+x.xOffset+this._letterSpacing/2),b.position.y=Math.round(s.y+x.yOffset),b.prevSpaces=v,n.push(b),d=b.position.x+Math.max(x.xAdvance-x.xOffset,x.texture.orig.width),s.x+=x.xAdvance+this._letterSpacing,_=Math.max(_,x.yOffset+x.texture.height),c=u,-1!==m&&l>0&&s.x>l&&(++y,i.Wp.removeItems(n,1+m-y,1+e-m),e=m,m=-1,o.push(g),a.push(n.length>0?n[n.length-1].prevSpaces:0),p=Math.max(p,g),f++,s.x=0,s.y+=t.lineHeight,c=null,v=0)}const x=h[h.length-1];"\r"!==x&&"\n"!==x&&(/(?:\s)/.test(x)&&(d=g),o.push(d),p=Math.max(p,d),a.push(-1));const b=[];for(let t=0;t<=f;t++){let e=0;"right"===this._align?e=p-o[t]:"center"===this._align?e=(p-o[t])/2:"justify"===this._align&&(e=a[t]<0?0:(p-o[t])/a[t]),b.push(e)}const E=n.length,T={},A=[],w=this._activePagesMeshData;u.push(...w);for(let e=0;e<E;e++){const r=n[e].texture,s=r.baseTexture.uid;if(!T[s]){let e=u.pop();if(!e){const r=new je;let s,n;"none"===t.distanceFieldType?(s=new We(i.gP.EMPTY),n=i.B9.NORMAL):(s=new We(i.gP.EMPTY,{program:i.BP.from("// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
2)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n","// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n if (median < 0.01) {\r\n alpha = 0.0;\r\n } else if (median > 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // Gamma correction for coverage-like alpha\r\n float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n float gamma = mix(1.0, 1.0 / 2.2, luma);\r\n float coverage = pow(uColor.a * alpha, gamma); \r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, coverage);\r\n}\r\n"),uniforms:{uFWidth:0}}),n=i.B9.NORMAL_NPM);const o=new He(r,s);o.blendMode=n,e={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:o,vertices:null,uvs:null,indices:null}}e.index=0,e.indexCount=0,e.vertexCount=0,e.uvsCount=0,e.total=0;const{_textureCache:n}=this;n[s]=n[s]||new i.gP(r.baseTexture),e.mesh.texture=n[s],e.mesh.tint=this._tintColor.value,A.push(e),T[s]=e}T[s].total++}for(let t=0;t<w.length;t++)A.includes(w[t])||this.removeChild(w[t].mesh);for(let t=0;t<A.length;t++)A[t].mesh.parent!==this&&this.addChild(A[t].mesh);this._activePagesMeshData=A;for(const t in T){const e=T[t],r=e.total;if(!(e.indices?.length>6*r)||e.vertices.length<2*He.BATCHABLE_SIZE)e.vertices=new Float32Array(8*r),e.uvs=new Float32Array(8*r),e.indices=new Uint16Array(6*r);else{const t=e.total,r=e.vertices;for(let e=4*t*2;e<r.length;e++)r[e]=0}e.mesh.size=6*r}for(let t=0;t<E;t++){const e=n[t];let i=e.position.x+b[e.line]*("justify"===this._align?e.prevSpaces:1);this._roundPixels&&(i=Math.round(i));const s=i*r,o=e.position.y*r,a=e.texture,h=T[a.baseTexture.uid],l=a.frame,u=a._uvs,c=h.index++;h.indices[6*c+0]=0+4*c,h.indices[6*c+1]=1+4*c,h.indices[6*c+2]=2+4*c,h.indices[6*c+3]=0+4*c,h.indices[6*c+4]=2+4*c,h.indices[6*c+5]=3+4*c,h.vertices[8*c+0]=s,h.vertices[8*c+1]=o,h.vertices[8*c+2]=s+l.width*r,h.vertices[8*c+3]=o,h.vertices[8*c+4]=s+l.width*r,h.vertices[8*c+5]=o+l.height*r,h.vertices[8*c+6]=s,h.vertices[8*c+7]=o+l.height*r,h.uvs[8*c+0]=u.x0,h.uvs[8*c+1]=u.y0,h.uvs[8*c+2]=u.x1,h.uvs[8*c+3]=u.y1,h.uvs[8*c+4]=u.x2,h.uvs[8*c+5]=u.y2,h.uvs[8*c+6]=u.x3,h.uvs[8*c+7]=u.y3}this._textWidth=p*r,this._textHeight=(s.y+t.lineHeight)*r;for(const t in T){const e=T[t];if(0!==this.anchor.x||0!==this.anchor.y){let t=0;const r=this._textWidth*this.anchor.x,i=this._textHeight*this.anchor.y;for(let s=0;s<e.total;s++)e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i}this._maxLineHeight=_*r;const i=e.mesh.geometry.getBuffer("aVertexPosition"),s=e.mesh.geometry.getBuffer("aTextureCoord"),n=e.mesh.geometry.getIndex();i.data=e.vertices,s.data=e.uvs,n.data=e.indices,i.update(),s.update(),n.update()}for(let t=0;t<n.length;t++)kr.push(n[t]);this._font=t,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);const{distanceFieldRange:e,distanceFieldType:r,size:i}=Nr.available[this._fontName];if("none"!==r){const{a:r,b:s,c:n,d:o}=this.worldTransform,a=Math.sqrt(r*r+s*s),h=Math.sqrt(n*n+o*o),l=(Math.abs(a)+Math.abs(h))/2,u=this.fontSize/i,c=t._view.resolution;for(const t of this._activePagesMeshData)t.mesh.shader.uniforms.uFWidth=l*e*u*c}super._render(t)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const t=Nr.available[this._fontName];if(!t)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(t){if(this.tint!==t){this._tintColor.setValue(t);for(let e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.dirty=!0)}get fontName(){return this._fontName}set fontName(t){if(!Nr.available[t])throw new Error(`Missing BitmapFont "${t}"`);this._fontName!==t&&(this._fontName=t,this.dirty=!0)}get fontSize(){return this._fontSize??Nr.available[this._fontName].size}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)}get anchor(){return this._anchor}
2set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}destroy(t){const{_textureCache:e}=this,r="none"===Nr.available[this._fontName].distanceFieldType?Lr:Fr;r.push(...this._activePagesMeshData);for(const t of this._activePagesMeshData)this.removeChild(t.mesh);this._activePagesMeshData=[],r.filter(t=>e[t.mesh.texture.baseTexture.uid]).forEach(t=>{t.mesh.texture=i.gP.EMPTY});for(const t in e)e[t].destroy(),delete e[t];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}}).styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const Ur=[".xml",".fnt"],Gr={extension:{type:i.Ag.LoadParser,priority:Q.Normal},name:"loadBitmapFont",test:t=>Ur.includes(i.Wp.path.extname(t).toLowerCase()),testParse:async t=>Rr.test(t)||Cr.test(t),async parse(t,e,r){const s=Rr.test(t)?Rr.parse(t):Cr.parse(t),{src:n}=e,{page:o}=s,a=[];for(let t=0;t<o.length;++t){const e=o[t].file;let r=i.Wp.path.join(i.Wp.path.dirname(n),e);r=kt(r,n),a.push(r)}const h=await r.load(a),l=a.map(t=>h[t]);return Nr.install(s,l,!0)},load:async(t,e)=>(await i.W0.ADAPTER.fetch(t)).text(),unload(t){t.destroy()}};i.XO.add(Gr);const Hr=class t extends Ze{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new t(Object.keys(t.defaultOptions).reduce((t,r)=>({...t,[r]:e[r]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,0===e.refs&&(e.fontFace&&document.fonts.delete(e.fontFace),delete t.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,r={}){const{availableFonts:s}=t;if(s[e]){const t=s[e];return this._fonts.push(t),t.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return i.W0.ADAPTER.fetch(e).then(t=>t.blob()).then(async t=>new Promise((e,r)=>{const i=URL.createObjectURL(t),s=new FileReader;s.onload=()=>e([i,s.result]),s.onerror=r,s.readAsDataURL(t)})).then(async([t,n])=>{const o=Object.assign({family:i.Wp.path.basename(e,i.Wp.path.extname(e)),weight:"normal",style:"normal",display:"auto",src:t,dataSrc:n,refs:1,originalUrl:e,fontFace:null},r);s[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...t){const e=t.filter(t=>!this._overrides.includes(t));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter(t=>this._overrides.includes(t));e.length>0&&(this._overrides=this._overrides.filter(t=>!e.includes(t)),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?["word-wrap: "+(this.breakWords?"break-all":"break-word"),`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((t,e)=>`${t}\n @font-face {\n font-family: "${e.family}";\n src: url('${e.dataSrc}');
2\n font-weight: ${e.weight};\n font-style: ${e.style};\n font-display: ${e.display};\n }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=i.Wp.rgb2hex(t)),"number"==typeof t?i.Wp.hex2string(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),i=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(255*e|0).toString(16).padStart(2,"0"));const s=`${r}px ${i}px`;return this.dropShadowBlur>0?`text-shadow: ${s} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${s} ${t}`}reset(){Object.assign(this,t.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=i.W0.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};Hr.availableFonts={},Hr.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let jr=Hr;const Wr=class t extends p{constructor(e="",r={}){super(i.gP.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,n=i.gP.from(s,{scaleMode:i.W0.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new i.M_,n.trim=new i.M_,this.texture=n;const o="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",h=document.createElementNS(o,"svg"),l=document.createElementNS(o,"foreignObject"),u=document.createElementNS(a,"div"),c=document.createElementNS(a,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",h.appendChild(l),this.maxWidth=t.defaultMaxWidth,this.maxHeight=t.defaultMaxHeight,this._domElement=u,this._styleElement=c,this._svgRoot=h,this._foreignObject=l,this._foreignObject.appendChild(c),this._foreignObject.appendChild(u),this._image=s,this._loadImage=new Image,this._autoResolution=t.defaultAutoResolution,this._resolution=t.defaultResolution??i.W0.RESOLUTION,this.text=e,this.style=r}measureText(t){const{text:e,style:r,resolution:i}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:r.toCSS(i)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);const s=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:n,height:o}=s;(n>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const a=Math.min(this.maxWidth,Math.ceil(n)),h=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",a.toString()),this._svgRoot.setAttribute("height",h.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:this._style?.toCSS(i)}),this._styleElement.textContent=this._style?.toGlobalCSS()),{width:a+2*r.padding,height:h+2*r.padding}}async updateText(t=!0){const{style:e,_image:r,_loadImage:i}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:s,height:n}=this.measureText();r.width=i.width=Math.ceil(Math.max(1,s)),r.height=i.height=Math.ceil(Math.max(1,n)),this._updateID++;const o=this._updateID;await new Promise(t=>{i.onload=async()=>{o<this._updateID||(await e.onBeforeDraw(),r.src=i.src,i.onload=null,i.src="",this.updateTexture()),t()};const s=(new XMLSerializer).serializeToString(this._svgRoot);i.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(s)}`})}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:r,resolution:i}=this,{padding:s}=t,{baseTexture:n}=e;e.trim.width=e._frame.width=r.width/i,e.trim.height=e._frame.height=r.height/i,e.trim.x=-s,e.trim.y=-s,e.orig.width=e._frame.width-2*s,e.orig.height=e._frame.height-2*s,this._onTextureUpdate(),n.setRealSize(r.width,r.height,i),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},t.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&this._style?.cleanFonts(),this._style=r,this._svgRoot?.remove(),this._svgRoot=r,this._domElement?.remove(),this._domElement=r,this._foreignObject?.remove(),this._foreignObject=r,this._styleElement?.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=i.Wp.sign(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=i.Wp.sign(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&((t=t||{})instanceof jr?(this.ownsStyle=!1,this._style=t):t instanceof Ze?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=jr.from(t)):(this.ownsStyle=!0,this._style=new jr(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(""===t||null==t?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};Wr.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Wr.defaultMaxWidth=2024,Wr.defaultMaxHeight=2024,Wr.defaultAutoResolution=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.