@phil65/demoreel 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +8 -5
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/args.js +1 -1
  4. package/dist/cli.js +3 -3
  5. package/dist/compose.d.ts +9 -1
  6. package/dist/compose.js +34 -2
  7. package/dist/idle.js +1 -1
  8. package/dist/index.d.ts +3 -3
  9. package/dist/index.js +2 -2
  10. package/dist/mcp.js +2 -2
  11. package/dist/project.d.ts +247 -11
  12. package/dist/project.js +244 -8
  13. package/dist/record.js +8 -0
  14. package/dist/renderer/assets/{CanvasPool-PBu3bHFZ.js → CanvasPool-SkgMbnEH.js} +1 -1
  15. package/dist/renderer/assets/{CanvasRenderer-HmF-4gyW.js → CanvasRenderer-CEGuSdsG.js} +1 -1
  16. package/dist/renderer/assets/{RenderTargetSystem-Dk1U4wDJ.js → RenderTargetSystem-um8Nv1HQ.js} +1 -1
  17. package/dist/renderer/assets/{WebGLRenderer-C0v9HBel.js → WebGLRenderer-BnY2xfDL.js} +1 -1
  18. package/dist/renderer/assets/{WebGPURenderer-Ce0-U9Q1.js → WebGPURenderer-D9KI_sD9.js} +1 -1
  19. package/dist/renderer/assets/{browserAll-DhvWQ7nM.js → browserAll-vQt6iTAv.js} +1 -1
  20. package/dist/renderer/assets/{canvasUtils-KRroregW.js → canvasUtils-CZLntkW8.js} +1 -1
  21. package/dist/renderer/assets/{getTexelRangeRects-D3pwCyRt.js → getTexelRangeRects-CRAnqulP.js} +1 -1
  22. package/dist/renderer/assets/{index-CE-lli1m.js → index-41-d13J1.js} +4 -4
  23. package/dist/renderer/assets/{init-DfmWKarH.js → init-D6nA7FlC.js} +1 -1
  24. package/dist/renderer/assets/webworkerAll-BEIrFubI.js +1 -0
  25. package/dist/renderer/index.html +1 -1
  26. package/dist/scene.d.ts +87 -1
  27. package/dist/scene.js +151 -1
  28. package/dist/types.d.ts +71 -1
  29. package/dist/voice.d.ts +8 -5
  30. package/dist/voice.js +43 -6
  31. package/package.json +2 -2
  32. package/skills/demoreel/SKILL.md +5 -1
  33. package/dist/renderer/assets/webworkerAll-B41hok0-.js +0 -1
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./browserAll-DhvWQ7nM.js","./init-DfmWKarH.js","./canvasUtils-KRroregW.js","./CanvasPool-PBu3bHFZ.js","./webworkerAll-B41hok0-.js","./WebGPURenderer-Ce0-U9Q1.js","./getTexelRangeRects-D3pwCyRt.js","./RenderTargetSystem-Dk1U4wDJ.js","./WebGLRenderer-C0v9HBel.js","./CanvasRenderer-HmF-4gyW.js"])))=>i.map(i=>d[i]);
2
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(let c of r(i))!a.call(e,c)&&c!==o&&(s=n(i,c),t(e,c,{get:s&&s.get&&!s.configurable?s.get:()=>i[c],enumerable:!s||s.enumerable}));return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=[{value:`none`,translationKey:`textAnimation.none`},{value:`fade`,translationKey:`textAnimation.fade`},{value:`rise`,translationKey:`textAnimation.rise`},{value:`pop`,translationKey:`textAnimation.pop`},{value:`slide-left`,translationKey:`textAnimation.slideLeft`},{value:`typewriter`,translationKey:`textAnimation.typewriter`},{value:`pulse`,translationKey:`textAnimation.pulse`}];function u(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function d(e){return 1-(1-u(e))**3}function f(e){let t=u(e);return 1+2.70158*(t-1)**3+1.70158*(t-1)**2}function p(e){return l.some(t=>t.value===e)?e:`none`}function m(e,t){let n=p(e.style.textAnimation);if(n===`none`)return{opacity:1,scale:1,translateX:0,translateY:0,revealProgress:1};let r=u(Math.max(0,t-e.startMs)/700),i=d(r);switch(n){case`fade`:return{opacity:i,scale:1,translateX:0,translateY:0,revealProgress:1};case`rise`:return{opacity:i,scale:1,translateX:0,translateY:(1-i)*18,revealProgress:1};case`pop`:return{opacity:i,scale:Math.max(.72,f(r)),translateX:0,translateY:0,revealProgress:1};case`slide-left`:return{opacity:i,scale:1,translateX:(1-i)*-28,translateY:0,revealProgress:1};case`typewriter`:return{opacity:1,scale:1,translateX:0,translateY:0,revealProgress:r};case`pulse`:return{opacity:1,scale:1+Math.sin(r*Math.PI)*.06,translateX:0,translateY:0,revealProgress:1};default:return{opacity:1,scale:1,translateX:0,translateY:0,revealProgress:1}}}var h=`picture-in-picture`,g=`rectangle`,_={rotationX:0,rotationY:0,rotationZ:0},v={iso:{rotationX:-10,rotationY:-16,rotationZ:0},left:{rotationX:0,rotationY:-22,rotationZ:0},right:{rotationX:0,rotationY:22,rotationZ:0}},y=2.6;function b(e,t){return Math.min(e,t)*y}function x(e){return e.rotationPreset?v[e.rotationPreset]:_}function S(e,t=.01){return Math.abs(e.rotationX)<t&&Math.abs(e.rotationY)<t&&Math.abs(e.rotationZ)<t}function C(e,t,n){return{rotationX:e.rotationX+(t.rotationX-e.rotationX)*n,rotationY:e.rotationY+(t.rotationY-e.rotationY)*n,rotationZ:e.rotationZ+(t.rotationZ-e.rotationZ)*n}}function w(e,t,n,r){let i=e.rotationX*Math.PI/180,a=e.rotationY*Math.PI/180,o=e.rotationZ*Math.PI/180,s=Math.cos(i),c=Math.sin(i),l=Math.cos(a),u=Math.sin(a),d=Math.cos(o),f=Math.sin(o),p=t/2,m=n/2,h=[[-p,-m],[p,-m],[p,m],[-p,m]],g=0,_=0;for(let[e,t]of h){let n=e,i=t,a=0,o=n*d-i*f,p=n*f+i*d;n=o,i=p;let m=n*l+a*u,h=-n*u+a*l;n=m,a=h;let v=i*s-a*c,y=i*c+a*s;if(i=v,a=y,r>0){let e=r-a;if(e<=0)return 1;let t=r/e;n*=t,i*=t}Math.abs(n)>g&&(g=Math.abs(n)),Math.abs(i)>_&&(_=Math.abs(i))}if(g===0||_===0)return 1;let v=p/g,y=m/_;return Math.min(v,y,1)}var T=.35,E={x:50,y:50},D={width:30,height:20},O={color:`#ffffff`,backgroundColor:`transparent`,fontSize:32,fontFamily:`Inter`,fontWeight:`bold`,fontStyle:`normal`,textDecoration:`none`,textAlign:`center`,textAnimation:`none`},k={arrowDirection:`right`,color:`#34B27B`,strokeWidth:4},ee=[{x:10,y:30},{x:25,y:10},{x:55,y:8},{x:82,y:20},{x:90,y:45},{x:78,y:72},{x:52,y:90},{x:22,y:84},{x:8,y:58}],te={type:`mosaic`,shape:`rectangle`,color:`white`,intensity:12,blockSize:12,freehandPoints:ee},A={x:0,y:0,width:1,height:1},j=.1;function ne(e){return Math.round(Math.min(16,Math.max(j,e))*100)/100}var re=1.5,ie={1:1.25,2:1.5,3:1.8,4:2.2,5:3.5,6:5};function ae(e){if(e.customScale!=null){let t=Math.max(1,Math.min(5,e.customScale));if(Number.isFinite(t))return t}return ie[e.depth]}function oe(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}function se(e){return`mosaic`}function ce(e){return e===`black`?`black`:`white`}function le(e){return oe(e?.intensity??12,2,40)}function ue(e,t=1){let n=oe(e?.blockSize??12,4,48);return Math.max(1,Math.round(n*Math.max(t,.01)))}function de(e){return ce(e?.color)===`black`?`rgba(0, 0, 0, 0.72)`:`rgba(255, 255, 255, 0.06)`}function fe(e,t){let n=e.width,r=e.height,i=e.data,a=Math.max(1,Math.floor(t));if(n<=0||r<=0||a<=1)return e;for(let e=0;e<r;e+=a)for(let t=0;t<n;t+=a){let o=Math.min(a,n-t),s=Math.min(a,r-e),c=o*s;if(c<=0)continue;let l=0,u=0,d=0,f=0;for(let r=e;r<e+s;r++)for(let e=t;e<t+o;e++){let t=(r*n+e)*4;l+=i[t],u+=i[t+1],d+=i[t+2],f+=i[t+3]}let p=Math.round(l/c),m=Math.round(u/c),h=Math.round(d/c),g=Math.round(f/c);for(let r=e;r<e+s;r++)for(let e=t;e<t+o;e++){let t=(r*n+e)*4;i[t]=p,i[t+1]=m,i[t+2]=h,i[t+3]=g}}return e}var pe=`default`,me=[{id:`hello-kitty-watermelon`,name:`Hello Kitty & Watermelon`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/hello-kitty-watermelon/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:.5},pointer:{assetPath:`cursors/hello-kitty-watermelon/pointer.png`,width:32,height:32,hotspotX:4,hotspotY:2}}},{id:`among-us-sus-knife-and-red-animated`,name:`Among Us Sus Knife & Red Animated`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/among-us-sus-knife-and-red-animated/arrow.png`,width:32,height:32,hotspotX:1.6,hotspotY:.96},pointer:{assetPath:`cursors/among-us-sus-knife-and-red-animated/pointer.png`,width:32,height:32,hotspotX:12,hotspotY:2}}},{id:`black-and-rainbow-stroke-gradient-animated`,name:`Black & Rainbow Stroke Gradient Animated`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/black-and-rainbow-stroke-gradient-animated/arrow.png`,width:32,height:32,hotspotX:1.6,hotspotY:.96},pointer:{assetPath:`cursors/black-and-rainbow-stroke-gradient-animated/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:1.5}}},{id:`black-pixel`,name:`Black Pixel`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/black-pixel/arrow.png`,width:32,height:32,hotspotX:2,hotspotY:3.5},pointer:{assetPath:`cursors/black-pixel/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:1.5}}},{id:`christmas-miles-morales`,name:`Christmas Miles Morales`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/christmas-miles-morales/arrow.png`,width:32,height:32,hotspotX:1,hotspotY:.5},pointer:{assetPath:`cursors/christmas-miles-morales/pointer.png`,width:32,height:32,hotspotX:5.5,hotspotY:3}}},{id:`hollow-knight-and-game-arrow`,name:`Hollow Knight & Game Arrow`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/hollow-knight-and-game-arrow/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/hollow-knight-and-game-arrow/pointer.png`,width:32,height:32,hotspotX:5,hotspotY:.5}}},{id:`hollow-knight-nail-sword-and-mask`,name:`Hollow Knight Nail Sword & Mask`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/hollow-knight-nail-sword-and-mask/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/hollow-knight-nail-sword-and-mask/pointer.png`,width:32,height:32,hotspotX:3.5,hotspotY:2}}},{id:`naruto-akatsuki-cloud-arrow`,name:`Naruto Akatsuki Cloud Arrow`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/naruto-akatsuki-cloud-arrow/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/naruto-akatsuki-cloud-arrow/pointer.png`,width:32,height:32,hotspotX:1,hotspotY:1}}},{id:`old-roblox`,name:`Old Roblox`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/old-roblox/arrow.png`,width:32,height:32,hotspotX:2.5,hotspotY:1.5},pointer:{assetPath:`cursors/old-roblox/pointer.png`,width:32,height:32,hotspotX:3.5,hotspotY:1.5}}},{id:`pink-glossy-arrow-and-hand-3d`,name:`Pink Glossy Arrow & Hand 3D`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/pink-glossy-arrow-and-hand-3d/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:1.5},pointer:{assetPath:`cursors/pink-glossy-arrow-and-hand-3d/pointer.png`,width:32,height:32,hotspotX:3,hotspotY:1}}},{id:`pinky-pixel`,name:`Pinky Pixel`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/pinky-pixel/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/pinky-pixel/pointer.png`,width:32,height:32,hotspotX:7,hotspotY:1}}},{id:`pokemon-neon-gengar`,name:`Pokemon Neon Gengar`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/pokemon-neon-gengar/arrow.png`,width:32,height:32,hotspotX:1,hotspotY:.5},pointer:{assetPath:`cursors/pokemon-neon-gengar/pointer.png`,width:32,height:32,hotspotX:2,hotspotY:2.5}}},{id:`sanrio-gudetama-and-arrow-kawaii`,name:`Sanrio Gudetama & Arrow Kawaii`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/sanrio-gudetama-and-arrow-kawaii/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/sanrio-gudetama-and-arrow-kawaii/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:4}}},{id:`spring-gradient`,name:`Spring Gradient`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/spring-gradient/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:.5},pointer:{assetPath:`cursors/spring-gradient/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:.5}}},{id:`mickey-mouse-black-hand-inflated-glove`,name:`Mickey Mouse Black Hand Inflated Glove`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/mickey-mouse-black-hand-inflated-glove/arrow.png`,width:32,height:32,hotspotX:2.5,hotspotY:.5},pointer:{assetPath:`cursors/mickey-mouse-black-hand-inflated-glove/pointer.png`,width:32,height:32,hotspotX:10,hotspotY:.5}}},{id:`sanrio-kuromi-skull-arrow`,name:`Sanrio Kuromi Skull Arrow`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/sanrio-kuromi-skull-arrow/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:.5},pointer:{assetPath:`cursors/sanrio-kuromi-skull-arrow/pointer.png`,width:32,height:32,hotspotX:9.5,hotspotY:1}}},{id:`solo-leveling-sung-jinwoo-dark-flames`,name:`Solo Leveling Sung Jinwoo Dark Flames`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/solo-leveling-sung-jinwoo-dark-flames/arrow.png`,width:32,height:32,hotspotX:2,hotspotY:1},pointer:{assetPath:`cursors/solo-leveling-sung-jinwoo-dark-flames/pointer.png`,width:32,height:32,hotspotX:7,hotspotY:4.5}}}],he=new Set([pe,...me.map(e=>e.id)]);function ge(e){return!e||e==="default"?null:me.find(t=>t.id===e)??null}function _e(e){return typeof e==`string`&&he.has(e)?e:pe}function ve(e){return e===`editable-overlay`||e===`system`?e:void 0}function ye(e){return typeof e==`string`&&e.trim()||void 0}function be(e){if(!e||typeof e!=`object`)return null;let t=e,n=ye(t.screenVideoPath);if(!n)return null;let r=ye(t.webcamVideoPath),i=ve(t.cursorCaptureMode);return{screenVideoPath:n,...r?{webcamVideoPath:r}:{},...i?{cursorCaptureMode:i}:{}}}var xe=class extends Error{constructor(e){super(`Unsafe asset path segment: ${e}`),this.name=`UnsafeAssetPathError`}},Se=class extends Error{constructor(){super(`electronAPI.assetBaseUrl is not available; preload did not load correctly`),this.name=`AssetBaseUnavailableError`}};function Ce(e){return e.replace(/^\/+/,``).split(`/`).filter(Boolean).map(e=>{let t=decodeURIComponent(e);if(t===`.`||t===`..`)throw new xe(t);return encodeURIComponent(t)}).join(`/`)}function we(e){return e.endsWith(`/`)?e:`${e}/`}function Te(e){let t=Ce(e);if(typeof window>`u`||window.location?.protocol?.startsWith(`http`))return`/${t}`;let n=window.electronAPI?.assetBaseUrl;if(!n)throw new Se;return new URL(t,we(n)).toString()}var Ee=Array.from({length:18},(e,t)=>`/wallpapers/wallpaper${t+1}.jpg`),De=Ee[0],Oe=/^(repeating-)?(linear|radial|conic)-gradient\(/,ke=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/,Ae=/^(\/|https?:\/\/|file:\/\/|data:)/;function je(e){let t=e.trim();return t===``?{kind:`color`,value:`#000000`}:t.startsWith(`#`)||ke.test(t)?{kind:`color`,value:t}:Oe.test(t)?{kind:`gradient`,value:t}:Ae.test(t)?{kind:`image`,path:t}:{kind:`color`,value:t}}var Me=`/wallpapers/`,Ne=class extends Error{constructor(e){super(`Image wallpaper path must live under ${e}`),this.name=`UnsafeImagePrefixError`}};function Pe(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`file://`)||e.startsWith(`data:`))return e;let t=e.startsWith(`/`)?e:`/${e}`;if(!t.startsWith(Me))throw new Fe(e,new Ne(Me));try{return Te(t.slice(1))}catch(t){throw t instanceof Fe?t:new Fe(e,t)}}var Fe=class extends Error{url;cause;constructor(e,t){super(`Failed to load background image: ${Ie(e)}`),this.name=`BackgroundLoadError`,this.url=e,this.cause=t}get displayUrl(){return Ie(this.url)}};function Ie(e){if(e.startsWith(`data:`))return`data:…`;try{let t=new URL(e).pathname.split(`/`).filter(Boolean).pop();return t?decodeURIComponent(t):`(unknown)`}catch{return e.split(`/`).filter(Boolean).pop()??`(unknown)`}}var Le=[`16:9`,`9:16`,`1:1`,`4:3`,`4:5`,`16:10`,`10:16`,`native`],Re=16/9;function ze(e){switch(e){case`16:9`:return 16/9;case`9:16`:return 9/16;case`1:1`:return 1;case`4:3`:return 4/3;case`4:5`:return .8;case`16:10`:return 1.6;case`10:16`:return .625;case`native`:return Re;default:return e}}function Be(e,t,n){let r=n?.width??1,i=n?.height??1;if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(i)||e<=0||t<=0||r<=0||i<=0)return Re;let a=e*r/(t*i);return Number.isFinite(a)&&a>0?a:Re}function Ve(e){return ze(e)<1}var He={width:1280,height:720},Ue={shadowIntensity:0,showBlur:!1,motionBlurAmount:0,borderRadius:0,showTrimWaveform:!0},We={padding:50,aspectRatio:`16:9`,cropRegion:A,wallpaper:De},Ge={layoutPreset:h,maskShape:g,sizePreset:25,position:null},Ke={quality:`good`,format:`mp4`},qe={frameRate:15,loop:!0,sizePreset:`medium`,outputDimensions:He},Je=new Set([`rectangle`,`oval`,`freehand`]),Ye=/^file:\/\/.*?\/(?:resources\/(?:assets\/)?|public\/)wallpapers\/(wallpaper\d+\.jpg)$/i,Xe=new Set(Ee);function Ze(e){let t=Ye.exec(e);if(!t)return e;let n=`/wallpapers/${t[1]}`;return Xe.has(n)?n:De}function M(e){return typeof e==`number`&&Number.isFinite(e)}function Qe(e,t){switch(e){case`picture-in-picture`:case`no-webcam`:return e;case`vertical-stack`:return Ve(t)?e:Ge.layoutPreset;case`dual-frame`:return Ve(t)?Ge.layoutPreset:e;default:return Ge.layoutPreset}}function $e(e,t,n){return Math.min(n,Math.max(t,e))}function et(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.version!=`number`||!tt(t)||!t.editor||typeof t.editor!=`object`)}function tt(e){return be(e.media)||(typeof e.videoPath==`string`&&e.videoPath.trim()?{screenVideoPath:e.videoPath}:null)}function nt(e){let t=new Set(Le).has(e.aspectRatio)?e.aspectRatio:We.aspectRatio,n=Qe(e.webcamLayoutPreset,t),r=n===`picture-in-picture`&&e.webcamPosition&&typeof e.webcamPosition==`object`&&M(e.webcamPosition.cx)&&M(e.webcamPosition.cy)?{cx:$e(e.webcamPosition.cx,0,1),cy:$e(e.webcamPosition.cy,0,1)}:Ge.position,i=Array.isArray(e.zoomRegions)?e.zoomRegions.filter(e=>!!(e&&typeof e.id==`string`)).map(e=>{let t=M(e.startMs)?Math.round(e.startMs):0,n=M(e.endMs)?Math.round(e.endMs):t+1e3,r=Math.max(0,Math.min(t,n)),i=Math.max(r+1,n),a=e.rotationPreset===`iso`||e.rotationPreset===`left`||e.rotationPreset===`right`?e.rotationPreset:void 0;return{id:e.id,startMs:r,endMs:i,depth:[1,2,3,4,5,6].includes(e.depth)?e.depth:3,focus:{cx:$e(M(e.focus?.cx)?e.focus.cx:.5,0,1),cy:$e(M(e.focus?.cy)?e.focus.cy:.5,0,1)},focusMode:e.focusMode===`auto`?`auto`:`manual`,source:e.source===`auto`?`auto`:`manual`,...a?{rotationPreset:a}:{}}}):[],a=Array.isArray(e.trimRegions)?e.trimRegions.filter(e=>!!(e&&typeof e.id==`string`)).map(e=>{let t=M(e.startMs)?Math.round(e.startMs):0,n=M(e.endMs)?Math.round(e.endMs):t+1e3,r=Math.max(0,Math.min(t,n)),i=Math.max(r+1,n);return{id:e.id,startMs:r,endMs:i}}):[],o=Array.isArray(e.speedRegions)?e.speedRegions.filter(e=>!!(e&&typeof e.id==`string`)).map(e=>{let t=M(e.startMs)?Math.round(e.startMs):0,n=M(e.endMs)?Math.round(e.endMs):t+1e3,r=Math.max(0,Math.min(t,n)),i=Math.max(r+1,n),a=M(e.speed)&&e.speed>=.1&&e.speed<=16?ne(e.speed):re;return{id:e.id,startMs:r,endMs:i,speed:a}}):[],s=Array.isArray(e.annotationRegions)?e.annotationRegions.filter(e=>!!(e&&typeof e.id==`string`)).map((e,t)=>{let n=M(e.startMs)?Math.round(e.startMs):0,r=M(e.endMs)?Math.round(e.endMs):n+1e3,i=Math.max(0,Math.min(n,r)),a=Math.max(i+1,r),o=typeof e.blurData?.shape==`string`&&Je.has(e.blurData.shape)?e.blurData.shape:te.shape,s=se(e.blurData?.type),c=ce(e.blurData?.color);return{id:e.id,startMs:i,endMs:a,type:e.type===`image`||e.type===`figure`||e.type===`blur`?e.type:`text`,content:typeof e.content==`string`?e.content:``,textContent:typeof e.textContent==`string`?e.textContent:void 0,imageContent:typeof e.imageContent==`string`?e.imageContent:void 0,annotationSource:e.annotationSource===`auto-caption`?`auto-caption`:void 0,position:{x:$e(M(e.position?.x)?e.position.x:E.x,0,100),y:$e(M(e.position?.y)?e.position.y:E.y,0,100)},size:{width:$e(M(e.size?.width)?e.size.width:D.width,1,200),height:$e(M(e.size?.height)?e.size.height:D.height,1,200)},style:{...O,...e.style&&typeof e.style==`object`?e.style:{},textAnimation:p(e.style?.textAnimation)},zIndex:M(e.zIndex)?e.zIndex:t+1,figureData:e.figureData?{...k,...e.figureData}:void 0,blurData:e.blurData&&typeof e.blurData==`object`?{...te,...e.blurData,type:s,shape:o,color:c,intensity:M(e.blurData.intensity)?$e(e.blurData.intensity,2,40):12,blockSize:M(e.blurData.blockSize)?$e(e.blurData.blockSize,4,48):12,freehandPoints:Array.isArray(e.blurData.freehandPoints)?e.blurData.freehandPoints.filter(e=>!!(e&&M(e.x)&&M(e.y))).map(e=>({x:$e(e.x,0,100),y:$e(e.y,0,100)})):ee}:void 0}}):[],c=M(e.cropRegion?.x)?e.cropRegion.x:We.cropRegion.x,l=M(e.cropRegion?.y)?e.cropRegion.y:We.cropRegion.y,u=M(e.cropRegion?.width)?e.cropRegion.width:We.cropRegion.width,d=M(e.cropRegion?.height)?e.cropRegion.height:We.cropRegion.height,f=$e(c,0,1),m=$e(l,0,1),h=$e(u,.01,1-f),g=$e(d,.01,1-m);return{cursorTheme:_e(e.cursorTheme),wallpaper:typeof e.wallpaper==`string`?Ze(e.wallpaper):We.wallpaper,shadowIntensity:typeof e.shadowIntensity==`number`?e.shadowIntensity:Ue.shadowIntensity,showBlur:typeof e.showBlur==`boolean`?e.showBlur:Ue.showBlur,showTrimWaveform:typeof e.showTrimWaveform==`boolean`?e.showTrimWaveform:Ue.showTrimWaveform,motionBlurAmount:M(e.motionBlurAmount)?$e(e.motionBlurAmount,0,1):typeof e.motionBlurEnabled==`boolean`&&e.motionBlurEnabled?T:Ue.motionBlurAmount,borderRadius:typeof e.borderRadius==`number`?e.borderRadius:Ue.borderRadius,padding:M(e.padding)?$e(e.padding,0,100):We.padding,cropRegion:{x:f,y:m,width:h,height:g},zoomRegions:i,autoZoomEnabled:typeof e.autoZoomEnabled!=`boolean`||e.autoZoomEnabled,autoFocusAll:typeof e.autoFocusAll==`boolean`&&e.autoFocusAll,trimRegions:a,speedRegions:o,annotationRegions:s,aspectRatio:t,webcamLayoutPreset:n,webcamMaskShape:e.webcamMaskShape===`rectangle`||e.webcamMaskShape===`circle`||e.webcamMaskShape===`square`||e.webcamMaskShape===`rounded`?e.webcamMaskShape:Ge.maskShape,webcamMirrored:typeof e.webcamMirrored==`boolean`&&e.webcamMirrored,webcamReactiveZoom:typeof e.webcamReactiveZoom!=`boolean`||e.webcamReactiveZoom,webcamSizePreset:typeof e.webcamSizePreset==`number`&&M(e.webcamSizePreset)?Math.max(10,Math.min(50,e.webcamSizePreset)):Ge.sizePreset,webcamPosition:r,exportQuality:e.exportQuality===`medium`||e.exportQuality===`source`?e.exportQuality:Ke.quality,exportFormat:e.exportFormat===`gif`?`gif`:Ke.format,gifFrameRate:e.gifFrameRate===15||e.gifFrameRate===20||e.gifFrameRate===25||e.gifFrameRate===30?e.gifFrameRate:qe.frameRate,gifLoop:typeof e.gifLoop==`boolean`?e.gifLoop:qe.loop,gifSizePreset:e.gifSizePreset===`medium`||e.gifSizePreset===`large`||e.gifSizePreset===`original`?e.gifSizePreset:qe.sizePreset}}var N=(e=>(e.Application=`application`,e.WebGLPipes=`webgl-pipes`,e.WebGLPipesAdaptor=`webgl-pipes-adaptor`,e.WebGLSystem=`webgl-system`,e.WebGLLoader=`webgl-loader`,e.WebGPUPipes=`webgpu-pipes`,e.WebGPUPipesAdaptor=`webgpu-pipes-adaptor`,e.WebGPUSystem=`webgpu-system`,e.WebGPULoader=`webgpu-loader`,e.CanvasSystem=`canvas-system`,e.CanvasPipesAdaptor=`canvas-pipes-adaptor`,e.CanvasPipes=`canvas-pipes`,e.CanvasLoader=`canvas-loader`,e.Asset=`asset`,e.LoadParser=`load-parser`,e.ResolveParser=`resolve-parser`,e.CacheParser=`cache-parser`,e.DetectionParser=`detection-parser`,e.MaskEffect=`mask-effect`,e.BlendMode=`blend-mode`,e.TextureSource=`texture-source`,e.TextureUploaderWebGL=`texture-uploader-webgl`,e.TextureUploaderWebGPU=`texture-uploader-webgpu`,e.Environment=`environment`,e.ShapeBuilder=`shape-builder`,e.Batcher=`batcher`,e))(N||{}),rt=e=>{if(typeof e==`function`||typeof e==`object`&&e.extension){if(!e.extension)throw Error(`Extension class must have an extension object`);e={...typeof e.extension==`object`?e.extension:{type:e.extension},ref:e}}if(typeof e==`object`)e={...e};else throw Error(`Invalid extension type`);return typeof e.type==`string`&&(e.type=[e.type]),e},it=(e,t)=>rt(e).priority??t,at={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(rt).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e))}),this},add(...e){return e.map(rt).forEach(e=>{e.type.forEach(t=>{let n=this._addHandlers,r=this._queue;n[t]?n[t]?.(e):(r[t]=r[t]||[],r[t]?.push(e))})}),this},handle(e,t,n){let r=this._addHandlers,i=this._removeHandlers;if(r[e]||i[e])throw Error(`Extension type ${e} already has a handler`);r[e]=t,i[e]=n;let a=this._queue;return a[e]&&(a[e]?.forEach(e=>t(e)),delete a[e]),this},handleByMap(e,t){return this.handle(e,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(e,t,n=-1){return this.handle(e,e=>{t.findIndex(t=>t.name===e.name)>=0||(t.push({name:e.name,value:e.ref}),t.sort((e,t)=>it(t.value,n)-it(e.value,n)))},e=>{let n=t.findIndex(t=>t.name===e.name);n!==-1&&t.splice(n,1)})},handleByList(e,t,n=-1){return this.handle(e,e=>{t.includes(e.ref)||(t.push(e.ref),t.sort((e,t)=>it(t,n)-it(e,n)))},e=>{let n=t.indexOf(e.ref);n!==-1&&t.splice(n,1)})},mixin(e,...t){for(let n of t)Object.defineProperties(e.prototype,Object.getOwnPropertyDescriptors(n))}},ot=`modulepreload`,st=function(e,t){return new URL(e,t).href},ct={},lt={},ut=function(e){return e.pathname.endsWith(`.css`)},dt=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw delete e[t],n});return e[t]=i,i},ft=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=st(t,n);let r=s(t),i=ut(r);return dt(ct,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}let t=i?e.styles:e.all,n=i?lt[r.href]:void 0;if(!n&&t.has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:ot,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),n&&delete lt[r.href],n?.isConnected?n.replaceWith(o):document.head.appendChild(o),i)return new Promise((e,t)=>{let n=i=>{o.removeEventListener(`load`,n),o.removeEventListener(`error`,n),i.type===`error`?(lt[r.href]=o,t(Error(`Unable to preload CSS for ${r}`))):e(i)};o.addEventListener(`load`,n),o.addEventListener(`error`,n)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},pt={extension:{type:N.Environment,name:`browser`,priority:-1},test:()=>!0,load:async()=>{await ft(()=>import(`./browserAll-DhvWQ7nM.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)}},mt={extension:{type:N.Environment,name:`webworker`,priority:0},test:()=>typeof self<`u`&&self.WorkerGlobalScope!==void 0,load:async()=>{await ft(()=>import(`./webworkerAll-B41hok0-.js`),__vite__mapDeps([4,1,2,3]),import.meta.url)}},ht=class e{constructor(e,t,n){this._x=t||0,this._y=n||0,this._observer=e}clone(t){return new e(t??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}},gt=c(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,_t=Math.PI*2,vt=180/Math.PI,yt=Math.PI/180,bt=class e{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new e(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return xt.x=0,xt.y=0,xt}},xt=new bt,P=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a,this}toArray(e,t){this.array||=new Float32Array(9);let n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(e,t){t||=new bt;let n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t}applyInverse(e,t){t||=new bt;let n=this.a,r=this.b,i=this.c,a=this.d,o=this.tx,s=this.ty,c=1/(n*a+i*-r),l=e.x,u=e.y;return t.x=a*c*l+-i*c*u+(s*i-o*a)*c,t.y=n*c*u+-r*c*l+(-s*n+o*r)*c,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,a=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=a*t-this.ty*n,this.ty=a*n+this.ty*t,this}append(e){let t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this}appendFrom(e,t){let n=e.a,r=e.b,i=e.c,a=e.d,o=e.tx,s=e.ty,c=t.a,l=t.b,u=t.c,d=t.d;return this.a=n*c+r*u,this.b=n*l+r*d,this.c=i*c+a*u,this.d=i*l+a*d,this.tx=o*c+s*u+t.tx,this.ty=o*l+s*d+t.ty,this}setTransform(e,t,n,r,i,a,o,s,c){return this.a=Math.cos(o+c)*i,this.b=Math.sin(o+c)*i,this.c=-Math.sin(o-s)*a,this.d=Math.cos(o-s)*a,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let t=this.a,n=this.c;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,o=-Math.atan2(-r,i),s=Math.atan2(n,t),c=Math.abs(o+s),l=Math.sqrt(t*t+n*n);return c<1e-5||Math.abs(_t-c)<1e-5?(e.rotation=s,e.skew.x=e.skew.y=0):Math.abs(Math.PI-c)<1e-5?(e.rotation=s-Math.PI,e.skew.x=e.skew.y=0,l=-l):(e.rotation=0,e.skew.x=o,e.skew.y=s),e.scale.x=l,e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e}invert(){let e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,a=e*r-t*n;return this.a=r/a,this.b=-t/a,this.c=-n/a,this.d=e/a,this.tx=(n*this.ty-r*i)/a,this.ty=-(e*this.ty-t*i)/a,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let t=new e;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(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Ct.identity()}static get shared(){return St.identity()}},St=new P,Ct=new P,wt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Tt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Et=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Dt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ot=[],kt=[],At=Math.sign;function jt(){for(let e=0;e<16;e++){let t=[];Ot.push(t);for(let n=0;n<16;n++){let r=At(wt[e]*wt[n]+Et[e]*Tt[n]),i=At(Tt[e]*wt[n]+Dt[e]*Tt[n]),a=At(wt[e]*Et[n]+Et[e]*Dt[n]),o=At(Tt[e]*Et[n]+Dt[e]*Dt[n]);for(let e=0;e<16;e++)if(wt[e]===r&&Tt[e]===i&&Et[e]===a&&Dt[e]===o){t.push(e);break}}}for(let e=0;e<16;e++){let t=new P;t.set(wt[e],Tt[e],Et[e],Dt[e],0,0),kt.push(t)}}jt();var F={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:e=>wt[e],uY:e=>Tt[e],vX:e=>Et[e],vY:e=>Dt[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Ot[e][t],sub:(e,t)=>Ot[e][F.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)==2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?F.S:F.N:Math.abs(t)*2<=Math.abs(e)?e>0?F.E:F.W:t>0?e>0?F.SE:F.SW:e>0?F.NE:F.NW,matrixAppendRotationInv:(e,t,n=0,r=0,i=0,a=0)=>{let o=kt[F.inv(t)],s=o.a,c=o.b,l=o.c,u=o.d,d=n-Math.min(0,s*i,l*a,s*i+l*a),f=r-Math.min(0,c*i,u*a,c*i+u*a),p=e.a,m=e.b,h=e.c,g=e.d;e.a=s*p+c*h,e.b=s*m+c*g,e.c=l*p+u*h,e.d=l*m+u*g,e.tx=d*p+f*h+e.tx,e.ty=d*m+f*g+e.ty},transformRectCoords:(e,t,n,r)=>{let{x:i,y:a,width:o,height:s}=e,{x:c,y:l,width:u,height:d}=t;return n===F.E?(r.set(i+c,a+l,o,s),r):n===F.S?r.set(u-a-s+c,i+l,s,o):n===F.W?r.set(u-i-o+c,d-a-s+l,o,s):n===F.N?r.set(a+c,d-i-o+l,s,o):r.set(i+c,a+l,o,s)}},Mt=[new bt,new bt,new bt,new bt],Nt=class e{constructor(e=0,t=0,n=0,r=0){this.type=`rectangle`,this.x=Number(e),this.y=Number(t),this.width=Number(n),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new e(0,0,0,0)}clone(){return new e(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,n,r=.5){let{width:i,height:a}=this;if(i<=0||a<=0)return!1;let o=this.x,s=this.y,c=n*(1-r),l=n-c,u=o-c,d=o+i+c,f=s-c,p=s+a+c,m=o+l,h=o+i-l,g=s+l,_=s+a-l;return e>=u&&e<=d&&t>=f&&t<=p&&!(e>m&&e<h&&t>g&&t<_)}intersects(e,t){if(!t){let t=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=t)return!1;let n=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>n}let n=this.left,r=this.right,i=this.top,a=this.bottom;if(r<=n||a<=i)return!1;let o=Mt[0].set(e.left,e.top),s=Mt[1].set(e.left,e.bottom),c=Mt[2].set(e.right,e.top),l=Mt[3].set(e.right,e.bottom);if(c.x<=o.x||s.y<=o.y)return!1;let u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(o,o),t.apply(s,s),t.apply(c,c),t.apply(l,l),Math.max(o.x,s.x,c.x,l.x)<=n||Math.min(o.x,s.x,c.x,l.x)>=r||Math.max(o.y,s.y,c.y,l.y)<=i||Math.min(o.y,s.y,c.y,l.y)>=a))return!1;let d=u*(s.y-o.y),f=u*(o.x-s.x),p=d*n+f*i,m=d*r+f*i,h=d*n+f*a,g=d*r+f*a;if(Math.max(p,m,h,g)<=d*o.x+f*o.y||Math.min(p,m,h,g)>=d*l.x+f*l.y)return!1;let _=u*(o.y-c.y),v=u*(c.x-o.x),y=_*n+v*i,b=_*r+v*i,x=_*n+v*a,S=_*r+v*a;return!(Math.max(y,b,x,S)<=_*o.x+v*o.y||Math.min(y,b,x,S)>=_*l.x+v*l.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this}ceil(e=1,t=.001){let n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){let t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this}getBounds(t){return t||=new e,t.copyFrom(this),t}containsRect(e){if(this.width<=0||this.height<=0)return!1;let t=e.x,n=e.y,r=e.x+e.width,i=e.y+e.height;return t>=this.x&&t<this.x+this.width&&n>=this.y&&n<this.y+this.height&&r>=this.x&&r<=this.x+this.width&&i>=this.y&&i<=this.y+this.height}set(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}},Pt={default:-1};function I(e=`default`){return Pt[e]===void 0&&(Pt[e]=-1),++Pt[e]}var Ft=new Set,L=`8.0.0`,It=`8.3.4`,Lt=`8.21.0`,Rt=`8.22.0`,zt={quiet:!1,noColor:!1},R=((e,t,n=3)=>{if(zt.quiet||Ft.has(t))return;let r=Error().stack,i=`${t}
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./browserAll-vQt6iTAv.js","./init-D6nA7FlC.js","./canvasUtils-CZLntkW8.js","./CanvasPool-SkgMbnEH.js","./webworkerAll-BEIrFubI.js","./WebGPURenderer-D9KI_sD9.js","./getTexelRangeRects-CRAnqulP.js","./RenderTargetSystem-um8Nv1HQ.js","./WebGLRenderer-BnY2xfDL.js","./CanvasRenderer-CEGuSdsG.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(let c of r(i))!a.call(e,c)&&c!==o&&(s=n(i,c),t(e,c,{get:s&&s.get&&!s.configurable?s.get:()=>i[c],enumerable:!s||s.enumerable}));return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=[{value:`none`,translationKey:`textAnimation.none`},{value:`fade`,translationKey:`textAnimation.fade`},{value:`rise`,translationKey:`textAnimation.rise`},{value:`pop`,translationKey:`textAnimation.pop`},{value:`slide-left`,translationKey:`textAnimation.slideLeft`},{value:`typewriter`,translationKey:`textAnimation.typewriter`},{value:`pulse`,translationKey:`textAnimation.pulse`}];function u(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function d(e){return 1-(1-u(e))**3}function f(e){let t=u(e);return 1+2.70158*(t-1)**3+1.70158*(t-1)**2}function p(e){return l.some(t=>t.value===e)?e:`none`}function m(e,t){let n=p(e.style.textAnimation);if(n===`none`)return{opacity:1,scale:1,translateX:0,translateY:0,revealProgress:1};let r=u(Math.max(0,t-e.startMs)/700),i=d(r);switch(n){case`fade`:return{opacity:i,scale:1,translateX:0,translateY:0,revealProgress:1};case`rise`:return{opacity:i,scale:1,translateX:0,translateY:(1-i)*18,revealProgress:1};case`pop`:return{opacity:i,scale:Math.max(.72,f(r)),translateX:0,translateY:0,revealProgress:1};case`slide-left`:return{opacity:i,scale:1,translateX:(1-i)*-28,translateY:0,revealProgress:1};case`typewriter`:return{opacity:1,scale:1,translateX:0,translateY:0,revealProgress:r};case`pulse`:return{opacity:1,scale:1+Math.sin(r*Math.PI)*.06,translateX:0,translateY:0,revealProgress:1};default:return{opacity:1,scale:1,translateX:0,translateY:0,revealProgress:1}}}var h=`picture-in-picture`,g=`rectangle`,_={rotationX:0,rotationY:0,rotationZ:0},v={iso:{rotationX:-10,rotationY:-16,rotationZ:0},left:{rotationX:0,rotationY:-22,rotationZ:0},right:{rotationX:0,rotationY:22,rotationZ:0}},y=2.6;function b(e,t){return Math.min(e,t)*y}function x(e){return e.rotationPreset?v[e.rotationPreset]:_}function S(e,t=.01){return Math.abs(e.rotationX)<t&&Math.abs(e.rotationY)<t&&Math.abs(e.rotationZ)<t}function C(e,t,n){return{rotationX:e.rotationX+(t.rotationX-e.rotationX)*n,rotationY:e.rotationY+(t.rotationY-e.rotationY)*n,rotationZ:e.rotationZ+(t.rotationZ-e.rotationZ)*n}}function w(e,t,n,r){let i=e.rotationX*Math.PI/180,a=e.rotationY*Math.PI/180,o=e.rotationZ*Math.PI/180,s=Math.cos(i),c=Math.sin(i),l=Math.cos(a),u=Math.sin(a),d=Math.cos(o),f=Math.sin(o),p=t/2,m=n/2,h=[[-p,-m],[p,-m],[p,m],[-p,m]],g=0,_=0;for(let[e,t]of h){let n=e,i=t,a=0,o=n*d-i*f,p=n*f+i*d;n=o,i=p;let m=n*l+a*u,h=-n*u+a*l;n=m,a=h;let v=i*s-a*c,y=i*c+a*s;if(i=v,a=y,r>0){let e=r-a;if(e<=0)return 1;let t=r/e;n*=t,i*=t}Math.abs(n)>g&&(g=Math.abs(n)),Math.abs(i)>_&&(_=Math.abs(i))}if(g===0||_===0)return 1;let v=p/g,y=m/_;return Math.min(v,y,1)}var T=.35,E={x:50,y:50},D={width:30,height:20},O={color:`#ffffff`,backgroundColor:`transparent`,fontSize:32,fontFamily:`Inter`,fontWeight:`bold`,fontStyle:`normal`,textDecoration:`none`,textAlign:`center`,textAnimation:`none`},k={arrowDirection:`right`,color:`#34B27B`,strokeWidth:4},ee=[{x:10,y:30},{x:25,y:10},{x:55,y:8},{x:82,y:20},{x:90,y:45},{x:78,y:72},{x:52,y:90},{x:22,y:84},{x:8,y:58}],te={type:`mosaic`,shape:`rectangle`,color:`white`,intensity:12,blockSize:12,freehandPoints:ee},A={x:0,y:0,width:1,height:1},j=.1;function ne(e){return Math.round(Math.min(16,Math.max(j,e))*100)/100}var re=1.5,ie={1:1.25,2:1.5,3:1.8,4:2.2,5:3.5,6:5};function ae(e){if(e.customScale!=null){let t=Math.max(1,Math.min(5,e.customScale));if(Number.isFinite(t))return t}return ie[e.depth]}function oe(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}function se(e){return`mosaic`}function ce(e){return e===`black`?`black`:`white`}function le(e){return oe(e?.intensity??12,2,40)}function ue(e,t=1){let n=oe(e?.blockSize??12,4,48);return Math.max(1,Math.round(n*Math.max(t,.01)))}function de(e){return ce(e?.color)===`black`?`rgba(0, 0, 0, 0.72)`:`rgba(255, 255, 255, 0.06)`}function fe(e,t){let n=e.width,r=e.height,i=e.data,a=Math.max(1,Math.floor(t));if(n<=0||r<=0||a<=1)return e;for(let e=0;e<r;e+=a)for(let t=0;t<n;t+=a){let o=Math.min(a,n-t),s=Math.min(a,r-e),c=o*s;if(c<=0)continue;let l=0,u=0,d=0,f=0;for(let r=e;r<e+s;r++)for(let e=t;e<t+o;e++){let t=(r*n+e)*4;l+=i[t],u+=i[t+1],d+=i[t+2],f+=i[t+3]}let p=Math.round(l/c),m=Math.round(u/c),h=Math.round(d/c),g=Math.round(f/c);for(let r=e;r<e+s;r++)for(let e=t;e<t+o;e++){let t=(r*n+e)*4;i[t]=p,i[t+1]=m,i[t+2]=h,i[t+3]=g}}return e}var pe=`default`,me=[{id:`hello-kitty-watermelon`,name:`Hello Kitty & Watermelon`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/hello-kitty-watermelon/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:.5},pointer:{assetPath:`cursors/hello-kitty-watermelon/pointer.png`,width:32,height:32,hotspotX:4,hotspotY:2}}},{id:`among-us-sus-knife-and-red-animated`,name:`Among Us Sus Knife & Red Animated`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/among-us-sus-knife-and-red-animated/arrow.png`,width:32,height:32,hotspotX:1.6,hotspotY:.96},pointer:{assetPath:`cursors/among-us-sus-knife-and-red-animated/pointer.png`,width:32,height:32,hotspotX:12,hotspotY:2}}},{id:`black-and-rainbow-stroke-gradient-animated`,name:`Black & Rainbow Stroke Gradient Animated`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/black-and-rainbow-stroke-gradient-animated/arrow.png`,width:32,height:32,hotspotX:1.6,hotspotY:.96},pointer:{assetPath:`cursors/black-and-rainbow-stroke-gradient-animated/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:1.5}}},{id:`black-pixel`,name:`Black Pixel`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/black-pixel/arrow.png`,width:32,height:32,hotspotX:2,hotspotY:3.5},pointer:{assetPath:`cursors/black-pixel/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:1.5}}},{id:`christmas-miles-morales`,name:`Christmas Miles Morales`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/christmas-miles-morales/arrow.png`,width:32,height:32,hotspotX:1,hotspotY:.5},pointer:{assetPath:`cursors/christmas-miles-morales/pointer.png`,width:32,height:32,hotspotX:5.5,hotspotY:3}}},{id:`hollow-knight-and-game-arrow`,name:`Hollow Knight & Game Arrow`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/hollow-knight-and-game-arrow/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/hollow-knight-and-game-arrow/pointer.png`,width:32,height:32,hotspotX:5,hotspotY:.5}}},{id:`hollow-knight-nail-sword-and-mask`,name:`Hollow Knight Nail Sword & Mask`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/hollow-knight-nail-sword-and-mask/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/hollow-knight-nail-sword-and-mask/pointer.png`,width:32,height:32,hotspotX:3.5,hotspotY:2}}},{id:`naruto-akatsuki-cloud-arrow`,name:`Naruto Akatsuki Cloud Arrow`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/naruto-akatsuki-cloud-arrow/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/naruto-akatsuki-cloud-arrow/pointer.png`,width:32,height:32,hotspotX:1,hotspotY:1}}},{id:`old-roblox`,name:`Old Roblox`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/old-roblox/arrow.png`,width:32,height:32,hotspotX:2.5,hotspotY:1.5},pointer:{assetPath:`cursors/old-roblox/pointer.png`,width:32,height:32,hotspotX:3.5,hotspotY:1.5}}},{id:`pink-glossy-arrow-and-hand-3d`,name:`Pink Glossy Arrow & Hand 3D`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/pink-glossy-arrow-and-hand-3d/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:1.5},pointer:{assetPath:`cursors/pink-glossy-arrow-and-hand-3d/pointer.png`,width:32,height:32,hotspotX:3,hotspotY:1}}},{id:`pinky-pixel`,name:`Pinky Pixel`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/pinky-pixel/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/pinky-pixel/pointer.png`,width:32,height:32,hotspotX:7,hotspotY:1}}},{id:`pokemon-neon-gengar`,name:`Pokemon Neon Gengar`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/pokemon-neon-gengar/arrow.png`,width:32,height:32,hotspotX:1,hotspotY:.5},pointer:{assetPath:`cursors/pokemon-neon-gengar/pointer.png`,width:32,height:32,hotspotX:2,hotspotY:2.5}}},{id:`sanrio-gudetama-and-arrow-kawaii`,name:`Sanrio Gudetama & Arrow Kawaii`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/sanrio-gudetama-and-arrow-kawaii/arrow.png`,width:32,height:32,hotspotX:.5,hotspotY:.5},pointer:{assetPath:`cursors/sanrio-gudetama-and-arrow-kawaii/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:4}}},{id:`spring-gradient`,name:`Spring Gradient`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/spring-gradient/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:.5},pointer:{assetPath:`cursors/spring-gradient/pointer.png`,width:32,height:32,hotspotX:8,hotspotY:.5}}},{id:`mickey-mouse-black-hand-inflated-glove`,name:`Mickey Mouse Black Hand Inflated Glove`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/mickey-mouse-black-hand-inflated-glove/arrow.png`,width:32,height:32,hotspotX:2.5,hotspotY:.5},pointer:{assetPath:`cursors/mickey-mouse-black-hand-inflated-glove/pointer.png`,width:32,height:32,hotspotX:10,hotspotY:.5}}},{id:`sanrio-kuromi-skull-arrow`,name:`Sanrio Kuromi Skull Arrow`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/sanrio-kuromi-skull-arrow/arrow.png`,width:32,height:32,hotspotX:1.5,hotspotY:.5},pointer:{assetPath:`cursors/sanrio-kuromi-skull-arrow/pointer.png`,width:32,height:32,hotspotX:9.5,hotspotY:1}}},{id:`solo-leveling-sung-jinwoo-dark-flames`,name:`Solo Leveling Sung Jinwoo Dark Flames`,source:`sweezy-cursors.com`,assets:{arrow:{assetPath:`cursors/solo-leveling-sung-jinwoo-dark-flames/arrow.png`,width:32,height:32,hotspotX:2,hotspotY:1},pointer:{assetPath:`cursors/solo-leveling-sung-jinwoo-dark-flames/pointer.png`,width:32,height:32,hotspotX:7,hotspotY:4.5}}}],he=new Set([pe,...me.map(e=>e.id)]);function ge(e){return!e||e==="default"?null:me.find(t=>t.id===e)??null}function _e(e){return typeof e==`string`&&he.has(e)?e:pe}function ve(e){return e===`editable-overlay`||e===`system`?e:void 0}function ye(e){return typeof e==`string`&&e.trim()||void 0}function be(e){if(!e||typeof e!=`object`)return null;let t=e,n=ye(t.screenVideoPath);if(!n)return null;let r=ye(t.webcamVideoPath),i=ve(t.cursorCaptureMode);return{screenVideoPath:n,...r?{webcamVideoPath:r}:{},...i?{cursorCaptureMode:i}:{}}}var xe=class extends Error{constructor(e){super(`Unsafe asset path segment: ${e}`),this.name=`UnsafeAssetPathError`}},Se=class extends Error{constructor(){super(`electronAPI.assetBaseUrl is not available; preload did not load correctly`),this.name=`AssetBaseUnavailableError`}};function Ce(e){return e.replace(/^\/+/,``).split(`/`).filter(Boolean).map(e=>{let t=decodeURIComponent(e);if(t===`.`||t===`..`)throw new xe(t);return encodeURIComponent(t)}).join(`/`)}function we(e){return e.endsWith(`/`)?e:`${e}/`}function Te(e){let t=Ce(e);if(typeof window>`u`||window.location?.protocol?.startsWith(`http`))return`/${t}`;let n=window.electronAPI?.assetBaseUrl;if(!n)throw new Se;return new URL(t,we(n)).toString()}var Ee=Array.from({length:18},(e,t)=>`/wallpapers/wallpaper${t+1}.jpg`),De=Ee[0],Oe=/^(repeating-)?(linear|radial|conic)-gradient\(/,ke=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/,Ae=/^(\/|https?:\/\/|file:\/\/|data:)/;function je(e){let t=e.trim();return t===``?{kind:`color`,value:`#000000`}:t.startsWith(`#`)||ke.test(t)?{kind:`color`,value:t}:Oe.test(t)?{kind:`gradient`,value:t}:Ae.test(t)?{kind:`image`,path:t}:{kind:`color`,value:t}}var Me=`/wallpapers/`,Ne=class extends Error{constructor(e){super(`Image wallpaper path must live under ${e}`),this.name=`UnsafeImagePrefixError`}};function Pe(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`file://`)||e.startsWith(`data:`))return e;let t=e.startsWith(`/`)?e:`/${e}`;if(!t.startsWith(Me))throw new Fe(e,new Ne(Me));try{return Te(t.slice(1))}catch(t){throw t instanceof Fe?t:new Fe(e,t)}}var Fe=class extends Error{url;cause;constructor(e,t){super(`Failed to load background image: ${Ie(e)}`),this.name=`BackgroundLoadError`,this.url=e,this.cause=t}get displayUrl(){return Ie(this.url)}};function Ie(e){if(e.startsWith(`data:`))return`data:…`;try{let t=new URL(e).pathname.split(`/`).filter(Boolean).pop();return t?decodeURIComponent(t):`(unknown)`}catch{return e.split(`/`).filter(Boolean).pop()??`(unknown)`}}var Le=[`16:9`,`9:16`,`1:1`,`4:3`,`4:5`,`16:10`,`10:16`,`native`],Re=16/9;function ze(e){switch(e){case`16:9`:return 16/9;case`9:16`:return 9/16;case`1:1`:return 1;case`4:3`:return 4/3;case`4:5`:return .8;case`16:10`:return 1.6;case`10:16`:return .625;case`native`:return Re;default:return e}}function Be(e,t,n){let r=n?.width??1,i=n?.height??1;if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(i)||e<=0||t<=0||r<=0||i<=0)return Re;let a=e*r/(t*i);return Number.isFinite(a)&&a>0?a:Re}function Ve(e){return ze(e)<1}var He={width:1280,height:720},Ue={shadowIntensity:0,showBlur:!1,motionBlurAmount:0,borderRadius:0,showTrimWaveform:!0},We={padding:50,aspectRatio:`16:9`,cropRegion:A,wallpaper:De},Ge={layoutPreset:h,maskShape:g,sizePreset:25,position:null},Ke={quality:`good`,format:`mp4`},qe={frameRate:15,loop:!0,sizePreset:`medium`,outputDimensions:He},Je=new Set([`rectangle`,`oval`,`freehand`]),Ye=/^file:\/\/.*?\/(?:resources\/(?:assets\/)?|public\/)wallpapers\/(wallpaper\d+\.jpg)$/i,Xe=new Set(Ee);function Ze(e){let t=Ye.exec(e);if(!t)return e;let n=`/wallpapers/${t[1]}`;return Xe.has(n)?n:De}function M(e){return typeof e==`number`&&Number.isFinite(e)}function Qe(e,t){switch(e){case`picture-in-picture`:case`no-webcam`:return e;case`vertical-stack`:return Ve(t)?e:Ge.layoutPreset;case`dual-frame`:return Ve(t)?Ge.layoutPreset:e;default:return Ge.layoutPreset}}function $e(e,t,n){return Math.min(n,Math.max(t,e))}function et(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.version!=`number`||!tt(t)||!t.editor||typeof t.editor!=`object`)}function tt(e){return be(e.media)||(typeof e.videoPath==`string`&&e.videoPath.trim()?{screenVideoPath:e.videoPath}:null)}function nt(e){let t=new Set(Le).has(e.aspectRatio)?e.aspectRatio:We.aspectRatio,n=Qe(e.webcamLayoutPreset,t),r=n===`picture-in-picture`&&e.webcamPosition&&typeof e.webcamPosition==`object`&&M(e.webcamPosition.cx)&&M(e.webcamPosition.cy)?{cx:$e(e.webcamPosition.cx,0,1),cy:$e(e.webcamPosition.cy,0,1)}:Ge.position,i=Array.isArray(e.zoomRegions)?e.zoomRegions.filter(e=>!!(e&&typeof e.id==`string`)).map(e=>{let t=M(e.startMs)?Math.round(e.startMs):0,n=M(e.endMs)?Math.round(e.endMs):t+1e3,r=Math.max(0,Math.min(t,n)),i=Math.max(r+1,n),a=e.rotationPreset===`iso`||e.rotationPreset===`left`||e.rotationPreset===`right`?e.rotationPreset:void 0;return{id:e.id,startMs:r,endMs:i,depth:[1,2,3,4,5,6].includes(e.depth)?e.depth:3,focus:{cx:$e(M(e.focus?.cx)?e.focus.cx:.5,0,1),cy:$e(M(e.focus?.cy)?e.focus.cy:.5,0,1)},focusMode:e.focusMode===`auto`?`auto`:`manual`,source:e.source===`auto`?`auto`:`manual`,...a?{rotationPreset:a}:{}}}):[],a=Array.isArray(e.trimRegions)?e.trimRegions.filter(e=>!!(e&&typeof e.id==`string`)).map(e=>{let t=M(e.startMs)?Math.round(e.startMs):0,n=M(e.endMs)?Math.round(e.endMs):t+1e3,r=Math.max(0,Math.min(t,n)),i=Math.max(r+1,n);return{id:e.id,startMs:r,endMs:i}}):[],o=Array.isArray(e.speedRegions)?e.speedRegions.filter(e=>!!(e&&typeof e.id==`string`)).map(e=>{let t=M(e.startMs)?Math.round(e.startMs):0,n=M(e.endMs)?Math.round(e.endMs):t+1e3,r=Math.max(0,Math.min(t,n)),i=Math.max(r+1,n),a=M(e.speed)&&e.speed>=.1&&e.speed<=16?ne(e.speed):re;return{id:e.id,startMs:r,endMs:i,speed:a}}):[],s=Array.isArray(e.annotationRegions)?e.annotationRegions.filter(e=>!!(e&&typeof e.id==`string`)).map((e,t)=>{let n=M(e.startMs)?Math.round(e.startMs):0,r=M(e.endMs)?Math.round(e.endMs):n+1e3,i=Math.max(0,Math.min(n,r)),a=Math.max(i+1,r),o=typeof e.blurData?.shape==`string`&&Je.has(e.blurData.shape)?e.blurData.shape:te.shape,s=se(e.blurData?.type),c=ce(e.blurData?.color);return{id:e.id,startMs:i,endMs:a,type:e.type===`image`||e.type===`figure`||e.type===`blur`?e.type:`text`,content:typeof e.content==`string`?e.content:``,textContent:typeof e.textContent==`string`?e.textContent:void 0,imageContent:typeof e.imageContent==`string`?e.imageContent:void 0,annotationSource:e.annotationSource===`auto-caption`?`auto-caption`:void 0,position:{x:$e(M(e.position?.x)?e.position.x:E.x,0,100),y:$e(M(e.position?.y)?e.position.y:E.y,0,100)},size:{width:$e(M(e.size?.width)?e.size.width:D.width,1,200),height:$e(M(e.size?.height)?e.size.height:D.height,1,200)},style:{...O,...e.style&&typeof e.style==`object`?e.style:{},textAnimation:p(e.style?.textAnimation)},zIndex:M(e.zIndex)?e.zIndex:t+1,figureData:e.figureData?{...k,...e.figureData}:void 0,blurData:e.blurData&&typeof e.blurData==`object`?{...te,...e.blurData,type:s,shape:o,color:c,intensity:M(e.blurData.intensity)?$e(e.blurData.intensity,2,40):12,blockSize:M(e.blurData.blockSize)?$e(e.blurData.blockSize,4,48):12,freehandPoints:Array.isArray(e.blurData.freehandPoints)?e.blurData.freehandPoints.filter(e=>!!(e&&M(e.x)&&M(e.y))).map(e=>({x:$e(e.x,0,100),y:$e(e.y,0,100)})):ee}:void 0}}):[],c=M(e.cropRegion?.x)?e.cropRegion.x:We.cropRegion.x,l=M(e.cropRegion?.y)?e.cropRegion.y:We.cropRegion.y,u=M(e.cropRegion?.width)?e.cropRegion.width:We.cropRegion.width,d=M(e.cropRegion?.height)?e.cropRegion.height:We.cropRegion.height,f=$e(c,0,1),m=$e(l,0,1),h=$e(u,.01,1-f),g=$e(d,.01,1-m);return{cursorTheme:_e(e.cursorTheme),wallpaper:typeof e.wallpaper==`string`?Ze(e.wallpaper):We.wallpaper,shadowIntensity:typeof e.shadowIntensity==`number`?e.shadowIntensity:Ue.shadowIntensity,showBlur:typeof e.showBlur==`boolean`?e.showBlur:Ue.showBlur,showTrimWaveform:typeof e.showTrimWaveform==`boolean`?e.showTrimWaveform:Ue.showTrimWaveform,motionBlurAmount:M(e.motionBlurAmount)?$e(e.motionBlurAmount,0,1):typeof e.motionBlurEnabled==`boolean`&&e.motionBlurEnabled?T:Ue.motionBlurAmount,borderRadius:typeof e.borderRadius==`number`?e.borderRadius:Ue.borderRadius,padding:M(e.padding)?$e(e.padding,0,100):We.padding,cropRegion:{x:f,y:m,width:h,height:g},zoomRegions:i,autoZoomEnabled:typeof e.autoZoomEnabled!=`boolean`||e.autoZoomEnabled,autoFocusAll:typeof e.autoFocusAll==`boolean`&&e.autoFocusAll,trimRegions:a,speedRegions:o,annotationRegions:s,aspectRatio:t,webcamLayoutPreset:n,webcamMaskShape:e.webcamMaskShape===`rectangle`||e.webcamMaskShape===`circle`||e.webcamMaskShape===`square`||e.webcamMaskShape===`rounded`?e.webcamMaskShape:Ge.maskShape,webcamMirrored:typeof e.webcamMirrored==`boolean`&&e.webcamMirrored,webcamReactiveZoom:typeof e.webcamReactiveZoom!=`boolean`||e.webcamReactiveZoom,webcamSizePreset:typeof e.webcamSizePreset==`number`&&M(e.webcamSizePreset)?Math.max(10,Math.min(50,e.webcamSizePreset)):Ge.sizePreset,webcamPosition:r,exportQuality:e.exportQuality===`medium`||e.exportQuality===`source`?e.exportQuality:Ke.quality,exportFormat:e.exportFormat===`gif`?`gif`:Ke.format,gifFrameRate:e.gifFrameRate===15||e.gifFrameRate===20||e.gifFrameRate===25||e.gifFrameRate===30?e.gifFrameRate:qe.frameRate,gifLoop:typeof e.gifLoop==`boolean`?e.gifLoop:qe.loop,gifSizePreset:e.gifSizePreset===`medium`||e.gifSizePreset===`large`||e.gifSizePreset===`original`?e.gifSizePreset:qe.sizePreset}}var N=(e=>(e.Application=`application`,e.WebGLPipes=`webgl-pipes`,e.WebGLPipesAdaptor=`webgl-pipes-adaptor`,e.WebGLSystem=`webgl-system`,e.WebGLLoader=`webgl-loader`,e.WebGPUPipes=`webgpu-pipes`,e.WebGPUPipesAdaptor=`webgpu-pipes-adaptor`,e.WebGPUSystem=`webgpu-system`,e.WebGPULoader=`webgpu-loader`,e.CanvasSystem=`canvas-system`,e.CanvasPipesAdaptor=`canvas-pipes-adaptor`,e.CanvasPipes=`canvas-pipes`,e.CanvasLoader=`canvas-loader`,e.Asset=`asset`,e.LoadParser=`load-parser`,e.ResolveParser=`resolve-parser`,e.CacheParser=`cache-parser`,e.DetectionParser=`detection-parser`,e.MaskEffect=`mask-effect`,e.BlendMode=`blend-mode`,e.TextureSource=`texture-source`,e.TextureUploaderWebGL=`texture-uploader-webgl`,e.TextureUploaderWebGPU=`texture-uploader-webgpu`,e.Environment=`environment`,e.ShapeBuilder=`shape-builder`,e.Batcher=`batcher`,e))(N||{}),rt=e=>{if(typeof e==`function`||typeof e==`object`&&e.extension){if(!e.extension)throw Error(`Extension class must have an extension object`);e={...typeof e.extension==`object`?e.extension:{type:e.extension},ref:e}}if(typeof e==`object`)e={...e};else throw Error(`Invalid extension type`);return typeof e.type==`string`&&(e.type=[e.type]),e},it=(e,t)=>rt(e).priority??t,at={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(rt).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e))}),this},add(...e){return e.map(rt).forEach(e=>{e.type.forEach(t=>{let n=this._addHandlers,r=this._queue;n[t]?n[t]?.(e):(r[t]=r[t]||[],r[t]?.push(e))})}),this},handle(e,t,n){let r=this._addHandlers,i=this._removeHandlers;if(r[e]||i[e])throw Error(`Extension type ${e} already has a handler`);r[e]=t,i[e]=n;let a=this._queue;return a[e]&&(a[e]?.forEach(e=>t(e)),delete a[e]),this},handleByMap(e,t){return this.handle(e,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(e,t,n=-1){return this.handle(e,e=>{t.findIndex(t=>t.name===e.name)>=0||(t.push({name:e.name,value:e.ref}),t.sort((e,t)=>it(t.value,n)-it(e.value,n)))},e=>{let n=t.findIndex(t=>t.name===e.name);n!==-1&&t.splice(n,1)})},handleByList(e,t,n=-1){return this.handle(e,e=>{t.includes(e.ref)||(t.push(e.ref),t.sort((e,t)=>it(t,n)-it(e,n)))},e=>{let n=t.indexOf(e.ref);n!==-1&&t.splice(n,1)})},mixin(e,...t){for(let n of t)Object.defineProperties(e.prototype,Object.getOwnPropertyDescriptors(n))}},ot=`modulepreload`,st=function(e,t){return new URL(e,t).href},ct={},lt={},ut=function(e){return e.pathname.endsWith(`.css`)},dt=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw delete e[t],n});return e[t]=i,i},ft=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=st(t,n);let r=s(t),i=ut(r);return dt(ct,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}let t=i?e.styles:e.all,n=i?lt[r.href]:void 0;if(!n&&t.has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:ot,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),n&&delete lt[r.href],n?.isConnected?n.replaceWith(o):document.head.appendChild(o),i)return new Promise((e,t)=>{let n=i=>{o.removeEventListener(`load`,n),o.removeEventListener(`error`,n),i.type===`error`?(lt[r.href]=o,t(Error(`Unable to preload CSS for ${r}`))):e(i)};o.addEventListener(`load`,n),o.addEventListener(`error`,n)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},pt={extension:{type:N.Environment,name:`browser`,priority:-1},test:()=>!0,load:async()=>{await ft(()=>import(`./browserAll-vQt6iTAv.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)}},mt={extension:{type:N.Environment,name:`webworker`,priority:0},test:()=>typeof self<`u`&&self.WorkerGlobalScope!==void 0,load:async()=>{await ft(()=>import(`./webworkerAll-BEIrFubI.js`),__vite__mapDeps([4,1,2,3]),import.meta.url)}},ht=class e{constructor(e,t,n){this._x=t||0,this._y=n||0,this._observer=e}clone(t){return new e(t??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}},gt=c(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,_t=Math.PI*2,vt=180/Math.PI,yt=Math.PI/180,bt=class e{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new e(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return xt.x=0,xt.y=0,xt}},xt=new bt,P=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a,this}toArray(e,t){this.array||=new Float32Array(9);let n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(e,t){t||=new bt;let n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t}applyInverse(e,t){t||=new bt;let n=this.a,r=this.b,i=this.c,a=this.d,o=this.tx,s=this.ty,c=1/(n*a+i*-r),l=e.x,u=e.y;return t.x=a*c*l+-i*c*u+(s*i-o*a)*c,t.y=n*c*u+-r*c*l+(-s*n+o*r)*c,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,a=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=a*t-this.ty*n,this.ty=a*n+this.ty*t,this}append(e){let t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this}appendFrom(e,t){let n=e.a,r=e.b,i=e.c,a=e.d,o=e.tx,s=e.ty,c=t.a,l=t.b,u=t.c,d=t.d;return this.a=n*c+r*u,this.b=n*l+r*d,this.c=i*c+a*u,this.d=i*l+a*d,this.tx=o*c+s*u+t.tx,this.ty=o*l+s*d+t.ty,this}setTransform(e,t,n,r,i,a,o,s,c){return this.a=Math.cos(o+c)*i,this.b=Math.sin(o+c)*i,this.c=-Math.sin(o-s)*a,this.d=Math.cos(o-s)*a,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let t=this.a,n=this.c;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,o=-Math.atan2(-r,i),s=Math.atan2(n,t),c=Math.abs(o+s),l=Math.sqrt(t*t+n*n);return c<1e-5||Math.abs(_t-c)<1e-5?(e.rotation=s,e.skew.x=e.skew.y=0):Math.abs(Math.PI-c)<1e-5?(e.rotation=s-Math.PI,e.skew.x=e.skew.y=0,l=-l):(e.rotation=0,e.skew.x=o,e.skew.y=s),e.scale.x=l,e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e}invert(){let e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,a=e*r-t*n;return this.a=r/a,this.b=-t/a,this.c=-n/a,this.d=e/a,this.tx=(n*this.ty-r*i)/a,this.ty=-(e*this.ty-t*i)/a,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let t=new e;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(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Ct.identity()}static get shared(){return St.identity()}},St=new P,Ct=new P,wt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Tt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Et=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Dt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ot=[],kt=[],At=Math.sign;function jt(){for(let e=0;e<16;e++){let t=[];Ot.push(t);for(let n=0;n<16;n++){let r=At(wt[e]*wt[n]+Et[e]*Tt[n]),i=At(Tt[e]*wt[n]+Dt[e]*Tt[n]),a=At(wt[e]*Et[n]+Et[e]*Dt[n]),o=At(Tt[e]*Et[n]+Dt[e]*Dt[n]);for(let e=0;e<16;e++)if(wt[e]===r&&Tt[e]===i&&Et[e]===a&&Dt[e]===o){t.push(e);break}}}for(let e=0;e<16;e++){let t=new P;t.set(wt[e],Tt[e],Et[e],Dt[e],0,0),kt.push(t)}}jt();var F={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:e=>wt[e],uY:e=>Tt[e],vX:e=>Et[e],vY:e=>Dt[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Ot[e][t],sub:(e,t)=>Ot[e][F.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)==2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?F.S:F.N:Math.abs(t)*2<=Math.abs(e)?e>0?F.E:F.W:t>0?e>0?F.SE:F.SW:e>0?F.NE:F.NW,matrixAppendRotationInv:(e,t,n=0,r=0,i=0,a=0)=>{let o=kt[F.inv(t)],s=o.a,c=o.b,l=o.c,u=o.d,d=n-Math.min(0,s*i,l*a,s*i+l*a),f=r-Math.min(0,c*i,u*a,c*i+u*a),p=e.a,m=e.b,h=e.c,g=e.d;e.a=s*p+c*h,e.b=s*m+c*g,e.c=l*p+u*h,e.d=l*m+u*g,e.tx=d*p+f*h+e.tx,e.ty=d*m+f*g+e.ty},transformRectCoords:(e,t,n,r)=>{let{x:i,y:a,width:o,height:s}=e,{x:c,y:l,width:u,height:d}=t;return n===F.E?(r.set(i+c,a+l,o,s),r):n===F.S?r.set(u-a-s+c,i+l,s,o):n===F.W?r.set(u-i-o+c,d-a-s+l,o,s):n===F.N?r.set(a+c,d-i-o+l,s,o):r.set(i+c,a+l,o,s)}},Mt=[new bt,new bt,new bt,new bt],Nt=class e{constructor(e=0,t=0,n=0,r=0){this.type=`rectangle`,this.x=Number(e),this.y=Number(t),this.width=Number(n),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new e(0,0,0,0)}clone(){return new e(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,n,r=.5){let{width:i,height:a}=this;if(i<=0||a<=0)return!1;let o=this.x,s=this.y,c=n*(1-r),l=n-c,u=o-c,d=o+i+c,f=s-c,p=s+a+c,m=o+l,h=o+i-l,g=s+l,_=s+a-l;return e>=u&&e<=d&&t>=f&&t<=p&&!(e>m&&e<h&&t>g&&t<_)}intersects(e,t){if(!t){let t=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=t)return!1;let n=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>n}let n=this.left,r=this.right,i=this.top,a=this.bottom;if(r<=n||a<=i)return!1;let o=Mt[0].set(e.left,e.top),s=Mt[1].set(e.left,e.bottom),c=Mt[2].set(e.right,e.top),l=Mt[3].set(e.right,e.bottom);if(c.x<=o.x||s.y<=o.y)return!1;let u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(o,o),t.apply(s,s),t.apply(c,c),t.apply(l,l),Math.max(o.x,s.x,c.x,l.x)<=n||Math.min(o.x,s.x,c.x,l.x)>=r||Math.max(o.y,s.y,c.y,l.y)<=i||Math.min(o.y,s.y,c.y,l.y)>=a))return!1;let d=u*(s.y-o.y),f=u*(o.x-s.x),p=d*n+f*i,m=d*r+f*i,h=d*n+f*a,g=d*r+f*a;if(Math.max(p,m,h,g)<=d*o.x+f*o.y||Math.min(p,m,h,g)>=d*l.x+f*l.y)return!1;let _=u*(o.y-c.y),v=u*(c.x-o.x),y=_*n+v*i,b=_*r+v*i,x=_*n+v*a,S=_*r+v*a;return!(Math.max(y,b,x,S)<=_*o.x+v*o.y||Math.min(y,b,x,S)>=_*l.x+v*l.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this}ceil(e=1,t=.001){let n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){let t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this}getBounds(t){return t||=new e,t.copyFrom(this),t}containsRect(e){if(this.width<=0||this.height<=0)return!1;let t=e.x,n=e.y,r=e.x+e.width,i=e.y+e.height;return t>=this.x&&t<this.x+this.width&&n>=this.y&&n<this.y+this.height&&r>=this.x&&r<=this.x+this.width&&i>=this.y&&i<=this.y+this.height}set(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}},Pt={default:-1};function I(e=`default`){return Pt[e]===void 0&&(Pt[e]=-1),++Pt[e]}var Ft=new Set,L=`8.0.0`,It=`8.3.4`,Lt=`8.21.0`,Rt=`8.22.0`,zt={quiet:!1,noColor:!1},R=((e,t,n=3)=>{if(zt.quiet||Ft.has(t))return;let r=Error().stack,i=`${t}
3
3
  Deprecated since v${e}`,a=typeof console.groupCollapsed==`function`&&!zt.noColor;r===void 0?console.warn(`PixiJS Deprecation Warning: `,i):(r=r.split(`
4
4
  `).splice(n).join(`
5
- `),a?(console.groupCollapsed(`%cPixiJS Deprecation Warning: %c%s`,`color:#614108;background:#fffbe6`,`font-weight:normal;color:#614108;background:#fffbe6`,i),console.warn(r),console.groupEnd()):(console.warn(`PixiJS Deprecation Warning: `,i),console.warn(r))),Ft.add(t)});Object.defineProperties(R,{quiet:{get:()=>zt.quiet,set:e=>{zt.quiet=e},enumerable:!0,configurable:!1},noColor:{get:()=>zt.noColor,set:e=>{zt.noColor=e},enumerable:!0,configurable:!1}});var Bt=()=>{};function Vt(e){return e.endsWith(`int`)}function Ht(e){return e+=+(e===0),--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function Ut(e){return!(e&e-1)&&!!e}function Wt(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}var Gt=Object.create(null);function Kt(e){let t=Gt[e];return t===void 0&&(Gt[e]=I(`resource`)),t}var qt=class e extends gt{constructor(t={}){super(),this._resourceType=`textureSampler`,this._maxAnisotropy=1,this.destroyed=!1,t={...e.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){R(L,`TextureStyle.wrapMode is now TextureStyle.addressMode`),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode=`linear`)}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit(`change`,this)}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Kt(e),this._resourceId}destroy(){this.destroyed=!0,this.emit(`destroy`,this),this.emit(`change`,this),this.removeAllListeners()}};qt.defaultOptions={addressMode:`clamp-to-edge`,scaleMode:`linear`};var Jt=qt,Yt=class e extends gt{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=I(`textureSource`),this._resourceType=`textureSource`,this._resourceId=I(`resource`),this.uploadMethodId=`unknown`,this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format=`rgba8unorm`,this.dimension=`2d`,this.viewDimension=`2d`,this.arrayLayerCount=1,this.depth=1,this._ownsStyle=!1,this.antialias=!1,this.transient=!1,this.storage=!1,this._batchTick=-1,this._textureBindLocation=-1;let n=t;t={...e.defaultOptions,...t};let r=Zt(t),i=r===`3d`||r===`1d`?r:`2d`;Qt(n,r,i),this.label=t.label??``,this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,this.pixelWidth=t.width?t.width*this._resolution:this.resource?this.resourceWidth??1:1,this.pixelHeight=t.height?t.height*this._resolution:this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=i,this.viewDimension=r,this.arrayLayerCount=t.arrayLayerCount,this.depth=i===`3d`?t.depth??1:1,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=i!==`3d`&&t.antialias,this.transient=t.transient??!1,this.storage=t.storage??!1,this.alphaMode=t.alphaMode,this.style=new Jt(Wt(t)),this._ownsStyle=!0,this.destroyed=!1,this._refreshPOT()}get depthOrArrayLayers(){return this.dimension===`3d`?this.depth:this.arrayLayerCount||1}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._ownsStyle=!1,this._style?.off(`change`,this._onStyleChange,this),this._style=e,this._style?.on(`change`,this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit(`styleChange`,this)}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit(`update`,this)}destroy(){this.destroyed=!0,this.unload(),this.emit(`destroy`,this),this._style&&=(this._ownsStyle&&this._style.destroy(),null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=I(`resource`),this.emit(`change`,this),this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,t,n){n||=this._resolution,e||=this.width,t||=this.height;let r=Math.round(e*n),i=Math.round(t*n);return this.width=r/n,this.height=i/n,this._resolution=n,this.pixelWidth===r&&this.pixelHeight===i?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=i,this.emit(`resize`,this),this._resourceId=I(`resource`),this.emit(`change`,this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit(`updateMipmaps`,this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Ut(this.pixelWidth)&&Ut(this.pixelHeight)}static test(e){throw Error(`Unimplemented`)}};Yt.defaultOptions={resolution:1,format:`bgra8unorm`,alphaMode:`premultiply-alpha-on-upload`,arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};var Xt=Yt;function Zt(e){return e.viewDimension?e.viewDimension:e.depth?`3d`:e.arrayLayerCount>1?`2d-array`:`2d`}function Qt(e,t,n){if(e.depth!==void 0&&typeof e.depth!=`number`)throw Error(`[TextureSource] depth is a 3D texture's depth in texels, but got ${e.depth}. For a depth buffer, use the depth option of a RenderTarget or the renderer.`);if(e.depth&&e.arrayLayerCount>1)throw Error(`[TextureSource] depth and arrayLayerCount can't be combined: use depth for a 3D texture or arrayLayerCount for a 2D array.`);if(e.depth&&t!==`3d`)throw Error(`[TextureSource] depth makes a 3D texture, but viewDimension is '${t}'. Use arrayLayerCount for layered textures.`);if(t===`3d`&&e.arrayLayerCount>1)throw Error(`[TextureSource] a 3D texture takes depth, not arrayLayerCount.`);if(e.dimensions&&e.dimensions!==n)throw Error(`[TextureSource] dimensions '${e.dimensions}' doesn't match viewDimension '${t}'. Leave dimensions out; it is derived from the view.`);if(e.dimensions&&R(Rt,`TextureSource dimensions is derived from viewDimension and depth; leave it out.`),n===`3d`&&e.antialias)throw Error(`[TextureSource] a 3D texture can't be antialiased: WebGPU has no multisampled 3D textures.`)}var $t=class extends Xt{constructor(e){let t=e.depth??e.arrayLayerCount??1,n=e.resource||new Float32Array(e.width*e.height*t*4),r=e.format;r||=n instanceof Float32Array?`rgba32float`:n instanceof Int32Array||n instanceof Uint32Array?`rgba32uint`:n instanceof Int16Array||n instanceof Uint16Array?`rgba16uint`:(n instanceof Int8Array,`bgra8unorm`);let i=Vt(r)||t>1;super({...i&&{alphaMode:`no-premultiply-alpha`},...e,resource:n,format:r}),this.uploadMethodId=`buffer`,this._updateStart=0,this._updateEnd=1/0}update(e=0,t=1/0){if((e>0||t<1/0)&&this.depthOrArrayLayers>1)throw Error(`[BufferImageSource] a 3D texture or 2D array uploads whole: call update() with no range.`);this._updateStart=e,this._updateEnd=t,super.update(),this._updateStart=0,this._updateEnd=1/0}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};$t.extension=N.TextureSource;var en=new P,tn=class{constructor(e,t){this.mapCoord=new P,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,this.clampMargin=t===void 0?e.width<10?0:.5:t,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture?.removeListener(`update`,this.update,this),this._texture=e,this._texture.addListener(`update`,this.update,this)),this.update()}destroy(){this._texture?.removeListener(`update`,this.update,this),this._texture=null}multiplyUvs(e,t){t===void 0&&(t=e);let n=this.mapCoord;for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];t[r]=i*n.a+a*n.c+n.tx,t[r+1]=i*n.b+a*n.d+n.ty}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let n=e.orig,r=e.trim;r&&(en.set(n.width/r.width,0,0,n.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(en));let i=e.source,a=this.uClampFrame,o=this.clampMargin/i._resolution,s=this.clampOffset/i._resolution;return a[0]=(e.frame.x+o+s)/i.width,a[1]=(e.frame.y+o+s)/i.height,a[2]=(e.frame.x+e.frame.width-o+s)/i.width,a[3]=(e.frame.y+e.frame.height-o+s)/i.height,this.uClampOffset[0]=this.clampOffset/i.pixelWidth,this.uClampOffset[1]=this.clampOffset/i.pixelHeight,this.isSimple=e.frame.width===i.width&&e.frame.height===i.height&&e.rotate===0,!0}},z=class extends gt{constructor({source:e,label:t,frame:n,orig:r,trim:i,defaultAnchor:a,defaultBorders:o,rotate:s,dynamic:c}={}){if(super(),this.uid=I(`texture`),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Nt,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=t,this.source=e?.source??new Xt,this.noFrame=!n,n)this.frame.copyFrom(n);else{let{width:e,height:t}=this._source;this.frame.width=e,this.frame.height=t}this.orig=r||this.frame,this.trim=i,this.rotate=s??0,this.defaultAnchor=a,this.defaultBorders=o,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off(`resize`,this.update,this),this._source=e,e.on(`resize`,this.update,this),this.emit(`update`,this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||=new tn(this),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:n,height:r}=this._source,i=t.x/n,a=t.y/r,o=t.width/n,s=t.height/r,c=this.rotate;if(c){let t=o/2,n=s/2,r=i+t,l=a+n;c=F.add(c,F.NW),e.x0=r+t*F.uX(c),e.y0=l+n*F.uY(c),c=F.add(c,2),e.x1=r+t*F.uX(c),e.y1=l+n*F.uY(c),c=F.add(c,2),e.x2=r+t*F.uX(c),e.y2=l+n*F.uY(c),c=F.add(c,2),e.x3=r+t*F.uX(c),e.y3=l+n*F.uY(c)}else e.x0=i,e.y0=a,e.x1=i+o,e.y1=a,e.x2=i+o,e.y2=a+s,e.x3=i,e.y3=a+s}destroy(e=!1){this._source&&(this._source.off(`resize`,this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit(`destroy`,this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit(`update`,this)}get baseTexture(){return R(L,`Texture.baseTexture is now Texture.source`),this._source}};z.EMPTY=new z({label:`EMPTY`,source:new Xt({label:`EMPTY`})}),z.EMPTY.destroy=Bt,z.WHITE=new z({source:new $t({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:`premultiply-alpha-on-upload`,label:`WHITE`}),label:`WHITE`}),z.WHITE.destroy=Bt;function nn(e,t,n){let{width:r,height:i}=n.orig,a=n.trim;if(a){let n=a.width,o=a.height;e.minX=a.x-t._x*r,e.maxX=e.minX+n,e.minY=a.y-t._y*i,e.maxY=e.minY+o}else e.minX=-t._x*r,e.maxX=e.minX+r,e.minY=-t._y*i,e.maxY=e.minY+i}for(var rn=new P,an=class e{constructor(e=1/0,t=1/0,n=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=rn,this.minX=e,this.minY=t,this.maxX=n,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||=new Nt;let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=rn,this}set(e,t,n,r){this.minX=e,this.minY=t,this.maxX=n,this.maxY=r}addFrame(e,t,n,r,i){i||=this.matrix;let a=i.a,o=i.b,s=i.c,c=i.d,l=i.tx,u=i.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,h=a*e+s*t+l,g=o*e+c*t+u;h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*n+s*t+l,g=o*n+c*t+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*e+s*r+l,g=o*e+c*r+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*n+s*r+l,g=o*n+c*r+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t)}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){let t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,{a,b:o,c:s,d:c,tx:l,ty:u}=e,d=a*t+s*n+l,f=o*t+c*n+u;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=a*r+s*n+l,f=o*r+c*n+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=a*t+s*i+l,f=o*t+c*i+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=a*r+s*i+l,f=o*r+c*i+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,n,r){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<n&&(this.minY=n),this.maxY>r&&(this.maxY=r),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new e(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,n,r){let i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;r||=this.matrix;let c=r.a,l=r.b,u=r.c,d=r.d,f=r.tx,p=r.ty;for(let r=t;r<n;r+=2){let t=e[r],n=e[r+1],m=c*t+u*n+f,h=l*t+d*n+p;i=m<i?m:i,a=h<a?h:a,o=m>o?m:o,s=h>s?h:s}this.minX=i,this.minY=a,this.maxX=o,this.maxY=s}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}},on={grad:.9,turn:360,rad:360/(2*Math.PI)},sn=function(e){return typeof e==`string`?e.length>0:typeof e==`number`},cn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n+0},ln=function(e){var t=Math.round(100*e)/100;return Math.round(255*t)===255*e?t:Math.round(1e3*e)/1e3},un=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},dn=function(e){return(e=isFinite(e)?e%360:0)<0?e+360:e},fn=function(e,t){return t===void 0&&(t=0),cn(e,t)%360},pn=function(e){return{r:un(e.r,0,255),g:un(e.g,0,255),b:un(e.b,0,255),a:un(e.a)}},mn=function(e){return{r:cn(e.r),g:cn(e.g),b:cn(e.b),a:ln(e.a)}},hn=/^#([0-9a-f]{3,8})$/i,gn=function(e,t){var n=e.charCodeAt(t);return(15&n)+9*(n>>6)},_n=function(e,t){return gn(e,t)<<4|gn(e,t+1)},vn=[],yn=0;yn<256;yn++)vn.push((yn<16?`0`:``)+yn.toString(16));var bn=function(e){return vn[un(e,0,255)]},xn=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},Sn=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6,u=function(e){return Math.round(255e9*e)/1e9+0};return{r:u([r,s,o,o,c,r][l]),g:u([c,r,r,s,o,o][l]),b:u([o,o,c,r,r,s][l]),a:i}},Cn=function(e){return{h:dn(e.h),s:un(e.s,0,100),l:un(e.l,0,100),a:un(e.a)}},wn=function(e){return{h:fn(e.h),s:cn(e.s),l:cn(e.l),a:ln(e.a)}},Tn=function(e){return Sn((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},En=function(e){return{h:(t=xn(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},Dn=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%\s*(?:,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,On=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%?\s*(?:\/\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,kn=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*(?:,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,An=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*(?:\/\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,jn={string:[[function(e){if(!hn.test(e))return null;var t=e.length;return t<=5?{r:17*gn(e,1),g:17*gn(e,2),b:17*gn(e,3),a:t===5?17*gn(e,4)/255:1}:t===7||t===9?{r:_n(e,1),g:_n(e,3),b:_n(e,5),a:t===9?_n(e,7)/255:1}:null},`hex`],[function(e){var t=kn.exec(e);if(t&&(t[2]!==t[4]||t[4]!==t[6]))return null;var n=t||An.exec(e);return n?pn({r:Number(n[1])/(n[2]?100/255:1),g:Number(n[3])/(n[4]?100/255:1),b:Number(n[5])/(n[6]?100/255:1),a:n[7]===void 0?1:Number(n[7])/(n[8]?100:1)}):null},`rgb`],[function(e){var t=Dn.exec(e)||On.exec(e);if(!t)return null;var n,r;return Tn(Cn({h:(n=t[1],r=t[2],r===void 0&&(r=`deg`),Number(n)*(on[r.toLowerCase()]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}))},`hsl`]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i===void 0?1:i;return sn(t)&&sn(n)&&sn(r)?pn({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},`rgb`],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,a=i===void 0?1:i;return!sn(t)||!sn(n)||!sn(r)?null:Tn(Cn({h:Number(t),s:Number(n),l:Number(r),a:Number(a)}))},`hsl`],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,a=i===void 0?1:i;return!sn(t)||!sn(n)||!sn(r)?null:Sn(function(e){return{h:dn(e.h),s:un(e.s,0,100),v:un(e.v,0,100),a:un(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)}))},`hsv`]]},Mn=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},Nn=function(e){return typeof e==`string`?Mn(e.trim(),jn.string):typeof e==`object`&&e?Mn(e,jn.object):[null,void 0]},Pn=function(e,t,n){var r=En(e);return{h:r.h,s:un(r.s+t*(n?r.s:100),0,100),l:r.l,a:r.a}},Fn=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},In=function(e,t,n){var r=En(e);return{h:r.h,s:r.s,l:un(r.l+t*(n?r.l:100),0,100),a:r.a}},Ln=function(){function e(e){this.parsed=Nn(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return cn(Fn(this.rgba),2)},e.prototype.isDark=function(){return Fn(this.rgba)<.5},e.prototype.isLight=function(){return Fn(this.rgba)>=.5},e.prototype.toHex=function(){return e=mn(this.rgba),t=e.r,n=e.g,r=e.b,a=(i=e.a)<1?bn(cn(255*i)):``,`#`+bn(t)+bn(n)+bn(r)+a;var e,t,n,r,i,a},e.prototype.toRgb=function(){return mn(this.rgba)},e.prototype.toRgbString=function(){return e=mn(this.rgba),t=e.r,n=e.g,r=e.b,(i=e.a)<1?`rgba(`+t+`, `+n+`, `+r+`, `+i+`)`:`rgb(`+t+`, `+n+`, `+r+`)`;var e,t,n,r,i},e.prototype.toHsl=function(){return wn(En(this.rgba))},e.prototype.toHslString=function(){return e=wn(En(this.rgba)),t=e.h,n=e.s,r=e.l,(i=e.a)<1?`hsla(`+t+`, `+n+`%, `+r+`%, `+i+`)`:`hsl(`+t+`, `+n+`%, `+r+`%)`;var e,t,n,r,i},e.prototype.toHsv=function(){return e=xn(this.rgba),{h:fn(e.h),s:cn(e.s),v:cn(e.v),a:ln(e.a)};var e},e.prototype.invert=function(){return Rn({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e,t){return e===void 0&&(e=.1),Rn(Pn(this.rgba,e,t?.relative))},e.prototype.desaturate=function(e,t){return e===void 0&&(e=.1),Rn(Pn(this.rgba,-e,t?.relative))},e.prototype.grayscale=function(){return Rn(Pn(this.rgba,-1))},e.prototype.lighten=function(e,t){return e===void 0&&(e=.1),Rn(In(this.rgba,e,t?.relative))},e.prototype.darken=function(e,t){return e===void 0&&(e=.1),Rn(In(this.rgba,-e,t?.relative))},e.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(En(this.rgba).h+e)},e.prototype.alpha=function(e){return typeof e==`number`?Rn({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ln(this.rgba.a);var t},e.prototype.hue=function(e){var t=En(this.rgba);return typeof e==`number`?Rn({h:e,s:t.s,l:t.l,a:t.a}):fn(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Rn(e).toHex()},e}(),Rn=function(e){return e instanceof Ln?e:new Ln(e)},zn=[];(function(e){e.forEach(function(e){zn.indexOf(e)<0&&(e(Ln,jn),zn.push(e))})})([function(e,t){var n={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`,sandybrown:`#f4a460`,rosybrown:`#bc8f8f`,darksalmon:`#e9967a`,lightgoldenrodyellow:`#fafad2`,snow:`#fffafa`,lightgrey:`#d3d3d3`,lightgray:`#d3d3d3`,dimgray:`#696969`,dimgrey:`#696969`,olivedrab:`#6b8e23`,olive:`#808000`},r={};for(var i in n)r[n[i]]=i;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return`transparent`;var i,o,s=r[this.toHex()];if(s)return s;if(t?.closest){var c=this.toRgb(),l=1/0,u=`black`;if(!a.length)for(var d in n)a[d]=new e(n[d]).toRgb();for(var f in n){var p=(i=c,o=a[f],(i.r-o.r)**2+(i.g-o.g)**2+(i.b-o.b)**2);p<l&&(l=p,u=f)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i=r===`transparent`?`#0000`:n[r];return typeof i==`string`?new e(i).toRgb():null},`name`])}]);var Bn=class e{constructor(e=0xffffff){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=0xffffff,this.value=e}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(e){return this.value=e,this}set value(t){if(t instanceof e)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else if(t===null)throw Error(`Cannot set Color#value to null`);else this._value!==null&&this._isSourceEqual(this._value,t)||(this._value=this._cloneSource(t),this._normalize(this._value))}get value(){return this._value}_cloneSource(e){return typeof e==`string`||typeof e==`number`||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e==`object`&&e?{...e}:e}_isSourceEqual(e,t){let n=typeof e;if(n!==typeof t)return!1;if(n===`number`||n===`string`||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length===t.length&&e.every((e,n)=>e===t[n]);if(e!==null&&t!==null){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}return e===t}toRgba(){let[e,t,n,r]=this._components;return{r:e,g:t,b:n,a:r}}toRgb(){let[e,t,n]=this._components;return{r:e,g:t,b:n}}toRgbaString(){let[e,t,n]=this.toUint8RgbArray();return`rgba(${e},${t},${n},${this.alpha})`}toUint8RgbArray(e){let[t,n,r]=this._components;return this._arrayRgb||=[],e||=this._arrayRgb,e[0]=Math.round(t*255),e[1]=Math.round(n*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||=[],e||=this._arrayRgba;let[t,n,r,i]=this._components;return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}toRgbArray(e){this._arrayRgb||=[],e||=this._arrayRgb;let[t,n,r]=this._components;return e[0]=t,e[1]=n,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){let[e,t,n]=this.toUint8RgbArray();return(n<<16)+(t<<8)+e}toLittleEndianNumber(){let e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(t){let[n,r,i,a]=e._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=r,this._components[2]*=i,this._components[3]*=a,this._refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let n=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return t&&(n=n*e+.5|0,r=r*e+.5|0,i=i*e+.5|0),(e*255<<24)+(n<<16)+(r<<8)+i}toHex(){let e=this._int.toString(16);return`#${`000000`.substring(0,6-e.length)+e}`}toHexa(){let e=Math.round(this._components[3]*255).toString(16);return this.toHex()+`00`.substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this._value=null,this}_normalize(t){let n,r,i,a;if((typeof t==`number`||t instanceof Number)&&t>=0&&t<=0xffffff){let e=t;n=(e>>16&255)/255,r=(e>>8&255)/255,i=(e&255)/255,a=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,r,i,a=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,r,i,a=255]=t,n/=255,r/=255,i/=255,a/=255;else if(typeof t==`string`||typeof t==`object`){if(typeof t==`string`){let n=e.HEX_PATTERN.exec(t);n&&(t=`#${n[2]}`)}let o=Rn(t);o.isValid()&&({r:n,g:r,b:i,a}=o.rgba,n/=255,r/=255,i/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=r,this._components[2]=i,this._components[3]=a,this._refreshInt();else throw Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);let[e,t,n]=this._components;this._int=(e*255<<16)+(t*255<<8)+(n*255|0)}_clamp(e,t=0,n=1){return typeof e==`number`?Math.min(Math.max(e,t),n):(e.forEach((r,i)=>{e[i]=Math.min(Math.max(r,t),n)}),e)}static isColorLike(t){return t==null?!1:typeof t==`number`||typeof t==`string`||t instanceof Number||t instanceof e||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Bn.shared=new Bn,Bn._temp=new Bn,Bn.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;var Vn=Bn,Hn={cullArea:null,cullable:!1,cullableChildren:!0},Un=0,Wn=500;function Gn(...e){Un!==Wn&&(Un++,Un===Wn?console.warn(`PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.`):console.warn(`PixiJS Warning: `,...e))}var Kn={_registeredResources:new Set,register(e){this._registeredResources.add(e)},unregister(e){this._registeredResources.delete(e)},release(){this._registeredResources.forEach(e=>e.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(e){return this._registeredResources.has(e)},reset(){this._registeredResources.clear()}},qn=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t)}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){let t;return this._index>0?t=this._pool[--this._index]:(t=new this._classType,this._count++),t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}},Jn=new class{constructor(){this._poolsByClass=new Map}prepopulate(e,t){this.getPool(e).prepopulate(t)}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new qn(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let n=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[n]={free:t.totalFree,used:t.totalUsed,size:t.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}};Kn.register(Jn);var Yn={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(e){typeof e==`boolean`&&e===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(e===!0?{}:e))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(e){R(`v8.6.0`,`cacheAsBitmap is deprecated, use cacheAsTexture instead.`),this.cacheAsTexture(e)}};function Xn(e,t,n){let r=e.length,i;if(t>=r||n===0)return;n=t+n>r?r-t:n;let a=r-n;for(i=t;i<a;++i)e[i]=e[i+n];e.length=a}var Zn={allowChildren:!0,removeChildren(e=0,t){let n=t??this.children.length,r=n-e,i=[];if(r>0&&r<=n){for(let t=n-1;t>=e;t--){let e=this.children[t];e&&(i.push(e),e.parent=null)}Xn(this.children,e,r);let t=this.renderGroup||this.parentRenderGroup;t&&t.removeChildren(i);for(let e=0;e<i.length;++e){let t=i[e];t.parentRenderLayer?.detach(t),this.emit(`childRemoved`,t,this,e),i[e].emit(`removed`,this)}return i.length>0&&this._didViewChangeTick++,i}if(r===0&&this.children.length===0)return i;throw RangeError(`removeChildren: numeric values are outside the acceptable range.`)},removeChildAt(e){let t=this.getChildAt(e);return this.removeChild(t)},getChildAt(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]},setChildIndex(e,t){if(t<0||t>=this.children.length)throw Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(e),this.addChildAt(e,t)},getChildIndex(e){let t=this.children.indexOf(e);if(t===-1)throw Error(`The supplied Container must be a child of the caller`);return t},addChildAt(e,t){this.allowChildren||R(L,`addChildAt: Only Containers will be allowed to add children in v8.0.0`);let{children:n}=this;if(t<0||t>n.length)throw Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${n.length}`);let r=e.parent===this;if(e.parent){let n=e.parent.children.indexOf(e);if(r){if(n===t)return e;e.parent.children.splice(n,1)}else e.removeFromParent()}t===n.length?n.push(e):n.splice(t,0,e);let i=this.renderGroup||this.parentRenderGroup;return this.sortableChildren&&(this.sortDirty=!0),r?(i&&(i.structureDidChange=!0),e):(e.parent=this,e.didChange=!0,e._updateFlags=15,i&&i.addChild(e),this.emit(`childAdded`,e,this,t),e.emit(`added`,this),e)},swapChildren(e,t){if(e===t)return;let n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...e){return e.length===1?this.reparentChildAt(e[0],this.children.length):(e.forEach(e=>this.reparentChildAt(e,this.children.length)),e[0])},reparentChildAt(e,t){if(e.parent===this)return this.setChildIndex(e,t),e;let n=e.worldTransform.clone();e.removeFromParent(),this.addChildAt(e,t);let r=this.worldTransform.clone();return r.invert(),n.prepend(r),e.setFromMatrix(n),e},replaceChild(e,t){e.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(e)),t.setFromMatrix(e.localTransform),t.updateLocalTransform(),this.removeChild(e)}},Qn={collectRenderables(e,t,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(e,t,n):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,e):this.collectRenderablesWithEffects(e,t,n))},collectRenderablesSimple(e,t,n){let r=this.children,i=r.length;for(let a=0;a<i;a++)r[a].collectRenderables(e,t,n)},collectRenderablesWithEffects(e,t,n){let{renderPipes:r}=t;for(let t=0;t<this.effects.length;t++){let n=this.effects[t];r[n.pipe].push(n,this,e)}this.collectRenderablesSimple(e,t,n);for(let t=this.effects.length-1;t>=0;t--){let n=this.effects[t];r[n.pipe].pop(n,this,e)}}},$n=class{constructor(){this.pipe=`filter`,this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}},er=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let n=this._tests[t];if(n.test(e))return Jn.get(n.maskClass,e)}return e}returnMaskEffect(e){Jn.return(e)}};at.handleByList(N.MaskEffect,er._effectClasses);var tr={_maskEffect:null,_maskOptions:{inverse:!1,channel:`red`},_filterEffect:null,effects:[],_markStructureAsChanged(){let e=this.renderGroup||this.parentRenderGroup;e&&(e.structureDidChange=!0)},addEffect(e){this.effects.indexOf(e)===-1&&(this.effects.push(e),this.effects.sort((e,t)=>e.priority-t.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(e){let t=this.effects.indexOf(e);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(e){let t=this._maskEffect;t?.mask!==e&&(t&&(this.removeEffect(t),er.returnMaskEffect(t),this._maskEffect=null),e!=null&&(this._maskEffect=er.getMaskEffect(e),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(e){this._maskOptions={...this._maskOptions,...e},e.mask&&(this.mask=e.mask),this._markStructureAsChanged()},set filters(e){!Array.isArray(e)&&e&&(e=[e]);let t=this._filterEffect||=new $n;e=e;let n=e?.length>0,r=n!==t.filters?.length>0;e=Array.isArray(e)?e.slice(0):e,t.filters=Object.freeze(e),r&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=e??null))},get filters(){return this._filterEffect?.filters},set filterArea(e){this._filterEffect||=new $n,this._filterEffect.filterArea=e},get filterArea(){return this._filterEffect?.filterArea}},nr={label:null,get name(){return R(L,`Container.name property has been removed, use Container.label instead`),this.label},set name(e){R(L,`Container.name property has been removed, use Container.label instead`),this.label=e},getChildByName(e,t=!1){return this.getChildByLabel(e,t)},getChildByLabel(e,t=!1){let n=this.children;for(let t=0;t<n.length;t++){let r=n[t];if(r.label===e||e instanceof RegExp&&e.test(r.label))return r}if(t)for(let t=0;t<n.length;t++){let r=n[t].getChildByLabel(e,!0);if(r)return r}return null},getChildrenByLabel(e,t=!1,n=[]){let r=this.children;for(let t=0;t<r.length;t++){let i=r[t];(i.label===e||e instanceof RegExp&&e.test(i.label))&&n.push(i)}if(t)for(let t=0;t<r.length;t++)r[t].getChildrenByLabel(e,!0,n);return n}},rr=Jn.getPool(P),ir=Jn.getPool(an),ar=new P,or={getFastGlobalBounds(e,t){t||=new an,t.clear(),this._getGlobalBoundsRecursive(!!e,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);let n=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(n.worldTransform),t},_getGlobalBoundsRecursive(e,t,n){let r=t;if(e&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;let i=!!this.effects.length;if((this.renderGroup||i)&&(r=ir.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){let e=this.bounds;r.addFrame(e.minX,e.minY,e.maxX,e.maxY,this.groupTransform)}let t=this.children;for(let i=0;i<t.length;i++)t[i]._getGlobalBoundsRecursive(e,r,n)}if(i){let e=!1,n=this.renderGroup||this.parentRenderGroup;for(let t=0;t<this.effects.length;t++)this.effects[t].addBounds&&(e||(e=!0,r.applyMatrix(n.worldTransform)),this.effects[t].addBounds(r,!0));e&&r.applyMatrix(n.worldTransform.copyTo(ar).invert()),t.addBounds(r),ir.return(r)}else this.renderGroup&&(t.addBounds(r,this.relativeGroupTransform),ir.return(r))}};function sr(e,t,n){n.clear();let r,i;return e.parent?t?r=e.parent.worldTransform:(i=rr.get().identity(),r=lr(e,i)):r=P.IDENTITY,cr(e,n,r,t),i&&rr.return(i),n.isValid||n.set(0,0,0,0),n}function cr(e,t,n,r){if(!e.visible||!e.measurable)return;let i;r?i=e.worldTransform:(e.updateLocalTransform(),i=rr.get(),i.appendFrom(e.localTransform,n));let a=t,o=!!e.effects.length;if(o&&(t=ir.get().clear()),e.boundsArea)t.addRect(e.boundsArea,i);else{let n=e.bounds;n&&!n.isEmpty()&&(t.matrix=i,t.addBounds(n));for(let n=0;n<e.children.length;n++)cr(e.children[n],t,i,r)}if(o){for(let n=0;n<e.effects.length;n++)e.effects[n].addBounds?.(t);a.addBounds(t,P.IDENTITY),ir.return(t)}r||rr.return(i)}function lr(e,t){let n=e.parent;return n&&(lr(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function ur(e,t){if(e===0xffffff||!t)return t;if(t===0xffffff||!e)return e;let n=e>>16&255,r=e>>8&255,i=e&255,a=t>>16&255,o=t>>8&255,s=t&255,c=n*a/255|0,l=r*o/255|0,u=i*s/255|0;return(c<<16)+(l<<8)+u}var dr=0xffffff;function fr(e,t){return e===dr?t:t===dr?e:ur(e,t)}function pr(e){return((e&255)<<16)+(e&65280)+(e>>16&255)}var mr={getGlobalAlpha(e){if(e)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,n=this.parent;for(;n;)t*=n.alpha,n=n.parent;return t},getGlobalTransform(e=new P,t){if(t)return e.copyFrom(this.worldTransform);this.updateLocalTransform();let n=lr(this,rr.get().identity());return e.appendFrom(this.localTransform,n),rr.return(n),e},getGlobalTint(e){if(e)return this.renderGroup?pr(this.renderGroup.worldColor):this.parentRenderGroup?pr(fr(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=fr(t,n.localColor),n=n.parent;return pr(t)}};function hr(e,t,n){return t.clear(),n||=P.IDENTITY,gr(e,t,n,e,!0),t.isValid||t.set(0,0,0,0),t}function gr(e,t,n,r,i){let a;if(i)a=rr.get(),a=n.copyTo(a);else{if(!e.visible||!e.measurable)return;e.updateLocalTransform();let t=e.localTransform;a=rr.get(),a.appendFrom(t,n)}let o=t,s=!!e.effects.length;if(s&&(t=ir.get().clear()),e.boundsArea)t.addRect(e.boundsArea,a);else{e.renderPipeId&&(t.matrix=a,t.addBounds(e.bounds));let n=e.children;for(let e=0;e<n.length;e++)gr(n[e],t,a,r,!1)}if(s){for(let n=0;n<e.effects.length;n++)e.effects[n].addLocalBounds?.(t,r);o.addBounds(t,P.IDENTITY),ir.return(t)}rr.return(a)}function _r(e,t){let n=e.children;for(let e=0;e<n.length;e++){let r=n[e],i=r.uid,a=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,o=t.index;(t.data[o]!==i||t.data[o+1]!==a)&&(t.data[t.index]=i,t.data[t.index+1]=a,t.didChange=!0),t.index=o+2,r.children.length&&_r(r,t)}return t.didChange}var vr=new P,yr={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(e,t){let n=Math.sign(this.scale.x)||1;t===0?this.scale.x=n:this.scale.x=e/t*n},_setHeight(e,t){let n=Math.sign(this.scale.y)||1;t===0?this.scale.y=n:this.scale.y=e/t*n},getLocalBounds(){this._localBoundsCacheData||={data:[],index:1,didChange:!1,localBounds:new an};let e=this._localBoundsCacheData;return e.index=1,e.didChange=!1,e.data[0]!==this._didViewChangeTick&&(e.didChange=!0,e.data[0]=this._didViewChangeTick),_r(this,e),e.didChange&&hr(this,e.localBounds,vr),e.localBounds},getBounds(e,t){return sr(this,e,t||new an)}},br={_onRender:null,set onRender(e){let t=this.renderGroup||this.parentRenderGroup;e?(this._onRender||t?.addOnRender(this),this._onRender=e):(this._onRender&&t?.removeOnRender(this),this._onRender=null)},get onRender(){return this._onRender}},xr={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(e){this._zIndex!==e&&(this._zIndex=e,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Sr))}};function Sr(e,t){return e._zIndex-t._zIndex}var Cr={getGlobalPosition(e=new bt,t=!1){return this.parent?this.parent.toGlobal(this._position,e,t):(e.x=this._position.x,e.y=this._position.y),e},toGlobal(e,t,n=!1){let r=this.getGlobalTransform(rr.get(),n);return t=r.apply(e,t),rr.return(r),t},toLocal(e,t,n,r){t&&(e=t.toGlobal(e,n,r));let i=this.getGlobalTransform(rr.get(),r);return n=i.applyInverse(e,n),rr.return(i),n}},wr=class{constructor(){this.uid=I(`instructionSet`),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){if(this.renderPipes)for(let e in this.renderPipes)this.renderPipes[e].destroyInstructionSet?.(this);this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,[`type`,`action`])}},Tr=class{constructor(){this._screenSizes=new Map,this._widths=[],this._heights=[],this._logicalWidths=[],this._logicalHeights=[]}get size(){return this._screenSizes.size}set(e,t,n,r=1){let i=this._screenSizes.get(e);return i&&i.pixelWidth===t&&i.pixelHeight===n&&i.resolution===r?!1:(this._screenSizes.set(e,{pixelWidth:t,pixelHeight:n,resolution:r}),this._update(),!0)}remove(e){return this._screenSizes.delete(e)?(this._update(),!0):!1}getFittingWidth(e,t=1){return this._getFittingAxis(e,t,this._widths,this._logicalWidths)}getFittingHeight(e,t=1){return this._getFittingAxis(e,t,this._heights,this._logicalHeights)}hasWidth(e){return this._widths.includes(e)}hasHeight(e){return this._heights.includes(e)}_getFittingAxis(e,t,n,r){let i;for(let t=0;t<n.length;t++)if(n[t]>=e){i=n[t];break}for(let n=0;n<r.length;n++){let a=Math.ceil(r[n]*t-1e-6);if(a>=e)return i===void 0?a:Math.min(i,a)}return i}_update(){let e=[...this._screenSizes.values()];this._widths=Er(e.map(e=>e.pixelWidth)),this._heights=Er(e.map(e=>e.pixelHeight)),this._logicalWidths=Er(e.map(e=>e.pixelWidth/e.resolution)),this._logicalHeights=Er(e.map(e=>e.pixelHeight/e.resolution))}};function Er(e){return e.filter((t,n)=>e.indexOf(t)===n).sort((e,t)=>e-t)}var Dr=0,Or=32767,kr=4294967296,Ar=8589934592,jr=Object.create(null),Mr=0;function Nr(e){let t=jr[e];return t===void 0?jr[e]=Mr++:t}function Pr(e,t,n,r,i,a){return(e<<17)+(t<<2)+(!!r<<1)+ +!!n+ +(a===`nearest`)*kr+Nr(i)*Ar}var Fr=new class extends gt{constructor(e){super(),this._buckets=new Map,this._poolKey=Object.create(null),this._poolStyle=Object.create(null),this._screens=new Tr,this._enableFullScreen=!1,this.textureOptions=e||{}}get textureStyle(){return R(Lt,`TexturePool.textureStyle is no longer used, pooled textures carry their own style. Pass scaleMode in the request instead.`),this._textureStyle||=new Jt(this.textureOptions),this._textureStyle}set textureStyle(e){R(Lt,`TexturePool.textureStyle is no longer used, pooled textures carry their own style. Pass scaleMode in the request instead.`),this._textureStyle=e}get enableFullScreen(){return R(Lt,`TexturePool.enableFullScreen is no longer used, the pool sizes textures to the screens registered with setScreenSize.`),this._enableFullScreen}set enableFullScreen(e){R(Lt,`TexturePool.enableFullScreen is no longer used, the pool sizes textures to the screens registered with setScreenSize.`),this._enableFullScreen=e}createTexture(...e){let t=e[0];typeof t==`number`&&(R(Lt,`TexturePool.createTexture params are now an options object. See params: { width, height, antialias, autoGenerateMipmaps }`),t={width:t,height:e[1],antialias:e[2]??!1,autoGenerateMipmaps:e[3]??!1});let n=t.format??this.textureOptions.format??Xt.defaultOptions.format,r=t.scaleMode??this.textureOptions.scaleMode??Jt.defaultOptions.scaleMode;return new z({source:new Xt({...this.textureOptions,width:t.width,height:t.height,resolution:1,antialias:t.antialias??!1,autoGarbageCollect:!1,autoGenerateMipmaps:t.autoGenerateMipmaps??!1,format:n,scaleMode:r}),label:`texturePool_${Dr++}`})}getOptimalTexture(...e){let t=e[0];typeof t==`number`&&(R(Lt,`TexturePool.getOptimalTexture params are now an options object. See params: { width, height, resolution, antialias, autoGenerateMipmaps }`),t={width:t,height:e[1],resolution:e[2]??1,antialias:e[3]??!1,autoGenerateMipmaps:e[4]??!1});let{width:n,height:r}=this.getOptimalSize(t.width,t.height,t.resolution??1);return this._getTexture(n,r,t)}getAlignedTexture(e,t,n){let r=e.source,i=t/r._resolution;return this._getTexture(Math.ceil(r.pixelWidth*i-1e-6),Math.ceil(r.pixelHeight*i-1e-6),{width:e.frame.width,height:e.frame.height,resolution:t,format:n})}_getTexture(e,t,n){let r=n.width,i=n.height,a=n.resolution??1,o=n.antialias??!1,s=n.autoGenerateMipmaps??!1,c=n.format??this.textureOptions.format??Xt.defaultOptions.format,l=n.scaleMode??this.textureOptions.scaleMode??Jt.defaultOptions.scaleMode;(e>Or||t>Or)&&Gn(`TexturePool: ${e}x${t} is larger than the ${Or}px pool key limit, textures of this size may be pooled together`);let u=Pr(e,t,o,s,c,l),d=this._buckets.get(u);d||(d=[],this._buckets.set(u,d));let f=d.pop();return f||(f=this.createTexture({width:e,height:t,antialias:o,autoGenerateMipmaps:s,format:c,scaleMode:l}),this._poolStyle[f.uid]=f.source.style),f.source._resolution=a,f.source.width=e/a,f.source.height=t/a,f.source.pixelWidth=e,f.source.pixelHeight=t,f.frame.x=0,f.frame.y=0,f.frame.width=r,f.frame.height=i,f.updateUvs(),this._poolKey[f.uid]=u,f}getOptimalSize(e,t,n=1){let r=Math.ceil(e*n-1e-6),i=Math.ceil(t*n-1e-6),a=Ht(r),o=this._screens.getFittingWidth(r,n),s=Ht(i),c=this._screens.getFittingHeight(i,n);return{width:o===void 0?a:Math.min(o,a),height:c===void 0?s:Math.min(c,s)}}getSameSizeTexture(e,t=!1){let n=e.source;return this.getOptimalTexture({width:e.width,height:e.height,resolution:n._resolution,antialias:t})}returnTexture(e,t=!1){let n=e.uid,r=this._poolKey[n];if(r===void 0){Gn(`TexturePool: returnTexture was passed a texture that did not come from this pool, ignoring it`);return}let i=this._poolStyle[n];t&&e.source.style!==i&&(e.source.style=i);let a=this._buckets.get(r);a?a.push(e):this._dropTextures([e],!0)}setScreenSize(e,t,n,r=1){this._screens.set(e,t,n,r)&&this._pruneScreenTextures()}removeScreen(e){this._screens.remove(e)&&this._pruneScreenTextures()}_pruneScreenTextures(){for(let[e,t]of this._buckets){let n=e>>>0,r=n>>>17,i=n>>>2&32767;(!Ut(r)&&!this._screens.hasWidth(r)||!Ut(i)&&!this._screens.hasHeight(i))&&(this._dropTextures(t,!0),this._buckets.delete(e))}}_dropTextures(e,t){t&&e.length>0&&this.emit(`evict`);for(let n=0;n<e.length;n++){let r=e[n];delete this._poolKey[r.uid],delete this._poolStyle[r.uid],t&&r.destroy(!0)}}clear(e){for(let t of this._buckets.values())this._dropTextures(t,e!==!1);this._buckets.clear()}};Kn.register(Fr);var Ir=class{constructor(){this.renderPipeId=`renderGroup`,this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new P,this.worldColorAlpha=0xffffffff,this.worldColor=0xffffff,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new wr,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;let t=e.children;for(let e=0;e<t.length;e++){let n=t[e];n._updateFlags=15,this.addChild(n)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&=(Fr.returnTexture(this.texture),null)}updateCacheTexture(){this.textureNeedsUpdate=!0;let e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.relativeRenderGroupDepth=e.parent===this.root?1:e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let e=0;e<t.length;e++)this.addChild(t[e])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let e=0;e<t.length;e++)this.removeChild(t[e])}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t])}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]},t.list[t.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.indexOf(e)===-1&&this._onRenderContainers.push(e)}removeOnRender(e){let t=this._onRenderContainers.indexOf(e);t!==-1&&this._onRenderContainers.splice(t,1)}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet?.destroy(),this.instructionSet=null}getChildren(e=[]){let t=this.root.children;for(let n=0;n<t.length;n++)this._getChildren(t[n],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let n=e.children;for(let e=0;e<n.length;e++)this._getChildren(n[e],t);return t}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return this._matrixDirty&1?(this._matrixDirty&=-2,this._inverseWorldTransform||=new P,this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return this._matrixDirty&2?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||=new P,this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(this._matrixDirty&4))return this._inverseParentTextureTransform;this._matrixDirty&=-5;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||=new P,this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};function Lr(e,t,n={}){for(let r in t)!n[r]&&t[r]!==void 0&&(e[r]=t[r])}var Rr=new ht(null),zr=new ht(null),Br=new ht(null,1,1),Vr=new ht(null),Hr=class e extends gt{constructor(e={}){super(),this.uid=I(`renderable`),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new P,this.relativeGroupTransform=new P,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new ht(this,0,0),this._scale=Br,this._pivot=zr,this._origin=Vr,this._skew=Rr,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=0xffffff,this.localAlpha=1,this.groupAlpha=1,this.groupColor=0xffffff,this.groupColorAlpha=0xffffffff,this.localBlendMode=`inherit`,this.groupBlendMode=`normal`,this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Lr(this,e,{children:!0,parent:!0,effects:!0}),e.children?.forEach(e=>this.addChild(e)),e.parent?.addChild(this)}static mixin(t){R(`8.8.0`,`Container.mixin is deprecated, please use extensions.mixin instead.`),at.mixin(e,t)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||R(L,`addChild: Only Containers will be allowed to add children in v8.0.0`),e.length>1){for(let t=0;t<e.length;t++)this.addChild(e[t]);return e[0]}let t=e[0],n=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),n&&(n.structureDidChange=!0),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=!0),t.parent=this,t.didChange=!0,t._updateFlags=15,n&&n.addChild(t),this.emit(`childAdded`,t,this,this.children.length-1),t.emit(`added`,this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let t=0;t<e.length;t++)this.removeChild(e[t]);return e[0]}let t=e[0],n=this.children.indexOf(t);return n>-1&&(this._didViewChangeTick++,this.children.splice(n,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit(`childRemoved`,t,this,n),t.emit(`removed`,this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=Jn.get(Ir,this),this.groupTransform=P.IDENTITY,e?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),Jn.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||=new P,this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*vt}set angle(e){this.rotation=e*yt}get pivot(){return this._pivot===zr&&(this._pivot=new ht(this,0,0)),this._pivot}set pivot(e){this._pivot===zr&&(this._pivot=new ht(this,0,0),this._origin!==Vr&&Gn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`)),typeof e==`number`?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===Rr&&(this._skew=new ht(this,0,0)),this._skew}set skew(e){this._skew===Rr&&(this._skew=new ht(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===Br&&(this._scale=new ht(this,1,1)),this._scale}set scale(e){this._scale===Br&&(this._scale=new ht(this,0,0)),typeof e==`string`&&(e=parseFloat(e)),typeof e==`number`?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===Vr&&(this._origin=new ht(this,0,0)),this._origin}set origin(e){this._origin===Vr&&(this._origin=new ht(this,0,0),this._pivot!==zr&&Gn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`)),typeof e==`number`?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||={};let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let n=this.getLocalBounds();typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,n.width),t!==void 0&&this._setHeight(t,n.height)}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set(typeof e.x==`number`?e.x:this.position.x,typeof e.y==`number`?e.y:this.position.y),this.scale.set(typeof e.scaleX==`number`?e.scaleX:this.scale.x,typeof e.scaleY==`number`?e.scaleY:this.scale.y),this.rotation=typeof e.rotation==`number`?e.rotation:this.rotation,this.skew.set(typeof e.skewX==`number`?e.skewX:this.skew.x,typeof e.skewY==`number`?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX==`number`?e.pivotX:this.pivot.x,typeof e.pivotY==`number`?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX==`number`?e.originX:this.origin.x,typeof e.originY==`number`?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,n=this._scale,r=this._pivot,i=this._origin,a=this._position,o=n._x,s=n._y,c=r._x,l=r._y,u=-i._x,d=-i._y;t.a=this._cx*o,t.b=this._sx*o,t.c=this._cy*s,t.d=this._sy*s,t.tx=a._x-(c*t.a+l*t.c)+(u*t.a+d*t.c)-u,t.ty=a._y-(c*t.b+l*t.d)+(u*t.b+d*t.d)-d}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=1,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){let t=typeof e==`number`?pr(e):Vn.shared.setValue(e??0xffffff).toBgrNumber();t!==this.localColor&&(this.localColor=t,this._updateFlags|=1,this._onUpdate())}get tint(){return pr(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=2,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=2,this._onUpdate(),this.emit(`visibleChanged`,e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){let t=+!!e;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=4,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){if(this.destroyed)return;this.destroyed=!0;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit(`destroyed`,this),this.removeAllListeners(),(typeof e==`boolean`?e:e?.children)&&t)for(let n=0;n<t.length;++n)t[n].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null}};at.mixin(Hr,Zn,or,Cr,br,yr,tr,nr,xr,Hn,Yn,mr,Qn);var Ur=class extends Hr{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new an(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty&&=(this.updateBounds(),!1),this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=+!!e}containsPoint(e){let t=this.bounds,{x:n,y:r}=e;return n>=t.minX&&n<=t.maxX&&r>=t.minY&&r<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,t,n){let{renderPipes:r}=t;r.blendMode.pushBlendMode(this,this.groupBlendMode,e);let i=r[this.renderPipeId];i?.addRenderable&&i.addRenderable(this,e),this.didViewUpdate=!1;let a=this.children,o=a.length;for(let r=0;r<o;r++)a[r].collectRenderables(e,t,n);r.blendMode.popBlendMode(e)}},Wr=class e extends Ur{constructor(e=z.EMPTY){e instanceof z&&(e={texture:e});let{texture:t=z.EMPTY,anchor:n,roundPixels:r,width:i,height:a,...o}=e;super({label:`Sprite`,...o}),this.renderPipeId=`sprite`,this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new ht({_onUpdate:()=>{this.onViewUpdate()}}),n?this.anchor=n:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=r??!1,i!==void 0&&(this.width=i),a!==void 0&&(this.height=a)}static from(t,n=!1){return t instanceof z?new e(t):new e(z.from(t,n))}set texture(e){e||=z.EMPTY;let t=this._texture;t!==e&&(t&&t.dynamic&&t.off(`update`,this.onViewUpdate,this),e.dynamic&&e.on(`update`,this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return nn(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return R(`8.6.1`,`Sprite.sourceBounds is deprecated, use visualBounds instead.`),this.visualBounds}updateBounds(){let e=this._anchor,t=this._texture,n=this._bounds,{width:r,height:i}=t.orig;n.minX=-e._x*r,n.maxX=n.minX+r,n.minY=-e._y*i,n.maxY=n.minY+i}destroy(e=!1){if(super.destroy(e),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._texture.destroy(t)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e==`number`?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||={},e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height)}},Gr=new an;function Kr(e,t,n){let r=Gr;e.measurable=!0,sr(e,n,r),t.addBoundsMask(r),e.measurable=!1}function qr(e,t,n){let r=ir.get();e.measurable=!0;let i=rr.get().identity();hr(e,r,Jr(e,n,i)),e.measurable=!1,t.addBoundsMask(r),rr.return(i),ir.return(r)}function Jr(e,t,n){return e?(e!==t&&(Jr(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(Gn(`Mask bounds, renderable is not inside the root container`),n)}var Yr=class{constructor(e){this.priority=0,this.inverse=!1,this.channel=`red`,this.pipe=`alphaMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Wr),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||Kr(this.mask,e,t)}addLocalBounds(e,t){qr(this.mask,e,t)}containsPoint(e,t){return t(this.mask,e)}destroy(){this.reset()}static test(e){return e instanceof Wr}};Yr.extension=N.MaskEffect;var Xr=class{constructor(e){this.priority=0,this.pipe=`colorMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e==`number`}};Xr.extension=N.MaskEffect;var Zr=class{constructor(e){this.priority=0,this.pipe=`stencilMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){Kr(this.mask,e,t)}addLocalBounds(e,t){qr(this.mask,e,t)}containsPoint(e,t){return t(this.mask,e)}destroy(){this.reset()}static test(e){return e instanceof Hr}};Zr.extension=N.MaskEffect;var Qr={createCanvas:(e,t)=>{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,`text/xml`)},$r={get(){return Qr},set(e){Qr=e}},ei=class extends Xt{constructor(e){e.resource||=$r.get().createCanvas(),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId=`image`,this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&`style`in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,t=this.height,n=this._resolution){let r=super.resize(e,t,n);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||=this.resource.getContext(`2d`)}};ei.extension=N.TextureSource;var ti=class extends Xt{constructor(e){super(e),this.uploadMethodId=`image`,this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}};ti.extension=N.TextureSource;var ni=(e=>(e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`,e))(ni||{}),ri=class{constructor(e,t=null,n=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=t,this.priority=n,this._once=r}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}},ii=class e{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 ri(null,null,1/0),this.deltaMS=1/e.targetFPMS,this.elapsedMS=1/e.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,n=ni.NORMAL){return this._addListener(new ri(e,t,n))}addOnce(e,t,n=ni.NORMAL){return this._addListener(new ri(e,t,n,!0))}_addListener(e){let t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this}remove(e,t){let n=this._head.next;for(;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){let e=t-this._lastFrame|0;if(e<this._minElapsedMS)return;this._lastFrame=t-e%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*e.targetFPMS;let r=this._head,i=r.next;for(;i;)i=i.emit(this);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){let n=Math.min(Math.max(0,t)/1e3,e.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!e._shared){let t=e._shared=new e;t.autoStart=!0,t._protected=!0}return e._shared}static get system(){if(!e._system){let t=e._system=new e;t.autoStart=!0,t._protected=!0}return e._system}};ii.targetFPMS=.06;var ai=ii,oi;async function si(){return oi??=(async()=>{let e=$r.get().createCanvas(1,1).getContext(`webgl`);if(!e)return`premultiply-alpha-on-upload`;let t=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!t)return`premultiply-alpha-on-upload`;let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(n),e.getExtension(`WEBGL_lose_context`)?.loseContext(),i[0]<=i[3]?`premultiplied-alpha`:`premultiply-alpha-on-upload`})(),oi}var ci=class e extends Xt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId=`video`,t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??`premultiply-alpha-on-upload`,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._onCanPlayThrough=this._onCanPlayThrough.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),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=ai.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this._videoFrameRequestCallbackHandle=this.destroyed?null:this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlayThrough),e.addEventListener(`error`,this._onError,!0)),this.isValid||e.addEventListener(`loadedmetadata`,this._onLoadedMetadata),this.alphaMode=await si(),this._load=new Promise((n,r)=>{this.isValid?n(this):(this._resolve=n,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener(`error`,this._onError,!0),this.emit(`error`,e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onLoadedMetadata(){this.isValid&&this._mediaReady()}_onCanPlay(){this.resource.removeEventListener(`canplay`,this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener(`canplaythrough`,this._onCanPlayThrough),this._preloadTimeout&&=(clearTimeout(this._preloadTimeout),void 0),this._mediaReady()}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&this.isValid&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlayThrough),e.removeEventListener(`loadedmetadata`,this._onLoadedMetadata),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ai.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ai.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ai.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};ci.extension=N.TextureSource,ci.defaultOptions={...Xt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},ci.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var li=ci,ui=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(e=>typeof e==`string`||n?t(e):e):e),di=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||Gn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let n=ui(e),r;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];if(i.test(t)){r=i.getCacheableAssets(n,t);break}}let i=new Map(Object.entries(r||{}));r||n.forEach(e=>{i.set(e,t)});let a=[...i.keys()],o={cacheKeys:a,keys:n};n.forEach(e=>{this._cacheMap.set(e,o)}),a.forEach(e=>{let n=r?r[e]:t;this._cache.has(e)&&this._cache.get(e)!==n&&Gn(`[Cache] already has key:`,e),this._cache.set(e,i.get(e))})}remove(e){if(!this._cacheMap.has(e)){Gn(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(e=>{this._cache.delete(e)}),t.keys.forEach(e=>{this._cacheMap.delete(e)})}get parsers(){return this._parsers}},fi=[];at.handleByList(N.TextureSource,fi);function pi(e={}){let t=e&&e.resource,n=t?e.resource:e,r=t?e:{resource:e};for(let e=0;e<fi.length;e++){let t=fi[e];if(t.test(n))return new t(r)}throw Error(`Could not find a source type for resource: ${r.resource}`)}function mi(e={},t=!1){let n=e&&e.resource,r=n?e.resource:e,i=n?e:{resource:e};if(!t&&di.has(r))return di.get(r);let a=new z({source:pi(i)});return a.on(`destroy`,()=>{di.has(r)&&di.remove(r)}),t||di.set(r,a),a}z.from=function(e,t=!1){return typeof e==`string`?di.get(e):e instanceof Xt?new z({source:e}):mi(e,t)},Xt.from=pi,at.add(Yr,Xr,Zr,li,ti,ei,$t);var hi=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(hi||{});function gi(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function _i(e){return e.split(`?`)[0].split(`#`)[0]}function vi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function yi(e,t,n){return e.replace(new RegExp(vi(t),`g`),n)}function bi(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(i!==s-1&&a!==1){if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var xi={toPosix(e){return yi(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){gi(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(e,t,n){if(gi(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;let r=_i(this.toPosix(t??$r.get().getBaseUrl())),i=_i(this.toPosix(n??this.rootname(r)));return e=this.toPosix(e),e.startsWith(`/`)?xi.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(r,e)},normalize(e){if(gi(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=bi(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return gi(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(gi(r),r.length>0){if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(gi(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){gi(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){gi(e),t&&gi(t),e=_i(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){gi(e),e=_i(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){gi(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=_i(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l)if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}}else s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1);return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(t.base=t.name=o===0&&r?e.slice(1,s):e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]};function Si(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?Si(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function Ci(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),Si(e,r,0,t,n)}else n.push(e);return n}var wi=e=>!Array.isArray(e),Ti=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${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(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}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(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,src:n}=e;return ui(t||n,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e):e?.src?e.src:e,!0)}removeAlias(e,t){this._assetMap[e]&&(t&&t!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&Gn(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[],r=t;Array.isArray(t)||(r=Object.entries(t).map(([e,t])=>typeof t==`string`||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t})),r.forEach(t=>{let r=t.src,i=t.alias,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}),this._bundles[e]=n}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=e=>{this.hasKey(e)&&Gn(`[Resolver] already has key: ${e} overwriting`)};ui(t).forEach(e=>{let{src:t}=e,{data:r,format:i,loadParser:a,parser:o}=e,s=ui(t).map(e=>typeof e==`string`?Ci(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(n):n(c);let l=[],u=e=>({src:e,...this._parsers.find(t=>t.test(e))?.parse(e)});s.forEach(t=>{t.forEach(t=>{let n={};if(typeof t==`object`?(r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,o=t.parser??o),n={...u(t.src),...t}):n=u(t),!c)throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);n=this._buildResolvedAsset(n,{aliases:c,data:r,format:i,loadParser:a,parser:o,progressSize:e.progressSize}),l.push(n)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=wi(e);e=ui(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=wi(e);e=ui(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e]){if(this._assetMap[e]){let t=this._assetMap[e],n=this._getPreferredOrder(t);n?.priority.forEach(e=>{n.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{})}n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let n=e[t],r=this._preferredOrder.find(e=>e.params.format.includes(n.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}_buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,parser:a,format:o,progressSize:s}=t;return(this._basePath||this._rootPath)&&(e.src=xi.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=a??e.parser,e.format=o??e.format??Ei(e.src),s!==void 0&&(e.progressSize=s),e}};Ti.RETINA_PREFIX=/@([0-9\.]+)x/;function Ei(e){return e.split(`.`).pop().split(`?`).shift().split(`#`).shift()}var Di=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e},Oi=class e{constructor(e,t){this.linkedSheets=[];let n=e;e?.source instanceof Xt&&(n={texture:e,data:t});let{texture:r,data:i,cachePrefix:a=``}=n;this.cachePrefix=a,this._texture=r instanceof z?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=i;let o=parseFloat(i.meta.scale);o?(this.resolution=o,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let r=t,i=n?1/0:e.BATCH_SIZE;for(;r-t<i&&r<this._frameKeys.length;){let e=this._frameKeys[r],t=this._frames[e],n=t.frame;if(n){let r=null,i=null,a=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,o=new Nt(0,0,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution);r=t.rotated?new Nt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.h)/this.resolution,Math.floor(n.w)/this.resolution):new Nt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(i=new Nt(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution)),this.textures[e]=new z({source:this.textureSource,frame:r,orig:o,trim:i,rotate:t.rotated?2:0,defaultAnchor:t.anchor,defaultBorders:t.borders,label:e.toString()})}r++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Oi.BATCH_SIZE=1e3;var ki=Oi,Ai=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`basis`,`etc2`,`bc7`,`bc6h`,`bc5`,`bc4`,`bc3`,`bc2`,`bc1`,`eac`,`astc`];function ji(e,t,n){let r={};if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=xi.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{let a=ji([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0);Object.assign(r,a)})}return r}var Mi={extension:N.Asset,cache:{test:e=>e instanceof ki,getCacheableAssets:(e,t)=>ji(e,t,!1)},resolver:{extension:{type:N.ResolveParser,name:`resolveSpritesheet`},test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&Ai.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(Ti.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,id:`spritesheet`,extension:{type:N.LoadParser,priority:hi.Normal,name:`spritesheetLoader`},async testParse(e,t){return xi.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:i,textureOptions:a,cachePrefix:o}=t?.data??{},s=xi.dirname(t.src);s&&s.lastIndexOf(`/`)!==s.length-1&&(s+=`/`);let c;if(r instanceof z)c=r;else{let r=Di(s+(i??e.meta.image),t.src);c=(await n.load([{src:r,data:a}]))[r]}let l=new ki({texture:c.source,data:e,cachePrefix:o});await l.parse();let u=e?.meta?.related_multi_packs;if(Array.isArray(u)){let e=[];for(let r of u){if(typeof r!=`string`)continue;let i=s+r;t.data?.ignoreMultiPack||(i=Di(i,t.src),e.push(n.load({src:i,data:{textureOptions:a,ignoreMultiPack:!0}})))}let r=await Promise.all(e);l.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[l].concat(l.linkedSheets.filter(t=>t!==e))})}return l},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};at.add(Mi);var Ni=Object.create(null),Pi=Object.create(null);function Fi(e,t){let n=Pi[e];return n===void 0&&(Ni[t]===void 0&&(Ni[t]=1),Pi[e]=n=Ni[t]++),n}function Ii(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm,``)}var Li=RegExp(`(?:layout\\s*\\(\\s*location\\s*=\\s*(\\d+)\\s*\\)\\s*)?\\bout\\s+(?:(?:highp|mediump|lowp)\\s+)?\\w+\\s+\\w+\\s*(?:\\[\\s*(\\d+)\\s*\\])?\\s*;`,`g`);function Ri(e){if(!e.includes(`#version 300 es`))return e.includes(`gl_FragData`)?null:1;let t=Ii(e),n=0,r;for(;(r=Li.exec(t))!==null;){let e=r[1]===void 0?0:parseInt(r[1],10),t=r[2]===void 0?1:parseInt(r[2],10);n|=(1<<t)-1<<e}return Li.lastIndex=0,n||(/\bout\b/.test(t)?null:0)}var zi;function Bi(){return(!zi||zi?.isContextLost())&&(zi=$r.get().createCanvas().getContext(`webgl`,{})),zi}var Vi;function Hi(){if(!Vi){Vi=`mediump`;let e=Bi();e&&e.getShaderPrecisionFormat&&(Vi=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?`highp`:`mediump`)}return Vi}function Ui(e,t,n){return t?e:n?(e=e.replace(`out vec4 finalColor;`,``),`
5
+ `),a?(console.groupCollapsed(`%cPixiJS Deprecation Warning: %c%s`,`color:#614108;background:#fffbe6`,`font-weight:normal;color:#614108;background:#fffbe6`,i),console.warn(r),console.groupEnd()):(console.warn(`PixiJS Deprecation Warning: `,i),console.warn(r))),Ft.add(t)});Object.defineProperties(R,{quiet:{get:()=>zt.quiet,set:e=>{zt.quiet=e},enumerable:!0,configurable:!1},noColor:{get:()=>zt.noColor,set:e=>{zt.noColor=e},enumerable:!0,configurable:!1}});var Bt=()=>{};function Vt(e){return e.endsWith(`int`)}function Ht(e){return e+=+(e===0),--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function Ut(e){return!(e&e-1)&&!!e}function Wt(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}var Gt=Object.create(null);function Kt(e){let t=Gt[e];return t===void 0&&(Gt[e]=I(`resource`)),t}var qt=class e extends gt{constructor(t={}){super(),this._resourceType=`textureSampler`,this._maxAnisotropy=1,this.destroyed=!1,t={...e.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){R(L,`TextureStyle.wrapMode is now TextureStyle.addressMode`),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode=`linear`)}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit(`change`,this)}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Kt(e),this._resourceId}destroy(){this.destroyed=!0,this.emit(`destroy`,this),this.emit(`change`,this),this.removeAllListeners()}};qt.defaultOptions={addressMode:`clamp-to-edge`,scaleMode:`linear`};var Jt=qt,Yt=class e extends gt{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=I(`textureSource`),this._resourceType=`textureSource`,this._resourceId=I(`resource`),this.uploadMethodId=`unknown`,this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format=`rgba8unorm`,this.dimension=`2d`,this.viewDimension=`2d`,this.arrayLayerCount=1,this.depth=1,this._ownsStyle=!1,this.antialias=!1,this.transient=!1,this.storage=!1,this._batchTick=-1,this._textureBindLocation=-1;let n=t;t={...e.defaultOptions,...t};let r=Zt(t),i=r===`3d`||r===`1d`?r:`2d`;Qt(n,r,i),this.label=t.label??``,this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,this.pixelWidth=t.width?t.width*this._resolution:this.resource?this.resourceWidth??1:1,this.pixelHeight=t.height?t.height*this._resolution:this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=i,this.viewDimension=r,this.arrayLayerCount=t.arrayLayerCount,this.depth=i===`3d`?t.depth??1:1,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=i!==`3d`&&t.antialias,this.transient=t.transient??!1,this.storage=t.storage??!1,this.alphaMode=t.alphaMode,this.style=new Jt(Wt(t)),this._ownsStyle=!0,this.destroyed=!1,this._refreshPOT()}get depthOrArrayLayers(){return this.dimension===`3d`?this.depth:this.arrayLayerCount||1}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._ownsStyle=!1,this._style?.off(`change`,this._onStyleChange,this),this._style=e,this._style?.on(`change`,this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit(`styleChange`,this)}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit(`update`,this)}destroy(){this.destroyed=!0,this.unload(),this.emit(`destroy`,this),this._style&&=(this._ownsStyle&&this._style.destroy(),null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=I(`resource`),this.emit(`change`,this),this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,t,n){n||=this._resolution,e||=this.width,t||=this.height;let r=Math.round(e*n),i=Math.round(t*n);return this.width=r/n,this.height=i/n,this._resolution=n,this.pixelWidth===r&&this.pixelHeight===i?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=i,this.emit(`resize`,this),this._resourceId=I(`resource`),this.emit(`change`,this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit(`updateMipmaps`,this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Ut(this.pixelWidth)&&Ut(this.pixelHeight)}static test(e){throw Error(`Unimplemented`)}};Yt.defaultOptions={resolution:1,format:`bgra8unorm`,alphaMode:`premultiply-alpha-on-upload`,arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};var Xt=Yt;function Zt(e){return e.viewDimension?e.viewDimension:e.depth?`3d`:e.arrayLayerCount>1?`2d-array`:`2d`}function Qt(e,t,n){if(e.depth!==void 0&&typeof e.depth!=`number`)throw Error(`[TextureSource] depth is a 3D texture's depth in texels, but got ${e.depth}. For a depth buffer, use the depth option of a RenderTarget or the renderer.`);if(e.depth&&e.arrayLayerCount>1)throw Error(`[TextureSource] depth and arrayLayerCount can't be combined: use depth for a 3D texture or arrayLayerCount for a 2D array.`);if(e.depth&&t!==`3d`)throw Error(`[TextureSource] depth makes a 3D texture, but viewDimension is '${t}'. Use arrayLayerCount for layered textures.`);if(t===`3d`&&e.arrayLayerCount>1)throw Error(`[TextureSource] a 3D texture takes depth, not arrayLayerCount.`);if(e.dimensions&&e.dimensions!==n)throw Error(`[TextureSource] dimensions '${e.dimensions}' doesn't match viewDimension '${t}'. Leave dimensions out; it is derived from the view.`);if(e.dimensions&&R(Rt,`TextureSource dimensions is derived from viewDimension and depth; leave it out.`),n===`3d`&&e.antialias)throw Error(`[TextureSource] a 3D texture can't be antialiased: WebGPU has no multisampled 3D textures.`)}var $t=class extends Xt{constructor(e){let t=e.depth??e.arrayLayerCount??1,n=e.resource||new Float32Array(e.width*e.height*t*4),r=e.format;r||=n instanceof Float32Array?`rgba32float`:n instanceof Int32Array||n instanceof Uint32Array?`rgba32uint`:n instanceof Int16Array||n instanceof Uint16Array?`rgba16uint`:(n instanceof Int8Array,`bgra8unorm`);let i=Vt(r)||t>1;super({...i&&{alphaMode:`no-premultiply-alpha`},...e,resource:n,format:r}),this.uploadMethodId=`buffer`,this._updateStart=0,this._updateEnd=1/0}update(e=0,t=1/0){if((e>0||t<1/0)&&this.depthOrArrayLayers>1)throw Error(`[BufferImageSource] a 3D texture or 2D array uploads whole: call update() with no range.`);this._updateStart=e,this._updateEnd=t,super.update(),this._updateStart=0,this._updateEnd=1/0}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};$t.extension=N.TextureSource;var en=new P,tn=class{constructor(e,t){this.mapCoord=new P,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,this.clampMargin=t===void 0?e.width<10?0:.5:t,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture?.removeListener(`update`,this.update,this),this._texture=e,this._texture.addListener(`update`,this.update,this)),this.update()}destroy(){this._texture?.removeListener(`update`,this.update,this),this._texture=null}multiplyUvs(e,t){t===void 0&&(t=e);let n=this.mapCoord;for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];t[r]=i*n.a+a*n.c+n.tx,t[r+1]=i*n.b+a*n.d+n.ty}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let n=e.orig,r=e.trim;r&&(en.set(n.width/r.width,0,0,n.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(en));let i=e.source,a=this.uClampFrame,o=this.clampMargin/i._resolution,s=this.clampOffset/i._resolution;return a[0]=(e.frame.x+o+s)/i.width,a[1]=(e.frame.y+o+s)/i.height,a[2]=(e.frame.x+e.frame.width-o+s)/i.width,a[3]=(e.frame.y+e.frame.height-o+s)/i.height,this.uClampOffset[0]=this.clampOffset/i.pixelWidth,this.uClampOffset[1]=this.clampOffset/i.pixelHeight,this.isSimple=e.frame.width===i.width&&e.frame.height===i.height&&e.rotate===0,!0}},z=class extends gt{constructor({source:e,label:t,frame:n,orig:r,trim:i,defaultAnchor:a,defaultBorders:o,rotate:s,dynamic:c}={}){if(super(),this.uid=I(`texture`),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Nt,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=t,this.source=e?.source??new Xt,this.noFrame=!n,n)this.frame.copyFrom(n);else{let{width:e,height:t}=this._source;this.frame.width=e,this.frame.height=t}this.orig=r||this.frame,this.trim=i,this.rotate=s??0,this.defaultAnchor=a,this.defaultBorders=o,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off(`resize`,this.update,this),this._source=e,e.on(`resize`,this.update,this),this.emit(`update`,this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||=new tn(this),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:n,height:r}=this._source,i=t.x/n,a=t.y/r,o=t.width/n,s=t.height/r,c=this.rotate;if(c){let t=o/2,n=s/2,r=i+t,l=a+n;c=F.add(c,F.NW),e.x0=r+t*F.uX(c),e.y0=l+n*F.uY(c),c=F.add(c,2),e.x1=r+t*F.uX(c),e.y1=l+n*F.uY(c),c=F.add(c,2),e.x2=r+t*F.uX(c),e.y2=l+n*F.uY(c),c=F.add(c,2),e.x3=r+t*F.uX(c),e.y3=l+n*F.uY(c)}else e.x0=i,e.y0=a,e.x1=i+o,e.y1=a,e.x2=i+o,e.y2=a+s,e.x3=i,e.y3=a+s}destroy(e=!1){this._source&&(this._source.off(`resize`,this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit(`destroy`,this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit(`update`,this)}get baseTexture(){return R(L,`Texture.baseTexture is now Texture.source`),this._source}};z.EMPTY=new z({label:`EMPTY`,source:new Xt({label:`EMPTY`})}),z.EMPTY.destroy=Bt,z.WHITE=new z({source:new $t({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:`premultiply-alpha-on-upload`,label:`WHITE`}),label:`WHITE`}),z.WHITE.destroy=Bt;function nn(e,t,n){let{width:r,height:i}=n.orig,a=n.trim;if(a){let n=a.width,o=a.height;e.minX=a.x-t._x*r,e.maxX=e.minX+n,e.minY=a.y-t._y*i,e.maxY=e.minY+o}else e.minX=-t._x*r,e.maxX=e.minX+r,e.minY=-t._y*i,e.maxY=e.minY+i}for(var rn=new P,an=class e{constructor(e=1/0,t=1/0,n=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=rn,this.minX=e,this.minY=t,this.maxX=n,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||=new Nt;let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=rn,this}set(e,t,n,r){this.minX=e,this.minY=t,this.maxX=n,this.maxY=r}addFrame(e,t,n,r,i){i||=this.matrix;let a=i.a,o=i.b,s=i.c,c=i.d,l=i.tx,u=i.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,h=a*e+s*t+l,g=o*e+c*t+u;h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*n+s*t+l,g=o*n+c*t+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*e+s*r+l,g=o*e+c*r+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*n+s*r+l,g=o*n+c*r+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t)}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){let t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,{a,b:o,c:s,d:c,tx:l,ty:u}=e,d=a*t+s*n+l,f=o*t+c*n+u;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=a*r+s*n+l,f=o*r+c*n+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=a*t+s*i+l,f=o*t+c*i+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=a*r+s*i+l,f=o*r+c*i+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,n,r){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<n&&(this.minY=n),this.maxY>r&&(this.maxY=r),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new e(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,n,r){let i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;r||=this.matrix;let c=r.a,l=r.b,u=r.c,d=r.d,f=r.tx,p=r.ty;for(let r=t;r<n;r+=2){let t=e[r],n=e[r+1],m=c*t+u*n+f,h=l*t+d*n+p;i=m<i?m:i,a=h<a?h:a,o=m>o?m:o,s=h>s?h:s}this.minX=i,this.minY=a,this.maxX=o,this.maxY=s}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}},on={grad:.9,turn:360,rad:360/(2*Math.PI)},sn=function(e){return typeof e==`string`?e.length>0:typeof e==`number`},cn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n+0},ln=function(e){var t=Math.round(100*e)/100;return Math.round(255*t)===255*e?t:Math.round(1e3*e)/1e3},un=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},dn=function(e){return(e=isFinite(e)?e%360:0)<0?e+360:e},fn=function(e,t){return t===void 0&&(t=0),cn(t?e:e+1e-9,t)%360},pn=function(e){return{r:un(e.r,0,255),g:un(e.g,0,255),b:un(e.b,0,255),a:un(e.a)}},mn=function(e){return{r:cn(e.r),g:cn(e.g),b:cn(e.b),a:ln(e.a)}},hn=/^#([0-9a-f]{3,8})$/i,gn=function(e,t){var n=e.charCodeAt(t);return(15&n)+9*(n>>6)},_n=function(e,t){return gn(e,t)<<4|gn(e,t+1)},vn=[],yn=0;yn<256;yn++)vn.push((yn<16?`0`:``)+yn.toString(16));var bn=function(e){return vn[un(e,0,255)]},xn=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},Sn=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6,u=function(e){return Math.round(255e9*e)/1e9+0};return{r:u([r,s,o,o,c,r][l]),g:u([c,r,r,s,o,o][l]),b:u([o,o,c,r,r,s][l]),a:i}},Cn=function(e){return{h:dn(e.h),s:un(e.s,0,100),l:un(e.l,0,100),a:un(e.a)}},wn=function(e){return{h:fn(e.h),s:cn(e.s+1e-9),l:cn(e.l),a:ln(e.a)}},Tn=function(e){return Sn((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},En=function(e){return{h:(t=xn(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},Dn=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%\s*(?:,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,On=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)%?\s*(?:\/\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,kn=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*(?:,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,An=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s+([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*(?:\/\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,jn={string:[[function(e){if(!hn.test(e))return null;var t=e.length;return t<=5?{r:17*gn(e,1),g:17*gn(e,2),b:17*gn(e,3),a:t===5?17*gn(e,4)/255:1}:t===7||t===9?{r:_n(e,1),g:_n(e,3),b:_n(e,5),a:t===9?_n(e,7)/255:1}:null},`hex`],[function(e){var t=kn.exec(e);if(t&&(t[2]!==t[4]||t[4]!==t[6]))return null;var n=t||An.exec(e);return n?pn({r:Number(n[1])/(n[2]?100/255:1),g:Number(n[3])/(n[4]?100/255:1),b:Number(n[5])/(n[6]?100/255:1),a:n[7]===void 0?1:Number(n[7])/(n[8]?100:1)}):null},`rgb`],[function(e){var t=Dn.exec(e)||On.exec(e);if(!t)return null;var n,r;return Tn(Cn({h:(n=t[1],r=t[2],r===void 0&&(r=`deg`),Number(n)*(on[r.toLowerCase()]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}))},`hsl`]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i===void 0?1:i;return sn(t)&&sn(n)&&sn(r)?pn({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},`rgb`],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,a=i===void 0?1:i;return!sn(t)||!sn(n)||!sn(r)?null:Tn(Cn({h:Number(t),s:Number(n),l:Number(r),a:Number(a)}))},`hsl`],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,a=i===void 0?1:i;return!sn(t)||!sn(n)||!sn(r)?null:Sn(function(e){return{h:dn(e.h),s:un(e.s,0,100),v:un(e.v,0,100),a:un(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)}))},`hsv`]]},Mn=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},Nn=function(e){return typeof e==`string`?Mn(e.trim(),jn.string):typeof e==`object`&&e?Mn(e,jn.object):[null,void 0]},Pn=function(e,t,n){var r=En(e);return{h:r.h,s:un(r.s+t*(n?r.s:100),0,100),l:r.l,a:r.a}},Fn=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},In=function(e,t,n){var r=En(e);return{h:r.h,s:r.s,l:un(r.l+t*(n?r.l:100),0,100),a:r.a}},Ln=function(){function e(e){this.parsed=Nn(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return cn(Fn(this.rgba)+1e-9,2)},e.prototype.isDark=function(){return Fn(this.rgba)<.5},e.prototype.isLight=function(){return Fn(this.rgba)>=.5},e.prototype.toHex=function(){return e=mn(this.rgba),t=e.r,n=e.g,r=e.b,a=(i=e.a)<1?bn(cn(255*i)):``,`#`+bn(t)+bn(n)+bn(r)+a;var e,t,n,r,i,a},e.prototype.toRgb=function(){return mn(this.rgba)},e.prototype.toRgbString=function(){return e=mn(this.rgba),t=e.r,n=e.g,r=e.b,(i=e.a)<1?`rgba(`+t+`, `+n+`, `+r+`, `+i+`)`:`rgb(`+t+`, `+n+`, `+r+`)`;var e,t,n,r,i},e.prototype.toHsl=function(){return wn(En(this.rgba))},e.prototype.toHslString=function(){return e=wn(En(this.rgba)),t=e.h,n=e.s,r=e.l,(i=e.a)<1?`hsla(`+t+`, `+n+`%, `+r+`%, `+i+`)`:`hsl(`+t+`, `+n+`%, `+r+`%)`;var e,t,n,r,i},e.prototype.toHsv=function(){return e=xn(this.rgba),{h:fn(e.h),s:cn(e.s+1e-9),v:cn(e.v),a:ln(e.a)};var e},e.prototype.invert=function(){return Rn({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e,t){return e===void 0&&(e=.1),Rn(Pn(this.rgba,e,t?.relative))},e.prototype.desaturate=function(e,t){return e===void 0&&(e=.1),Rn(Pn(this.rgba,-e,t?.relative))},e.prototype.grayscale=function(){return Rn(Pn(this.rgba,-1))},e.prototype.lighten=function(e,t){return e===void 0&&(e=.1),Rn(In(this.rgba,e,t?.relative))},e.prototype.darken=function(e,t){return e===void 0&&(e=.1),Rn(In(this.rgba,-e,t?.relative))},e.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(En(this.rgba).h+e)},e.prototype.alpha=function(e){return typeof e==`number`?Rn({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ln(this.rgba.a);var t},e.prototype.hue=function(e){var t=En(this.rgba);return typeof e==`number`?Rn({h:e,s:t.s,l:t.l,a:t.a}):fn(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Rn(e).toHex()},e}(),Rn=function(e){return e instanceof Ln?e:new Ln(e)},zn=[];(function(e){e.forEach(function(e){var t=typeof e==`function`?e:e.default;zn.indexOf(t)<0&&(t(Ln,jn),zn.push(t))})})([function(e,t){var n={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`,sandybrown:`#f4a460`,rosybrown:`#bc8f8f`,darksalmon:`#e9967a`,lightgoldenrodyellow:`#fafad2`,snow:`#fffafa`,lightgrey:`#d3d3d3`,lightgray:`#d3d3d3`,dimgray:`#696969`,dimgrey:`#696969`,olivedrab:`#6b8e23`,olive:`#808000`},r={};for(var i in n)r[n[i]]=i;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return`transparent`;var i,o,s=r[this.toHex()];if(s)return s;if(t?.closest){var c=this.toRgb(),l=1/0,u=`black`;if(!a.length)for(var d in n)a[d]=new e(n[d]).toRgb();for(var f in n){var p=(i=c,o=a[f],(i.r-o.r)**2+(i.g-o.g)**2+(i.b-o.b)**2);p<l&&(l=p,u=f)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i=r===`transparent`?`#0000`:n[r];return typeof i==`string`?new e(i).toRgb():null},`name`])}]);var Bn=class e{constructor(e=0xffffff){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=0xffffff,this.value=e}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(e){return this.value=e,this}set value(t){if(t instanceof e)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else if(t===null)throw Error(`Cannot set Color#value to null`);else this._value!==null&&this._isSourceEqual(this._value,t)||(this._value=this._cloneSource(t),this._normalize(this._value))}get value(){return this._value}_cloneSource(e){return typeof e==`string`||typeof e==`number`||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e==`object`&&e?{...e}:e}_isSourceEqual(e,t){let n=typeof e;if(n!==typeof t)return!1;if(n===`number`||n===`string`||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length===t.length&&e.every((e,n)=>e===t[n]);if(e!==null&&t!==null){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}return e===t}toRgba(){let[e,t,n,r]=this._components;return{r:e,g:t,b:n,a:r}}toRgb(){let[e,t,n]=this._components;return{r:e,g:t,b:n}}toRgbaString(){let[e,t,n]=this.toUint8RgbArray();return`rgba(${e},${t},${n},${this.alpha})`}toUint8RgbArray(e){let[t,n,r]=this._components;return this._arrayRgb||=[],e||=this._arrayRgb,e[0]=Math.round(t*255),e[1]=Math.round(n*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||=[],e||=this._arrayRgba;let[t,n,r,i]=this._components;return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}toRgbArray(e){this._arrayRgb||=[],e||=this._arrayRgb;let[t,n,r]=this._components;return e[0]=t,e[1]=n,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){let[e,t,n]=this.toUint8RgbArray();return(n<<16)+(t<<8)+e}toLittleEndianNumber(){let e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(t){let[n,r,i,a]=e._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=r,this._components[2]*=i,this._components[3]*=a,this._refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let n=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return t&&(n=n*e+.5|0,r=r*e+.5|0,i=i*e+.5|0),(e*255<<24)+(n<<16)+(r<<8)+i}toHex(){let e=this._int.toString(16);return`#${`000000`.substring(0,6-e.length)+e}`}toHexa(){let e=Math.round(this._components[3]*255).toString(16);return this.toHex()+`00`.substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this._value=null,this}_normalize(t){let n,r,i,a;if((typeof t==`number`||t instanceof Number)&&t>=0&&t<=0xffffff){let e=t;n=(e>>16&255)/255,r=(e>>8&255)/255,i=(e&255)/255,a=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,r,i,a=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,r,i,a=255]=t,n/=255,r/=255,i/=255,a/=255;else if(typeof t==`string`||typeof t==`object`){if(typeof t==`string`){let n=e.HEX_PATTERN.exec(t);n&&(t=`#${n[2]}`)}let o=Rn(t);o.isValid()&&({r:n,g:r,b:i,a}=o.rgba,n/=255,r/=255,i/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=r,this._components[2]=i,this._components[3]=a,this._refreshInt();else throw Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);let[e,t,n]=this._components;this._int=(e*255<<16)+(t*255<<8)+(n*255|0)}_clamp(e,t=0,n=1){return typeof e==`number`?Math.min(Math.max(e,t),n):(e.forEach((r,i)=>{e[i]=Math.min(Math.max(r,t),n)}),e)}static isColorLike(t){return t==null?!1:typeof t==`number`||typeof t==`string`||t instanceof Number||t instanceof e||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Bn.shared=new Bn,Bn._temp=new Bn,Bn.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;var Vn=Bn,Hn={cullArea:null,cullable:!1,cullableChildren:!0},Un=0,Wn=500;function Gn(...e){Un!==Wn&&(Un++,Un===Wn?console.warn(`PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.`):console.warn(`PixiJS Warning: `,...e))}var Kn={_registeredResources:new Set,register(e){this._registeredResources.add(e)},unregister(e){this._registeredResources.delete(e)},release(){this._registeredResources.forEach(e=>e.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(e){return this._registeredResources.has(e)},reset(){this._registeredResources.clear()}},qn=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t)}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){let t;return this._index>0?t=this._pool[--this._index]:(t=new this._classType,this._count++),t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}},Jn=new class{constructor(){this._poolsByClass=new Map}prepopulate(e,t){this.getPool(e).prepopulate(t)}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new qn(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let n=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[n]={free:t.totalFree,used:t.totalUsed,size:t.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}};Kn.register(Jn);var Yn={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(e){typeof e==`boolean`&&e===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(e===!0?{}:e))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(e){R(`v8.6.0`,`cacheAsBitmap is deprecated, use cacheAsTexture instead.`),this.cacheAsTexture(e)}};function Xn(e,t,n){let r=e.length,i;if(t>=r||n===0)return;n=t+n>r?r-t:n;let a=r-n;for(i=t;i<a;++i)e[i]=e[i+n];e.length=a}var Zn={allowChildren:!0,removeChildren(e=0,t){let n=t??this.children.length,r=n-e,i=[];if(r>0&&r<=n){for(let t=n-1;t>=e;t--){let e=this.children[t];e&&(i.push(e),e.parent=null)}Xn(this.children,e,r);let t=this.renderGroup||this.parentRenderGroup;t&&t.removeChildren(i);for(let e=0;e<i.length;++e){let t=i[e];t.parentRenderLayer?.detach(t),this.emit(`childRemoved`,t,this,e),i[e].emit(`removed`,this)}return i.length>0&&this._didViewChangeTick++,i}if(r===0&&this.children.length===0)return i;throw RangeError(`removeChildren: numeric values are outside the acceptable range.`)},removeChildAt(e){let t=this.getChildAt(e);return this.removeChild(t)},getChildAt(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]},setChildIndex(e,t){if(t<0||t>=this.children.length)throw Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(e),this.addChildAt(e,t)},getChildIndex(e){let t=this.children.indexOf(e);if(t===-1)throw Error(`The supplied Container must be a child of the caller`);return t},addChildAt(e,t){this.allowChildren||R(L,`addChildAt: Only Containers will be allowed to add children in v8.0.0`);let{children:n}=this;if(t<0||t>n.length)throw Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${n.length}`);let r=e.parent===this;if(e.parent){let n=e.parent.children.indexOf(e);if(r){if(n===t)return e;e.parent.children.splice(n,1)}else e.removeFromParent()}t===n.length?n.push(e):n.splice(t,0,e);let i=this.renderGroup||this.parentRenderGroup;return this.sortableChildren&&(this.sortDirty=!0),r?(i&&(i.structureDidChange=!0),e):(e.parent=this,e.didChange=!0,e._updateFlags=15,i&&i.addChild(e),this.emit(`childAdded`,e,this,t),e.emit(`added`,this),e)},swapChildren(e,t){if(e===t)return;let n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...e){return e.length===1?this.reparentChildAt(e[0],this.children.length):(e.forEach(e=>this.reparentChildAt(e,this.children.length)),e[0])},reparentChildAt(e,t){if(e.parent===this)return this.setChildIndex(e,t),e;let n=e.worldTransform.clone();e.removeFromParent(),this.addChildAt(e,t);let r=this.worldTransform.clone();return r.invert(),n.prepend(r),e.setFromMatrix(n),e},replaceChild(e,t){e.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(e)),t.setFromMatrix(e.localTransform),t.updateLocalTransform(),this.removeChild(e)}},Qn={collectRenderables(e,t,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(e,t,n):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,e):this.collectRenderablesWithEffects(e,t,n))},collectRenderablesSimple(e,t,n){let r=this.children,i=r.length;for(let a=0;a<i;a++)r[a].collectRenderables(e,t,n)},collectRenderablesWithEffects(e,t,n){let{renderPipes:r}=t;for(let t=0;t<this.effects.length;t++){let n=this.effects[t];r[n.pipe].push(n,this,e)}this.collectRenderablesSimple(e,t,n);for(let t=this.effects.length-1;t>=0;t--){let n=this.effects[t];r[n.pipe].pop(n,this,e)}}},$n=class{constructor(){this.pipe=`filter`,this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}},er=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let n=this._tests[t];if(n.test(e))return Jn.get(n.maskClass,e)}return e}returnMaskEffect(e){Jn.return(e)}};at.handleByList(N.MaskEffect,er._effectClasses);var tr={_maskEffect:null,_maskOptions:{inverse:!1,channel:`red`},_filterEffect:null,effects:[],_markStructureAsChanged(){let e=this.renderGroup||this.parentRenderGroup;e&&(e.structureDidChange=!0)},addEffect(e){this.effects.indexOf(e)===-1&&(this.effects.push(e),this.effects.sort((e,t)=>e.priority-t.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(e){let t=this.effects.indexOf(e);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(e){let t=this._maskEffect;t?.mask!==e&&(t&&(this.removeEffect(t),er.returnMaskEffect(t),this._maskEffect=null),e!=null&&(this._maskEffect=er.getMaskEffect(e),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(e){this._maskOptions={...this._maskOptions,...e},e.mask&&(this.mask=e.mask),this._markStructureAsChanged()},set filters(e){!Array.isArray(e)&&e&&(e=[e]);let t=this._filterEffect||=new $n;e=e;let n=e?.length>0,r=n!==t.filters?.length>0;e=Array.isArray(e)?e.slice(0):e,t.filters=Object.freeze(e),r&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=e??null))},get filters(){return this._filterEffect?.filters},set filterArea(e){this._filterEffect||=new $n,this._filterEffect.filterArea=e},get filterArea(){return this._filterEffect?.filterArea}},nr={label:null,get name(){return R(L,`Container.name property has been removed, use Container.label instead`),this.label},set name(e){R(L,`Container.name property has been removed, use Container.label instead`),this.label=e},getChildByName(e,t=!1){return this.getChildByLabel(e,t)},getChildByLabel(e,t=!1){let n=this.children;for(let t=0;t<n.length;t++){let r=n[t];if(r.label===e||e instanceof RegExp&&e.test(r.label))return r}if(t)for(let t=0;t<n.length;t++){let r=n[t].getChildByLabel(e,!0);if(r)return r}return null},getChildrenByLabel(e,t=!1,n=[]){let r=this.children;for(let t=0;t<r.length;t++){let i=r[t];(i.label===e||e instanceof RegExp&&e.test(i.label))&&n.push(i)}if(t)for(let t=0;t<r.length;t++)r[t].getChildrenByLabel(e,!0,n);return n}},rr=Jn.getPool(P),ir=Jn.getPool(an),ar=new P,or={getFastGlobalBounds(e,t){t||=new an,t.clear(),this._getGlobalBoundsRecursive(!!e,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);let n=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(n.worldTransform),t},_getGlobalBoundsRecursive(e,t,n){let r=t;if(e&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;let i=!!this.effects.length;if((this.renderGroup||i)&&(r=ir.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){let e=this.bounds;r.addFrame(e.minX,e.minY,e.maxX,e.maxY,this.groupTransform)}let t=this.children;for(let i=0;i<t.length;i++)t[i]._getGlobalBoundsRecursive(e,r,n)}if(i){let e=!1,n=this.renderGroup||this.parentRenderGroup;for(let t=0;t<this.effects.length;t++)this.effects[t].addBounds&&(e||(e=!0,r.applyMatrix(n.worldTransform)),this.effects[t].addBounds(r,!0));e&&r.applyMatrix(n.worldTransform.copyTo(ar).invert()),t.addBounds(r),ir.return(r)}else this.renderGroup&&(t.addBounds(r,this.relativeGroupTransform),ir.return(r))}};function sr(e,t,n){n.clear();let r,i;return e.parent?t?r=e.parent.worldTransform:(i=rr.get().identity(),r=lr(e,i)):r=P.IDENTITY,cr(e,n,r,t),i&&rr.return(i),n.isValid||n.set(0,0,0,0),n}function cr(e,t,n,r){if(!e.visible||!e.measurable)return;let i;r?i=e.worldTransform:(e.updateLocalTransform(),i=rr.get(),i.appendFrom(e.localTransform,n));let a=t,o=!!e.effects.length;if(o&&(t=ir.get().clear()),e.boundsArea)t.addRect(e.boundsArea,i);else{let n=e.bounds;n&&!n.isEmpty()&&(t.matrix=i,t.addBounds(n));for(let n=0;n<e.children.length;n++)cr(e.children[n],t,i,r)}if(o){for(let n=0;n<e.effects.length;n++)e.effects[n].addBounds?.(t);a.addBounds(t,P.IDENTITY),ir.return(t)}r||rr.return(i)}function lr(e,t){let n=e.parent;return n&&(lr(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function ur(e,t){if(e===0xffffff||!t)return t;if(t===0xffffff||!e)return e;let n=e>>16&255,r=e>>8&255,i=e&255,a=t>>16&255,o=t>>8&255,s=t&255,c=n*a/255|0,l=r*o/255|0,u=i*s/255|0;return(c<<16)+(l<<8)+u}var dr=0xffffff;function fr(e,t){return e===dr?t:t===dr?e:ur(e,t)}function pr(e){return((e&255)<<16)+(e&65280)+(e>>16&255)}var mr={getGlobalAlpha(e){if(e)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,n=this.parent;for(;n;)t*=n.alpha,n=n.parent;return t},getGlobalTransform(e=new P,t){if(t)return e.copyFrom(this.worldTransform);this.updateLocalTransform();let n=lr(this,rr.get().identity());return e.appendFrom(this.localTransform,n),rr.return(n),e},getGlobalTint(e){if(e)return this.renderGroup?pr(this.renderGroup.worldColor):this.parentRenderGroup?pr(fr(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=fr(t,n.localColor),n=n.parent;return pr(t)}};function hr(e,t,n){return t.clear(),n||=P.IDENTITY,gr(e,t,n,e,!0),t.isValid||t.set(0,0,0,0),t}function gr(e,t,n,r,i){let a;if(i)a=rr.get(),a=n.copyTo(a);else{if(!e.visible||!e.measurable)return;e.updateLocalTransform();let t=e.localTransform;a=rr.get(),a.appendFrom(t,n)}let o=t,s=!!e.effects.length;if(s&&(t=ir.get().clear()),e.boundsArea)t.addRect(e.boundsArea,a);else{e.renderPipeId&&(t.matrix=a,t.addBounds(e.bounds));let n=e.children;for(let e=0;e<n.length;e++)gr(n[e],t,a,r,!1)}if(s){for(let n=0;n<e.effects.length;n++)e.effects[n].addLocalBounds?.(t,r);o.addBounds(t,P.IDENTITY),ir.return(t)}rr.return(a)}function _r(e,t){let n=e.children;for(let e=0;e<n.length;e++){let r=n[e],i=r.uid,a=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,o=t.index;(t.data[o]!==i||t.data[o+1]!==a)&&(t.data[t.index]=i,t.data[t.index+1]=a,t.didChange=!0),t.index=o+2,r.children.length&&_r(r,t)}return t.didChange}var vr=new P,yr={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(e,t){let n=Math.sign(this.scale.x)||1;t===0?this.scale.x=n:this.scale.x=e/t*n},_setHeight(e,t){let n=Math.sign(this.scale.y)||1;t===0?this.scale.y=n:this.scale.y=e/t*n},getLocalBounds(){this._localBoundsCacheData||={data:[],index:1,didChange:!1,localBounds:new an};let e=this._localBoundsCacheData;return e.index=1,e.didChange=!1,e.data[0]!==this._didViewChangeTick&&(e.didChange=!0,e.data[0]=this._didViewChangeTick),_r(this,e),e.didChange&&hr(this,e.localBounds,vr),e.localBounds},getBounds(e,t){return sr(this,e,t||new an)}},br={_onRender:null,set onRender(e){let t=this.renderGroup||this.parentRenderGroup;e?(this._onRender||t?.addOnRender(this),this._onRender=e):(this._onRender&&t?.removeOnRender(this),this._onRender=null)},get onRender(){return this._onRender}},xr={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(e){this._zIndex!==e&&(this._zIndex=e,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Sr))}};function Sr(e,t){return e._zIndex-t._zIndex}var Cr={getGlobalPosition(e=new bt,t=!1){return this.parent?this.parent.toGlobal(this._position,e,t):(e.x=this._position.x,e.y=this._position.y),e},toGlobal(e,t,n=!1){let r=this.getGlobalTransform(rr.get(),n);return t=r.apply(e,t),rr.return(r),t},toLocal(e,t,n,r){t&&(e=t.toGlobal(e,n,r));let i=this.getGlobalTransform(rr.get(),r);return n=i.applyInverse(e,n),rr.return(i),n}},wr=class{constructor(){this.uid=I(`instructionSet`),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){if(this.renderPipes)for(let e in this.renderPipes)this.renderPipes[e].destroyInstructionSet?.(this);this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,[`type`,`action`])}},Tr=class{constructor(){this._screenSizes=new Map,this._widths=[],this._heights=[],this._logicalWidths=[],this._logicalHeights=[]}get size(){return this._screenSizes.size}set(e,t,n,r=1){let i=this._screenSizes.get(e);return i&&i.pixelWidth===t&&i.pixelHeight===n&&i.resolution===r?!1:(this._screenSizes.set(e,{pixelWidth:t,pixelHeight:n,resolution:r}),this._update(),!0)}remove(e){return this._screenSizes.delete(e)?(this._update(),!0):!1}getFittingWidth(e,t=1){return this._getFittingAxis(e,t,this._widths,this._logicalWidths)}getFittingHeight(e,t=1){return this._getFittingAxis(e,t,this._heights,this._logicalHeights)}hasWidth(e){return this._widths.includes(e)}hasHeight(e){return this._heights.includes(e)}_getFittingAxis(e,t,n,r){let i;for(let t=0;t<n.length;t++)if(n[t]>=e){i=n[t];break}for(let n=0;n<r.length;n++){let a=Math.ceil(r[n]*t-1e-6);if(a>=e)return i===void 0?a:Math.min(i,a)}return i}_update(){let e=[...this._screenSizes.values()];this._widths=Er(e.map(e=>e.pixelWidth)),this._heights=Er(e.map(e=>e.pixelHeight)),this._logicalWidths=Er(e.map(e=>e.pixelWidth/e.resolution)),this._logicalHeights=Er(e.map(e=>e.pixelHeight/e.resolution))}};function Er(e){return e.filter((t,n)=>e.indexOf(t)===n).sort((e,t)=>e-t)}var Dr=0,Or=32767,kr=4294967296,Ar=8589934592,jr=Object.create(null),Mr=0;function Nr(e){let t=jr[e];return t===void 0?jr[e]=Mr++:t}function Pr(e,t,n,r,i,a){return(e<<17)+(t<<2)+(!!r<<1)+ +!!n+ +(a===`nearest`)*kr+Nr(i)*Ar}var Fr=new class extends gt{constructor(e){super(),this._buckets=new Map,this._poolKey=Object.create(null),this._poolStyle=Object.create(null),this._screens=new Tr,this._enableFullScreen=!1,this.textureOptions=e||{}}get textureStyle(){return R(Lt,`TexturePool.textureStyle is no longer used, pooled textures carry their own style. Pass scaleMode in the request instead.`),this._textureStyle||=new Jt(this.textureOptions),this._textureStyle}set textureStyle(e){R(Lt,`TexturePool.textureStyle is no longer used, pooled textures carry their own style. Pass scaleMode in the request instead.`),this._textureStyle=e}get enableFullScreen(){return R(Lt,`TexturePool.enableFullScreen is no longer used, the pool sizes textures to the screens registered with setScreenSize.`),this._enableFullScreen}set enableFullScreen(e){R(Lt,`TexturePool.enableFullScreen is no longer used, the pool sizes textures to the screens registered with setScreenSize.`),this._enableFullScreen=e}createTexture(...e){let t=e[0];typeof t==`number`&&(R(Lt,`TexturePool.createTexture params are now an options object. See params: { width, height, antialias, autoGenerateMipmaps }`),t={width:t,height:e[1],antialias:e[2]??!1,autoGenerateMipmaps:e[3]??!1});let n=t.format??this.textureOptions.format??Xt.defaultOptions.format,r=t.scaleMode??this.textureOptions.scaleMode??Jt.defaultOptions.scaleMode;return new z({source:new Xt({...this.textureOptions,width:t.width,height:t.height,resolution:1,antialias:t.antialias??!1,autoGarbageCollect:!1,autoGenerateMipmaps:t.autoGenerateMipmaps??!1,format:n,scaleMode:r}),label:`texturePool_${Dr++}`})}getOptimalTexture(...e){let t=e[0];typeof t==`number`&&(R(Lt,`TexturePool.getOptimalTexture params are now an options object. See params: { width, height, resolution, antialias, autoGenerateMipmaps }`),t={width:t,height:e[1],resolution:e[2]??1,antialias:e[3]??!1,autoGenerateMipmaps:e[4]??!1});let{width:n,height:r}=this.getOptimalSize(t.width,t.height,t.resolution??1);return this._getTexture(n,r,t)}getAlignedTexture(e,t,n){let r=e.source,i=t/r._resolution;return this._getTexture(Math.ceil(r.pixelWidth*i-1e-6),Math.ceil(r.pixelHeight*i-1e-6),{width:e.frame.width,height:e.frame.height,resolution:t,format:n})}_getTexture(e,t,n){let r=n.width,i=n.height,a=n.resolution??1,o=n.antialias??!1,s=n.autoGenerateMipmaps??!1,c=n.format??this.textureOptions.format??Xt.defaultOptions.format,l=n.scaleMode??this.textureOptions.scaleMode??Jt.defaultOptions.scaleMode;(e>Or||t>Or)&&Gn(`TexturePool: ${e}x${t} is larger than the ${Or}px pool key limit, textures of this size may be pooled together`);let u=Pr(e,t,o,s,c,l),d=this._buckets.get(u);d||(d=[],this._buckets.set(u,d));let f=d.pop();return f||(f=this.createTexture({width:e,height:t,antialias:o,autoGenerateMipmaps:s,format:c,scaleMode:l}),this._poolStyle[f.uid]=f.source.style),f.source._resolution=a,f.source.width=e/a,f.source.height=t/a,f.source.pixelWidth=e,f.source.pixelHeight=t,f.frame.x=0,f.frame.y=0,f.frame.width=r,f.frame.height=i,f.updateUvs(),this._poolKey[f.uid]=u,f}getOptimalSize(e,t,n=1){let r=Math.ceil(e*n-1e-6),i=Math.ceil(t*n-1e-6),a=Ht(r),o=this._screens.getFittingWidth(r,n),s=Ht(i),c=this._screens.getFittingHeight(i,n);return{width:o===void 0?a:Math.min(o,a),height:c===void 0?s:Math.min(c,s)}}getSameSizeTexture(e,t=!1){let n=e.source;return this.getOptimalTexture({width:e.width,height:e.height,resolution:n._resolution,antialias:t})}returnTexture(e,t=!1){let n=e.uid,r=this._poolKey[n];if(r===void 0){Gn(`TexturePool: returnTexture was passed a texture that did not come from this pool, ignoring it`);return}let i=this._poolStyle[n];t&&e.source.style!==i&&(e.source.style=i);let a=this._buckets.get(r);a?a.push(e):this._dropTextures([e],!0)}setScreenSize(e,t,n,r=1){this._screens.set(e,t,n,r)&&this._pruneScreenTextures()}removeScreen(e){this._screens.remove(e)&&this._pruneScreenTextures()}_pruneScreenTextures(){for(let[e,t]of this._buckets){let n=e>>>0,r=n>>>17,i=n>>>2&32767;(!Ut(r)&&!this._screens.hasWidth(r)||!Ut(i)&&!this._screens.hasHeight(i))&&(this._dropTextures(t,!0),this._buckets.delete(e))}}_dropTextures(e,t){t&&e.length>0&&this.emit(`evict`);for(let n=0;n<e.length;n++){let r=e[n];delete this._poolKey[r.uid],delete this._poolStyle[r.uid],t&&r.destroy(!0)}}clear(e){for(let t of this._buckets.values())this._dropTextures(t,e!==!1);this._buckets.clear()}};Kn.register(Fr);var Ir=class{constructor(){this.renderPipeId=`renderGroup`,this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new P,this.worldColorAlpha=0xffffffff,this.worldColor=0xffffff,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new wr,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;let t=e.children;for(let e=0;e<t.length;e++){let n=t[e];n._updateFlags=15,this.addChild(n)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&=(Fr.returnTexture(this.texture),null)}updateCacheTexture(){this.textureNeedsUpdate=!0;let e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.relativeRenderGroupDepth=e.parent===this.root?1:e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let e=0;e<t.length;e++)this.addChild(t[e])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let e=0;e<t.length;e++)this.removeChild(t[e])}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t])}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]},t.list[t.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.indexOf(e)===-1&&this._onRenderContainers.push(e)}removeOnRender(e){let t=this._onRenderContainers.indexOf(e);t!==-1&&this._onRenderContainers.splice(t,1)}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet?.destroy(),this.instructionSet=null}getChildren(e=[]){let t=this.root.children;for(let n=0;n<t.length;n++)this._getChildren(t[n],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let n=e.children;for(let e=0;e<n.length;e++)this._getChildren(n[e],t);return t}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return this._matrixDirty&1?(this._matrixDirty&=-2,this._inverseWorldTransform||=new P,this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return this._matrixDirty&2?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||=new P,this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(this._matrixDirty&4))return this._inverseParentTextureTransform;this._matrixDirty&=-5;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||=new P,this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};function Lr(e,t,n={}){for(let r in t)!n[r]&&t[r]!==void 0&&(e[r]=t[r])}var Rr=new ht(null),zr=new ht(null),Br=new ht(null,1,1),Vr=new ht(null),Hr=class e extends gt{constructor(e={}){super(),this.uid=I(`renderable`),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new P,this.relativeGroupTransform=new P,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new ht(this,0,0),this._scale=Br,this._pivot=zr,this._origin=Vr,this._skew=Rr,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=0xffffff,this.localAlpha=1,this.groupAlpha=1,this.groupColor=0xffffff,this.groupColorAlpha=0xffffffff,this.localBlendMode=`inherit`,this.groupBlendMode=`normal`,this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Lr(this,e,{children:!0,parent:!0,effects:!0}),e.children?.forEach(e=>this.addChild(e)),e.parent?.addChild(this)}static mixin(t){R(`8.8.0`,`Container.mixin is deprecated, please use extensions.mixin instead.`),at.mixin(e,t)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||R(L,`addChild: Only Containers will be allowed to add children in v8.0.0`),e.length>1){for(let t=0;t<e.length;t++)this.addChild(e[t]);return e[0]}let t=e[0],n=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),n&&(n.structureDidChange=!0),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=!0),t.parent=this,t.didChange=!0,t._updateFlags=15,n&&n.addChild(t),this.emit(`childAdded`,t,this,this.children.length-1),t.emit(`added`,this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let t=0;t<e.length;t++)this.removeChild(e[t]);return e[0]}let t=e[0],n=this.children.indexOf(t);return n>-1&&(this._didViewChangeTick++,this.children.splice(n,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit(`childRemoved`,t,this,n),t.emit(`removed`,this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=Jn.get(Ir,this),this.groupTransform=P.IDENTITY,e?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),Jn.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||=new P,this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*vt}set angle(e){this.rotation=e*yt}get pivot(){return this._pivot===zr&&(this._pivot=new ht(this,0,0)),this._pivot}set pivot(e){this._pivot===zr&&(this._pivot=new ht(this,0,0),this._origin!==Vr&&Gn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`)),typeof e==`number`?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===Rr&&(this._skew=new ht(this,0,0)),this._skew}set skew(e){this._skew===Rr&&(this._skew=new ht(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===Br&&(this._scale=new ht(this,1,1)),this._scale}set scale(e){this._scale===Br&&(this._scale=new ht(this,0,0)),typeof e==`string`&&(e=parseFloat(e)),typeof e==`number`?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===Vr&&(this._origin=new ht(this,0,0)),this._origin}set origin(e){this._origin===Vr&&(this._origin=new ht(this,0,0),this._pivot!==zr&&Gn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`)),typeof e==`number`?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||={};let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let n=this.getLocalBounds();typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,n.width),t!==void 0&&this._setHeight(t,n.height)}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set(typeof e.x==`number`?e.x:this.position.x,typeof e.y==`number`?e.y:this.position.y),this.scale.set(typeof e.scaleX==`number`?e.scaleX:this.scale.x,typeof e.scaleY==`number`?e.scaleY:this.scale.y),this.rotation=typeof e.rotation==`number`?e.rotation:this.rotation,this.skew.set(typeof e.skewX==`number`?e.skewX:this.skew.x,typeof e.skewY==`number`?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX==`number`?e.pivotX:this.pivot.x,typeof e.pivotY==`number`?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX==`number`?e.originX:this.origin.x,typeof e.originY==`number`?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,n=this._scale,r=this._pivot,i=this._origin,a=this._position,o=n._x,s=n._y,c=r._x,l=r._y,u=-i._x,d=-i._y;t.a=this._cx*o,t.b=this._sx*o,t.c=this._cy*s,t.d=this._sy*s,t.tx=a._x-(c*t.a+l*t.c)+(u*t.a+d*t.c)-u,t.ty=a._y-(c*t.b+l*t.d)+(u*t.b+d*t.d)-d}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=1,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){let t=typeof e==`number`?pr(e):Vn.shared.setValue(e??0xffffff).toBgrNumber();t!==this.localColor&&(this.localColor=t,this._updateFlags|=1,this._onUpdate())}get tint(){return pr(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=2,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=2,this._onUpdate(),this.emit(`visibleChanged`,e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){let t=+!!e;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=4,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){if(this.destroyed)return;this.destroyed=!0;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit(`destroyed`,this),this.removeAllListeners(),(typeof e==`boolean`?e:e?.children)&&t)for(let n=0;n<t.length;++n)t[n].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null}};at.mixin(Hr,Zn,or,Cr,br,yr,tr,nr,xr,Hn,Yn,mr,Qn);var Ur=class extends Hr{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new an(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty&&=(this.updateBounds(),!1),this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=+!!e}containsPoint(e){let t=this.bounds,{x:n,y:r}=e;return n>=t.minX&&n<=t.maxX&&r>=t.minY&&r<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,t,n){let{renderPipes:r}=t;r.blendMode.pushBlendMode(this,this.groupBlendMode,e);let i=r[this.renderPipeId];i?.addRenderable&&i.addRenderable(this,e),this.didViewUpdate=!1;let a=this.children,o=a.length;for(let r=0;r<o;r++)a[r].collectRenderables(e,t,n);r.blendMode.popBlendMode(e)}},Wr=class e extends Ur{constructor(e=z.EMPTY){e instanceof z&&(e={texture:e});let{texture:t=z.EMPTY,anchor:n,roundPixels:r,width:i,height:a,...o}=e;super({label:`Sprite`,...o}),this.renderPipeId=`sprite`,this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new ht({_onUpdate:()=>{this.onViewUpdate()}}),n?this.anchor=n:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=r??!1,i!==void 0&&(this.width=i),a!==void 0&&(this.height=a)}static from(t,n=!1){return t instanceof z?new e(t):new e(z.from(t,n))}set texture(e){e||=z.EMPTY;let t=this._texture;t!==e&&(t&&t.dynamic&&t.off(`update`,this.onViewUpdate,this),e.dynamic&&e.on(`update`,this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return nn(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return R(`8.6.1`,`Sprite.sourceBounds is deprecated, use visualBounds instead.`),this.visualBounds}updateBounds(){let e=this._anchor,t=this._texture,n=this._bounds,{width:r,height:i}=t.orig;n.minX=-e._x*r,n.maxX=n.minX+r,n.minY=-e._y*i,n.maxY=n.minY+i}destroy(e=!1){if(super.destroy(e),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._texture.destroy(t)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e==`number`?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||={},e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height)}},Gr=new an;function Kr(e,t,n){let r=Gr;e.measurable=!0,sr(e,n,r),t.addBoundsMask(r),e.measurable=!1}function qr(e,t,n){let r=ir.get();e.measurable=!0;let i=rr.get().identity();hr(e,r,Jr(e,n,i)),e.measurable=!1,t.addBoundsMask(r),rr.return(i),ir.return(r)}function Jr(e,t,n){return e?(e!==t&&(Jr(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(Gn(`Mask bounds, renderable is not inside the root container`),n)}var Yr=class{constructor(e){this.priority=0,this.inverse=!1,this.channel=`red`,this.pipe=`alphaMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Wr),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||Kr(this.mask,e,t)}addLocalBounds(e,t){qr(this.mask,e,t)}containsPoint(e,t){return t(this.mask,e)}destroy(){this.reset()}static test(e){return e instanceof Wr}};Yr.extension=N.MaskEffect;var Xr=class{constructor(e){this.priority=0,this.pipe=`colorMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e==`number`}};Xr.extension=N.MaskEffect;var Zr=class{constructor(e){this.priority=0,this.pipe=`stencilMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){Kr(this.mask,e,t)}addLocalBounds(e,t){qr(this.mask,e,t)}containsPoint(e,t){return t(this.mask,e)}destroy(){this.reset()}static test(e){return e instanceof Hr}};Zr.extension=N.MaskEffect;var Qr={createCanvas:(e,t)=>{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,`text/xml`)},$r={get(){return Qr},set(e){Qr=e}},ei=class extends Xt{constructor(e){e.resource||=$r.get().createCanvas(),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId=`image`,this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&`style`in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,t=this.height,n=this._resolution){let r=super.resize(e,t,n);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||=this.resource.getContext(`2d`)}};ei.extension=N.TextureSource;var ti=class extends Xt{constructor(e){super(e),this.uploadMethodId=`image`,this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}};ti.extension=N.TextureSource;var ni=(e=>(e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`,e))(ni||{}),ri=class{constructor(e,t=null,n=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=t,this.priority=n,this._once=r}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}},ii=class e{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 ri(null,null,1/0),this.deltaMS=1/e.targetFPMS,this.elapsedMS=1/e.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,n=ni.NORMAL){return this._addListener(new ri(e,t,n))}addOnce(e,t,n=ni.NORMAL){return this._addListener(new ri(e,t,n,!0))}_addListener(e){let t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this}remove(e,t){let n=this._head.next;for(;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){let e=t-this._lastFrame|0;if(e<this._minElapsedMS)return;this._lastFrame=t-e%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*e.targetFPMS;let r=this._head,i=r.next;for(;i;)i=i.emit(this);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){let n=Math.min(Math.max(0,t)/1e3,e.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!e._shared){let t=e._shared=new e;t.autoStart=!0,t._protected=!0}return e._shared}static get system(){if(!e._system){let t=e._system=new e;t.autoStart=!0,t._protected=!0}return e._system}};ii.targetFPMS=.06;var ai=ii,oi;async function si(){return oi??=(async()=>{let e=$r.get().createCanvas(1,1).getContext(`webgl`);if(!e)return`premultiply-alpha-on-upload`;let t=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!t)return`premultiply-alpha-on-upload`;let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(n),e.getExtension(`WEBGL_lose_context`)?.loseContext(),i[0]<=i[3]?`premultiplied-alpha`:`premultiply-alpha-on-upload`})(),oi}var ci=class e extends Xt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId=`video`,t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??`premultiply-alpha-on-upload`,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._onCanPlayThrough=this._onCanPlayThrough.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),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=ai.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this._videoFrameRequestCallbackHandle=this.destroyed?null:this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlayThrough),e.addEventListener(`error`,this._onError,!0)),this.isValid||e.addEventListener(`loadedmetadata`,this._onLoadedMetadata),this.alphaMode=await si(),this._load=new Promise((n,r)=>{this.isValid?n(this):(this._resolve=n,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener(`error`,this._onError,!0),this.emit(`error`,e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onLoadedMetadata(){this.isValid&&this._mediaReady()}_onCanPlay(){this.resource.removeEventListener(`canplay`,this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener(`canplaythrough`,this._onCanPlayThrough),this._preloadTimeout&&=(clearTimeout(this._preloadTimeout),void 0),this._mediaReady()}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&this.isValid&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlayThrough),e.removeEventListener(`loadedmetadata`,this._onLoadedMetadata),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ai.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ai.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ai.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};ci.extension=N.TextureSource,ci.defaultOptions={...Xt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},ci.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var li=ci,ui=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(e=>typeof e==`string`||n?t(e):e):e),di=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||Gn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let n=ui(e),r;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];if(i.test(t)){r=i.getCacheableAssets(n,t);break}}let i=new Map(Object.entries(r||{}));r||n.forEach(e=>{i.set(e,t)});let a=[...i.keys()],o={cacheKeys:a,keys:n};n.forEach(e=>{this._cacheMap.set(e,o)}),a.forEach(e=>{let n=r?r[e]:t;this._cache.has(e)&&this._cache.get(e)!==n&&Gn(`[Cache] already has key:`,e),this._cache.set(e,i.get(e))})}remove(e){if(!this._cacheMap.has(e)){Gn(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(e=>{this._cache.delete(e)}),t.keys.forEach(e=>{this._cacheMap.delete(e)})}get parsers(){return this._parsers}},fi=[];at.handleByList(N.TextureSource,fi);function pi(e={}){let t=e&&e.resource,n=t?e.resource:e,r=t?e:{resource:e};for(let e=0;e<fi.length;e++){let t=fi[e];if(t.test(n))return new t(r)}throw Error(`Could not find a source type for resource: ${r.resource}`)}function mi(e={},t=!1){let n=e&&e.resource,r=n?e.resource:e,i=n?e:{resource:e};if(!t&&di.has(r))return di.get(r);let a=new z({source:pi(i)});return a.on(`destroy`,()=>{di.has(r)&&di.remove(r)}),t||di.set(r,a),a}z.from=function(e,t=!1){return typeof e==`string`?di.get(e):e instanceof Xt?new z({source:e}):mi(e,t)},Xt.from=pi,at.add(Yr,Xr,Zr,li,ti,ei,$t);var hi=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(hi||{});function gi(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function _i(e){return e.split(`?`)[0].split(`#`)[0]}function vi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function yi(e,t,n){return e.replace(new RegExp(vi(t),`g`),n)}function bi(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(i!==s-1&&a!==1){if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var xi={toPosix(e){return yi(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){gi(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(e,t,n){if(gi(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;let r=_i(this.toPosix(t??$r.get().getBaseUrl())),i=_i(this.toPosix(n??this.rootname(r)));return e=this.toPosix(e),e.startsWith(`/`)?xi.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(r,e)},normalize(e){if(gi(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=bi(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return gi(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(gi(r),r.length>0){if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(gi(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){gi(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){gi(e),t&&gi(t),e=_i(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){gi(e),e=_i(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){gi(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=_i(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l)if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}}else s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1);return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(t.base=t.name=o===0&&r?e.slice(1,s):e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]};function Si(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?Si(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function Ci(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),Si(e,r,0,t,n)}else n.push(e);return n}var wi=e=>!Array.isArray(e),Ti=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${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(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}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(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,src:n}=e;return ui(t||n,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e):e?.src?e.src:e,!0)}removeAlias(e,t){this._assetMap[e]&&(t&&t!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&Gn(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[],r=t;Array.isArray(t)||(r=Object.entries(t).map(([e,t])=>typeof t==`string`||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t})),r.forEach(t=>{let r=t.src,i=t.alias,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}),this._bundles[e]=n}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=e=>{this.hasKey(e)&&Gn(`[Resolver] already has key: ${e} overwriting`)};ui(t).forEach(e=>{let{src:t}=e,{data:r,format:i,loadParser:a,parser:o}=e,s=ui(t).map(e=>typeof e==`string`?Ci(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(n):n(c);let l=[],u=e=>({src:e,...this._parsers.find(t=>t.test(e))?.parse(e)});s.forEach(t=>{t.forEach(t=>{let n={};if(typeof t==`object`?(r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,o=t.parser??o),n={...u(t.src),...t}):n=u(t),!c)throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);n=this._buildResolvedAsset(n,{aliases:c,data:r,format:i,loadParser:a,parser:o,progressSize:e.progressSize}),l.push(n)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=wi(e);e=ui(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=wi(e);e=ui(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e]){if(this._assetMap[e]){let t=this._assetMap[e],n=this._getPreferredOrder(t);n?.priority.forEach(e=>{n.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{})}n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let n=e[t],r=this._preferredOrder.find(e=>e.params.format.includes(n.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}_buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,parser:a,format:o,progressSize:s}=t;return(this._basePath||this._rootPath)&&(e.src=xi.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=a??e.parser,e.format=o??e.format??Ei(e.src),s!==void 0&&(e.progressSize=s),e}};Ti.RETINA_PREFIX=/@([0-9\.]+)x/;function Ei(e){return e.split(`.`).pop().split(`?`).shift().split(`#`).shift()}var Di=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e},Oi=class e{constructor(e,t){this.linkedSheets=[];let n=e;e?.source instanceof Xt&&(n={texture:e,data:t});let{texture:r,data:i,cachePrefix:a=``}=n;this.cachePrefix=a,this._texture=r instanceof z?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=i;let o=parseFloat(i.meta.scale);o?(this.resolution=o,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let r=t,i=n?1/0:e.BATCH_SIZE;for(;r-t<i&&r<this._frameKeys.length;){let e=this._frameKeys[r],t=this._frames[e],n=t.frame;if(n){let r=null,i=null,a=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,o=new Nt(0,0,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution);r=t.rotated?new Nt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.h)/this.resolution,Math.floor(n.w)/this.resolution):new Nt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(i=new Nt(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution)),this.textures[e]=new z({source:this.textureSource,frame:r,orig:o,trim:i,rotate:t.rotated?2:0,defaultAnchor:t.anchor,defaultBorders:t.borders,label:e.toString()})}r++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Oi.BATCH_SIZE=1e3;var ki=Oi,Ai=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`basis`,`etc2`,`bc7`,`bc6h`,`bc5`,`bc4`,`bc3`,`bc2`,`bc1`,`eac`,`astc`];function ji(e,t,n){let r={};if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=xi.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{let a=ji([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0);Object.assign(r,a)})}return r}var Mi={extension:N.Asset,cache:{test:e=>e instanceof ki,getCacheableAssets:(e,t)=>ji(e,t,!1)},resolver:{extension:{type:N.ResolveParser,name:`resolveSpritesheet`},test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&Ai.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(Ti.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,id:`spritesheet`,extension:{type:N.LoadParser,priority:hi.Normal,name:`spritesheetLoader`},async testParse(e,t){return xi.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:i,textureOptions:a,cachePrefix:o}=t?.data??{},s=xi.dirname(t.src);s&&s.lastIndexOf(`/`)!==s.length-1&&(s+=`/`);let c;if(r instanceof z)c=r;else{let r=Di(s+(i??e.meta.image),t.src);c=(await n.load([{src:r,data:a}]))[r]}let l=new ki({texture:c.source,data:e,cachePrefix:o});await l.parse();let u=e?.meta?.related_multi_packs;if(Array.isArray(u)){let e=[];for(let r of u){if(typeof r!=`string`)continue;let i=s+r;t.data?.ignoreMultiPack||(i=Di(i,t.src),e.push(n.load({src:i,data:{textureOptions:a,ignoreMultiPack:!0}})))}let r=await Promise.all(e);l.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[l].concat(l.linkedSheets.filter(t=>t!==e))})}return l},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};at.add(Mi);var Ni=Object.create(null),Pi=Object.create(null);function Fi(e,t){let n=Pi[e];return n===void 0&&(Ni[t]===void 0&&(Ni[t]=1),Pi[e]=n=Ni[t]++),n}function Ii(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm,``)}var Li=RegExp(`(?:layout\\s*\\(\\s*location\\s*=\\s*(\\d+)\\s*\\)\\s*)?\\bout\\s+(?:(?:highp|mediump|lowp)\\s+)?\\w+\\s+\\w+\\s*(?:\\[\\s*(\\d+)\\s*\\])?\\s*;`,`g`);function Ri(e){if(!e.includes(`#version 300 es`))return e.includes(`gl_FragData`)?null:1;let t=Ii(e),n=0,r;for(;(r=Li.exec(t))!==null;){let e=r[1]===void 0?0:parseInt(r[1],10),t=r[2]===void 0?1:parseInt(r[2],10);n|=(1<<t)-1<<e}return Li.lastIndex=0,n||(/\bout\b/.test(t)?null:0)}var zi;function Bi(){return(!zi||zi?.isContextLost())&&(zi=$r.get().createCanvas().getContext(`webgl`,{})),zi}var Vi;function Hi(){if(!Vi){Vi=`mediump`;let e=Bi();e&&e.getShaderPrecisionFormat&&(Vi=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?`highp`:`mediump`)}return Vi}function Ui(e,t,n){return t?e:n?(e=e.replace(`out vec4 finalColor;`,``),`
6
6
 
7
7
  #ifdef GL_ES // This checks if it is WebGL1
8
8
  #define in varying
@@ -21,7 +21,7 @@ Deprecated since v${e}`,a=typeof console.groupCollapsed==`function`&&!zt.noColor
21
21
  ${e}`}else r!==`highp`&&e.substring(0,15)===`precision highp`&&(e=e.replace(`precision highp`,`precision mediump`));let i=t.maxSupportedFragmentPrecision===`highp`?`highp`:`mediump`;return Ji(e,i)}function Ji(e,t){let n=new Set,r=``;for(let[,t]of e.matchAll(Gi))n.add(t);for(let[,i]of e.matchAll(Wi))n.has(i)||(n.add(i),r+=`precision ${Ki[i]??t} ${i};
22
22
  `);return r+e}function Yi(e,t){return t?`#version 300 es
23
23
  ${e}`:e}var Xi={},Zi={};function Qi(e,{name:t=`pixi-program`},n=!0){t=t.replace(/\s+/g,`-`),t+=n?`-fragment`:`-vertex`;let r=n?Xi:Zi;return r[t]?(r[t]++,t+=`-${r[t]}`):r[t]=1,e.indexOf(`#define SHADER_NAME`)===-1?`#define SHADER_NAME ${t}
24
- ${e}`:e}function $i(e,t){return t?e.replace(`#version 300 es`,``):e}var ea={stripVersion:$i,ensurePrecision:qi,addProgramDefines:Ui,setProgramName:Qi,insertVersion:Yi},ta=Object.create(null),na=class e{constructor(t){t={...e.defaultOptions,...t};let n=t.fragment.indexOf(`#version 300 es`)!==-1,r={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:`highp`,maxSupportedFragmentPrecision:Hi()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n},i=t.fragment,a=t.vertex;Object.keys(ea).forEach(e=>{let t=r[e];i=ea[e](i,t,!0),a=ea[e](a,t,!1)}),this.fragment=i,this.vertex=a,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Fi(`${this.vertex}:${this.fragment}`,`gl-program`)}get fragmentOutputMask(){return this._fragmentOutputMask===void 0&&(this._fragmentOutputMask=Ri(this.fragment)),this._fragmentOutputMask}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,ta[this._cacheKey]=null}static from(t){let n=`${t.vertex}:${t.fragment}`;return ta[n]||(ta[n]=new e(t),ta[n]._cacheKey=n),ta[n]}};na.defaultOptions={preferredVertexPrecision:`highp`,preferredFragmentPrecision:`mediump`};var ra=na,ia={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function aa(e){return ia[e]??ia.float32}var oa={f32:`float32`,"vec2<f32>":`float32x2`,"vec3<f32>":`float32x3`,"vec4<f32>":`float32x4`,vec2f:`float32x2`,vec3f:`float32x3`,vec4f:`float32x4`,i32:`sint32`,"vec2<i32>":`sint32x2`,"vec3<i32>":`sint32x3`,"vec4<i32>":`sint32x4`,vec2i:`sint32x2`,vec3i:`sint32x3`,vec4i:`sint32x4`,u32:`uint32`,"vec2<u32>":`uint32x2`,"vec3<u32>":`uint32x3`,"vec4<u32>":`uint32x4`,vec2u:`uint32x2`,vec3u:`uint32x3`,vec4u:`uint32x4`,bool:`uint32`,"vec2<bool>":`uint32x2`,"vec3<bool>":`uint32x3`,"vec4<bool>":`uint32x4`},sa=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function ca(e,t){let n;for(;(n=sa.exec(e))!==null;){let e=oa[n[3]]??`float32`;t[n[2]]={location:parseInt(n[1],10),format:e,stride:aa(e).stride,offset:0,instance:!1,start:0}}sa.lastIndex=0}function la({source:e,entryPoint:t}){let n={},r=Ii(e),i=r.indexOf(`fn ${t}(`);if(i===-1)return n;let a=r.indexOf(`->`,i);if(a===-1)return n;let o=r.substring(i,a);if(ca(o,n),Object.keys(n).length===0){let e=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(e){let t=e[1],i=RegExp(`struct\\s+${t}\\s*\\{([^}]+)\\}`,`s`),a=r.match(i);a&&ca(a[1],n)}}return n}var ua=/@location\(\s*(\d+)\s*\)/g;function da(e){let t=0,n;for(;(n=ua.exec(e))!==null;)t|=1<<parseInt(n[1],10);return ua.lastIndex=0,t}function fa({source:e,entryPoint:t}){if(!t)return null;let n=Ii(e),r=RegExp(`fn\\s+${t}\\s*\\(`).exec(n);if(!r)return null;let i=1,a=r.index+r[0].length;for(;a<n.length&&i>0;){let e=n[a++];e===`(`?i++:e===`)`&&i--}let o=n.indexOf(`{`,a);if(o===-1)return null;let s=n.substring(a,o).trim();if(!s.startsWith(`->`))return 0;let c=s.substring(2).trim();if(c.startsWith(`@builtin`))return 0;if(c.startsWith(`@location`))return da(c);if(!/^\w+$/.test(c))return null;let l=RegExp(`struct\\s+${c}\\s*\\{([^}]*)\\}`).exec(n);return l?da(l[1]):null}function pa(e){let t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,a=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,s=/(\w+)\s*:\s*([\w\<\>]+)/g,c=/struct\s+(\w+)/,l=e.match(t)?.map(e=>{let t=e.match(i),o=t?.[1]??``,s;return o===`<uniform>`?s=`uniform`:o.startsWith(`<storage`)&&(s=`storage`),{group:parseInt(e.match(n)[1],10),binding:parseInt(e.match(r)[1],10),name:t[2],accessMode:s,type:e.match(a)[1]}});return l?{groups:l,structs:e.match(o)?.map(e=>{let t=e.match(c)[1],n=e.match(s).reduce((e,t)=>{let[n,r]=t.split(`:`);return e[n.trim()]=r.trim(),e},{});return n?{name:t,members:n}:null}).filter(({name:e})=>l.some(t=>t.type===e||t.type.includes(`<${e}>`)))??[]}:{groups:[],structs:[]}}var B=(e=>(e[e.VERTEX=1]=`VERTEX`,e[e.FRAGMENT=2]=`FRAGMENT`,e[e.COMPUTE=4]=`COMPUTE`,e))(B||{});function ma(e){return e.endsWith(`<u32>`)?`uint`:e.endsWith(`<i32>`)?`sint`:`float`}function ha({groups:e}){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.group]||(t[r.group]=[]),r.accessMode===`uniform`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,buffer:{type:`uniform`}}):r.accessMode===`storage`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,buffer:{type:`read-only-storage`}}):r.type===`sampler`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,sampler:{type:`filtering`}}):r.type===`sampler_comparison`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,sampler:{type:`comparison`}}):r.type===`texture_2d`||r.type.startsWith(`texture_2d<`)?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`2d`,multisampled:!1}}):r.type===`texture_depth_2d`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:`depth`,viewDimension:`2d`,multisampled:!1}}):r.type===`texture_depth_2d_array`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:`depth`,viewDimension:`2d-array`,multisampled:!1}}):r.type===`texture_2d_array`||r.type.startsWith(`texture_2d_array<`)?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`2d-array`,multisampled:!1}}):r.type===`texture_3d`||r.type.startsWith(`texture_3d<`)?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`3d`,multisampled:!1}}):(r.type===`texture_cube`||r.type.startsWith(`texture_cube<`))&&t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`cube`,multisampled:!1}})}for(let e=0;e<t.length;e++)t[e]||(t[e]=[]);return t}function ga({groups:e}){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.group]||(t[r.group]={}),t[r.group][r.name]=r.binding}return t}function _a(e,t){let n=new Set,r=new Set;return{structs:[...e.structs,...t.structs].filter(e=>!n.has(e.name)&&(n.add(e.name),!0)),groups:[...e.groups,...t.groups].filter(e=>{let t=`${e.name}-${e.binding}`;return!r.has(t)&&(r.add(t),!0)})}}var va=Object.create(null),ya=class e{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:t,vertex:n,layout:r,gpuLayout:i,name:a}=e;if(this.name=a,this.fragment=t,this.vertex=n,t.source===n.source){let e=pa(t.source);this.structsAndGroups=e}else{let e=pa(n.source),r=pa(t.source);this.structsAndGroups=_a(e,r)}this.layout=r??ga(this.structsAndGroups),this.gpuLayout=i??ha(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){let{vertex:e,fragment:t}=this,n=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=Fi(n,`program`)}get attributeData(){return this._attributeData??=la(this.vertex),this._attributeData}get fragmentOutputMask(){return this._fragmentOutputMask===void 0&&(this._fragmentOutputMask=fa(this.fragment)),this._fragmentOutputMask}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,va[this._cacheKey]=null}static from(t){let n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return va[n]||(va[n]=new e(t),va[n]._cacheKey=n),va[n]}},ba=[`f32`,`i32`,`u32`,`vec2<f32>`,`vec3<f32>`,`vec4<f32>`,`mat2x2<f32>`,`mat3x3<f32>`,`mat4x4<f32>`,`mat3x2<f32>`,`mat4x2<f32>`,`mat2x3<f32>`,`mat4x3<f32>`,`mat2x4<f32>`,`mat3x4<f32>`,`vec2<i32>`,`vec3<i32>`,`vec4<i32>`,`vec2<u32>`,`vec3<u32>`,`vec4<u32>`],xa=ba.reduce((e,t)=>(e[t]=!0,e),{});function Sa(e,t){switch(e){case`f32`:return 0;case`vec2<f32>`:return new Float32Array(2*t);case`vec3<f32>`:return new Float32Array(3*t);case`vec4<f32>`:return new Float32Array(4*t);case`mat2x2<f32>`:return new Float32Array([1,0,0,1]);case`mat3x3<f32>`:return new Float32Array([1,0,0,0,1,0,0,0,1]);case`mat4x4<f32>`:return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Ca=class e extends gt{constructor(t,n){super(),this.uid=I(`uniform`),this._resourceType=`uniformGroup`,this._resourceId=I(`resource`),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...e.defaultOptions,...n},this.uniformStructures=t;let r={};for(let e in t){let n=t[e];if(n.name=e,n.size=n.size??1,!xa[n.type]){let e=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(e){let[,t,r]=e;throw Error(`Uniform type ${n.type} is not supported. Use type: '${t}', size: ${r} instead.`)}throw Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${ba.join(`, `)}`)}n.value??=Sa(n.type,n.size),r[e]=n.value}this.uniforms=r,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Fi(Object.keys(r).map(e=>`${e}-${t[e].type}`).join(`-`),`uniform-group`)}get buffer(){return this._buffer}set buffer(e){this._buffer!==e&&(this._buffer?.off(`change`,this.onBufferChange,this),this._buffer=e,e?.on(`change`,this.onBufferChange,this))}get _gcLastUsed(){return this._buffer?._gcLastUsed??-1}set _gcLastUsed(e){this._buffer&&(this._buffer._gcLastUsed=e)}onBufferChange(){this._resourceId=I(`resource`),this.emit(`change`,this)}update(){this._dirtyId++}};Ca.defaultOptions={ubo:!1,isStatic:!1};var wa=Ca;function Ta(e,t){let n=Math.imul(t+0x9e3779b9,0x85ebca6b)^Math.imul(e+1,0xc2b2ae35);return n^=n>>>16,n=Math.imul(n,0x7feb352d),n^=n>>>15,n=Math.imul(n,0x846ca68b),n^n>>>16}function Ea(e,t){let n=Math.imul(t+0x7f4a7c15,668265263)^Math.imul(e+374761393,0x9e3779b1);return n^=n>>>15,n=Math.imul(n,739982445),n^=n>>>12,n=Math.imul(n,695872825),n^n>>>15}var Da=class{constructor(e){this.resources=Object.create(null),this._resourceKeysValue=null,this._touchKeysValue=null,this._keyLow=0,this._keyHigh=0,this._gpuEntry=null,this._gpuEntryLayoutKey=-1,this._keyedIds=[],this.layout=null;let t=0;for(let n in e){t===0&&!/^\d/.test(n)&&(this.layout={}),this.layout&&(this.layout[n]=t);let r=e[n];r&&this.setResource(r,t),t++}}get _resourceKeys(){return this._resourceKeysValue??=Object.keys(this.resources).map(Number),this._resourceKeysValue}setResource(e,t){typeof t==`string`&&(t=this._bindingOf(t));let n=this.resources[t];e!==n&&(n&&n.off?.(`change`,this.onResourceChange,this),e.on?.(`change`,this.onResourceChange,this),this.setResourceUnwatched(e,t))}setResourceUnwatched(e,t){let n=this.resources[t];if(e===n)return;let r=e._resourceId;n?._resourceType!==e._resourceType&&(this._touchKeysValue=null),n===void 0?(this._resourceKeysValue=null,this._keyLow^=Ta(t,r),this._keyHigh^=Ea(t,r),this._keyedIds[t]=r,this._gpuEntry=null):this._keyedIds[t]!==r&&this._rekey(t,r),this.resources[t]=e}_rekey(e,t){let n=this._keyedIds[e];this._keyLow^=Ta(e,n)^Ta(e,t),this._keyHigh^=Ea(e,n)^Ea(e,t),this._keyedIds[e]=t,this._gpuEntry=null}getResource(e){return this.resources[typeof e==`string`?this._bindingOf(e):e]}_bindingOf(e){let t=this.layout?.[e];if(t===void 0)throw Error(`[BindGroup] no binding named '${e}' in this group`);return t}_touch(e){let t=this.resources,n=this._touchKeys;for(let r=0;r<n.length;r++){let i=t[n[r]];i&&(i._gcLastUsed=e)}}get _touchKeys(){return this._touchKeysValue??=this._resourceKeys.filter(e=>this.resources[e]?._resourceType!==`textureSampler`),this._touchKeysValue}destroy(){let e=this.resources;for(let t in e)e[t]?.off?.(`change`,this.onResourceChange,this);this.resources=null,this._resourceKeysValue=null,this._touchKeysValue=null,this._gpuEntry=null}onResourceChange(e){let t=this.resources;if(!t)return;let n=this._resourceKeys,r=e.destroyed;for(let i=0;i<n.length;i++){let a=n[i];t[a]===e&&(r&&(t[a]=null),this._rekey(a,r?-1:e._resourceId))}r&&Gn(`[BindGroup] a '${e._resourceType}' was destroyed while still bound to a shader. Remove it from the shader before destroying it.`)}},Oa=(e=>(e[e.WEBGL=1]=`WEBGL`,e[e.WEBGPU=2]=`WEBGPU`,e[e.CANVAS=4]=`CANVAS`,e[e.BOTH=3]=`BOTH`,e))(Oa||{}),ka=class e{constructor(e){this.data={...e};let t=Object.keys(e).sort().map(t=>`${t}:${e[t]}`).join(`|`);this.id=Fi(t,`shader-overrides`)}static from(t){return t instanceof e?t:new e(t)}},Aa=class e extends gt{constructor(e){super(),this.uid=I(`shader`),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:t,glProgram:n,groups:r,resources:i,compatibleRenderers:a,groupMap:o,overrides:s}=e;this._overrides=s?ka.from(s):null,this.gpuProgram=t,this.glProgram=n,a===void 0&&(a=0,t&&(a|=Oa.WEBGPU),n&&(a|=Oa.WEBGL)),this.compatibleRenderers=a;let c={};if(o)for(let e in o)for(let t in o[e]){let n=o[e][t];c[n]={group:Number(e),binding:Number(t),name:n}}if(!i&&!r&&(i={}),i&&r)throw Error(`[Shader] Cannot have both resources and groups`);if(!t&&r&&!o)throw Error(`[Shader] No group map or WebGPU shader provided - consider using resources instead.`);if(t&&r&&!o){let e=t.structsAndGroups.groups;o={},e.forEach(e=>{o[e.group]=o[e.group]||{},o[e.group][e.binding]=e.name,c[e.name]=e})}else if(i){r={},o||={},t&&t.structsAndGroups.groups.forEach(e=>{o[e.group]=o[e.group]||{},o[e.group][e.binding]=e.name,c[e.name]=e});let e=0;for(let a in i)c[a]||(t&&!n&&Gn(`[Shader] the resource '${a}' matches no binding in the WGSL source \u2014 is the name correct?`),r[99]||(r[99]=new Da,this._ownedBindGroups.push(r[99])),c[a]={group:99,binding:e,name:a},o[99]=o[99]||{},o[99][e]=a,e++);for(let e in i){let t=e,n=i[e];!n.source&&!n._resourceType&&(n=new wa(n));let a=c[t];a&&(r[a.group]||(r[a.group]=new Da,this._ownedBindGroups.push(r[a.group])),r[a.group].setResource(n,a.binding))}}this.groups=r,this._uniformBindMap=o,this.resources=this._buildResourceAccessor(r,c)}addResource(e,t,n){var r,i;(r=this._uniformBindMap)[t]||(r[t]={}),(i=this._uniformBindMap[t])[n]||(i[n]=e),this.groups[t]||(this.groups[t]=new Da,this._ownedBindGroups.push(this.groups[t]))}_buildResourceAccessor(e,t){let n={};for(let r in t){let i=t[r];Object.defineProperty(n,i.name,{get(){let t=e[i.group];return t.getResource(t.layout?t.layout[i.name]:i.binding)},set(t){let n=e[i.group];n.setResource(t,n.layout?n.layout[i.name]:i.binding)}})}return n}destroy(e=!1){this._destroyed||(this._destroyed=!0,this.emit(`destroy`,this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null,this._overrides=null)}static from(t){let{gpu:n,gl:r,...i}=t,a,o;return n&&(a=ya.from(n)),r&&(o=ra.from(r)),new e({gpuProgram:a,glProgram:o,...i})}},ja={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Ma={BLEND:0,OFFSET:1,CULLING:2,DEPTH_TEST:3,WINDING:4,DEPTH_MASK:5},{BLEND:Na,OFFSET:Pa,CULLING:Fa,DEPTH_TEST:Ia,WINDING:La,DEPTH_MASK:Ra}=Ma,za=class e{constructor(){this.data=0,this.blendMode=`normal`,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Na)}set blend(e){!!(this.data&1<<Na)!==e&&(this.data^=1<<Na)}get offsets(){return!!(this.data&1<<Pa)}set offsets(e){!!(this.data&1<<Pa)!==e&&(this.data^=1<<Pa)}set cullMode(e){e===`none`?this.culling=!1:(this.culling=!0,this.clockwiseFrontFace=e===`front`)}get cullMode(){return this.culling?this.clockwiseFrontFace?`front`:`back`:`none`}get culling(){return!!(this.data&1<<Fa)}set culling(e){!!(this.data&1<<Fa)!==e&&(this.data^=1<<Fa)}get depthTest(){return!!(this.data&1<<Ia)}set depthTest(e){!!(this.data&1<<Ia)!==e&&(this.data^=1<<Ia)}get depthMask(){return!!(this.data&1<<Ra)}set depthMask(e){!!(this.data&1<<Ra)!==e&&(this.data^=1<<Ra)}get clockwiseFrontFace(){return!!(this.data&1<<La)}set clockwiseFrontFace(e){!!(this.data&1<<La)!==e&&(this.data^=1<<La)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==`none`,this._blendMode=e,this._blendModeId=ja[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let t=new e;return t.depthTest=!1,t.depthMask=!1,t.blend=!0,t}};za.default2d=za.for2d();var Ba=za,Va=class e extends Aa{constructor(t){t={...e.defaultOptions,...t},super(t),this.enabled=!0,this._state=Ba.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,this.antialias=typeof t.antialias==`boolean`?t.antialias?`on`:`off`:t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource(`uTexture`,0,1),t.blendRequired&&this.addResource(`uBackTexture`,0,3)}apply(e,t,n,r){e.applyFilter(this,t,n,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(t){let{gpu:n,gl:r,...i}=t,a,o;return n&&(a=ya.from(n)),r&&(o=ra.from(r)),new e({gpuProgram:a,glProgram:o,...i})}};Va.defaultOptions={blendMode:`normal`,resolution:1,padding:0,antialias:`off`,blendRequired:!1,clipToViewport:!0};var Ha=Va,Ua=[];at.handleByNamedList(N.Environment,Ua);async function Wa(e){if(!e)for(let e=0;e<Ua.length;e++){let t=Ua[e];if(t.value.test()){await t.value.load();return}}}var Ga;function Ka(){if(typeof Ga==`boolean`)return Ga;try{Ga=Function(`param1`,`param2`,`param3`,`return param1[param2] === param3;`)({a:`b`},`a`,`b`)===!0}catch{Ga=!1}return Ga}var qa=new Set,Ja=!1;function Ya(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length;qa.size&&qa.clear();let a=Xa(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;let s=0,c=0,l=0;if(r&&(a=io(e,t,a,n)),e.length>80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;a<i;a+=n){let n=e[a],i=e[a+1];n<s&&(s=n),i<c&&(c=i),n>t&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return Qa(a,o,s,c,l),o}function Xa(e,t,n,r,i){let a=null;if(i===Vo(e,t,n,r)>0)for(let i=t;i<n;i+=r)a=Ro(i/r|0,e[i],e[i+1],a);else for(let i=n-r;i>=t;i-=r)a=Ro(i/r|0,e[i],e[i+1],a);return a&&jo(a,a.next)&&(zo(a),a=a.next),a}function Za(e,t=e){let n=t===e,r=e,i;do i=!1,r!==r.next&&(qa.size===0||!qa.has(r))&&(jo(r,r.next)||H(r.prev,r,r.next)===0)?((n||r===t)&&(t=r.prev),Ja=!0,zo(r),r=r.prev,i=!0):(n||r!==t)&&(r=r.next,i=!n);while(i||r!==t);return t}function Qa(e,t,n,r,i){i&&wo(e,n,r,i);let a=e,o=!1;for(;e.prev!==e.next;){let s=e.prev,c=e.next;if(H(s,e,c)<0&&(i?eo(e,n,r,i):$a(e)))t.push(s.i,e.i,c.i),zo(e),e=c,a=c;else if(e=c,e===a){if(Ja=!1,e=Za(e),Ja){a=e;continue}if(!o){e=to(e,t),a=e,o=!0;continue}no(e,t,n,r,i);break}}}function $a(e){let t=e.prev,n=e,r=e.next,i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&(i!==m.x||s!==m.y)&&ko(i,s,a,c,o,l,m.x,m.y)&&H(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function eo(e,t,n,r){let i=e.prev,a=e,o=e.next,s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=Do(p,m,t,n,r),v=Do(h,g,t,n,r),y=e.prevZ;for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==o&&(s!==y.x||u!==y.y)&&ko(s,u,c,d,l,f,y.x,y.y)&&H(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let b=e.nextZ;for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==o&&(s!==b.x||u!==b.y)&&ko(s,u,c,d,l,f,b.x,b.y)&&H(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function to(e,t){let n=e,r=!1;do{let i=n.prev,a=n.next.next;Mo(i,n,n.next,a,!1)&&Fo(i,a)&&Fo(a,i)&&(t.push(i.i,n.i,a.i),zo(n),zo(n.next),n=e=a,r=!0),n=n.next}while(n!==e);return r?Za(n):n}function no(e,t,n,r,i){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Ao(a,e)){let o=Lo(a,e);a=Za(a,a.next),o=Za(o,o.next),Qa(a,t,n,r,i),Qa(o,t,n,r,i);return}e=e.next}a=a.next}while(a!==e)}var ro=!1;function io(e,t,n,r){let i=[];for(let n=0,a=t.length;n<a;n++){let o=Xa(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1);o===o.next&&qa.add(o),i.push(Oo(o))}i.sort(ao),fo(e.length/r,t.length),po(n,n),ro=!0;for(let e=0;e<i.length;e++)n=oo(i[e],n);return ro=!1,Za(n)}function ao(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function oo(e,t){let n=_o(e,t);if(!n)return t;let r=Lo(n,e);return po(n,r.next.next),Za(r,r.next),Za(n,n.next)}var so=16,V=new Float64Array,co=0,lo=[],uo=[];function fo(e,t){let n=Math.ceil((e+2*t)/so)+t+2;V.length<n*4&&(V=new Float64Array(n*4)),co=0}function po(e,t){let n=e;do{let e=co++;lo[e]=n;let r=n.x,i=n.y,a=n.x,o=n.y,s=0;do{let t=n.next;n.z=e,t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>o&&(o=t.y),n=t}while(++s<so&&n!==t);uo[e]=n;let c=e*4;V[c]=r,V[c+1]=i,V[c+2]=a,V[c+3]=o}while(n!==t)}function mo(e,t){let n=e.z*4;t.x<V[n]&&(V[n]=t.x),t.y<V[n+1]&&(V[n+1]=t.y),t.x>V[n+2]&&(V[n+2]=t.x),t.y>V[n+3]&&(V[n+3]=t.y)}function ho(e){let t=uo[e];for(;t.prev.next!==t;)t=t.next;return uo[e]=t,t}function go(e){let t=lo[e];for(;t.prev.next!==t;)t=t.next;return lo[e]=t,t}function _o(e,t){let n=t,r=e.x,i=e.y,a=-1/0,o;if(jo(e,n))return n;for(let t=0,s=0;t<co;t++,s+=4){if(i<V[s+1]||i>V[s+3]||V[s]>r||V[s+2]<=a)continue;let c=ho(t);n=go(t);do{if(n.prev.next===n){if(jo(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x<n.next.x?n:n.next,e===r))return o}}n=n.next}while(n!==c)}if(!o)return null;let s=o.x,c=o.y,l=Math.min(i,c),u=Math.max(i,c),d=1/0;for(let t=0,f=0;t<co;t++,f+=4){if(V[f+2]<s||V[f]>r||V[f+3]<l||V[f+1]>u)continue;let p=ho(t);n=go(t);do{if(n.prev.next===n&&r>=n.x&&n.x>=s&&r!==n.x&&ko(i<c?r:a,i,s,c,i<c?a:r,i,n.x,n.y)){let t=Math.abs(i-n.y)/(r-n.x);(Fo(n,e)||n.y===i&&n.next.y===i&&n.next.x>r)&&(t<d||t===d&&(n.x>o.x||n.x===o.x&&vo(o,n)))&&(o=n,d=t)}n=n.next}while(n!==p)}return o}function vo(e,t){return H(e.prev,e,t.prev)<0&&H(t.next,e,e.next)<0}var yo=[],bo=[],xo=new Uint32Array,So=new Uint32Array,Co=new Uint32Array(256);function wo(e,t,n,r){let i=e,a=0;do i.z=Do(i.x,i.y,t,n,r),yo[a++]=i,i=i.next;while(i!==e);To(a);let o=null;for(let e=0;e<a;e++){let t=yo[e];t.prevZ=o,o&&(o.nextZ=t),o=t}o.nextZ=null,yo.fill(null,0,a),bo.fill(null,0,a)}function To(e){if(e<=32)for(let t=1;t<e;t++){let e=yo[t],n=e.z,r=t-1;for(;r>=0&&yo[r].z>n;)yo[r+1]=yo[r],r--;yo[r+1]=e}else{xo.length<e&&(xo=new Uint32Array(e),So=new Uint32Array(e),bo=Array(e));for(let t=0;t<e;t++)xo[t]=yo[t].z;Eo(e,yo,xo,bo,So,0),Eo(e,bo,So,yo,xo,8),Eo(e,yo,xo,bo,So,16),Eo(e,bo,So,yo,xo,24)}}function Eo(e,t,n,r,i,a){Co.fill(0);for(let t=0;t<e;t++)Co[n[t]>>>a&255]++;let o=0;for(let e=0;e<256;e++){let t=Co[e];Co[e]=o,o+=t}for(let o=0;o<e;o++){let e=n[o],s=Co[e>>>a&255]++;r[s]=t[o],i[s]=e}}function Do(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&0xff00ff,e=(e|e<<4)&0xf0f0f0f,e=(e|e<<2)&858993459,e=(e|e<<1)&0x55555555,t=(t|t<<8)&0xff00ff,t=(t|t<<4)&0xf0f0f0f,t=(t|t<<2)&858993459,t=(t|t<<1)&0x55555555,e|t<<1}function Oo(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function ko(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function Ao(e,t){let n=jo(e,t)&&H(e.prev,e,e.next)>0&&H(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||Fo(e,t)&&Fo(t,e)&&(H(e.prev,e,t.prev)!==0||H(e,t.prev,t)!==0))&&!Po(e,t)&&(n||Io(e,t))}function H(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function jo(e,t){return e.x===t.x&&e.y===t.y}function Mo(e,t,n,r,i=!0){let a=H(e,t,n),o=H(e,t,r),s=H(n,r,e),c=H(n,r,t);return(a>0&&o<0||a<0&&o>0)&&(s>0&&c<0||s<0&&c>0)?!0:i?!!(a===0&&No(e,n,t)||o===0&&No(e,r,t)||s===0&&No(n,e,r)||c===0&&No(n,t,r)):!1}function No(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Po(e,t){let n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.y,t.y),o=e;do{let s=o.next;if(o.x>r&&s.x>r||o.x<n&&s.x<n||o.y>a&&s.y>a||o.y<i&&s.y<i)o=s;else{if(o.i!==e.i&&s.i!==e.i&&o.i!==t.i&&s.i!==t.i&&Mo(o,s,e,t))return!0;o=s}}while(o!==e);return!1}function Fo(e,t){return H(e.prev,e,e.next)<0?H(e,t,e.next)>=0&&H(e,e.prev,t)>=0:H(e,t,e.prev)<0||H(e,e.next,t)<0}function Io(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{let e=n.next;n.y>a!=e.y>a&&i<(e.x-n.x)*(a-n.y)/(e.y-n.y)+n.x&&(r=!r),n=e}while(n!==e);return r}function Lo(e,t){let n=Bo(e.i,e.x,e.y),r=Bo(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Ro(e,t,n,r){let i=Bo(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function zo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),ro&&mo(e.prev,e.next)}function Bo(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Vo(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var Ho=Ya.default||Ya,Uo=(e=>(e[e.NONE=0]=`NONE`,e[e.COLOR=16384]=`COLOR`,e[e.STENCIL=1024]=`STENCIL`,e[e.DEPTH=256]=`DEPTH`,e[e.COLOR_DEPTH=16640]=`COLOR_DEPTH`,e[e.COLOR_STENCIL=17408]=`COLOR_STENCIL`,e[e.DEPTH_STENCIL=1280]=`DEPTH_STENCIL`,e[e.ALL=17664]=`ALL`,e))(Uo||{}),Wo=class{constructor(e){this.items=[],this._name=e}emit(e,t,n,r,i,a,o,s){let{name:c,items:l}=this;for(let u=0,d=l.length;u<d;u++)l[u][c](e,t,n,r,i,a,o,s);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){let t=this.items.indexOf(e);return t!==-1&&this.items.splice(t,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}},Go=[`init`,`destroy`,`contextChange`,`resolutionChange`,`resetState`,`renderEnd`,`renderStart`,`render`,`update`,`postrender`,`prerender`],Ko=class e extends gt{constructor(e){super(),this.tick=0,this.uid=I(`renderer`),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;let t=[...Go,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck()}async init(t={}){let n=t.skipExtensionImports===!0||t.manageImports===!1;await Wa(n),!n&&this.config.loaders&&await Promise.all(this.config.loaders.map(e=>e.value.load())),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(let e in this._systemsHash)t={...this._systemsHash[e].constructor.defaultOptions,...t};t={...e.defaultOptions,...t},this._roundPixels=+!!t.roundPixels;for(let e=0;e<this.runners.init.items.length;e++)await this.runners.init.items[e].init(t);this._initOptions=t}render(e,t){this.tick++;let n=e;if(n instanceof Hr&&(n={container:n},t&&(R(L,`passing a second argument is deprecated, please use render options instead`),n.target=t.renderTexture)),n.target||(n.target=this.view.renderTarget),n.target===this.view.renderTarget&&(this._lastObjectRendered=n.container,n.clearColor??(n.clearColor=this.background.colorRgba),n.clear??(n.clear=this.background.clearBeforeRender)),n.clearColor){let e=Array.isArray(n.clearColor)&&n.clearColor.length===4;n.clearColor=e?n.clearColor:Vn.shared.setValue(n.clearColor).toArray()}n.transform||(n.container.updateLocalTransform(),n.transform=n.container.localTransform),n.container.visible&&(n.container.enableRenderGroup(),this.runners.prerender.emit(n),this.runners.renderStart.emit(n),this.runners.render.emit(n),this.runners.renderEnd.emit(n),this.runners.postrender.emit(n))}resize(e,t,n){let r=this.view.resolution;this.view.resize(e,t,n),this.emit(`resize`,this.view.screen.width,this.view.screen.height,this.view.resolution),n!==void 0&&n!==r&&this.runners.resolutionChange.emit(n)}clear(e={}){let t=this;e.target||=t.renderTarget.renderTarget,e.clearColor||=this.background.colorRgba,e.clear??=Uo.ALL;let{clear:n,clearColor:r,target:i,mipLevel:a,layer:o}=e;Vn.shared.setValue(r??this.background.colorRgba),t.renderTarget.clear(i,n,Vn.shared.toArray(),a??0,o??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(e=>{this.runners[e]=new Wo(e)})}_addSystems(e){let t;for(t in e){let n=e[t];this._addSystem(n.value,n.name)}}_addSystem(e,t){let n=new e(this);if(this[t])throw Error(`Whoops! The name "${t}" is already in use`);this[t]=n,this._systemsHash[t]=n;for(let e in this.runners)this.runners[e].add(n);return this}_addPipes(e,t){let n=t.reduce((e,t)=>(e[t.name]=t.value,e),{});e.forEach(e=>{let t=e.value,r=e.name,i=n[r];this.renderPipes[r]=new t(this,i?new i:null),this.runners.destroy.add(this.renderPipes[r])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e==`object`&&e.releaseGlobalResources)&&Kn.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Ka())throw Error(`Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.`)}resetState(){this.runners.resetState.emit()}};Ko.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};var qo=Ko,Jo;function Yo(e){return Jo===void 0&&(Jo=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:e??qo.defaultOptions.failIfMajorPerformanceCaveat};try{if(!$r.get().getWebGLRenderingContext())return!1;let e=$r.get().createCanvas().getContext(`webgl`,t),n=!!e?.getContextAttributes()?.stencil;if(e){let t=e.getExtension(`WEBGL_lose_context`);t&&t.loseContext()}return e=null,n}catch{return!1}})()),Jo}var Xo;async function Zo(e={}){return Xo===void 0&&(Xo=await(async()=>{let t=$r.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Xo}var Qo=[`webgl`,`webgpu`,`canvas`];async function $o(e){let t=[];e.preference?Array.isArray(e.preference)?t=e.preference.slice():(t.push(e.preference),Qo.forEach(n=>{n!==e.preference&&t.push(n)})):t=Qo.slice();let n,r={};for(let i=0;i<t.length;i++){let a=t[i];if(a===`webgpu`&&await Zo()){let{WebGPURenderer:t}=await ft(async()=>{let{WebGPURenderer:e}=await import(`./WebGPURenderer-Ce0-U9Q1.js`);return{WebGPURenderer:e}},__vite__mapDeps([5,6,7,3]),import.meta.url);n=t,r={...e,...e.webgpu};break}if(a===`webgl`&&Yo(e.failIfMajorPerformanceCaveat??qo.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:t}=await ft(async()=>{let{WebGLRenderer:e}=await import(`./WebGLRenderer-C0v9HBel.js`);return{WebGLRenderer:e}},__vite__mapDeps([8,6,7,3]),import.meta.url);n=t,r={...e,...e.webgl};break}if(a===`canvas`){let{CanvasRenderer:t}=await ft(async()=>{let{CanvasRenderer:e}=await import(`./CanvasRenderer-HmF-4gyW.js`);return{CanvasRenderer:e}},__vite__mapDeps([9,7,3,2]),import.meta.url);n=t,r={...e,...e.canvasOptions};break}}if(delete r.webgpu,delete r.webgl,delete r.canvasOptions,!n)throw Error(`No available renderer for the current environment`);let i=new n;return await i.init(r),i}var es=`8.23.0`,ts=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,es)}static destroy(){}};ts.extension=N.Application;var ns=class{constructor(e){this._renderer=e}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,es)}destroy(){this._renderer=null}};ns.extension={type:[N.WebGLSystem,N.WebGPUSystem],name:`initHook`,priority:-10};var rs=class{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(e){globalThis.removeEventListener(`resize`,this.queueResize),this._resizeTo=e,e&&(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),null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,t;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{let{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,t=r}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener(`resize`,this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}};rs.extension=N.Application;var is=class{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,ni.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?ai.shared:new ai,e.autoStart&&this.start()}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy()}}};is.extension=N.Application,at.add(rs),at.add(is);var as=class e{constructor(...e){this.stage=new Hr,e[0]!==void 0&&R(L,`Application constructor options are deprecated, please use Application.init() instead.`)}async init(t){t={...t},this.stage||=new Hr,this.renderer=await $o(t),e._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return R(L,`Application.view is deprecated, please use Application.canvas instead.`),this.renderer.canvas}get screen(){return this.renderer.screen}get domContainerRoot(){return this.renderer.renderPipes.dom?._domElement}destroy(t=!1,n=!1){let r=e._plugins.slice(0);r.reverse(),r.forEach(e=>{e.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};as._plugins=[];var os=as;at.handleByList(N.Application,os._plugins),at.add(ts);var ss={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},cs=/([astvzqmhlc])([^astvzqmhlc]*)/gi,ls=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function us(e){let t=[];return e.replace(cs,(e,n,r)=>{let i=n.toLowerCase(),a=n,o=ds(r);for(i===`m`&&o.length>2&&(t.push([a,...o.splice(0,2)]),i=`l`,a=a===`m`?`l`:`L`);;){if(o.length===ss[i])return t.push([a,...o]),``;if(o.length<ss[i])throw Error(`malformed path data`);t.push([a,...o.splice(0,ss[i])])}}),t}function ds(e){let t=e.match(ls);return t?t.map(Number):[]}function fs(e,t){let n=us(e),r=[],i=null,a=0,o=0;for(let e=0;e<n.length;e++){let s=n[e],c=s[0],l=s;switch(c){case`M`:a=l[1],o=l[2],t.moveTo(a,o);break;case`m`:a+=l[1],o+=l[2],t.moveTo(a,o);break;case`H`:a=l[1],t.lineTo(a,o);break;case`h`:a+=l[1],t.lineTo(a,o);break;case`V`:o=l[1],t.lineTo(a,o);break;case`v`:o+=l[1],t.lineTo(a,o);break;case`L`:a=l[1],o=l[2],t.lineTo(a,o);break;case`l`:a+=l[1],o+=l[2],t.lineTo(a,o);break;case`C`:a=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],a,o);break;case`c`:t.bezierCurveTo(a+l[1],o+l[2],a+l[3],o+l[4],a+l[5],o+l[6]),a+=l[5],o+=l[6];break;case`S`:a=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],a,o);break;case`s`:t.bezierCurveToShort(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`Q`:a=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],a,o);break;case`q`:t.quadraticCurveTo(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`T`:a=l[1],o=l[2],t.quadraticCurveToShort(a,o);break;case`t`:a+=l[1],o+=l[2],t.quadraticCurveToShort(a,o);break;case`A`:a=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`a`:a+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`Z`:case`z`:t.closePath(),r.length>0&&(i=r.pop(),i?(a=i.startX,o=i.startY):(a=0,o=0)),i=null;break;default:Gn(`Unknown SVG path command: ${c}`)}c!==`Z`&&c!==`z`&&i===null&&(i={startX:a,startY:o},r.push(i))}return t}var ps=class e{constructor(e=0,t=0,n=0){this.type=`circle`,this.x=e,this.y=t,this.radius=n}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}strokeContains(e,t,n,r=.5){if(this.radius===0)return!1;let i=this.x-e,a=this.y-t,o=this.radius,s=(1-r)*n,c=Math.sqrt(i*i+a*a);return c<=o+s&&c>o-(n-s)}getBounds(e){return e||=new Nt,e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}},ms=class e{constructor(e=0,t=0,n=0,r=0){this.type=`ellipse`,this.x=e,this.y=t,this.halfWidth=n,this.halfHeight=r}clone(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let n=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return n*=n,r*=r,n+r<=1}strokeContains(e,t,n,r=.5){let{halfWidth:i,halfHeight:a}=this;if(i<=0||a<=0)return!1;let o=n*(1-r),s=n-o,c=i-s,l=a-s,u=i+o,d=a+o,f=e-this.x,p=t-this.y;return f*f/(u*u)+p*p/(d*d)>1?!1:c<=0||l<=0||f*f/(c*c)+p*p/(l*l)>1}getBounds(e){return e||=new Nt,e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};function hs(e){let t=e.length;if(t<6)return 1;let n=0;for(let r=0,i=e[t-2],a=e[t-1];r<t;r+=2){let t=e[r],o=e[r+1];n+=(t-i)*(o+a),i=t,a=o}return n<0?-1:1}function gs(e,t,n,r,i,a){let o=e-n,s=t-r,c=i-n,l=a-r,u=o*c+s*l,d=c*c+l*l,f=-1;d!==0&&(f=u/d);let p,m;f<0?(p=n,m=r):f>1?(p=i,m=a):(p=n+f*c,m=r+f*l);let h=e-p,g=t-m;return h*h+g*g}var _s,vs,ys=class e{constructor(...e){this.type=`polygon`;let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.closePath=!0}isClockwise(){let e=0,t=this.points,n=t.length;for(let r=0;r<n;r+=2){let i=t[r],a=t[r+1],o=t[(r+2)%n],s=t[(r+3)%n];e+=(o-i)*(s+a)}return e<0}containsPolygon(e){let t=this.getBounds(_s),n=e.getBounds(vs);if(!t.containsRect(n))return!1;let r=e.points;for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!this.contains(t,n))return!1}return!0}clone(){let t=this.points.slice(),n=new e(t);return n.closePath=this.closePath,n}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}strokeContains(e,t,n,r=.5){let{points:i}=this,a=n*(r===.5?r:(r-.5)*hs(i)+.5),o=n-a,s=a*a,c=o*o,l=i.length-(this.closePath?0:2);for(let n=0;n<l;n+=2){let r=i[n],a=i[n+1],o=i[(n+2)%i.length],l=i[(n+3)%i.length];if(gs(e,t,r,a,o,l)<=(Math.sign((o-r)*(t-a)-(l-a)*(e-r))<0?s:c))return!0}return!1}getBounds(e){e||=new Nt;let t=this.points,n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e=0,o=t.length;e<o;e+=2){let o=t[e],s=t[e+1];n=o<n?o:n,r=o>r?o:r,i=s<i?s:i,a=s>a?s:a}return e.x=n,e.width=r-n,e.y=i,e.height=a-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,``)}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return R(`8.11.0`,`Polygon.lastX is deprecated, please use Polygon.lastX instead.`),this.points[this.points.length-2]}get y(){return R(`8.11.0`,`Polygon.y is deprecated, please use Polygon.lastY instead.`),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}},bs=(e,t,n,r,i,a,o)=>{let s=e-n,c=t-r,l=Math.sqrt(s*s+c*c);return l>=i-a&&l<=i+o},xs=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.type=`roundedRectangle`,this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i}getBounds(e){return e||=new Nt,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}strokeContains(e,t,n,r=.5){let{x:i,y:a,width:o,height:s}=this,c=Math.max(0,Math.min(this.radius,Math.min(o,s)/2)),l=n*(1-r),u=n-l,d=i+c,f=a+c,p=o-c*2,m=s-c*2,h=i+o,g=a+s;return(e>=i-l&&e<=i+u||e>=h-u&&e<=h+l)&&t>=f&&t<=f+m||(t>=a-l&&t<=a+u||t>=g-u&&t<=g+l)&&e>=d&&e<=d+p||e<d&&t<f&&bs(e,t,d,f,c,u,l)||e>h-c&&t<f&&bs(e,t,h-c,f,c,u,l)||e>h-c&&t>g-c&&bs(e,t,h-c,g-c,c,u,l)||e<d&&t>g-c&&bs(e,t,d,g-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}},Ss=class{constructor(e){this.rawBinaryData=typeof e==`number`?new ArrayBuffer(e):e instanceof Uint8Array?e.buffer:e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||=new Int8Array(this.rawBinaryData),this._int8View}get uint8View(){return this._uint8View||=new Uint8Array(this.rawBinaryData),this._uint8View}get int16View(){return this._int16View||=new Int16Array(this.rawBinaryData),this._int16View}get int32View(){return this._int32View||=new Int32Array(this.rawBinaryData),this._int32View}get float64View(){return this._float64Array||=new Float64Array(this.rawBinaryData),this._float64Array}get bigUint64View(){return this._bigUint64Array||=new BigUint64Array(this.rawBinaryData),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case`int8`:case`uint8`:return 1;case`int16`:case`uint16`:return 2;case`int32`:case`uint32`:case`float32`:return 4;default:throw Error(`${e} isn't a valid view type`)}}};function Cs(e,t,n,r){if(n??=0,r??=Math.min(e.byteLength-n,t.byteLength),!(n&7)&&!(r&7)){let i=r/8;new Float64Array(t,0,i).set(new Float64Array(e,n,i))}else if(!(n&3)&&!(r&3)){let i=r/4;new Float32Array(t,0,i).set(new Float32Array(e,n,i))}else new Uint8Array(t).set(new Uint8Array(e,n,r))}var ws={normal:`normal-npm`,add:`add-npm`,screen:`screen-npm`},Ts=(e=>(e[e.DISABLED=0]=`DISABLED`,e[e.RENDERING_MASK_ADD=1]=`RENDERING_MASK_ADD`,e[e.MASK_ACTIVE=2]=`MASK_ACTIVE`,e[e.INVERSE_MASK_ACTIVE=3]=`INVERSE_MASK_ACTIVE`,e[e.RENDERING_MASK_REMOVE=4]=`RENDERING_MASK_REMOVE`,e[e.NONE=5]=`NONE`,e))(Ts||{});function Es(e,t){return t.alphaMode===`no-premultiply-alpha`&&ws[e]||e}var Ds=`precision mediump float;
24
+ ${e}`:e}function $i(e,t){return t?e.replace(`#version 300 es`,``):e}var ea={stripVersion:$i,ensurePrecision:qi,addProgramDefines:Ui,setProgramName:Qi,insertVersion:Yi},ta=Object.create(null),na=class e{constructor(t){t={...e.defaultOptions,...t};let n=t.fragment.indexOf(`#version 300 es`)!==-1,r={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:`highp`,maxSupportedFragmentPrecision:Hi()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n},i=t.fragment,a=t.vertex;Object.keys(ea).forEach(e=>{let t=r[e];i=ea[e](i,t,!0),a=ea[e](a,t,!1)}),this.fragment=i,this.vertex=a,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Fi(`${this.vertex}:${this.fragment}`,`gl-program`)}get fragmentOutputMask(){return this._fragmentOutputMask===void 0&&(this._fragmentOutputMask=Ri(this.fragment)),this._fragmentOutputMask}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,ta[this._cacheKey]=null}static from(t){let n=`${t.vertex}:${t.fragment}`;return ta[n]||(ta[n]=new e(t),ta[n]._cacheKey=n),ta[n]}};na.defaultOptions={preferredVertexPrecision:`highp`,preferredFragmentPrecision:`mediump`};var ra=na,ia={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function aa(e){return ia[e]??ia.float32}var oa={f32:`float32`,"vec2<f32>":`float32x2`,"vec3<f32>":`float32x3`,"vec4<f32>":`float32x4`,vec2f:`float32x2`,vec3f:`float32x3`,vec4f:`float32x4`,i32:`sint32`,"vec2<i32>":`sint32x2`,"vec3<i32>":`sint32x3`,"vec4<i32>":`sint32x4`,vec2i:`sint32x2`,vec3i:`sint32x3`,vec4i:`sint32x4`,u32:`uint32`,"vec2<u32>":`uint32x2`,"vec3<u32>":`uint32x3`,"vec4<u32>":`uint32x4`,vec2u:`uint32x2`,vec3u:`uint32x3`,vec4u:`uint32x4`,bool:`uint32`,"vec2<bool>":`uint32x2`,"vec3<bool>":`uint32x3`,"vec4<bool>":`uint32x4`},sa=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function ca(e,t){let n;for(;(n=sa.exec(e))!==null;){let e=oa[n[3]]??`float32`;t[n[2]]={location:parseInt(n[1],10),format:e,stride:aa(e).stride,offset:0,instance:!1,start:0}}sa.lastIndex=0}function la({source:e,entryPoint:t}){let n={},r=Ii(e),i=r.indexOf(`fn ${t}(`);if(i===-1)return n;let a=r.indexOf(`->`,i);if(a===-1)return n;let o=r.substring(i,a);if(ca(o,n),Object.keys(n).length===0){let e=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(e){let t=e[1],i=RegExp(`struct\\s+${t}\\s*\\{([^}]+)\\}`,`s`),a=r.match(i);a&&ca(a[1],n)}}return n}var ua=/@location\(\s*(\d+)\s*\)/g;function da(e){let t=0,n;for(;(n=ua.exec(e))!==null;)t|=1<<parseInt(n[1],10);return ua.lastIndex=0,t}function fa({source:e,entryPoint:t}){if(!t)return null;let n=Ii(e),r=RegExp(`fn\\s+${t}\\s*\\(`).exec(n);if(!r)return null;let i=1,a=r.index+r[0].length;for(;a<n.length&&i>0;){let e=n[a++];e===`(`?i++:e===`)`&&i--}let o=n.indexOf(`{`,a);if(o===-1)return null;let s=n.substring(a,o).trim();if(!s.startsWith(`->`))return 0;let c=s.substring(2).trim();if(c.startsWith(`@builtin`))return 0;if(c.startsWith(`@location`))return da(c);if(!/^\w+$/.test(c))return null;let l=RegExp(`struct\\s+${c}\\s*\\{([^}]*)\\}`).exec(n);return l?da(l[1]):null}function pa(e){let t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,a=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,s=/(\w+)\s*:\s*([\w\<\>]+)/g,c=/struct\s+(\w+)/,l=e.match(t)?.map(e=>{let t=e.match(i),o=t?.[1]??``,s;return o===`<uniform>`?s=`uniform`:o.startsWith(`<storage`)&&(s=`storage`),{group:parseInt(e.match(n)[1],10),binding:parseInt(e.match(r)[1],10),name:t[2],accessMode:s,type:e.match(a)[1]}});return l?{groups:l,structs:e.match(o)?.map(e=>{let t=e.match(c)[1],n=e.match(s).reduce((e,t)=>{let[n,r]=t.split(`:`);return e[n.trim()]=r.trim(),e},{});return n?{name:t,members:n}:null}).filter(({name:e})=>l.some(t=>t.type===e||t.type.includes(`<${e}>`)))??[]}:{groups:[],structs:[]}}var B=(e=>(e[e.VERTEX=1]=`VERTEX`,e[e.FRAGMENT=2]=`FRAGMENT`,e[e.COMPUTE=4]=`COMPUTE`,e))(B||{});function ma(e){return e.endsWith(`<u32>`)?`uint`:e.endsWith(`<i32>`)?`sint`:`float`}function ha({groups:e}){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.group]||(t[r.group]=[]),r.accessMode===`uniform`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,buffer:{type:`uniform`}}):r.accessMode===`storage`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,buffer:{type:`read-only-storage`}}):r.type===`sampler`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,sampler:{type:`filtering`}}):r.type===`sampler_comparison`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,sampler:{type:`comparison`}}):r.type===`texture_2d`||r.type.startsWith(`texture_2d<`)?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`2d`,multisampled:!1}}):r.type===`texture_depth_2d`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:`depth`,viewDimension:`2d`,multisampled:!1}}):r.type===`texture_depth_2d_array`?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:`depth`,viewDimension:`2d-array`,multisampled:!1}}):r.type===`texture_2d_array`||r.type.startsWith(`texture_2d_array<`)?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`2d-array`,multisampled:!1}}):r.type===`texture_3d`||r.type.startsWith(`texture_3d<`)?t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`3d`,multisampled:!1}}):(r.type===`texture_cube`||r.type.startsWith(`texture_cube<`))&&t[r.group].push({binding:r.binding,visibility:B.VERTEX|B.FRAGMENT,texture:{sampleType:ma(r.type),viewDimension:`cube`,multisampled:!1}})}for(let e=0;e<t.length;e++)t[e]||(t[e]=[]);return t}function ga({groups:e}){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.group]||(t[r.group]={}),t[r.group][r.name]=r.binding}return t}function _a(e,t){let n=new Set,r=new Set;return{structs:[...e.structs,...t.structs].filter(e=>!n.has(e.name)&&(n.add(e.name),!0)),groups:[...e.groups,...t.groups].filter(e=>{let t=`${e.name}-${e.binding}`;return!r.has(t)&&(r.add(t),!0)})}}var va=Object.create(null),ya=class e{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:t,vertex:n,layout:r,gpuLayout:i,name:a}=e;if(this.name=a,this.fragment=t,this.vertex=n,t.source===n.source){let e=pa(t.source);this.structsAndGroups=e}else{let e=pa(n.source),r=pa(t.source);this.structsAndGroups=_a(e,r)}this.layout=r??ga(this.structsAndGroups),this.gpuLayout=i??ha(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){let{vertex:e,fragment:t}=this,n=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=Fi(n,`program`)}get attributeData(){return this._attributeData??=la(this.vertex),this._attributeData}get fragmentOutputMask(){return this._fragmentOutputMask===void 0&&(this._fragmentOutputMask=fa(this.fragment)),this._fragmentOutputMask}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,va[this._cacheKey]=null}static from(t){let n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return va[n]||(va[n]=new e(t),va[n]._cacheKey=n),va[n]}},ba=[`f32`,`i32`,`u32`,`vec2<f32>`,`vec3<f32>`,`vec4<f32>`,`mat2x2<f32>`,`mat3x3<f32>`,`mat4x4<f32>`,`mat3x2<f32>`,`mat4x2<f32>`,`mat2x3<f32>`,`mat4x3<f32>`,`mat2x4<f32>`,`mat3x4<f32>`,`vec2<i32>`,`vec3<i32>`,`vec4<i32>`,`vec2<u32>`,`vec3<u32>`,`vec4<u32>`],xa=ba.reduce((e,t)=>(e[t]=!0,e),{});function Sa(e,t){switch(e){case`f32`:return 0;case`vec2<f32>`:return new Float32Array(2*t);case`vec3<f32>`:return new Float32Array(3*t);case`vec4<f32>`:return new Float32Array(4*t);case`mat2x2<f32>`:return new Float32Array([1,0,0,1]);case`mat3x3<f32>`:return new Float32Array([1,0,0,0,1,0,0,0,1]);case`mat4x4<f32>`:return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Ca=class e extends gt{constructor(t,n){super(),this.uid=I(`uniform`),this._resourceType=`uniformGroup`,this._resourceId=I(`resource`),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...e.defaultOptions,...n},this.uniformStructures=t;let r={};for(let e in t){let n=t[e];if(n.name=e,n.size=n.size??1,!xa[n.type]){let e=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(e){let[,t,r]=e;throw Error(`Uniform type ${n.type} is not supported. Use type: '${t}', size: ${r} instead.`)}throw Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${ba.join(`, `)}`)}n.value??=Sa(n.type,n.size),r[e]=n.value}this.uniforms=r,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Fi(Object.keys(r).map(e=>`${e}-${t[e].type}`).join(`-`),`uniform-group`)}get buffer(){return this._buffer}set buffer(e){this._buffer!==e&&(this._buffer?.off(`change`,this.onBufferChange,this),this._buffer=e,e?.on(`change`,this.onBufferChange,this))}get _gcLastUsed(){return this._buffer?._gcLastUsed??-1}set _gcLastUsed(e){this._buffer&&(this._buffer._gcLastUsed=e)}onBufferChange(){this._resourceId=I(`resource`),this.emit(`change`,this)}update(){this._dirtyId++}};Ca.defaultOptions={ubo:!1,isStatic:!1};var wa=Ca;function Ta(e,t){let n=Math.imul(t+0x9e3779b9,0x85ebca6b)^Math.imul(e+1,0xc2b2ae35);return n^=n>>>16,n=Math.imul(n,0x7feb352d),n^=n>>>15,n=Math.imul(n,0x846ca68b),n^n>>>16}function Ea(e,t){let n=Math.imul(t+0x7f4a7c15,668265263)^Math.imul(e+374761393,0x9e3779b1);return n^=n>>>15,n=Math.imul(n,739982445),n^=n>>>12,n=Math.imul(n,695872825),n^n>>>15}var Da=class{constructor(e){this.resources=Object.create(null),this._resourceKeysValue=null,this._touchKeysValue=null,this._keyLow=0,this._keyHigh=0,this._gpuEntry=null,this._gpuEntryLayoutKey=-1,this._keyedIds=[],this.layout=null;let t=0;for(let n in e){t===0&&!/^\d/.test(n)&&(this.layout={}),this.layout&&(this.layout[n]=t);let r=e[n];r&&this.setResource(r,t),t++}}get _resourceKeys(){return this._resourceKeysValue??=Object.keys(this.resources).map(Number),this._resourceKeysValue}setResource(e,t){typeof t==`string`&&(t=this._bindingOf(t));let n=this.resources[t];e!==n&&(n&&n.off?.(`change`,this.onResourceChange,this),e.on?.(`change`,this.onResourceChange,this),this.setResourceUnwatched(e,t))}setResourceUnwatched(e,t){let n=this.resources[t];if(e===n)return;let r=e._resourceId;n?._resourceType!==e._resourceType&&(this._touchKeysValue=null),n===void 0?(this._resourceKeysValue=null,this._keyLow^=Ta(t,r),this._keyHigh^=Ea(t,r),this._keyedIds[t]=r,this._gpuEntry=null):this._keyedIds[t]!==r&&this._rekey(t,r),this.resources[t]=e}_rekey(e,t){let n=this._keyedIds[e];this._keyLow^=Ta(e,n)^Ta(e,t),this._keyHigh^=Ea(e,n)^Ea(e,t),this._keyedIds[e]=t,this._gpuEntry=null}getResource(e){return this.resources[typeof e==`string`?this._bindingOf(e):e]}_bindingOf(e){let t=this.layout?.[e];if(t===void 0)throw Error(`[BindGroup] no binding named '${e}' in this group`);return t}_touch(e){let t=this.resources,n=this._touchKeys;for(let r=0;r<n.length;r++){let i=t[n[r]];i&&(i._gcLastUsed=e)}}get _touchKeys(){return this._touchKeysValue??=this._resourceKeys.filter(e=>this.resources[e]?._resourceType!==`textureSampler`),this._touchKeysValue}destroy(){let e=this.resources;for(let t in e)e[t]?.off?.(`change`,this.onResourceChange,this);this.resources=null,this._resourceKeysValue=null,this._touchKeysValue=null,this._gpuEntry=null}onResourceChange(e){let t=this.resources;if(!t)return;let n=this._resourceKeys,r=e.destroyed;for(let i=0;i<n.length;i++){let a=n[i];t[a]===e&&(r&&(t[a]=null),this._rekey(a,r?-1:e._resourceId))}r&&Gn(`[BindGroup] a '${e._resourceType}' was destroyed while still bound to a shader. Remove it from the shader before destroying it.`)}},Oa=(e=>(e[e.WEBGL=1]=`WEBGL`,e[e.WEBGPU=2]=`WEBGPU`,e[e.CANVAS=4]=`CANVAS`,e[e.BOTH=3]=`BOTH`,e))(Oa||{}),ka=class e{constructor(e){this.data={...e};let t=Object.keys(e).sort().map(t=>`${t}:${e[t]}`).join(`|`);this.id=Fi(t,`shader-overrides`)}static from(t){return t instanceof e?t:new e(t)}},Aa=class e extends gt{constructor(e){super(),this.uid=I(`shader`),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:t,glProgram:n,groups:r,resources:i,compatibleRenderers:a,groupMap:o,overrides:s}=e;this._overrides=s?ka.from(s):null,this.gpuProgram=t,this.glProgram=n,a===void 0&&(a=0,t&&(a|=Oa.WEBGPU),n&&(a|=Oa.WEBGL)),this.compatibleRenderers=a;let c={};if(o)for(let e in o)for(let t in o[e]){let n=o[e][t];c[n]={group:Number(e),binding:Number(t),name:n}}if(!i&&!r&&(i={}),i&&r)throw Error(`[Shader] Cannot have both resources and groups`);if(!t&&r&&!o)throw Error(`[Shader] No group map or WebGPU shader provided - consider using resources instead.`);if(t&&r&&!o){let e=t.structsAndGroups.groups;o={},e.forEach(e=>{o[e.group]=o[e.group]||{},o[e.group][e.binding]=e.name,c[e.name]=e})}else if(i){r={},o||={},t&&t.structsAndGroups.groups.forEach(e=>{o[e.group]=o[e.group]||{},o[e.group][e.binding]=e.name,c[e.name]=e});let e=0;for(let a in i)c[a]||(t&&!n&&Gn(`[Shader] the resource '${a}' matches no binding in the WGSL source \u2014 is the name correct?`),r[99]||(r[99]=new Da,this._ownedBindGroups.push(r[99])),c[a]={group:99,binding:e,name:a},o[99]=o[99]||{},o[99][e]=a,e++);for(let e in i){let t=e,n=i[e];!n.source&&!n._resourceType&&(n=new wa(n));let a=c[t];a&&(r[a.group]||(r[a.group]=new Da,this._ownedBindGroups.push(r[a.group])),r[a.group].setResource(n,a.binding))}}this.groups=r,this._uniformBindMap=o,this.resources=this._buildResourceAccessor(r,c)}addResource(e,t,n){var r,i;(r=this._uniformBindMap)[t]||(r[t]={}),(i=this._uniformBindMap[t])[n]||(i[n]=e),this.groups[t]||(this.groups[t]=new Da,this._ownedBindGroups.push(this.groups[t]))}_buildResourceAccessor(e,t){let n={};for(let r in t){let i=t[r];Object.defineProperty(n,i.name,{get(){let t=e[i.group];return t.getResource(t.layout?t.layout[i.name]:i.binding)},set(t){let n=e[i.group];n.setResource(t,n.layout?n.layout[i.name]:i.binding)}})}return n}destroy(e=!1){this._destroyed||(this._destroyed=!0,this.emit(`destroy`,this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null,this._overrides=null)}static from(t){let{gpu:n,gl:r,...i}=t,a,o;return n&&(a=ya.from(n)),r&&(o=ra.from(r)),new e({gpuProgram:a,glProgram:o,...i})}},ja={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Ma={BLEND:0,OFFSET:1,CULLING:2,DEPTH_TEST:3,WINDING:4,DEPTH_MASK:5},{BLEND:Na,OFFSET:Pa,CULLING:Fa,DEPTH_TEST:Ia,WINDING:La,DEPTH_MASK:Ra}=Ma,za=class e{constructor(){this.data=0,this.blendMode=`normal`,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Na)}set blend(e){!!(this.data&1<<Na)!==e&&(this.data^=1<<Na)}get offsets(){return!!(this.data&1<<Pa)}set offsets(e){!!(this.data&1<<Pa)!==e&&(this.data^=1<<Pa)}set cullMode(e){e===`none`?this.culling=!1:(this.culling=!0,this.clockwiseFrontFace=e===`front`)}get cullMode(){return this.culling?this.clockwiseFrontFace?`front`:`back`:`none`}get culling(){return!!(this.data&1<<Fa)}set culling(e){!!(this.data&1<<Fa)!==e&&(this.data^=1<<Fa)}get depthTest(){return!!(this.data&1<<Ia)}set depthTest(e){!!(this.data&1<<Ia)!==e&&(this.data^=1<<Ia)}get depthMask(){return!!(this.data&1<<Ra)}set depthMask(e){!!(this.data&1<<Ra)!==e&&(this.data^=1<<Ra)}get clockwiseFrontFace(){return!!(this.data&1<<La)}set clockwiseFrontFace(e){!!(this.data&1<<La)!==e&&(this.data^=1<<La)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==`none`,this._blendMode=e,this._blendModeId=ja[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let t=new e;return t.depthTest=!1,t.depthMask=!1,t.blend=!0,t}};za.default2d=za.for2d();var Ba=za,Va=class e extends Aa{constructor(t){t={...e.defaultOptions,...t},super(t),this.enabled=!0,this._state=Ba.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,this.antialias=typeof t.antialias==`boolean`?t.antialias?`on`:`off`:t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource(`uTexture`,0,1),t.blendRequired&&this.addResource(`uBackTexture`,0,3)}apply(e,t,n,r){e.applyFilter(this,t,n,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(t){let{gpu:n,gl:r,...i}=t,a,o;return n&&(a=ya.from(n)),r&&(o=ra.from(r)),new e({gpuProgram:a,glProgram:o,...i})}};Va.defaultOptions={blendMode:`normal`,resolution:1,padding:0,antialias:`off`,blendRequired:!1,clipToViewport:!0};var Ha=Va,Ua=[];at.handleByNamedList(N.Environment,Ua);async function Wa(e){if(!e)for(let e=0;e<Ua.length;e++){let t=Ua[e];if(t.value.test()){await t.value.load();return}}}var Ga;function Ka(){if(typeof Ga==`boolean`)return Ga;try{Ga=Function(`param1`,`param2`,`param3`,`return param1[param2] === param3;`)({a:`b`},`a`,`b`)===!0}catch{Ga=!1}return Ga}var qa=new Set,Ja=!1;function Ya(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length;qa.size&&qa.clear();let a=Xa(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;let s=0,c=0,l=0;if(r&&(a=io(e,t,a,n)),e.length>80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;a<i;a+=n){let n=e[a],i=e[a+1];n<s&&(s=n),i<c&&(c=i),n>t&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return Qa(a,o,s,c,l),o}function Xa(e,t,n,r,i){let a=null;if(i===Vo(e,t,n,r)>0)for(let i=t;i<n;i+=r)a=Ro(i/r|0,e[i],e[i+1],a);else for(let i=n-r;i>=t;i-=r)a=Ro(i/r|0,e[i],e[i+1],a);return a&&jo(a,a.next)&&(zo(a),a=a.next),a}function Za(e,t=e){let n=t===e,r=e,i;do i=!1,r!==r.next&&(qa.size===0||!qa.has(r))&&(jo(r,r.next)||H(r.prev,r,r.next)===0)?((n||r===t)&&(t=r.prev),Ja=!0,zo(r),r=r.prev,i=!0):(n||r!==t)&&(r=r.next,i=!n);while(i||r!==t);return t}function Qa(e,t,n,r,i){i&&wo(e,n,r,i);let a=e,o=!1;for(;e.prev!==e.next;){let s=e.prev,c=e.next;if(H(s,e,c)<0&&(i?eo(e,n,r,i):$a(e)))t.push(s.i,e.i,c.i),zo(e),e=c,a=c;else if(e=c,e===a){if(Ja=!1,e=Za(e),Ja){a=e;continue}if(!o){e=to(e,t),a=e,o=!0;continue}no(e,t,n,r,i);break}}}function $a(e){let t=e.prev,n=e,r=e.next,i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&(i!==m.x||s!==m.y)&&ko(i,s,a,c,o,l,m.x,m.y)&&H(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function eo(e,t,n,r){let i=e.prev,a=e,o=e.next,s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=Do(p,m,t,n,r),v=Do(h,g,t,n,r),y=e.prevZ;for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==o&&(s!==y.x||u!==y.y)&&ko(s,u,c,d,l,f,y.x,y.y)&&H(y.prev,y,y.next)>=0)return!1;y=y.prevZ}let b=e.nextZ;for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==o&&(s!==b.x||u!==b.y)&&ko(s,u,c,d,l,f,b.x,b.y)&&H(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function to(e,t){let n=e,r=!1;do{let i=n.prev,a=n.next.next;Mo(i,n,n.next,a,!1)&&Fo(i,a)&&Fo(a,i)&&(t.push(i.i,n.i,a.i),zo(n),zo(n.next),n=e=a,r=!0),n=n.next}while(n!==e);return r?Za(n):n}function no(e,t,n,r,i){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Ao(a,e)){let o=Lo(a,e);a=Za(a,a.next),o=Za(o,o.next),Qa(a,t,n,r,i),Qa(o,t,n,r,i);return}e=e.next}a=a.next}while(a!==e)}var ro=!1;function io(e,t,n,r){let i=[];for(let n=0,a=t.length;n<a;n++){let o=Xa(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1);o===o.next&&qa.add(o),i.push(Oo(o))}i.sort(ao),fo(e.length/r,t.length),po(n,n),ro=!0;for(let e=0;e<i.length;e++)n=oo(i[e],n);return ro=!1,Za(n)}function ao(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function oo(e,t){let n=_o(e,t);if(!n)return t;let r=Lo(n,e);return po(n,r.next.next),Za(r,r.next),Za(n,n.next)}var so=16,V=new Float64Array,co=0,lo=[],uo=[];function fo(e,t){let n=Math.ceil((e+2*t)/so)+t+2;V.length<n*4&&(V=new Float64Array(n*4)),co=0}function po(e,t){let n=e;do{let e=co++;lo[e]=n;let r=n.x,i=n.y,a=n.x,o=n.y,s=0;do{let t=n.next;n.z=e,t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>o&&(o=t.y),n=t}while(++s<so&&n!==t);uo[e]=n;let c=e*4;V[c]=r,V[c+1]=i,V[c+2]=a,V[c+3]=o}while(n!==t)}function mo(e,t){let n=e.z*4;t.x<V[n]&&(V[n]=t.x),t.y<V[n+1]&&(V[n+1]=t.y),t.x>V[n+2]&&(V[n+2]=t.x),t.y>V[n+3]&&(V[n+3]=t.y)}function ho(e){let t=uo[e];for(;t.prev.next!==t;)t=t.next;return uo[e]=t,t}function go(e){let t=lo[e];for(;t.prev.next!==t;)t=t.next;return lo[e]=t,t}function _o(e,t){let n=t,r=e.x,i=e.y,a=-1/0,o;if(jo(e,n))return n;for(let t=0,s=0;t<co;t++,s+=4){if(i<V[s+1]||i>V[s+3]||V[s]>r||V[s+2]<=a)continue;let c=ho(t);n=go(t);do{if(n.prev.next===n){if(jo(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x<n.next.x?n:n.next,e===r))return o}}n=n.next}while(n!==c)}if(!o)return null;let s=o.x,c=o.y,l=Math.min(i,c),u=Math.max(i,c),d=1/0;for(let t=0,f=0;t<co;t++,f+=4){if(V[f+2]<s||V[f]>r||V[f+3]<l||V[f+1]>u)continue;let p=ho(t);n=go(t);do{if(n.prev.next===n&&r>=n.x&&n.x>=s&&r!==n.x&&ko(i<c?r:a,i,s,c,i<c?a:r,i,n.x,n.y)){let t=Math.abs(i-n.y)/(r-n.x);(Fo(n,e)||n.y===i&&n.next.y===i&&n.next.x>r)&&(t<d||t===d&&(n.x>o.x||n.x===o.x&&vo(o,n)))&&(o=n,d=t)}n=n.next}while(n!==p)}return o}function vo(e,t){return H(e.prev,e,t.prev)<0&&H(t.next,e,e.next)<0}var yo=[],bo=[],xo=new Uint32Array,So=new Uint32Array,Co=new Uint32Array(256);function wo(e,t,n,r){let i=e,a=0;do i.z=Do(i.x,i.y,t,n,r),yo[a++]=i,i=i.next;while(i!==e);To(a);let o=null;for(let e=0;e<a;e++){let t=yo[e];t.prevZ=o,o&&(o.nextZ=t),o=t}o.nextZ=null,yo.fill(null,0,a),bo.fill(null,0,a)}function To(e){if(e<=32)for(let t=1;t<e;t++){let e=yo[t],n=e.z,r=t-1;for(;r>=0&&yo[r].z>n;)yo[r+1]=yo[r],r--;yo[r+1]=e}else{xo.length<e&&(xo=new Uint32Array(e),So=new Uint32Array(e),bo=Array(e));for(let t=0;t<e;t++)xo[t]=yo[t].z;Eo(e,yo,xo,bo,So,0),Eo(e,bo,So,yo,xo,8),Eo(e,yo,xo,bo,So,16),Eo(e,bo,So,yo,xo,24)}}function Eo(e,t,n,r,i,a){Co.fill(0);for(let t=0;t<e;t++)Co[n[t]>>>a&255]++;let o=0;for(let e=0;e<256;e++){let t=Co[e];Co[e]=o,o+=t}for(let o=0;o<e;o++){let e=n[o],s=Co[e>>>a&255]++;r[s]=t[o],i[s]=e}}function Do(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&0xff00ff,e=(e|e<<4)&0xf0f0f0f,e=(e|e<<2)&858993459,e=(e|e<<1)&0x55555555,t=(t|t<<8)&0xff00ff,t=(t|t<<4)&0xf0f0f0f,t=(t|t<<2)&858993459,t=(t|t<<1)&0x55555555,e|t<<1}function Oo(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function ko(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function Ao(e,t){let n=jo(e,t)&&H(e.prev,e,e.next)>0&&H(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||Fo(e,t)&&Fo(t,e)&&(H(e.prev,e,t.prev)!==0||H(e,t.prev,t)!==0))&&!Po(e,t)&&(n||Io(e,t))}function H(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function jo(e,t){return e.x===t.x&&e.y===t.y}function Mo(e,t,n,r,i=!0){let a=H(e,t,n),o=H(e,t,r),s=H(n,r,e),c=H(n,r,t);return(a>0&&o<0||a<0&&o>0)&&(s>0&&c<0||s<0&&c>0)?!0:i?!!(a===0&&No(e,n,t)||o===0&&No(e,r,t)||s===0&&No(n,e,r)||c===0&&No(n,t,r)):!1}function No(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Po(e,t){let n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.y,t.y),o=e;do{let s=o.next;if(o.x>r&&s.x>r||o.x<n&&s.x<n||o.y>a&&s.y>a||o.y<i&&s.y<i)o=s;else{if(o.i!==e.i&&s.i!==e.i&&o.i!==t.i&&s.i!==t.i&&Mo(o,s,e,t))return!0;o=s}}while(o!==e);return!1}function Fo(e,t){return H(e.prev,e,e.next)<0?H(e,t,e.next)>=0&&H(e,e.prev,t)>=0:H(e,t,e.prev)<0||H(e,e.next,t)<0}function Io(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{let e=n.next;n.y>a!=e.y>a&&i<(e.x-n.x)*(a-n.y)/(e.y-n.y)+n.x&&(r=!r),n=e}while(n!==e);return r}function Lo(e,t){let n=Bo(e.i,e.x,e.y),r=Bo(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Ro(e,t,n,r){let i=Bo(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function zo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),ro&&mo(e.prev,e.next)}function Bo(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Vo(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var Ho=Ya.default||Ya,Uo=(e=>(e[e.NONE=0]=`NONE`,e[e.COLOR=16384]=`COLOR`,e[e.STENCIL=1024]=`STENCIL`,e[e.DEPTH=256]=`DEPTH`,e[e.COLOR_DEPTH=16640]=`COLOR_DEPTH`,e[e.COLOR_STENCIL=17408]=`COLOR_STENCIL`,e[e.DEPTH_STENCIL=1280]=`DEPTH_STENCIL`,e[e.ALL=17664]=`ALL`,e))(Uo||{}),Wo=class{constructor(e){this.items=[],this._name=e}emit(e,t,n,r,i,a,o,s){let{name:c,items:l}=this;for(let u=0,d=l.length;u<d;u++)l[u][c](e,t,n,r,i,a,o,s);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){let t=this.items.indexOf(e);return t!==-1&&this.items.splice(t,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}},Go=[`init`,`destroy`,`contextChange`,`resolutionChange`,`resetState`,`renderEnd`,`renderStart`,`render`,`update`,`postrender`,`prerender`],Ko=class e extends gt{constructor(e){super(),this.tick=0,this.uid=I(`renderer`),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;let t=[...Go,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck()}async init(t={}){let n=t.skipExtensionImports===!0||t.manageImports===!1;await Wa(n),!n&&this.config.loaders&&await Promise.all(this.config.loaders.map(e=>e.value.load())),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(let e in this._systemsHash)t={...this._systemsHash[e].constructor.defaultOptions,...t};t={...e.defaultOptions,...t},this._roundPixels=+!!t.roundPixels;for(let e=0;e<this.runners.init.items.length;e++)await this.runners.init.items[e].init(t);this._initOptions=t}render(e,t){this.tick++;let n=e;if(n instanceof Hr&&(n={container:n},t&&(R(L,`passing a second argument is deprecated, please use render options instead`),n.target=t.renderTexture)),n.target||(n.target=this.view.renderTarget),n.target===this.view.renderTarget&&(this._lastObjectRendered=n.container,n.clearColor??(n.clearColor=this.background.colorRgba),n.clear??(n.clear=this.background.clearBeforeRender)),n.clearColor){let e=Array.isArray(n.clearColor)&&n.clearColor.length===4;n.clearColor=e?n.clearColor:Vn.shared.setValue(n.clearColor).toArray()}n.transform||(n.container.updateLocalTransform(),n.transform=n.container.localTransform),n.container.visible&&(n.container.enableRenderGroup(),this.runners.prerender.emit(n),this.runners.renderStart.emit(n),this.runners.render.emit(n),this.runners.renderEnd.emit(n),this.runners.postrender.emit(n))}resize(e,t,n){let r=this.view.resolution;this.view.resize(e,t,n),this.emit(`resize`,this.view.screen.width,this.view.screen.height,this.view.resolution),n!==void 0&&n!==r&&this.runners.resolutionChange.emit(n)}clear(e={}){let t=this;e.target||=t.renderTarget.renderTarget,e.clearColor||=this.background.colorRgba,e.clear??=Uo.ALL;let{clear:n,clearColor:r,target:i,mipLevel:a,layer:o}=e;Vn.shared.setValue(r??this.background.colorRgba),t.renderTarget.clear(i,n,Vn.shared.toArray(),a??0,o??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(e=>{this.runners[e]=new Wo(e)})}_addSystems(e){let t;for(t in e){let n=e[t];this._addSystem(n.value,n.name)}}_addSystem(e,t){let n=new e(this);if(this[t])throw Error(`Whoops! The name "${t}" is already in use`);this[t]=n,this._systemsHash[t]=n;for(let e in this.runners)this.runners[e].add(n);return this}_addPipes(e,t){let n=t.reduce((e,t)=>(e[t.name]=t.value,e),{});e.forEach(e=>{let t=e.value,r=e.name,i=n[r];this.renderPipes[r]=new t(this,i?new i:null),this.runners.destroy.add(this.renderPipes[r])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e==`object`&&e.releaseGlobalResources)&&Kn.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Ka())throw Error(`Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.`)}resetState(){this.runners.resetState.emit()}};Ko.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};var qo=Ko,Jo;function Yo(e){return Jo===void 0&&(Jo=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:e??qo.defaultOptions.failIfMajorPerformanceCaveat};try{if(!$r.get().getWebGLRenderingContext())return!1;let e=$r.get().createCanvas().getContext(`webgl`,t),n=!!e?.getContextAttributes()?.stencil;if(e){let t=e.getExtension(`WEBGL_lose_context`);t&&t.loseContext()}return e=null,n}catch{return!1}})()),Jo}var Xo;async function Zo(e={}){return Xo===void 0&&(Xo=await(async()=>{let t=$r.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Xo}var Qo=[`webgl`,`webgpu`,`canvas`];async function $o(e){let t=[];e.preference?Array.isArray(e.preference)?t=e.preference.slice():(t.push(e.preference),Qo.forEach(n=>{n!==e.preference&&t.push(n)})):t=Qo.slice();let n,r={};for(let i=0;i<t.length;i++){let a=t[i];if(a===`webgpu`&&await Zo()){let{WebGPURenderer:t}=await ft(async()=>{let{WebGPURenderer:e}=await import(`./WebGPURenderer-D9KI_sD9.js`);return{WebGPURenderer:e}},__vite__mapDeps([5,6,7,3]),import.meta.url);n=t,r={...e,...e.webgpu};break}if(a===`webgl`&&Yo(e.failIfMajorPerformanceCaveat??qo.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:t}=await ft(async()=>{let{WebGLRenderer:e}=await import(`./WebGLRenderer-BnY2xfDL.js`);return{WebGLRenderer:e}},__vite__mapDeps([8,6,7,3]),import.meta.url);n=t,r={...e,...e.webgl};break}if(a===`canvas`){let{CanvasRenderer:t}=await ft(async()=>{let{CanvasRenderer:e}=await import(`./CanvasRenderer-CEGuSdsG.js`);return{CanvasRenderer:e}},__vite__mapDeps([9,7,3,2]),import.meta.url);n=t,r={...e,...e.canvasOptions};break}}if(delete r.webgpu,delete r.webgl,delete r.canvasOptions,!n)throw Error(`No available renderer for the current environment`);let i=new n;return await i.init(r),i}var es=`8.23.0`,ts=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,es)}static destroy(){}};ts.extension=N.Application;var ns=class{constructor(e){this._renderer=e}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,es)}destroy(){this._renderer=null}};ns.extension={type:[N.WebGLSystem,N.WebGPUSystem],name:`initHook`,priority:-10};var rs=class{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(e){globalThis.removeEventListener(`resize`,this.queueResize),this._resizeTo=e,e&&(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),null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,t;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{let{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,t=r}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener(`resize`,this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}};rs.extension=N.Application;var is=class{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,ni.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?ai.shared:new ai,e.autoStart&&this.start()}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy()}}};is.extension=N.Application,at.add(rs),at.add(is);var as=class e{constructor(...e){this.stage=new Hr,e[0]!==void 0&&R(L,`Application constructor options are deprecated, please use Application.init() instead.`)}async init(t){t={...t},this.stage||=new Hr,this.renderer=await $o(t),e._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return R(L,`Application.view is deprecated, please use Application.canvas instead.`),this.renderer.canvas}get screen(){return this.renderer.screen}get domContainerRoot(){return this.renderer.renderPipes.dom?._domElement}destroy(t=!1,n=!1){let r=e._plugins.slice(0);r.reverse(),r.forEach(e=>{e.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};as._plugins=[];var os=as;at.handleByList(N.Application,os._plugins),at.add(ts);var ss={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},cs=/([astvzqmhlc])([^astvzqmhlc]*)/gi,ls=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function us(e){let t=[];return e.replace(cs,(e,n,r)=>{let i=n.toLowerCase(),a=n,o=ds(r);for(i===`m`&&o.length>2&&(t.push([a,...o.splice(0,2)]),i=`l`,a=a===`m`?`l`:`L`);;){if(o.length===ss[i])return t.push([a,...o]),``;if(o.length<ss[i])throw Error(`malformed path data`);t.push([a,...o.splice(0,ss[i])])}}),t}function ds(e){let t=e.match(ls);return t?t.map(Number):[]}function fs(e,t){let n=us(e),r=[],i=null,a=0,o=0;for(let e=0;e<n.length;e++){let s=n[e],c=s[0],l=s;switch(c){case`M`:a=l[1],o=l[2],t.moveTo(a,o);break;case`m`:a+=l[1],o+=l[2],t.moveTo(a,o);break;case`H`:a=l[1],t.lineTo(a,o);break;case`h`:a+=l[1],t.lineTo(a,o);break;case`V`:o=l[1],t.lineTo(a,o);break;case`v`:o+=l[1],t.lineTo(a,o);break;case`L`:a=l[1],o=l[2],t.lineTo(a,o);break;case`l`:a+=l[1],o+=l[2],t.lineTo(a,o);break;case`C`:a=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],a,o);break;case`c`:t.bezierCurveTo(a+l[1],o+l[2],a+l[3],o+l[4],a+l[5],o+l[6]),a+=l[5],o+=l[6];break;case`S`:a=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],a,o);break;case`s`:t.bezierCurveToShort(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`Q`:a=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],a,o);break;case`q`:t.quadraticCurveTo(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`T`:a=l[1],o=l[2],t.quadraticCurveToShort(a,o);break;case`t`:a+=l[1],o+=l[2],t.quadraticCurveToShort(a,o);break;case`A`:a=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`a`:a+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`Z`:case`z`:t.closePath(),r.length>0&&(i=r.pop(),i?(a=i.startX,o=i.startY):(a=0,o=0)),i=null;break;default:Gn(`Unknown SVG path command: ${c}`)}c!==`Z`&&c!==`z`&&i===null&&(i={startX:a,startY:o},r.push(i))}return t}var ps=class e{constructor(e=0,t=0,n=0){this.type=`circle`,this.x=e,this.y=t,this.radius=n}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}strokeContains(e,t,n,r=.5){if(this.radius===0)return!1;let i=this.x-e,a=this.y-t,o=this.radius,s=(1-r)*n,c=Math.sqrt(i*i+a*a);return c<=o+s&&c>o-(n-s)}getBounds(e){return e||=new Nt,e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}},ms=class e{constructor(e=0,t=0,n=0,r=0){this.type=`ellipse`,this.x=e,this.y=t,this.halfWidth=n,this.halfHeight=r}clone(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let n=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return n*=n,r*=r,n+r<=1}strokeContains(e,t,n,r=.5){let{halfWidth:i,halfHeight:a}=this;if(i<=0||a<=0)return!1;let o=n*(1-r),s=n-o,c=i-s,l=a-s,u=i+o,d=a+o,f=e-this.x,p=t-this.y;return f*f/(u*u)+p*p/(d*d)>1?!1:c<=0||l<=0||f*f/(c*c)+p*p/(l*l)>1}getBounds(e){return e||=new Nt,e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};function hs(e){let t=e.length;if(t<6)return 1;let n=0;for(let r=0,i=e[t-2],a=e[t-1];r<t;r+=2){let t=e[r],o=e[r+1];n+=(t-i)*(o+a),i=t,a=o}return n<0?-1:1}function gs(e,t,n,r,i,a){let o=e-n,s=t-r,c=i-n,l=a-r,u=o*c+s*l,d=c*c+l*l,f=-1;d!==0&&(f=u/d);let p,m;f<0?(p=n,m=r):f>1?(p=i,m=a):(p=n+f*c,m=r+f*l);let h=e-p,g=t-m;return h*h+g*g}var _s,vs,ys=class e{constructor(...e){this.type=`polygon`;let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.closePath=!0}isClockwise(){let e=0,t=this.points,n=t.length;for(let r=0;r<n;r+=2){let i=t[r],a=t[r+1],o=t[(r+2)%n],s=t[(r+3)%n];e+=(o-i)*(s+a)}return e<0}containsPolygon(e){let t=this.getBounds(_s),n=e.getBounds(vs);if(!t.containsRect(n))return!1;let r=e.points;for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!this.contains(t,n))return!1}return!0}clone(){let t=this.points.slice(),n=new e(t);return n.closePath=this.closePath,n}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}strokeContains(e,t,n,r=.5){let{points:i}=this,a=n*(r===.5?r:(r-.5)*hs(i)+.5),o=n-a,s=a*a,c=o*o,l=i.length-(this.closePath?0:2);for(let n=0;n<l;n+=2){let r=i[n],a=i[n+1],o=i[(n+2)%i.length],l=i[(n+3)%i.length];if(gs(e,t,r,a,o,l)<=(Math.sign((o-r)*(t-a)-(l-a)*(e-r))<0?s:c))return!0}return!1}getBounds(e){e||=new Nt;let t=this.points,n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e=0,o=t.length;e<o;e+=2){let o=t[e],s=t[e+1];n=o<n?o:n,r=o>r?o:r,i=s<i?s:i,a=s>a?s:a}return e.x=n,e.width=r-n,e.y=i,e.height=a-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,``)}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return R(`8.11.0`,`Polygon.lastX is deprecated, please use Polygon.lastX instead.`),this.points[this.points.length-2]}get y(){return R(`8.11.0`,`Polygon.y is deprecated, please use Polygon.lastY instead.`),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}},bs=(e,t,n,r,i,a,o)=>{let s=e-n,c=t-r,l=Math.sqrt(s*s+c*c);return l>=i-a&&l<=i+o},xs=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.type=`roundedRectangle`,this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i}getBounds(e){return e||=new Nt,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}strokeContains(e,t,n,r=.5){let{x:i,y:a,width:o,height:s}=this,c=Math.max(0,Math.min(this.radius,Math.min(o,s)/2)),l=n*(1-r),u=n-l,d=i+c,f=a+c,p=o-c*2,m=s-c*2,h=i+o,g=a+s;return(e>=i-l&&e<=i+u||e>=h-u&&e<=h+l)&&t>=f&&t<=f+m||(t>=a-l&&t<=a+u||t>=g-u&&t<=g+l)&&e>=d&&e<=d+p||e<d&&t<f&&bs(e,t,d,f,c,u,l)||e>h-c&&t<f&&bs(e,t,h-c,f,c,u,l)||e>h-c&&t>g-c&&bs(e,t,h-c,g-c,c,u,l)||e<d&&t>g-c&&bs(e,t,d,g-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}},Ss=class{constructor(e){this.rawBinaryData=typeof e==`number`?new ArrayBuffer(e):e instanceof Uint8Array?e.buffer:e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||=new Int8Array(this.rawBinaryData),this._int8View}get uint8View(){return this._uint8View||=new Uint8Array(this.rawBinaryData),this._uint8View}get int16View(){return this._int16View||=new Int16Array(this.rawBinaryData),this._int16View}get int32View(){return this._int32View||=new Int32Array(this.rawBinaryData),this._int32View}get float64View(){return this._float64Array||=new Float64Array(this.rawBinaryData),this._float64Array}get bigUint64View(){return this._bigUint64Array||=new BigUint64Array(this.rawBinaryData),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case`int8`:case`uint8`:return 1;case`int16`:case`uint16`:return 2;case`int32`:case`uint32`:case`float32`:return 4;default:throw Error(`${e} isn't a valid view type`)}}};function Cs(e,t,n,r){if(n??=0,r??=Math.min(e.byteLength-n,t.byteLength),!(n&7)&&!(r&7)){let i=r/8;new Float64Array(t,0,i).set(new Float64Array(e,n,i))}else if(!(n&3)&&!(r&3)){let i=r/4;new Float32Array(t,0,i).set(new Float32Array(e,n,i))}else new Uint8Array(t).set(new Uint8Array(e,n,r))}var ws={normal:`normal-npm`,add:`add-npm`,screen:`screen-npm`},Ts=(e=>(e[e.DISABLED=0]=`DISABLED`,e[e.RENDERING_MASK_ADD=1]=`RENDERING_MASK_ADD`,e[e.MASK_ACTIVE=2]=`MASK_ACTIVE`,e[e.INVERSE_MASK_ACTIVE=3]=`INVERSE_MASK_ACTIVE`,e[e.RENDERING_MASK_REMOVE=4]=`RENDERING_MASK_REMOVE`,e[e.NONE=5]=`NONE`,e))(Ts||{});function Es(e,t){return t.alphaMode===`no-premultiply-alpha`&&ws[e]||e}var Ds=`precision mediump float;
25
25
  void main(void){
26
26
  float test = 0.1;
27
27
  %forloop%