@omnimedia/omnitool 1.1.0-42 → 1.1.0-44

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 (179) hide show
  1. package/package.json +17 -18
  2. package/s/demo/demo.bundle.ts +20 -40
  3. package/s/demo/routines/export-test.ts +8 -0
  4. package/s/demo/routines/playback-test.ts +21 -0
  5. package/s/demo/routines/timeline-setup.ts +24 -0
  6. package/s/demo/routines/transcode-test.ts +2 -0
  7. package/s/driver/driver-worker.ts +9 -0
  8. package/s/driver/driver.test.ts +1 -1
  9. package/s/driver/driver.ts +8 -22
  10. package/s/driver/fns/schematic.ts +6 -2
  11. package/s/driver/fns/work.ts +2 -133
  12. package/s/driver/parts/compositor.ts +178 -0
  13. package/s/driver/parts/machina.ts +19 -20
  14. package/s/index.ts +1 -0
  15. package/s/timeline/index.ts +1 -1
  16. package/s/timeline/parts/media.ts +11 -2
  17. package/s/timeline/parts/{compositor → renderers}/parts/html-tree.ts +2 -2
  18. package/s/timeline/parts/{compositor → renderers}/parts/tree-builder.ts +4 -2
  19. package/s/timeline/parts/{compositor → renderers}/playback.ts +4 -13
  20. package/s/timeline/parts/{compositor → renderers}/samplers/html.ts +19 -5
  21. package/s/timeline/parts/{compositor → renderers}/samplers/webcodecs.ts +1 -1
  22. package/s/timeline/parts/resource-pool.ts +8 -4
  23. package/s/timeline/parts/resource.ts +1 -0
  24. package/s/timeline/sugar/o.ts +10 -2
  25. package/s/timeline/sugar/omni-test.ts +14 -14
  26. package/s/timeline/sugar/omni.ts +2 -2
  27. package/s/timeline/utils/datafile.ts +14 -4
  28. package/s/timeline/utils/dummy-data.ts +3 -3
  29. package/x/demo/WebGLRenderer-Q3OV2JVE.js +2 -0
  30. package/x/demo/WebGLRenderer-Q3OV2JVE.js.map +7 -0
  31. package/x/demo/WebGPURenderer-FUFF62QA.js +2 -0
  32. package/x/demo/WebGPURenderer-FUFF62QA.js.map +7 -0
  33. package/x/demo/browserAll-PGQYU756.js +2 -0
  34. package/x/demo/browserAll-PGQYU756.js.map +7 -0
  35. package/x/demo/chunk-2RBLPWNG.js +393 -0
  36. package/x/demo/chunk-2RBLPWNG.js.map +7 -0
  37. package/x/demo/chunk-6DBMQOFE.js +42 -0
  38. package/x/demo/chunk-6DBMQOFE.js.map +7 -0
  39. package/x/demo/chunk-LAJHJD2S.js +2 -0
  40. package/x/demo/chunk-LAJHJD2S.js.map +7 -0
  41. package/x/demo/chunk-LQU5JKKZ.js +269 -0
  42. package/x/demo/chunk-LQU5JKKZ.js.map +7 -0
  43. package/x/demo/chunk-RFNLITDQ.js +327 -0
  44. package/x/demo/chunk-RFNLITDQ.js.map +7 -0
  45. package/x/demo/chunk-TBWCKYN2.js +2 -0
  46. package/x/demo/chunk-TBWCKYN2.js.map +7 -0
  47. package/x/demo/chunk-TLDBHU4V.js +15 -0
  48. package/x/demo/chunk-TLDBHU4V.js.map +7 -0
  49. package/x/demo/chunk-X2GHKWPJ.js +157 -0
  50. package/x/demo/chunk-X2GHKWPJ.js.map +7 -0
  51. package/x/demo/demo.bundle.js +18 -27
  52. package/x/demo/demo.bundle.js.map +1 -1
  53. package/x/demo/demo.bundle.min.js +2378 -534
  54. package/x/demo/demo.bundle.min.js.map +4 -4
  55. package/x/demo/routines/export-test.d.ts +2 -0
  56. package/x/demo/routines/export-test.js +7 -0
  57. package/x/demo/routines/export-test.js.map +1 -0
  58. package/x/demo/routines/playback-test.d.ts +3 -0
  59. package/x/demo/routines/playback-test.js +17 -0
  60. package/x/demo/routines/playback-test.js.map +1 -0
  61. package/x/demo/routines/timeline-setup.d.ts +6 -0
  62. package/x/demo/routines/timeline-setup.js +13 -0
  63. package/x/demo/routines/timeline-setup.js.map +1 -0
  64. package/x/demo/routines/transcode-test.js +2 -0
  65. package/x/demo/routines/transcode-test.js.map +1 -1
  66. package/x/demo/webworkerAll-3YNCLHCR.js +2 -0
  67. package/x/demo/webworkerAll-3YNCLHCR.js.map +7 -0
  68. package/x/driver/WebGLRenderer-OMRWYQIV.js +2 -0
  69. package/x/driver/WebGLRenderer-OMRWYQIV.js.map +7 -0
  70. package/x/driver/WebGPURenderer-KQJB2OJJ.js +2 -0
  71. package/x/driver/WebGPURenderer-KQJB2OJJ.js.map +7 -0
  72. package/x/driver/browserAll-YBZEJCN3.js +2 -0
  73. package/x/driver/browserAll-YBZEJCN3.js.map +7 -0
  74. package/x/driver/chunk-3L3MB5NY.js +393 -0
  75. package/x/driver/chunk-3L3MB5NY.js.map +7 -0
  76. package/x/driver/chunk-42BQ4XKE.js +269 -0
  77. package/x/driver/chunk-42BQ4XKE.js.map +7 -0
  78. package/x/driver/chunk-4HAYG3N5.js +327 -0
  79. package/x/driver/chunk-4HAYG3N5.js.map +7 -0
  80. package/x/driver/chunk-BFBY7VYB.js +42 -0
  81. package/x/driver/chunk-BFBY7VYB.js.map +7 -0
  82. package/x/driver/chunk-KM6O72WE.js +157 -0
  83. package/x/driver/chunk-KM6O72WE.js.map +7 -0
  84. package/x/driver/chunk-N6HD4WYJ.js +2 -0
  85. package/x/driver/chunk-N6HD4WYJ.js.map +7 -0
  86. package/x/driver/chunk-WCZ2O3UN.js +15 -0
  87. package/x/driver/chunk-WCZ2O3UN.js.map +7 -0
  88. package/x/driver/chunk-XWNSF3WJ.js +2 -0
  89. package/x/driver/chunk-XWNSF3WJ.js.map +7 -0
  90. package/x/driver/driver-worker.d.ts +1 -0
  91. package/x/driver/driver-worker.js +6 -0
  92. package/x/driver/driver-worker.js.map +1 -0
  93. package/x/driver/driver.d.ts +5 -4
  94. package/x/driver/driver.js +10 -20
  95. package/x/driver/driver.js.map +1 -1
  96. package/x/driver/driver.test.js +1 -1
  97. package/x/driver/driver.test.js.map +1 -1
  98. package/x/driver/driver.worker.bundle.min.js +119 -3504
  99. package/x/driver/driver.worker.bundle.min.js.map +4 -4
  100. package/x/driver/fns/host.d.ts +1 -2
  101. package/x/driver/fns/schematic.d.ts +6 -1
  102. package/x/driver/fns/work.d.ts +2 -4
  103. package/x/driver/fns/work.js +1 -100
  104. package/x/driver/fns/work.js.map +1 -1
  105. package/x/driver/parts/compositor.d.ts +15 -0
  106. package/x/driver/parts/compositor.js +152 -0
  107. package/x/driver/parts/compositor.js.map +1 -0
  108. package/x/driver/parts/machina.d.ts +0 -20
  109. package/x/driver/parts/machina.js +6 -10
  110. package/x/driver/parts/machina.js.map +1 -1
  111. package/x/driver/webworkerAll-BKJQW6P7.js +2 -0
  112. package/x/driver/webworkerAll-BKJQW6P7.js.map +7 -0
  113. package/x/features/speech/transcribe/parts/prep-audio.d.ts +1 -1
  114. package/x/features/speech/transcribe/worker.bundle.min.js +899 -899
  115. package/x/features/speech/transcribe/worker.bundle.min.js.map +4 -4
  116. package/x/index.d.ts +1 -0
  117. package/x/index.html +2 -2
  118. package/x/index.js +1 -0
  119. package/x/index.js.map +1 -1
  120. package/x/timeline/index.d.ts +1 -1
  121. package/x/timeline/index.js +1 -1
  122. package/x/timeline/index.js.map +1 -1
  123. package/x/timeline/parts/filmstrip.d.ts +1 -1
  124. package/x/timeline/parts/media.d.ts +2 -0
  125. package/x/timeline/parts/media.js +10 -2
  126. package/x/timeline/parts/media.js.map +1 -1
  127. package/x/timeline/parts/renderers/export.js.map +1 -0
  128. package/x/timeline/parts/{compositor → renderers}/parts/html-tree.js +2 -2
  129. package/x/timeline/parts/renderers/parts/html-tree.js.map +1 -0
  130. package/x/timeline/parts/renderers/parts/schedulers.js.map +1 -0
  131. package/x/timeline/parts/{compositor → renderers}/parts/tree-builder.js +4 -2
  132. package/x/timeline/parts/renderers/parts/tree-builder.js.map +1 -0
  133. package/x/timeline/parts/renderers/parts/webcodecs-tree.js.map +1 -0
  134. package/x/timeline/parts/{compositor → renderers}/playback.d.ts +2 -4
  135. package/x/timeline/parts/{compositor → renderers}/playback.js +5 -14
  136. package/x/timeline/parts/renderers/playback.js.map +1 -0
  137. package/x/timeline/parts/{compositor → renderers}/samplers/html.js +14 -5
  138. package/x/timeline/parts/renderers/samplers/html.js.map +1 -0
  139. package/x/timeline/parts/{compositor → renderers}/samplers/webcodecs.js +1 -1
  140. package/x/timeline/parts/renderers/samplers/webcodecs.js.map +1 -0
  141. package/x/timeline/parts/resource-pool.d.ts +2 -0
  142. package/x/timeline/parts/resource-pool.js +7 -4
  143. package/x/timeline/parts/resource-pool.js.map +1 -1
  144. package/x/timeline/parts/resource.d.ts +1 -0
  145. package/x/timeline/sugar/o.d.ts +4 -1
  146. package/x/timeline/sugar/o.js +4 -2
  147. package/x/timeline/sugar/o.js.map +1 -1
  148. package/x/timeline/sugar/omni-test.js +14 -7
  149. package/x/timeline/sugar/omni-test.js.map +1 -1
  150. package/x/timeline/sugar/omni.d.ts +1 -2
  151. package/x/timeline/sugar/omni.js +2 -2
  152. package/x/timeline/sugar/omni.js.map +1 -1
  153. package/x/timeline/utils/datafile.d.ts +4 -3
  154. package/x/timeline/utils/datafile.js +16 -5
  155. package/x/timeline/utils/datafile.js.map +1 -1
  156. package/x/timeline/utils/dummy-data.d.ts +1 -2
  157. package/x/timeline/utils/dummy-data.js +4 -2
  158. package/x/timeline/utils/dummy-data.js.map +1 -1
  159. package/x/timeline/parts/compositor/export.js.map +0 -1
  160. package/x/timeline/parts/compositor/parts/html-tree.js.map +0 -1
  161. package/x/timeline/parts/compositor/parts/schedulers.js.map +0 -1
  162. package/x/timeline/parts/compositor/parts/tree-builder.js.map +0 -1
  163. package/x/timeline/parts/compositor/parts/webcodecs-tree.js.map +0 -1
  164. package/x/timeline/parts/compositor/playback.js.map +0 -1
  165. package/x/timeline/parts/compositor/samplers/html.js.map +0 -1
  166. package/x/timeline/parts/compositor/samplers/webcodecs.js.map +0 -1
  167. /package/s/timeline/parts/{compositor → renderers}/export.ts +0 -0
  168. /package/s/timeline/parts/{compositor → renderers}/parts/schedulers.ts +0 -0
  169. /package/s/timeline/parts/{compositor → renderers}/parts/webcodecs-tree.ts +0 -0
  170. /package/x/timeline/parts/{compositor → renderers}/export.d.ts +0 -0
  171. /package/x/timeline/parts/{compositor → renderers}/export.js +0 -0
  172. /package/x/timeline/parts/{compositor → renderers}/parts/html-tree.d.ts +0 -0
  173. /package/x/timeline/parts/{compositor → renderers}/parts/schedulers.d.ts +0 -0
  174. /package/x/timeline/parts/{compositor → renderers}/parts/schedulers.js +0 -0
  175. /package/x/timeline/parts/{compositor → renderers}/parts/tree-builder.d.ts +0 -0
  176. /package/x/timeline/parts/{compositor → renderers}/parts/webcodecs-tree.d.ts +0 -0
  177. /package/x/timeline/parts/{compositor → renderers}/parts/webcodecs-tree.js +0 -0
  178. /package/x/timeline/parts/{compositor → renderers}/samplers/html.d.ts +0 -0
  179. /package/x/timeline/parts/{compositor → renderers}/samplers/webcodecs.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../node_modules/pixi.js/src/app/init.ts", "../../node_modules/pixi.js/src/scene/graphics/init.ts", "../../node_modules/pixi.js/src/scene/mesh/init.ts", "../../node_modules/pixi.js/src/scene/particle-container/init.ts", "../../node_modules/pixi.js/src/scene/text/init.ts", "../../node_modules/pixi.js/src/scene/text-bitmap/init.ts", "../../node_modules/pixi.js/src/scene/text-html/init.ts", "../../node_modules/pixi.js/src/scene/sprite-tiling/init.ts", "../../node_modules/pixi.js/src/scene/sprite-nine-slice/init.ts", "../../node_modules/pixi.js/src/filters/init.ts"],
4
+ "sourcesContent": ["import { extensions } from '../extensions/Extensions';\nimport { ResizePlugin } from './ResizePlugin';\nimport { TickerPlugin } from './TickerPlugin';\n\nextensions.add(ResizePlugin);\nextensions.add(TickerPlugin);\n", "import { extensions } from '../../extensions/Extensions';\nimport { GraphicsContextSystem } from './shared/GraphicsContextSystem';\nimport { GraphicsPipe } from './shared/GraphicsPipe';\n\nextensions.add(GraphicsPipe);\nextensions.add(GraphicsContextSystem);\n", "import { extensions } from '../../extensions/Extensions';\nimport { MeshPipe } from './shared/MeshPipe';\n\nextensions.add(MeshPipe);\n", "import { extensions } from '../../extensions/Extensions';\nimport { GlParticleContainerPipe } from './shared/GlParticleContainerPipe';\nimport { GpuParticleContainerPipe } from './shared/GpuParticleContainerPipe';\n\n// NOTE: this is the first occurrence of needing both gl and gpu pipes in the same file\n// This could cause some issues with tree shaking in the future.\n// Right now these two files do not import anything specific for a renderer, so is not an issue for now.\nextensions.add(GlParticleContainerPipe);\nextensions.add(GpuParticleContainerPipe);\n", "import { extensions } from '../../extensions/Extensions';\nimport { CanvasTextPipe } from './canvas/CanvasTextPipe';\nimport { CanvasTextSystem } from './canvas/CanvasTextSystem';\n\nextensions.add(CanvasTextSystem);\nextensions.add(CanvasTextPipe);\n", "import { extensions } from '../../extensions/Extensions';\nimport { BitmapTextPipe } from './BitmapTextPipe';\n\nextensions.add(BitmapTextPipe);\n", "import { extensions } from '../../extensions/Extensions';\nimport { HTMLTextPipe } from './HTMLTextPipe';\nimport { HTMLTextSystem } from './HTMLTextSystem';\n\nextensions.add(HTMLTextSystem);\nextensions.add(HTMLTextPipe);\n", "import { extensions } from '../../extensions/Extensions';\nimport { TilingSpritePipe } from './TilingSpritePipe';\n\nextensions.add(TilingSpritePipe);\n", "import { extensions } from '../../extensions/Extensions';\nimport { NineSliceSpritePipe } from './NineSliceSpritePipe';\n\nextensions.add(NineSliceSpritePipe);\n", "import { extensions } from '../extensions/Extensions';\nimport { FilterPipe } from './FilterPipe';\nimport { FilterSystem } from './FilterSystem';\n\nextensions.add(FilterSystem);\nextensions.add(FilterPipe);\n"],
5
+ "mappings": "oLAIAA,EAAW,IAAIC,CAAY,EAC3BD,EAAW,IAAIE,CAAY,ECD3BC,EAAW,IAAIC,CAAY,EAC3BD,EAAW,IAAIE,CAAqB,ECFpCC,EAAW,IAAIC,CAAQ,ECIvBC,EAAW,IAAIC,CAAuB,EACtCD,EAAW,IAAIE,CAAwB,ECJvCC,EAAW,IAAIC,CAAgB,EAC/BD,EAAW,IAAIE,CAAc,ECF7BC,EAAW,IAAIC,CAAc,ECC7BC,EAAW,IAAIC,CAAc,EAC7BD,EAAW,IAAIE,CAAY,ECF3BC,EAAW,IAAIC,CAAgB,ECA/BC,EAAW,IAAIC,CAAmB,ECClCC,EAAW,IAAIC,CAAY,EAC3BD,EAAW,IAAIE,CAAU",
6
+ "names": ["extensions", "ResizePlugin", "TickerPlugin", "extensions", "GraphicsPipe", "GraphicsContextSystem", "extensions", "MeshPipe", "extensions", "GlParticleContainerPipe", "GpuParticleContainerPipe", "extensions", "CanvasTextSystem", "CanvasTextPipe", "extensions", "BitmapTextPipe", "extensions", "HTMLTextSystem", "HTMLTextPipe", "extensions", "TilingSpritePipe", "extensions", "NineSliceSpritePipe", "extensions", "FilterSystem", "FilterPipe"]
7
+ }
@@ -0,0 +1,269 @@
1
+ var ys=Object.create;var ue=Object.defineProperty;var _s=Object.getOwnPropertyDescriptor;var bs=Object.getOwnPropertyNames;var ws=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var Ms=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),An=(i,t)=>{for(var e in t)ue(i,e,{get:t[e],enumerable:!0})},Cs=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of bs(t))!vs.call(i,s)&&s!==e&&ue(i,s,{get:()=>t[s],enumerable:!(r=_s(t,s))||r.enumerable});return i};var Ts=(i,t,e)=>(e=i!=null?ys(ws(i)):{},Cs(t||!i||!i.__esModule?ue(e,"default",{value:i,enumerable:!0}):e,i));var ai=Ms((Gn,ce)=>{"use strict";var Ss=Object.prototype.hasOwnProperty,E="~";function pt(){}Object.create&&(pt.prototype=Object.create(null),new pt().__proto__||(E=!1));function As(i,t,e){this.fn=i,this.context=t,this.once=e||!1}function hi(i,t,e,r,s){if(typeof e!="function")throw new TypeError("The listener must be a function");var n=new As(e,r||i,s),o=E?E+t:t;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],n]:i._events[o].push(n):(i._events[o]=n,i._eventsCount++),i}function kt(i,t){--i._eventsCount===0?i._events=new pt:delete i._events[t]}function G(){this._events=new pt,this._eventsCount=0}G.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)Ss.call(e,r)&&t.push(E?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};G.prototype.listeners=function(t){var e=E?E+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,o=new Array(n);s<n;s++)o[s]=r[s].fn;return o};G.prototype.listenerCount=function(t){var e=E?E+t:t,r=this._events[e];return r?r.fn?1:r.length:0};G.prototype.emit=function(t,e,r,s,n,o){var h=E?E+t:t;if(!this._events[h])return!1;var a=this._events[h],u=arguments.length,c,l;if(a.fn){switch(a.once&&this.removeListener(t,a.fn,void 0,!0),u){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,e),!0;case 3:return a.fn.call(a.context,e,r),!0;case 4:return a.fn.call(a.context,e,r,s),!0;case 5:return a.fn.call(a.context,e,r,s,n),!0;case 6:return a.fn.call(a.context,e,r,s,n,o),!0}for(l=1,c=new Array(u-1);l<u;l++)c[l-1]=arguments[l];a.fn.apply(a.context,c)}else{var d=a.length,f;for(l=0;l<d;l++)switch(a[l].once&&this.removeListener(t,a[l].fn,void 0,!0),u){case 1:a[l].fn.call(a[l].context);break;case 2:a[l].fn.call(a[l].context,e);break;case 3:a[l].fn.call(a[l].context,e,r);break;case 4:a[l].fn.call(a[l].context,e,r,s);break;default:if(!c)for(f=1,c=new Array(u-1);f<u;f++)c[f-1]=arguments[f];a[l].fn.apply(a[l].context,c)}}return!0};G.prototype.on=function(t,e,r){return hi(this,t,e,r,!1)};G.prototype.once=function(t,e,r){return hi(this,t,e,r,!0)};G.prototype.removeListener=function(t,e,r,s){var n=E?E+t:t;if(!this._events[n])return this;if(!e)return kt(this,n),this;var o=this._events[n];if(o.fn)o.fn===e&&(!s||o.once)&&(!r||o.context===r)&&kt(this,n);else{for(var h=0,a=[],u=o.length;h<u;h++)(o[h].fn!==e||s&&!o[h].once||r&&o[h].context!==r)&&a.push(o[h]);a.length?this._events[n]=a.length===1?a[0]:a:kt(this,n)}return this};G.prototype.removeAllListeners=function(t){var e;return t?(e=E?E+t:t,this._events[e]&&kt(this,e)):(this._events=new pt,this._eventsCount=0),this};G.prototype.off=G.prototype.removeListener;G.prototype.addListener=G.prototype.on;G.prefixed=E;G.EventEmitter=G;typeof ce<"u"&&(ce.exports=G)});var V=(i=>(i.Application="application",i.WebGLPipes="webgl-pipes",i.WebGLPipesAdaptor="webgl-pipes-adaptor",i.WebGLSystem="webgl-system",i.WebGPUPipes="webgpu-pipes",i.WebGPUPipesAdaptor="webgpu-pipes-adaptor",i.WebGPUSystem="webgpu-system",i.CanvasSystem="canvas-system",i.CanvasPipesAdaptor="canvas-pipes-adaptor",i.CanvasPipes="canvas-pipes",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i.MaskEffect="mask-effect",i.BlendMode="blend-mode",i.TextureSource="texture-source",i.Environment="environment",i.ShapeBuilder="shape-builder",i.Batcher="batcher",i))(V||{}),le=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},Bt=(i,t)=>le(i).priority??t,ft={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(le).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...i){return i.map(le).forEach(t=>{t.type.forEach(e=>{let r=this._addHandlers,s=this._queue;r[e]?r[e]?.(t):(s[e]=s[e]||[],s[e]?.push(t))})}),this},handle(i,t,e){let r=this._addHandlers,s=this._removeHandlers;if(r[i]||s[i])throw new Error(`Extension type ${i} already has a handler`);r[i]=t,s[i]=e;let n=this._queue;return n[i]&&(n[i]?.forEach(o=>t(o)),delete n[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(i,t,e=-1){return this.handle(i,r=>{t.findIndex(n=>n.name===r.name)>=0||(t.push({name:r.name,value:r.ref}),t.sort((n,o)=>Bt(o.value,e)-Bt(n.value,e)))},r=>{let s=t.findIndex(n=>n.name===r.name);s!==-1&&t.splice(s,1)})},handleByList(i,t,e=-1){return this.handle(i,r=>{t.includes(r.ref)||(t.push(r.ref),t.sort((s,n)=>Bt(n,e)-Bt(s,e)))},r=>{let s=t.indexOf(r.ref);s!==-1&&t.splice(s,1)})},mixin(i,...t){for(let e of t)Object.defineProperties(i.prototype,Object.getOwnPropertyDescriptors(e))}};var Ft=(i=>(i[i.WEBGL=1]="WEBGL",i[i.WEBGPU=2]="WEBGPU",i[i.BOTH=3]="BOTH",i))(Ft||{});var ui=Ts(ai(),1);var B=ui.default;var Rs={grad:.9,turn:360,rad:360/(2*Math.PI)},$=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},S=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},Y=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},gi=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},li=function(i){return{r:Y(i.r,0,255),g:Y(i.g,0,255),b:Y(i.b,0,255),a:Y(i.a)}},de=function(i){return{r:S(i.r),g:S(i.g),b:S(i.b),a:S(i.a,3)}},Ps=/^#([0-9a-f]{3,8})$/i,Dt=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},yi=function(i){var t=i.r,e=i.g,r=i.b,s=i.a,n=Math.max(t,e,r),o=n-Math.min(t,e,r),h=o?n===t?(e-r)/o:n===e?2+(r-t)/o:4+(t-e)/o:0;return{h:60*(h<0?h+6:h),s:n?o/n*100:0,v:n/255*100,a:s}},_i=function(i){var t=i.h,e=i.s,r=i.v,s=i.a;t=t/360*6,e/=100,r/=100;var n=Math.floor(t),o=r*(1-e),h=r*(1-(t-n)*e),a=r*(1-(1-t+n)*e),u=n%6;return{r:255*[r,h,o,o,a,r][u],g:255*[a,r,r,h,o,o][u],b:255*[o,o,a,r,r,h][u],a:s}},ci=function(i){return{h:gi(i.h),s:Y(i.s,0,100),l:Y(i.l,0,100),a:Y(i.a)}},di=function(i){return{h:S(i.h),s:S(i.s),l:S(i.l),a:S(i.a,3)}},fi=function(i){return _i((e=(t=i).s,{h:t.h,s:(e*=((r=t.l)<50?r:100-r)/100)>0?2*e/(r+e)*100:0,v:r+e,a:t.a}));var t,e,r},mt=function(i){return{h:(t=yi(i)).h,s:(s=(200-(e=t.s))*(r=t.v)/100)>0&&s<200?e*r/100/(s<=100?s:200-s)*100:0,l:s/2,a:t.a};var t,e,r,s},Is=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gs=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Es=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bs=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,me={string:[[function(i){var t=Ps.exec(i);return t?(i=t[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?S(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?S(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=Es.exec(i)||Bs.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:li({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(i){var t=Is.exec(i)||Gs.exec(i);if(!t)return null;var e,r,s=ci({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(Rs[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return fi(s)},"hsl"]],object:[[function(i){var t=i.r,e=i.g,r=i.b,s=i.a,n=s===void 0?1:s;return $(t)&&$(e)&&$(r)?li({r:Number(t),g:Number(e),b:Number(r),a:Number(n)}):null},"rgb"],[function(i){var t=i.h,e=i.s,r=i.l,s=i.a,n=s===void 0?1:s;if(!$(t)||!$(e)||!$(r))return null;var o=ci({h:Number(t),s:Number(e),l:Number(r),a:Number(n)});return fi(o)},"hsl"],[function(i){var t=i.h,e=i.s,r=i.v,s=i.a,n=s===void 0?1:s;if(!$(t)||!$(e)||!$(r))return null;var o=(function(h){return{h:gi(h.h),s:Y(h.s,0,100),v:Y(h.v,0,100),a:Y(h.a)}})({h:Number(t),s:Number(e),v:Number(r),a:Number(n)});return _i(o)},"hsv"]]},pi=function(i,t){for(var e=0;e<t.length;e++){var r=t[e][0](i);if(r)return[r,t[e][1]]}return[null,void 0]},Fs=function(i){return typeof i=="string"?pi(i.trim(),me.string):typeof i=="object"&&i!==null?pi(i,me.object):[null,void 0]};var fe=function(i,t){var e=mt(i);return{h:e.h,s:Y(e.s+100*t,0,100),l:e.l,a:e.a}},pe=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},mi=function(i,t){var e=mt(i);return{h:e.h,s:e.s,l:Y(e.l+100*t,0,100),a:e.a}},xe=(function(){function i(t){this.parsed=Fs(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return S(pe(this.rgba),2)},i.prototype.isDark=function(){return pe(this.rgba)<.5},i.prototype.isLight=function(){return pe(this.rgba)>=.5},i.prototype.toHex=function(){return t=de(this.rgba),e=t.r,r=t.g,s=t.b,o=(n=t.a)<1?Dt(S(255*n)):"","#"+Dt(e)+Dt(r)+Dt(s)+o;var t,e,r,s,n,o},i.prototype.toRgb=function(){return de(this.rgba)},i.prototype.toRgbString=function(){return t=de(this.rgba),e=t.r,r=t.g,s=t.b,(n=t.a)<1?"rgba("+e+", "+r+", "+s+", "+n+")":"rgb("+e+", "+r+", "+s+")";var t,e,r,s,n},i.prototype.toHsl=function(){return di(mt(this.rgba))},i.prototype.toHslString=function(){return t=di(mt(this.rgba)),e=t.h,r=t.s,s=t.l,(n=t.a)<1?"hsla("+e+", "+r+"%, "+s+"%, "+n+")":"hsl("+e+", "+r+"%, "+s+"%)";var t,e,r,s,n},i.prototype.toHsv=function(){return t=yi(this.rgba),{h:S(t.h),s:S(t.s),v:S(t.v),a:S(t.a,3)};var t},i.prototype.invert=function(){return U({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},i.prototype.saturate=function(t){return t===void 0&&(t=.1),U(fe(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),U(fe(this.rgba,-t))},i.prototype.grayscale=function(){return U(fe(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),U(mi(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),U(mi(this.rgba,-t))},i.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},i.prototype.alpha=function(t){return typeof t=="number"?U({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):S(this.rgba.a,3);var e},i.prototype.hue=function(t){var e=mt(this.rgba);return typeof t=="number"?U({h:t,s:e.s,l:e.l,a:e.a}):S(e.h)},i.prototype.isEqual=function(t){return this.toHex()===U(t).toHex()},i})(),U=function(i){return i instanceof xe?i:new xe(i)},xi=[],bi=function(i){i.forEach(function(t){xi.indexOf(t)<0&&(t(xe,me),xi.push(t))})};function wi(i,t){var e={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 s in e)r[e[s]]=s;var n={};i.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var h,a,u=r[this.toHex()];if(u)return u;if(o?.closest){var c=this.toRgb(),l=1/0,d="black";if(!n.length)for(var f in e)n[f]=new i(e[f]).toRgb();for(var m in e){var y=(h=c,a=n[m],Math.pow(h.r-a.r,2)+Math.pow(h.g-a.g,2)+Math.pow(h.b-a.b,2));y<l&&(l=y,d=m)}return d}},t.string.push([function(o){var h=o.toLowerCase(),a=h==="transparent"?"#0000":e[h];return a?new i(a).toRgb():null},"name"])}bi([wi]);var tt=class xt{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof xt)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,e){let r=typeof t;if(r!==typeof e)return!1;if(r==="number"||r==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,o)=>n===e[o]);if(t!==null&&e!==null){let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(h=>t[h]===e[h])}return t===e}toRgba(){let[t,e,r,s]=this._components;return{r:t,g:e,b:r,a:s}}toRgb(){let[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){let[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){let[e,r,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(r*255),t[2]=Math.round(s*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);let[e,r,s,n]=this._components;return t[0]=e,t[1]=r,t[2]=s,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);let[e,r,s]=this._components;return t[0]=e,t[1]=r,t[2]=s,t}toNumber(){return this._int}toBgrNumber(){let[t,e,r]=this.toUint8RgbArray();return(r<<16)+(e<<8)+t}toLittleEndianNumber(){let t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){let[e,r,s,n]=xt._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=s,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let r=this._int>>16&255,s=this._int>>8&255,n=this._int&255;return e&&(r=r*t+.5|0,s=s*t+.5|0,n=n*t+.5|0),(t*255<<24)+(r<<16)+(s<<8)+n}toHex(){let t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){let e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(t){let e,r,s,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){let o=t;e=(o>>16&255)/255,r=(o>>8&255)/255,s=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,r,s,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,r,s,n=255]=t,e/=255,r/=255,s/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){let h=xt.HEX_PATTERN.exec(t);h&&(t=`#${h[2]}`)}let o=U(t);o.isValid()&&({r:e,g:r,b:s,a:n}=o.rgba,e/=255,r/=255,s/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=r,this._components[2]=s,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);let[t,e,r]=this._components;this._int=(t*255<<16)+(e*255<<8)+(r*255|0)}_clamp(t,e=0,r=1){return typeof t=="number"?Math.min(Math.max(t,e),r):(t.forEach((s,n)=>{t[n]=Math.min(Math.max(s,e),r)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof xt||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}};tt.shared=new tt;tt._temp=new tt;tt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;var vi=tt;var Mi=Math.PI*2,Ci=180/Math.PI,Ti=Math.PI/180;var F=class i{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new i(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return ge.x=0,ge.y=0,ge}},ge=new F;var b=class i{constructor(t=1,e=0,r=0,s=1,n=0,o=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=s,this.tx=n,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,r,s,n,o){return this.a=t,this.b=e,this.c=r,this.d=s,this.tx=n,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));let r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(t,e){e=e||new F;let r=t.x,s=t.y;return e.x=this.a*r+this.c*s+this.tx,e.y=this.b*r+this.d*s+this.ty,e}applyInverse(t,e){e=e||new F;let r=this.a,s=this.b,n=this.c,o=this.d,h=this.tx,a=this.ty,u=1/(r*o+n*-s),c=t.x,l=t.y;return e.x=o*u*c+-n*u*l+(a*n-h*o)*u,e.y=r*u*l+-s*u*c+(-a*r+h*s)*u,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){let e=Math.cos(t),r=Math.sin(t),s=this.a,n=this.c,o=this.tx;return this.a=s*e-this.b*r,this.b=s*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this}append(t){let e=this.a,r=this.b,s=this.c,n=this.d;return this.a=t.a*e+t.b*s,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*s,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*s+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this}appendFrom(t,e){let r=t.a,s=t.b,n=t.c,o=t.d,h=t.tx,a=t.ty,u=e.a,c=e.b,l=e.c,d=e.d;return this.a=r*u+s*l,this.b=r*c+s*d,this.c=n*u+o*l,this.d=n*c+o*d,this.tx=h*u+a*l+e.tx,this.ty=h*c+a*d+e.ty,this}setTransform(t,e,r,s,n,o,h,a,u){return this.a=Math.cos(h+u)*n,this.b=Math.sin(h+u)*n,this.c=-Math.sin(h-a)*o,this.d=Math.cos(h-a)*o,this.tx=t-(r*this.a+s*this.c),this.ty=e-(r*this.b+s*this.d),this}prepend(t){let e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){let r=this.a,s=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){let e=this.a,r=this.b,s=this.c,n=this.d,o=t.pivot,h=-Math.atan2(-s,n),a=Math.atan2(r,e),u=Math.abs(h+a);return u<1e-5||Math.abs(Mi-u)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=h,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(s*s+n*n),t.position.x=this.tx+(o.x*e+o.y*s),t.position.y=this.ty+(o.x*r+o.y*n),t}invert(){let t=this.a,e=this.b,r=this.c,s=this.d,n=this.tx,o=t*s-e*r;return this.a=s/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-s*n)/o,this.ty=-(t*this.ty-e*n)/o,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 i;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}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 Ds.identity()}static get shared(){return ks.identity()}},ks=new b,Ds=new b;var ye={default:-1};function M(i="default"){return ye[i]===void 0&&(ye[i]=-1),++ye[i]}var Si=new Set,X="8.0.0",Vn="8.3.4",et={quiet:!1,noColor:!1},T=(i,t,e=3)=>{if(et.quiet||Si.has(t))return;let r=new Error().stack,s=`${t}
2
+ Deprecated since v${i}`,n=typeof console.groupCollapsed=="function"&&!et.noColor;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",s):(r=r.split(`
3
+ `).splice(e).join(`
4
+ `),n?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",s),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",s),console.warn(r))),Si.add(t)};Object.defineProperties(T,{quiet:{get:()=>et.quiet,set:i=>{et.quiet=i},enumerable:!0,configurable:!1},noColor:{get:()=>et.noColor,set:i=>{et.noColor=i},enumerable:!0,configurable:!1}});var _e=0,Ai=500;function gt(...i){_e!==Ai&&(_e++,_e===Ai?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...i))}var it={_registeredResources:new Set,register(i){this._registeredResources.add(i)},unregister(i){this._registeredResources.delete(i)},release(){this._registeredResources.forEach(i=>i.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(i){return this._registeredResources.has(i)},reset(){this._registeredResources.clear()}};var Yt=class{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}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 t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}};var be=class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Yt(t)),this._poolsByClass.get(t)}stats(){let t={};return this._poolsByClass.forEach(e=>{let r=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[r]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}},O=new be;it.register(O);var we=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){let r=this._tests[e];if(r.test(t))return O.get(r.maskClass,t)}return t}returnMaskEffect(t){O.return(t)}},Ut=new we;ft.handleByList(V.MaskEffect,Ut._effectClasses);function ve(i){return i+=i===0?1:0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1}function Me(i){return!(i&i-1)&&!!i}function Ri(i){let t={};for(let e in i)i[e]!==void 0&&(t[e]=i[e]);return t}var Pi=Object.create(null);function Ys(i){let t=Pi[i];return t===void 0&&(Pi[i]=M("resource")),t}var Ii=class Gi extends B{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Gi.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(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){T(X,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){let t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Ys(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Ii.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};var Xt=Ii;var Ei=class Bi extends B{constructor(t={}){super(),this.options=t,this.uid=M("textureSource"),this._resourceType="textureSource",this._resourceId=M("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.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Bi.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Xt(Ri(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){let t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=M("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){let{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){let{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,r){r||(r=this._resolution),t||(t=this.width),e||(e=this.height);let s=Math.round(t*r),n=Math.round(e*r);return this.width=s/r,this.height=n/r,this._resolution=r,this.pixelWidth===s&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=n,this.emit("resize",this),this._resourceId=M("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Me(this.pixelWidth)&&Me(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Ei.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};var H=Ei;var yt=class extends H{constructor(t){let e=t.resource||new Float32Array(t.width*t.height*4),r=t.format;r||(e instanceof Float32Array?r="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?r="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?r="rgba16uint":(e instanceof Int8Array,r="bgra8unorm")),super({...t,resource:e,format:r}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}};yt.extension=V.TextureSource;var q=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Z=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],K=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Q=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ce=[],Fi=[],zt=Math.sign;function Us(){for(let i=0;i<16;i++){let t=[];Ce.push(t);for(let e=0;e<16;e++){let r=zt(q[i]*q[e]+K[i]*Z[e]),s=zt(Z[i]*q[e]+Q[i]*Z[e]),n=zt(q[i]*K[e]+K[i]*Q[e]),o=zt(Z[i]*K[e]+Q[i]*Q[e]);for(let h=0;h<16;h++)if(q[h]===r&&Z[h]===s&&K[h]===n&&Q[h]===o){t.push(h);break}}}for(let i=0;i<16;i++){let t=new b;t.set(q[i],Z[i],K[i],Q[i],0,0),Fi.push(t)}}Us();var v={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:i=>q[i],uY:i=>Z[i],vX:i=>K[i],vY:i=>Q[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>Ce[i][t],sub:(i,t)=>Ce[i][v.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?v.S:v.N:Math.abs(t)*2<=Math.abs(i)?i>0?v.E:v.W:t>0?i>0?v.SE:v.SW:i>0?v.NE:v.NW,matrixAppendRotationInv:(i,t,e=0,r=0)=>{let s=Fi[v.inv(t)];s.tx=e,s.ty=r,i.append(s)},transformRectCoords:(i,t,e,r)=>{let{x:s,y:n,width:o,height:h}=i,{x:a,y:u,width:c,height:l}=t;return e===v.E?(r.set(s+a,n+u,o,h),r):e===v.S?r.set(c-n-h+a,s+u,h,o):e===v.W?r.set(c-s-o+a,l-n-h+u,o,h):e===v.N?r.set(n+a,l-s-o+u,h,o):r.set(s+a,n+u,o,h)}};var Ot=[new F,new F,new F,new F],rt=class i{constructor(t=0,e=0,r=0,s=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(s)}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 i(0,0,0,0)}clone(){return new i(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,r,s=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return!1;let h=this.x,a=this.y,u=r*(1-s),c=r-u,l=h-u,d=h+n+u,f=a-u,m=a+o+u,y=h+c,p=h+n-c,_=a+c,w=a+o-c;return t>=l&&t<=d&&e>=f&&e<=m&&!(t>y&&t<p&&e>_&&e<w)}intersects(t,e){if(!e){let xs=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=xs)return!1;let gs=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>gs}let r=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=r||o<=n)return!1;let h=Ot[0].set(t.left,t.top),a=Ot[1].set(t.left,t.bottom),u=Ot[2].set(t.right,t.top),c=Ot[3].set(t.right,t.bottom);if(u.x<=h.x||a.y<=h.y)return!1;let l=Math.sign(e.a*e.d-e.b*e.c);if(l===0||(e.apply(h,h),e.apply(a,a),e.apply(u,u),e.apply(c,c),Math.max(h.x,a.x,u.x,c.x)<=r||Math.min(h.x,a.x,u.x,c.x)>=s||Math.max(h.y,a.y,u.y,c.y)<=n||Math.min(h.y,a.y,u.y,c.y)>=o))return!1;let d=l*(a.y-h.y),f=l*(h.x-a.x),m=d*r+f*n,y=d*s+f*n,p=d*r+f*o,_=d*s+f*o;if(Math.max(m,y,p,_)<=d*h.x+f*h.y||Math.min(m,y,p,_)>=d*c.x+f*c.y)return!1;let w=l*(h.y-u.y),x=l*(u.x-h.x),g=w*r+x*n,z=w*s+x*n,dt=w*r+x*o,oi=w*s+x*o;return!(Math.max(g,z,dt,oi)<=w*h.x+x*h.y||Math.min(g,z,dt,oi)>=w*c.x+x*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){let e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(t=1,e=.001){let r=Math.ceil((this.x+this.width-e)*t)/t,s=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=s-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){let e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=s,this.height=n-s,this}getBounds(t){return t||(t=new i),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;let e=t.x,r=t.y,s=t.x+t.width,n=t.y+t.height;return e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height&&s>=this.x&&s<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(t,e,r,s){return this.x=t,this.y=e,this.width=r,this.height=s,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};var Te=()=>{};var ki=new b,Lt=class{constructor(t,e){this.mapCoord=new b,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);let r=this.mapCoord;for(let s=0;s<t.length;s+=2){let n=t[s],o=t[s+1];e[s]=n*r.a+o*r.c+r.tx,e[s+1]=n*r.b+o*r.d+r.ty}return e}update(){let t=this._texture;this._updateID++;let e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);let r=t.orig,s=t.trim;s&&(ki.set(r.width/s.width,0,0,r.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(ki));let n=t.source,o=this.uClampFrame,h=this.clampMargin/n._resolution,a=this.clampOffset/n._resolution;return o[0]=(t.frame.x+h+a)/n.width,o[1]=(t.frame.y+h+a)/n.height,o[2]=(t.frame.x+t.frame.width-h+a)/n.width,o[3]=(t.frame.y+t.frame.height-h+a)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&t.rotate===0,!0}};var R=class extends B{constructor({source:t,label:e,frame:r,orig:s,trim:n,defaultAnchor:o,defaultBorders:h,rotate:a,dynamic:u}={}){if(super(),this.uid=M("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new rt,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new H,this.noFrame=!r,r)this.frame.copyFrom(r);else{let{width:c,height:l}=this._source;this.frame.width=c,this.frame.height=l}this.orig=s||this.frame,this.trim=n,this.rotate=a??0,this.defaultAnchor=o,this.defaultBorders=h,this.destroyed=!1,this.dynamic=u||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new Lt(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:t,frame:e}=this,{width:r,height:s}=this._source,n=e.x/r,o=e.y/s,h=e.width/r,a=e.height/s,u=this.rotate;if(u){let c=h/2,l=a/2,d=n+c,f=o+l;u=v.add(u,v.NW),t.x0=d+c*v.uX(u),t.y0=f+l*v.uY(u),u=v.add(u,2),t.x1=d+c*v.uX(u),t.y1=f+l*v.uY(u),u=v.add(u,2),t.x2=d+c*v.uX(u),t.y2=f+l*v.uY(u),u=v.add(u,2),t.x3=d+c*v.uX(u),t.y3=f+l*v.uY(u)}else t.x0=n,t.y0=o,t.x1=n+h,t.y1=o,t.x2=n+h,t.y2=o+a,t.x3=n,t.y3=o+a}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(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 T(X,"Texture.baseTexture is now Texture.source"),this._source}};R.EMPTY=new R({label:"EMPTY",source:new H({label:"EMPTY"})});R.EMPTY.destroy=Te;R.WHITE=new R({source:new yt({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});R.WHITE.destroy=Te;var Di={cullArea:null,cullable:!1,cullableChildren:!0};var A=class i{constructor(t,e,r){this._x=e||0,this._y=r||0,this._observer=t}clone(t){return new i(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.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(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}};var Yi={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(i){typeof i=="boolean"&&i===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(i===!0?{}:i))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(i){T("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(i)}};function Ui(i,t,e){let r=i.length,s;if(t>=r||e===0)return;e=t+e>r?r-t:e;let n=r-e;for(s=t;s<n;++s)i[s]=i[s+e];i.length=n}var Xi={allowChildren:!0,removeChildren(i=0,t){let e=t??this.children.length,r=e-i,s=[];if(r>0&&r<=e){for(let o=e-1;o>=i;o--){let h=this.children[o];h&&(s.push(h),h.parent=null)}Ui(this.children,i,e);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(s);for(let o=0;o<s.length;++o){let h=s[o];h.parentRenderLayer?.detach(h),this.emit("childRemoved",h,this,o),s[o].emit("removed",this)}return s.length>0&&this._didViewChangeTick++,s}else if(r===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(i){let t=this.getChildAt(i);return this.removeChild(t)},getChildAt(i){if(i<0||i>=this.children.length)throw new Error(`getChildAt: Index (${i}) does not exist.`);return this.children[i]},setChildIndex(i,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(i),this.addChildAt(i,t)},getChildIndex(i){let t=this.children.indexOf(i);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(i,t){this.allowChildren||T(X,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:e}=this;if(t<0||t>e.length)throw new Error(`${i}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(i.parent){let s=i.parent.children.indexOf(i);if(i.parent===this&&s===t)return i;s!==-1&&i.parent.children.splice(s,1)}t===e.length?e.push(i):e.splice(t,0,i),i.parent=this,i.didChange=!0,i._updateFlags=15;let r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(i),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",i,this,t),i.emit("added",this),i},swapChildren(i,t){if(i===t)return;let e=this.getChildIndex(i),r=this.getChildIndex(t);this.children[e]=t,this.children[r]=i;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...i){return i.length===1?this.reparentChildAt(i[0],this.children.length):(i.forEach(t=>this.reparentChildAt(t,this.children.length)),i[0])},reparentChildAt(i,t){if(i.parent===this)return this.setChildIndex(i,t),i;let e=i.worldTransform.clone();i.removeFromParent(),this.addChildAt(i,t);let r=this.worldTransform.clone();return r.invert(),e.prepend(r),i.setFromMatrix(e),i},replaceChild(i,t){i.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(i)),t.setFromMatrix(i.localTransform),t.updateLocalTransform(),this.removeChild(i)}};var zi={collectRenderables(i,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(i,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,i):this.collectRenderablesWithEffects(i,t,e))},collectRenderablesSimple(i,t,e){let r=this.children,s=r.length;for(let n=0;n<s;n++)r[n].collectRenderables(i,t,e)},collectRenderablesWithEffects(i,t,e){let{renderPipes:r}=t;for(let s=0;s<this.effects.length;s++){let n=this.effects[s];r[n.pipe].push(n,this,i)}this.collectRenderablesSimple(i,t,e);for(let s=this.effects.length-1;s>=0;s--){let n=this.effects[s];r[n.pipe].pop(n,this,i)}}};var _t=class{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}};var Oi={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0)},addEffect(i){this.effects.indexOf(i)===-1&&(this.effects.push(i),this.effects.sort((e,r)=>e.priority-r.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(i){let t=this.effects.indexOf(i);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(i){let t=this._maskEffect;t?.mask!==i&&(t&&(this.removeEffect(t),Ut.returnMaskEffect(t),this._maskEffect=null),i!=null&&(this._maskEffect=Ut.getMaskEffect(i),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(i){this._maskOptions={...this._maskOptions,...i},i.mask&&(this.mask=i.mask),this._markStructureAsChanged()},set filters(i){!Array.isArray(i)&&i&&(i=[i]);let t=this._filterEffect||(this._filterEffect=new _t);i=i;let e=i?.length>0,r=t.filters?.length>0,s=e!==r;i=Array.isArray(i)?i.slice(0):i,t.filters=Object.freeze(i),s&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=i??null))},get filters(){return this._filterEffect?.filters},set filterArea(i){this._filterEffect||(this._filterEffect=new _t),this._filterEffect.filterArea=i},get filterArea(){return this._filterEffect?.filterArea}};var Li={label:null,get name(){return T(X,"Container.name property has been removed, use Container.label instead"),this.label},set name(i){T(X,"Container.name property has been removed, use Container.label instead"),this.label=i},getChildByName(i,t=!1){return this.getChildByLabel(i,t)},getChildByLabel(i,t=!1){let e=this.children;for(let r=0;r<e.length;r++){let s=e[r];if(s.label===i||i instanceof RegExp&&i.test(s.label))return s}if(t)for(let r=0;r<e.length;r++){let n=e[r].getChildByLabel(i,!0);if(n)return n}return null},getChildrenByLabel(i,t=!1,e=[]){let r=this.children;for(let s=0;s<r.length;s++){let n=r[s];(n.label===i||i instanceof RegExp&&i.test(n.label))&&e.push(n)}if(t)for(let s=0;s<r.length;s++)r[s].getChildrenByLabel(i,!0,e);return e}};var Ni=new b,k=class i{constructor(t=1/0,e=1/0,r=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ni,this.minX=t,this.minY=e,this.maxX=r,this.maxY=s}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new rt);let t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ni,this}set(t,e,r,s){this.minX=t,this.minY=e,this.maxX=r,this.maxY=s}addFrame(t,e,r,s,n){n||(n=this.matrix);let o=n.a,h=n.b,a=n.c,u=n.d,c=n.tx,l=n.ty,d=this.minX,f=this.minY,m=this.maxX,y=this.maxY,p=o*t+a*e+c,_=h*t+u*e+l;p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>y&&(y=_),p=o*r+a*e+c,_=h*r+u*e+l,p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>y&&(y=_),p=o*t+a*s+c,_=h*t+u*s+l,p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>y&&(y=_),p=o*r+a*s+c,_=h*r+u*s+l,p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>y&&(y=_),this.minX=d,this.minY=f,this.maxX=m,this.maxY=y}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){let e=this.minX,r=this.minY,s=this.maxX,n=this.maxY,{a:o,b:h,c:a,d:u,tx:c,ty:l}=t,d=o*e+a*r+c,f=h*e+u*r+l;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*s+a*r+c,f=h*s+u*r+l,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=o*e+a*n+c,f=h*e+u*n+l,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=o*s+a*n+c,f=h*s+u*n+l,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(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,r,s){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<r&&(this.minY=r),this.maxY>s&&(this.maxY=s),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,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 i(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){let e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){let e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}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(t,e,r,s){let n=this.minX,o=this.minY,h=this.maxX,a=this.maxY;s||(s=this.matrix);let u=s.a,c=s.b,l=s.c,d=s.d,f=s.tx,m=s.ty;for(let y=e;y<r;y+=2){let p=t[y],_=t[y+1],w=u*p+l*_+f,x=c*p+d*_+m;n=w<n?w:n,o=x<o?x:o,h=w>h?w:h,a=x>a?x:a}this.minX=n,this.minY=o,this.maxX=h,this.maxY=a}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}};var P=O.getPool(b),L=O.getPool(k);var Xs=new b,Vi={getFastGlobalBounds(i,t){t||(t=new k),t.clear(),this._getGlobalBoundsRecursive(!!i,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);let e=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(e.worldTransform),t},_getGlobalBoundsRecursive(i,t,e){let r=t;if(i&&this.parentRenderLayer&&this.parentRenderLayer!==e||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(r=L.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){let o=this.bounds;r.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(i,r,e)}if(s){let n=!1,o=this.renderGroup||this.parentRenderGroup;for(let h=0;h<this.effects.length;h++)this.effects[h].addBounds&&(n||(n=!0,r.applyMatrix(o.worldTransform)),this.effects[h].addBounds(r,!0));n&&r.applyMatrix(o.worldTransform.copyTo(Xs).invert()),t.addBounds(r),L.return(r)}else this.renderGroup&&(t.addBounds(r,this.relativeGroupTransform),L.return(r))}};function $i(i,t,e){e.clear();let r,s;return i.parent?t?r=i.parent.worldTransform:(s=P.get().identity(),r=Nt(i,s)):r=b.IDENTITY,Hi(i,e,r,t),s&&P.return(s),e.isValid||e.set(0,0,0,0),e}function Hi(i,t,e,r){if(!i.visible||!i.measurable)return;let s;r?s=i.worldTransform:(i.updateLocalTransform(),s=P.get(),s.appendFrom(i.localTransform,e));let n=t,o=!!i.effects.length;if(o&&(t=L.get().clear()),i.boundsArea)t.addRect(i.boundsArea,s);else{let h=i.bounds;h&&!h.isEmpty()&&(t.matrix=s,t.addBounds(h));for(let a=0;a<i.children.length;a++)Hi(i.children[a],t,s,r)}if(o){for(let h=0;h<i.effects.length;h++)i.effects[h].addBounds?.(t);n.addBounds(t,b.IDENTITY),L.return(t)}r||P.return(s)}function Nt(i,t){let e=i.parent;return e&&(Nt(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}function Wi(i,t){if(i===16777215||!t)return t;if(t===16777215||!i)return i;let e=i>>16&255,r=i>>8&255,s=i&255,n=t>>16&255,o=t>>8&255,h=t&255,a=e*n/255|0,u=r*o/255|0,c=s*h/255|0;return(a<<16)+(u<<8)+c}var ji=16777215;function Se(i,t){return i===ji?t:t===ji?i:Wi(i,t)}function bt(i){return((i&255)<<16)+(i&65280)+(i>>16&255)}var qi={getGlobalAlpha(i){if(i)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(i=new b,t){if(t)return i.copyFrom(this.worldTransform);this.updateLocalTransform();let e=Nt(this,P.get().identity());return i.appendFrom(this.localTransform,e),P.return(e),i},getGlobalTint(i){if(i)return this.renderGroup?bt(this.renderGroup.worldColor):this.parentRenderGroup?bt(Se(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=Se(t,e.localColor),e=e.parent;return bt(t)}};function Zi(i,t,e){return t.clear(),e||(e=b.IDENTITY),Ki(i,t,e,i,!0),t.isValid||t.set(0,0,0,0),t}function Ki(i,t,e,r,s){let n;if(s)n=P.get(),n=e.copyTo(n);else{if(!i.visible||!i.measurable)return;i.updateLocalTransform();let a=i.localTransform;n=P.get(),n.appendFrom(a,e)}let o=t,h=!!i.effects.length;if(h&&(t=L.get().clear()),i.boundsArea)t.addRect(i.boundsArea,n);else{i.renderPipeId&&(t.matrix=n,t.addBounds(i.bounds));let a=i.children;for(let u=0;u<a.length;u++)Ki(a[u],t,n,r,!1)}if(h){for(let a=0;a<i.effects.length;a++)i.effects[a].addLocalBounds?.(t,r);o.addBounds(t,b.IDENTITY),L.return(t)}P.return(n)}function Ae(i,t){let e=i.children;for(let r=0;r<e.length;r++){let s=e[r],n=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,h=t.index;(t.data[h]!==n||t.data[h+1]!==o)&&(t.data[t.index]=n,t.data[t.index+1]=o,t.didChange=!0),t.index=h+2,s.children.length&&Ae(s,t)}return t.didChange}var zs=new b,Qi={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(i,t){let e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=i/t*e:this.scale.x=e},_setHeight(i,t){let e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=i/t*e:this.scale.y=e},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new k});let i=this._localBoundsCacheData;return i.index=1,i.didChange=!1,i.data[0]!==this._didViewChangeTick&&(i.didChange=!0,i.data[0]=this._didViewChangeTick),Ae(this,i),i.didChange&&Zi(this,i.localBounds,zs),i.localBounds},getBounds(i,t){return $i(this,i,t||new k)}};var Ji={_onRender:null,set onRender(i){let t=this.renderGroup||this.parentRenderGroup;if(!i){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=i},get onRender(){return this._onRender}};var tr={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(i){this._zIndex!==i&&(this._zIndex=i,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(Os))}};function Os(i,t){return i._zIndex-t._zIndex}var er={getGlobalPosition(i=new F,t=!1){return this.parent?this.parent.toGlobal(this._position,i,t):(i.x=this._position.x,i.y=this._position.y),i},toGlobal(i,t,e=!1){let r=this.getGlobalTransform(P.get(),e);return t=r.apply(i,t),P.return(r),t},toLocal(i,t,e,r){t&&(i=t.toGlobal(i,e,r));let s=this.getGlobalTransform(P.get(),r);return e=s.applyInverse(i,e),P.return(s),e}};var Vt=class{constructor(){this.uid=M("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}};var Ls=0,Re=class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Xt(this.textureOptions)}createTexture(t,e,r){let s=new H({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!1});return new R({source:s,label:`texturePool_${Ls++}`})}getOptimalTexture(t,e,r=1,s){let n=Math.ceil(t*r-1e-6),o=Math.ceil(e*r-1e-6);n=ve(n),o=ve(o);let h=(n<<17)+(o<<1)+(s?1:0);this._texturePool[h]||(this._texturePool[h]=[]);let a=this._texturePool[h].pop();return a||(a=this.createTexture(n,o,s)),a.source._resolution=r,a.source.width=n/r,a.source.height=o/r,a.source.pixelWidth=n,a.source.pixelHeight=o,a.frame.x=0,a.frame.y=0,a.frame.width=t,a.frame.height=e,a.updateUvs(),this._poolKeyHash[a.uid]=h,a}getSameSizeTexture(t,e=!1){let r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t,e=!1){let r=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[r].push(t)}clear(t){if(t=t!==!1,t)for(let e in this._texturePool){let r=this._texturePool[e];if(r)for(let s=0;s<r.length;s++)r[s].destroy(!0)}this._texturePool={}}},Pe=new Re;it.register(Pe);var $t=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new b,this.worldColorAlpha=4294967295,this.worldColor=16777215,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 Vt,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;let e=t.children;for(let r=0;r<e.length;r++){let s=e[r];s._updateFlags=15,this.addChild(s)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(Pe.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;let t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(let t in this.childrenToUpdate){let e=this.childrenToUpdate[t];e.list.fill(null),e.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(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){let e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);let e=t.children;for(let r=0;r<e.length;r++)this.addChild(e[r])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}let e=t.children;for(let r=0;r<e.length;r++)this.removeChild(e[r])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){let e=this.root.children;for(let r=0;r<e.length;r++)this._getChildren(e[r],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;let r=t.children;for(let s=0;s<r.length;s++)this._getChildren(r[s],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new b),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new b),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;let t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new b),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};function ir(i,t,e={}){for(let r in t)!e[r]&&t[r]!==void 0&&(i[r]=t[r])}var Ie=new A(null),Ht=new A(null),Ge=new A(null,1,1),Wt=new A(null),rr=1,Ns=2,Ee=4;var wt=class i extends B{constructor(t={}){super(),this.uid=M("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 b,this.relativeGroupTransform=new b,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new A(this,0,0),this._scale=Ge,this._pivot=Ht,this._origin=Wt,this._skew=Ie,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],ir(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(e=>this.addChild(e)),t.parent?.addChild(this)}static mixin(t){T("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),ft.mixin(i,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||T(X,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let s=0;s<t.length;s++)this.addChild(t[s]);return t[0]}let e=t[0],r=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),r&&(r.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,r&&r.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,e._zIndex!==0&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let s=0;s<t.length;s++)this.removeChild(t[s]);return t[0]}let e=t[0],r=this.children.indexOf(e);return r>-1&&(this._didViewChangeTick++,this.children.splice(r,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,r),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=O.get($t,this),this.groupTransform=b.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;let t=this.parentRenderGroup;t?.removeChild(this),O.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new b),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(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*Ci}set angle(t){this.rotation=t*Ti}get pivot(){return this._pivot===Ht&&(this._pivot=new A(this,0,0)),this._pivot}set pivot(t){this._pivot===Ht&&(this._pivot=new A(this,0,0),this._origin!==Wt&&gt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Ie&&(this._skew=new A(this,0,0)),this._skew}set skew(t){this._skew===Ie&&(this._skew=new A(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Ge&&(this._scale=new A(this,1,1)),this._scale}set scale(t){this._scale===Ge&&(this._scale=new A(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===Wt&&(this._origin=new A(this,0,0)),this._origin}set origin(t){this._origin===Wt&&(this._origin=new A(this,0,0),this._pivot!==Ht&&gt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){let e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){let e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});let e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){let r=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,r.width),e!==void 0&&this._setHeight(e,r.height)}_updateSkew(){let t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){let t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;let e=this.localTransform,r=this._scale,s=this._pivot,n=this._origin,o=this._position,h=r._x,a=r._y,u=s._x,c=s._y,l=-n._x,d=-n._y;e.a=this._cx*h,e.b=this._sx*h,e.c=this._cy*a,e.d=this._sy*a,e.tx=o._x-(u*e.a+c*e.c)+(l*e.a+d*e.c)-l,e.ty=o._y-(u*e.b+c*e.d)+(l*e.b+d*e.d)-d}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=rr,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){let r=vi.shared.setValue(t??16777215).toBgrNumber();r!==this.localColor&&(this.localColor=r,this._updateFlags|=rr,this._onUpdate())}get tint(){return bt(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ns,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){let e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ee,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){let e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ee,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){let e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=Ee,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=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 t=="boolean"?t:t?.children)&&e)for(let s=0;s<e.length;++s)e[s].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}};ft.mixin(wt,Xi,Vi,er,Ji,Qi,Oi,Li,tr,Di,Yi,qi,zi);var sr={createCanvas:(i,t)=>{let e=document.createElement("canvas");return e.width=i,e.height=t,e},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,t)=>fetch(i,t),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")};var nr=sr,jt={get(){return nr},set(i){nr=i}};var Be=class extends H{constructor(t){t.resource||(t.resource=jt.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.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(t=this.width,e=this.height,r=this._resolution){let s=super.resize(t,e,r);return s&&this.resizeCanvas(),s}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};Be.extension=V.TextureSource;var st=class{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(let r in t){let s=t[r];this.setResource(s,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;let t=[],e=0;for(let r in this.resources)t[e++]=this.resources[r]._resourceId;this._key=t.join("|")}setResource(t,e){let r=this.resources[e];t!==r&&(r&&t.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){let e=this.resources;for(let r in e)e[r]._touched=t}destroy(){let t=this.resources;for(let e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){let e=this.resources;for(let r in e)e[r]===t&&(e[r]=null)}else this._updateKey()}};function Fe(i,t){let e=i.byteLength/8|0,r=new Float64Array(i,0,e);new Float64Array(t,0,e).set(r);let n=i.byteLength-e*8;if(n>0){let o=new Uint8Array(i,e*8,n);new Uint8Array(t,e*8,n).set(o)}}var or={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},Vs=(i=>(i[i.DISABLED=0]="DISABLED",i[i.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",i[i.MASK_ACTIVE=2]="MASK_ACTIVE",i[i.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",i[i.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",i[i.NONE=5]="NONE",i))(Vs||{});var $s=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
5
+ `);function Hs(i){let t="";for(let e=0;e<i;++e)e>0&&(t+=`
6
+ else `),e<i-1&&(t+=`if(test == ${e}.0){}`);return t}function hr(i,t){if(i===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");let e=t.createShader(t.FRAGMENT_SHADER);try{for(;;){let r=$s.replace(/%forloop%/gi,Hs(i));if(t.shaderSource(e,r),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))i=i/2|0;else break}}finally{t.deleteShader(e)}return i}var I=(i=>(i[i.MAP_READ=1]="MAP_READ",i[i.MAP_WRITE=2]="MAP_WRITE",i[i.COPY_SRC=4]="COPY_SRC",i[i.COPY_DST=8]="COPY_DST",i[i.INDEX=16]="INDEX",i[i.VERTEX=32]="VERTEX",i[i.UNIFORM=64]="UNIFORM",i[i.STORAGE=128]="STORAGE",i[i.INDIRECT=256]="INDIRECT",i[i.QUERY_RESOLVE=512]="QUERY_RESOLVE",i[i.STATIC=1024]="STATIC",i))(I||{});var N=class extends B{constructor(t){let{data:e,size:r}=t,{usage:s,label:n,shrinkToFit:o}=t;super(),this.uid=M("buffer"),this._resourceType="buffer",this._resourceId=M("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,r??(r=e?.byteLength);let h=!!e;this.descriptor={size:r,usage:s,mappedAtCreation:h,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&I.STATIC)}set static(t){t?this.descriptor.usage|=I.STATIC:this.descriptor.usage&=~I.STATIC}setDataWithSize(t,e,r){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){r&&this.emit("update",this);return}let s=this._data;if(this._data=t,this._dataInt32=null,!s||s.length!==t.length){!this.shrinkToFit&&s&&t.byteLength<s.byteLength?r&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=M("resource"),this.emit("change",this));return}r&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}};function ke(i,t){if(!(i instanceof N)){let e=t?I.INDEX:I.VERTEX;i instanceof Array&&(t?(i=new Uint32Array(i),e=I.INDEX|I.COPY_DST):(i=new Float32Array(i),e=I.VERTEX|I.COPY_DST)),i=new N({data:i,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:e})}return i}function ar(i,t,e){let r=i.getAttribute(t);if(!r)return e.minX=0,e.minY=0,e.maxX=0,e.maxY=0,e;let s=r.buffer.data,n=1/0,o=1/0,h=-1/0,a=-1/0,u=s.BYTES_PER_ELEMENT,c=(r.offset||0)/u,l=(r.stride||8)/u;for(let d=c;d<s.length;d+=l){let f=s[d],m=s[d+1];f>h&&(h=f),m>a&&(a=m),f<n&&(n=f),m<o&&(o=m)}return e.minX=n,e.minY=o,e.maxX=h,e.maxY=a,e}function Ws(i){return(i instanceof N||Array.isArray(i)||i.BYTES_PER_ELEMENT)&&(i={buffer:i}),i.buffer=ke(i.buffer,!1),i}var qt=class extends B{constructor(t={}){super(),this.uid=M("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new k,this._boundsDirty=!0;let{attributes:e,indexBuffer:r,topology:s}=t;if(this.buffers=[],this.attributes={},e)for(let n in e)this.addAttribute(n,e[n]);this.instanceCount=t.instanceCount??1,r&&this.addIndex(r),this.topology=s||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(let t in this.attributes){let e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){let r=Ws(e);this.buffers.indexOf(r.buffer)===-1&&(this.buffers.push(r.buffer),r.buffer.on("update",this.onBufferUpdate,this),r.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=r}addIndex(t){this.indexBuffer=ke(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,ar(this,"aPosition",this._bounds)):this._bounds}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(e=>e.destroy()),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}};var De=Object.create(null),ur=Object.create(null);function nt(i,t){let e=ur[i];return e===void 0&&(De[t]===void 0&&(De[t]=1),ur[i]=e=De[t]++),e}var Zt;function Kt(){return(!Zt||Zt?.isContextLost())&&(Zt=jt.get().createCanvas().getContext("webgl",{})),Zt}var Qt;function lr(){if(!Qt){Qt="mediump";let i=Kt();i&&i.getShaderPrecisionFormat&&(Qt=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision?"highp":"mediump")}return Qt}function cr(i,t,e){return t?i:e?(i=i.replace("out vec4 finalColor;",""),`
7
+
8
+ #ifdef GL_ES // This checks if it is WebGL1
9
+ #define in varying
10
+ #define finalColor gl_FragColor
11
+ #define texture texture2D
12
+ #endif
13
+ ${i}
14
+ `):`
15
+
16
+ #ifdef GL_ES // This checks if it is WebGL1
17
+ #define in attribute
18
+ #define out varying
19
+ #endif
20
+ ${i}
21
+ `}function dr(i,t,e){let r=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(i.substring(0,9)!=="precision"){let s=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return s==="highp"&&r!=="highp"&&(s="mediump"),`precision ${s} float;
22
+ ${i}`}else if(r!=="highp"&&i.substring(0,15)==="precision highp")return i.replace("precision highp","precision mediump");return i}function fr(i,t){return t?`#version 300 es
23
+ ${i}`:i}var js={},qs={};function pr(i,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";let r=e?js:qs;return r[t]?(r[t]++,t+=`-${r[t]}`):r[t]=1,i.indexOf("#define SHADER_NAME")!==-1?i:`${`#define SHADER_NAME ${t}`}
24
+ ${i}`}function mr(i,t){return t?i.replace("#version 300 es",""):i}var Ye={stripVersion:mr,ensurePrecision:dr,addProgramDefines:cr,setProgramName:pr,insertVersion:fr},vt=Object.create(null),xr=class Ue{constructor(t){t={...Ue.defaultOptions,...t};let e=t.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:lr()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e},s=t.fragment,n=t.vertex;Object.keys(Ye).forEach(o=>{let h=r[o];s=Ye[o](s,h,!0),n=Ye[o](n,h,!1)}),this.fragment=s,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=nt(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,vt[this._cacheKey]=null}static from(t){let e=`${t.vertex}:${t.fragment}`;return vt[e]||(vt[e]=new Ue(t),vt[e]._cacheKey=e),vt[e]}};xr.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};var ot=xr;var gr={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 yr(i){return gr[i]??gr.float32}var Zs={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",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function _r({source:i,entryPoint:t}){let e={},r=i.indexOf(`fn ${t}`);if(r!==-1){let s=i.indexOf("->",r);if(s!==-1){let n=i.substring(r,s),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g,h;for(;(h=o.exec(n))!==null;){let a=Zs[h[3]]??"float32";e[h[2]]={location:parseInt(h[1],10),format:a,stride:yr(a).stride,offset:0,instance:!1,start:0}}}}return e}function Jt(i){let t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,s=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,h=/(\w+)\s*:\s*([\w\<\>]+)/g,a=/struct\s+(\w+)/,u=i.match(t)?.map(l=>({group:parseInt(l.match(e)[1],10),binding:parseInt(l.match(r)[1],10),name:l.match(s)[2],isUniform:l.match(s)[1]==="<uniform>",type:l.match(n)[1]}));if(!u)return{groups:[],structs:[]};let c=i.match(o)?.map(l=>{let d=l.match(a)[1],f=l.match(h).reduce((m,y)=>{let[p,_]=y.split(":");return m[p.trim()]=_.trim(),m},{});return f?{name:d,members:f}:null}).filter(({name:l})=>u.some(d=>d.type===l))??[];return{groups:u,structs:c}}var ht=(i=>(i[i.VERTEX=1]="VERTEX",i[i.FRAGMENT=2]="FRAGMENT",i[i.COMPUTE=4]="COMPUTE",i))(ht||{});function br({groups:i}){let t=[];for(let e=0;e<i.length;e++){let r=i[e];t[r.group]||(t[r.group]=[]),r.isUniform?t[r.group].push({binding:r.binding,visibility:ht.VERTEX|ht.FRAGMENT,buffer:{type:"uniform"}}):r.type==="sampler"?t[r.group].push({binding:r.binding,visibility:ht.FRAGMENT,sampler:{type:"filtering"}}):r.type==="texture_2d"&&t[r.group].push({binding:r.binding,visibility:ht.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return t}function wr({groups:i}){let t=[];for(let e=0;e<i.length;e++){let r=i[e];t[r.group]||(t[r.group]={}),t[r.group][r.name]=r.binding}return t}function vr(i,t){let e=new Set,r=new Set,s=[...i.structs,...t.structs].filter(o=>e.has(o.name)?!1:(e.add(o.name),!0)),n=[...i.groups,...t.groups].filter(o=>{let h=`${o.name}-${o.binding}`;return r.has(h)?!1:(r.add(h),!0)});return{structs:s,groups:n}}var Mt=Object.create(null),W=class i{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:e,vertex:r,layout:s,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=r,e.source===r.source){let h=Jt(e.source);this.structsAndGroups=h}else{let h=Jt(r.source),a=Jt(e.source);this.structsAndGroups=vr(h,a)}this.layout=s??wr(this.structsAndGroups),this.gpuLayout=n??br(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){let{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=nt(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=_r(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Mt[this._cacheKey]=null}static from(t){let e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Mt[e]||(Mt[e]=new i(t),Mt[e]._cacheKey=e),Mt[e]}};function Xe(i,t,e){if(i)for(let r in i){let s=r.toLocaleLowerCase(),n=t[s];if(n){let o=i[r];r==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&n.push(`//----${e}----//`),n.push(o)}else gt(`${r} placement hook does not exist in shader`)}}var Ks=/\{\{(.*?)\}\}/g;function ze(i){let t={};return(i.match(Ks)?.map(r=>r.replace(/[{()}]/g,""))??[]).forEach(r=>{t[r]=[]}),t}function Mr(i,t){let e,r=/@in\s+([^;]+);/g;for(;(e=r.exec(i))!==null;)t.push(e[1])}function Oe(i,t,e=!1){let r=[];Mr(t,r),i.forEach(h=>{h.header&&Mr(h.header,r)});let s=r;e&&s.sort();let n=s.map((h,a)=>` @location(${a}) ${h},`).join(`
25
+ `),o=t.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`
26
+ ${n}
27
+ `),o}function Cr(i,t){let e,r=/@out\s+([^;]+);/g;for(;(e=r.exec(i))!==null;)t.push(e[1])}function Qs(i){let e=/\b(\w+)\s*:/g.exec(i);return e?e[1]:""}function Js(i){let t=/@.*?\s+/g;return i.replace(t,"")}function Tr(i,t){let e=[];Cr(t,e),i.forEach(a=>{a.header&&Cr(a.header,e)});let r=0,s=e.sort().map(a=>a.indexOf("builtin")>-1?a:`@location(${r++}) ${a}`).join(`,
28
+ `),n=e.sort().map(a=>` var ${Js(a)};`).join(`
29
+ `),o=`return VSOutput(
30
+ ${e.sort().map(a=>` ${Qs(a)}`).join(`,
31
+ `)});`,h=t.replace(/@out\s+[^;]+;\s*/g,"");return h=h.replace("{{struct}}",`
32
+ ${s}
33
+ `),h=h.replace("{{start}}",`
34
+ ${n}
35
+ `),h=h.replace("{{return}}",`
36
+ ${o}
37
+ `),h}function Le(i,t){let e=i;for(let r in t){let s=t[r];s.join(`
38
+ `).length?e=e.replace(`{{${r}}}`,`//-----${r} START-----//
39
+ ${s.join(`
40
+ `)}
41
+ //----${r} FINISH----//`):e=e.replace(`{{${r}}}`,"")}return e}var j=Object.create(null),Ne=new Map,tn=0;function Sr({template:i,bits:t}){let e=Rr(i,t);if(j[e])return j[e];let{vertex:r,fragment:s}=en(i,t);return j[e]=Pr(r,s,t),j[e]}function Ar({template:i,bits:t}){let e=Rr(i,t);return j[e]||(j[e]=Pr(i.vertex,i.fragment,t)),j[e]}function en(i,t){let e=t.map(o=>o.vertex).filter(o=>!!o),r=t.map(o=>o.fragment).filter(o=>!!o),s=Oe(e,i.vertex,!0);s=Tr(e,s);let n=Oe(r,i.fragment,!0);return{vertex:s,fragment:n}}function Rr(i,t){return t.map(e=>(Ne.has(e)||Ne.set(e,tn++),Ne.get(e))).sort((e,r)=>e-r).join("-")+i.vertex+i.fragment}function Pr(i,t,e){let r=ze(i),s=ze(t);return e.forEach(n=>{Xe(n.vertex,r,n.name),Xe(n.fragment,s,n.name)}),{vertex:Le(i,r),fragment:Le(t,s)}}var Ir=`
42
+ @in aPosition: vec2<f32>;
43
+ @in aUV: vec2<f32>;
44
+
45
+ @out @builtin(position) vPosition: vec4<f32>;
46
+ @out vUV : vec2<f32>;
47
+ @out vColor : vec4<f32>;
48
+
49
+ {{header}}
50
+
51
+ struct VSOutput {
52
+ {{struct}}
53
+ };
54
+
55
+ @vertex
56
+ fn main( {{in}} ) -> VSOutput {
57
+
58
+ var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
59
+ var modelMatrix = mat3x3<f32>(
60
+ 1.0, 0.0, 0.0,
61
+ 0.0, 1.0, 0.0,
62
+ 0.0, 0.0, 1.0
63
+ );
64
+ var position = aPosition;
65
+ var uv = aUV;
66
+
67
+ {{start}}
68
+
69
+ vColor = vec4<f32>(1., 1., 1., 1.);
70
+
71
+ {{main}}
72
+
73
+ vUV = uv;
74
+
75
+ var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
76
+
77
+ vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
78
+
79
+ vColor *= globalUniforms.uWorldColorAlpha;
80
+
81
+ {{end}}
82
+
83
+ {{return}}
84
+ };
85
+ `,Gr=`
86
+ @in vUV : vec2<f32>;
87
+ @in vColor : vec4<f32>;
88
+
89
+ {{header}}
90
+
91
+ @fragment
92
+ fn main(
93
+ {{in}}
94
+ ) -> @location(0) vec4<f32> {
95
+
96
+ {{start}}
97
+
98
+ var outColor:vec4<f32>;
99
+
100
+ {{main}}
101
+
102
+ var finalColor:vec4<f32> = outColor * vColor;
103
+
104
+ {{end}}
105
+
106
+ return finalColor;
107
+ };
108
+ `,Er=`
109
+ in vec2 aPosition;
110
+ in vec2 aUV;
111
+
112
+ out vec4 vColor;
113
+ out vec2 vUV;
114
+
115
+ {{header}}
116
+
117
+ void main(void){
118
+
119
+ mat3 worldTransformMatrix = uWorldTransformMatrix;
120
+ mat3 modelMatrix = mat3(
121
+ 1.0, 0.0, 0.0,
122
+ 0.0, 1.0, 0.0,
123
+ 0.0, 0.0, 1.0
124
+ );
125
+ vec2 position = aPosition;
126
+ vec2 uv = aUV;
127
+
128
+ {{start}}
129
+
130
+ vColor = vec4(1.);
131
+
132
+ {{main}}
133
+
134
+ vUV = uv;
135
+
136
+ mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
137
+
138
+ gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
139
+
140
+ vColor *= uWorldColorAlpha;
141
+
142
+ {{end}}
143
+ }
144
+ `,Br=`
145
+
146
+ in vec4 vColor;
147
+ in vec2 vUV;
148
+
149
+ out vec4 finalColor;
150
+
151
+ {{header}}
152
+
153
+ void main(void) {
154
+
155
+ {{start}}
156
+
157
+ vec4 outColor;
158
+
159
+ {{main}}
160
+
161
+ finalColor = outColor * vColor;
162
+
163
+ {{end}}
164
+ }
165
+ `;var Fr={name:"global-uniforms-bit",vertex:{header:`
166
+ struct GlobalUniforms {
167
+ uProjectionMatrix:mat3x3<f32>,
168
+ uWorldTransformMatrix:mat3x3<f32>,
169
+ uWorldColorAlpha: vec4<f32>,
170
+ uResolution: vec2<f32>,
171
+ }
172
+
173
+ @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
174
+ `}};var kr={name:"global-uniforms-bit",vertex:{header:`
175
+ uniform mat3 uProjectionMatrix;
176
+ uniform mat3 uWorldTransformMatrix;
177
+ uniform vec4 uWorldColorAlpha;
178
+ uniform vec2 uResolution;
179
+ `}};function Dr({bits:i,name:t}){let e=Sr({template:{fragment:Gr,vertex:Ir},bits:[Fr,...i]});return W.from({name:t,vertex:{source:e.vertex,entryPoint:"main"},fragment:{source:e.fragment,entryPoint:"main"}})}function Yr({bits:i,name:t}){return new ot({name:t,...Ar({template:{vertex:Er,fragment:Br},bits:[kr,...i]})})}var Ur={name:"color-bit",vertex:{header:`
180
+ @in aColor: vec4<f32>;
181
+ `,main:`
182
+ vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
183
+ `}},Xr={name:"color-bit",vertex:{header:`
184
+ in vec4 aColor;
185
+ `,main:`
186
+ vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
187
+ `}};var Ve={};function rn(i){let t=[];if(i===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let e=0;for(let r=0;r<i;r++)t.push(`@group(1) @binding(${e++}) var textureSource${r+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${e++}) var textureSampler${r+1}: sampler;`)}return t.join(`
188
+ `)}function sn(i){let t=[];if(i===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let e=0;e<i;e++)e===i-1?t.push(" default:{"):t.push(` case ${e}:{`),t.push(` outColor = textureSampleGrad(textureSource${e+1}, textureSampler${e+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
189
+ `)}function zr(i){return Ve[i]||(Ve[i]={name:"texture-batch-bit",vertex:{header:`
190
+ @in aTextureIdAndRound: vec2<u32>;
191
+ @out @interpolate(flat) vTextureId : u32;
192
+ `,main:`
193
+ vTextureId = aTextureIdAndRound.y;
194
+ `,end:`
195
+ if(aTextureIdAndRound.x == 1)
196
+ {
197
+ vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
198
+ }
199
+ `},fragment:{header:`
200
+ @in @interpolate(flat) vTextureId: u32;
201
+
202
+ ${rn(i)}
203
+ `,main:`
204
+ var uvDx = dpdx(vUV);
205
+ var uvDy = dpdy(vUV);
206
+
207
+ ${sn(i)}
208
+ `}}),Ve[i]}var $e={};function nn(i){let t=[];for(let e=0;e<i;e++)e>0&&t.push("else"),e<i-1&&t.push(`if(vTextureId < ${e}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${e}], vUV);`),t.push("}");return t.join(`
209
+ `)}function Or(i){return $e[i]||($e[i]={name:"texture-batch-bit",vertex:{header:`
210
+ in vec2 aTextureIdAndRound;
211
+ out float vTextureId;
212
+
213
+ `,main:`
214
+ vTextureId = aTextureIdAndRound.y;
215
+ `,end:`
216
+ if(aTextureIdAndRound.x == 1.)
217
+ {
218
+ gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
219
+ }
220
+ `},fragment:{header:`
221
+ in float vTextureId;
222
+
223
+ uniform sampler2D uTextures[${i}];
224
+
225
+ `,main:`
226
+
227
+ ${nn(i)}
228
+ `}}),$e[i]}var Lr={name:"round-pixels-bit",vertex:{header:`
229
+ fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
230
+ {
231
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
232
+ }
233
+ `}},Nr={name:"round-pixels-bit",vertex:{header:`
234
+ vec2 roundPixels(vec2 position, vec2 targetSize)
235
+ {
236
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
237
+ }
238
+ `}};var He=["f32","i32","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>"],Vr=He.reduce((i,t)=>(i[t]=!0,i),{});function $r(i,t){switch(i){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 Hr=class Wr{constructor(t,e){this._touched=0,this.uid=M("uniform"),this._resourceType="uniformGroup",this._resourceId=M("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...Wr.defaultOptions,...e},this.uniformStructures=t;let r={};for(let s in t){let n=t[s];if(n.name=s,n.size=n.size??1,!Vr[n.type]){let o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){let[,h,a]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${h}', size: ${a} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${He.join(", ")}`)}n.value??(n.value=$r(n.type,n.size)),r[s]=n.value}this.uniforms=r,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=nt(Object.keys(r).map(s=>`${s}-${t[s].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Hr.defaultOptions={ubo:!1,isStatic:!1};var te=Hr;var jr={};function qr(i){let t=jr[i];if(t)return t;let e=new Int32Array(i);for(let r=0;r<i;r++)e[r]=r;return t=jr[i]=new te({uTextures:{value:e,type:"i32",size:i}},{isStatic:!0}),t}var at=class i extends B{constructor(t){super(),this.uid=M("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:r,groups:s,resources:n,compatibleRenderers:o,groupMap:h}=t;this.gpuProgram=e,this.glProgram=r,o===void 0&&(o=0,e&&(o|=Ft.WEBGPU),r&&(o|=Ft.WEBGL)),this.compatibleRenderers=o;let a={};if(!n&&!s&&(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&s&&!h)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&s&&h)for(let u in h)for(let c in h[u]){let l=h[u][c];a[l]={group:u,binding:c,name:l}}else if(e&&s&&!h){let u=e.structsAndGroups.groups;h={},u.forEach(c=>{h[c.group]=h[c.group]||{},h[c.group][c.binding]=c.name,a[c.name]=c})}else if(n){s={},h={},e&&e.structsAndGroups.groups.forEach(l=>{h[l.group]=h[l.group]||{},h[l.group][l.binding]=l.name,a[l.name]=l});let u=0;for(let c in n)a[c]||(s[99]||(s[99]=new st,this._ownedBindGroups.push(s[99])),a[c]={group:99,binding:u,name:c},h[99]=h[99]||{},h[99][u]=c,u++);for(let c in n){let l=c,d=n[c];!d.source&&!d._resourceType&&(d=new te(d));let f=a[l];f&&(s[f.group]||(s[f.group]=new st,this._ownedBindGroups.push(s[f.group])),s[f.group].setResource(d,f.binding))}}this.groups=s,this._uniformBindMap=h,this.resources=this._buildResourceAccessor(s,a)}addResource(t,e,r){var s,n;(s=this._uniformBindMap)[e]||(s[e]={}),(n=this._uniformBindMap[e])[r]||(n[r]=t),this.groups[e]||(this.groups[e]=new st,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){let r={};for(let s in e){let n=e[s];Object.defineProperty(r,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return r}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(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)}static from(t){let{gpu:e,gl:r,...s}=t,n,o;return e&&(n=W.from(e)),r&&(o=ot.from(r)),new i({gpuProgram:n,glProgram:o,...s})}};function re(i,t,e=2){let r=t&&t.length,s=r?t[0]*e:i.length,n=Kr(i,0,s,e,!0),o=[];if(!n||n.next===n.prev)return o;let h,a,u;if(r&&(n=ln(i,t,n,e)),i.length>80*e){h=i[0],a=i[1];let c=h,l=a;for(let d=e;d<s;d+=e){let f=i[d],m=i[d+1];f<h&&(h=f),m<a&&(a=m),f>c&&(c=f),m>l&&(l=m)}u=Math.max(c-h,l-a),u=u!==0?32767/u:0}return Tt(n,o,e,h,a,u,0),o}function Kr(i,t,e,r,s){let n;if(s===wn(i,t,e,r)>0)for(let o=t;o<e;o+=r)n=Zr(o/r|0,i[o],i[o+1],n);else for(let o=e-r;o>=t;o-=r)n=Zr(o/r|0,i[o],i[o+1],n);return n&&ut(n,n.next)&&(At(n),n=n.next),n}function J(i,t){if(!i)return i;t||(t=i);let e=i,r;do if(r=!1,!e.steiner&&(ut(e,e.next)||C(e.prev,e,e.next)===0)){if(At(e),e=t=e.prev,e===e.next)break;r=!0}else e=e.next;while(r||e!==t);return t}function Tt(i,t,e,r,s,n,o){if(!i)return;!o&&n&&mn(i,r,s,n);let h=i;for(;i.prev!==i.next;){let a=i.prev,u=i.next;if(n?hn(i,r,s,n):on(i)){t.push(a.i,i.i,u.i),At(i),i=u.next,h=u.next;continue}if(i=u,i===h){o?o===1?(i=an(J(i),t),Tt(i,t,e,r,s,n,2)):o===2&&un(i,t,e,r,s,n):Tt(J(i),t,e,r,s,n,1);break}}}function on(i){let t=i.prev,e=i,r=i.next;if(C(t,e,r)>=0)return!1;let s=t.x,n=e.x,o=r.x,h=t.y,a=e.y,u=r.y,c=Math.min(s,n,o),l=Math.min(h,a,u),d=Math.max(s,n,o),f=Math.max(h,a,u),m=r.next;for(;m!==t;){if(m.x>=c&&m.x<=d&&m.y>=l&&m.y<=f&&Ct(s,h,n,a,o,u,m.x,m.y)&&C(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function hn(i,t,e,r){let s=i.prev,n=i,o=i.next;if(C(s,n,o)>=0)return!1;let h=s.x,a=n.x,u=o.x,c=s.y,l=n.y,d=o.y,f=Math.min(h,a,u),m=Math.min(c,l,d),y=Math.max(h,a,u),p=Math.max(c,l,d),_=We(f,m,t,e,r),w=We(y,p,t,e,r),x=i.prevZ,g=i.nextZ;for(;x&&x.z>=_&&g&&g.z<=w;){if(x.x>=f&&x.x<=y&&x.y>=m&&x.y<=p&&x!==s&&x!==o&&Ct(h,c,a,l,u,d,x.x,x.y)&&C(x.prev,x,x.next)>=0||(x=x.prevZ,g.x>=f&&g.x<=y&&g.y>=m&&g.y<=p&&g!==s&&g!==o&&Ct(h,c,a,l,u,d,g.x,g.y)&&C(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;x&&x.z>=_;){if(x.x>=f&&x.x<=y&&x.y>=m&&x.y<=p&&x!==s&&x!==o&&Ct(h,c,a,l,u,d,x.x,x.y)&&C(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;g&&g.z<=w;){if(g.x>=f&&g.x<=y&&g.y>=m&&g.y<=p&&g!==s&&g!==o&&Ct(h,c,a,l,u,d,g.x,g.y)&&C(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function an(i,t){let e=i;do{let r=e.prev,s=e.next.next;!ut(r,s)&&Jr(r,e,e.next,s)&&St(r,s)&&St(s,r)&&(t.push(r.i,e.i,s.i),At(e),At(e.next),e=i=s),e=e.next}while(e!==i);return J(e)}function un(i,t,e,r,s,n){let o=i;do{let h=o.next.next;for(;h!==o.prev;){if(o.i!==h.i&&yn(o,h)){let a=ts(o,h);o=J(o,o.next),a=J(a,a.next),Tt(o,t,e,r,s,n,0),Tt(a,t,e,r,s,n,0);return}h=h.next}o=o.next}while(o!==i)}function ln(i,t,e,r){let s=[];for(let n=0,o=t.length;n<o;n++){let h=t[n]*r,a=n<o-1?t[n+1]*r:i.length,u=Kr(i,h,a,r,!1);u===u.next&&(u.steiner=!0),s.push(gn(u))}s.sort(cn);for(let n=0;n<s.length;n++)e=dn(s[n],e);return e}function cn(i,t){let e=i.x-t.x;if(e===0&&(e=i.y-t.y,e===0)){let r=(i.next.y-i.y)/(i.next.x-i.x),s=(t.next.y-t.y)/(t.next.x-t.x);e=r-s}return e}function dn(i,t){let e=fn(i,t);if(!e)return t;let r=ts(e,i);return J(r,r.next),J(e,e.next)}function fn(i,t){let e=t,r=i.x,s=i.y,n=-1/0,o;if(ut(i,e))return e;do{if(ut(i,e.next))return e.next;if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){let l=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(l<=r&&l>n&&(n=l,o=e.x<e.next.x?e:e.next,l===r))return o}e=e.next}while(e!==t);if(!o)return null;let h=o,a=o.x,u=o.y,c=1/0;e=o;do{if(r>=e.x&&e.x>=a&&r!==e.x&&Qr(s<u?r:n,s,a,u,s<u?n:r,s,e.x,e.y)){let l=Math.abs(s-e.y)/(r-e.x);St(e,i)&&(l<c||l===c&&(e.x>o.x||e.x===o.x&&pn(o,e)))&&(o=e,c=l)}e=e.next}while(e!==h);return o}function pn(i,t){return C(i.prev,i,t.prev)<0&&C(t.next,i,i.next)<0}function mn(i,t,e,r){let s=i;do s.z===0&&(s.z=We(s.x,s.y,t,e,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==i);s.prevZ.nextZ=null,s.prevZ=null,xn(s)}function xn(i){let t,e=1;do{let r=i,s;i=null;let n=null;for(t=0;r;){t++;let o=r,h=0;for(let u=0;u<e&&(h++,o=o.nextZ,!!o);u++);let a=e;for(;h>0||a>0&&o;)h!==0&&(a===0||!o||r.z<=o.z)?(s=r,r=r.nextZ,h--):(s=o,o=o.nextZ,a--),n?n.nextZ=s:i=s,s.prevZ=n,n=s;r=o}n.nextZ=null,e*=2}while(t>1);return i}function We(i,t,e,r,s){return i=(i-e)*s|0,t=(t-r)*s|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,i|t<<1}function gn(i){let t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function Qr(i,t,e,r,s,n,o,h){return(s-o)*(t-h)>=(i-o)*(n-h)&&(i-o)*(r-h)>=(e-o)*(t-h)&&(e-o)*(n-h)>=(s-o)*(r-h)}function Ct(i,t,e,r,s,n,o,h){return!(i===o&&t===h)&&Qr(i,t,e,r,s,n,o,h)}function yn(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!_n(i,t)&&(St(i,t)&&St(t,i)&&bn(i,t)&&(C(i.prev,i,t.prev)||C(i,t.prev,t))||ut(i,t)&&C(i.prev,i,i.next)>0&&C(t.prev,t,t.next)>0)}function C(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function ut(i,t){return i.x===t.x&&i.y===t.y}function Jr(i,t,e,r){let s=ie(C(i,t,e)),n=ie(C(i,t,r)),o=ie(C(e,r,i)),h=ie(C(e,r,t));return!!(s!==n&&o!==h||s===0&&ee(i,e,t)||n===0&&ee(i,r,t)||o===0&&ee(e,i,r)||h===0&&ee(e,t,r))}function ee(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function ie(i){return i>0?1:i<0?-1:0}function _n(i,t){let e=i;do{if(e.i!==i.i&&e.next.i!==i.i&&e.i!==t.i&&e.next.i!==t.i&&Jr(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function St(i,t){return C(i.prev,i,i.next)<0?C(i,t,i.next)>=0&&C(i,i.prev,t)>=0:C(i,t,i.prev)<0||C(i,i.next,t)<0}function bn(i,t){let e=i,r=!1,s=(i.x+t.x)/2,n=(i.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&s<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next;while(e!==i);return r}function ts(i,t){let e=je(i.i,i.x,i.y),r=je(t.i,t.x,t.y),s=i.next,n=t.prev;return i.next=t,t.prev=i,e.next=s,s.prev=e,r.next=e,e.prev=r,n.next=r,r.prev=n,r}function Zr(i,t,e,r){let s=je(i,t,e);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function At(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function je(i,t,e){return{i,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wn(i,t,e,r){let s=0;for(let n=t,o=e-r;n<e;n+=r)s+=(i[o]-i[n])*(i[n+1]+i[o+1]),o=n;return s}var cl=re.default||re;var vn={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},qe=0,Ze=1,Ke=2,Qe=3,Je=4,ti=5,ei=class es{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<qe)}set blend(t){!!(this.data&1<<qe)!==t&&(this.data^=1<<qe)}get offsets(){return!!(this.data&1<<Ze)}set offsets(t){!!(this.data&1<<Ze)!==t&&(this.data^=1<<Ze)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Ke)}set culling(t){!!(this.data&1<<Ke)!==t&&(this.data^=1<<Ke)}get depthTest(){return!!(this.data&1<<Qe)}set depthTest(t){!!(this.data&1<<Qe)!==t&&(this.data^=1<<Qe)}get depthMask(){return!!(this.data&1<<ti)}set depthMask(t){!!(this.data&1<<ti)!==t&&(this.data^=1<<ti)}get clockwiseFrontFace(){return!!(this.data&1<<Je)}set clockwiseFrontFace(t){!!(this.data&1<<Je)!==t&&(this.data^=1<<Je)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=vn[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}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 es;return t.depthTest=!1,t.blend=!0,t}};ei.default2d=ei.for2d();var is=ei;var ii={name:"local-uniform-bit",vertex:{header:`
239
+
240
+ struct LocalUniforms {
241
+ uTransformMatrix:mat3x3<f32>,
242
+ uColor:vec4<f32>,
243
+ uRound:f32,
244
+ }
245
+
246
+ @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
247
+ `,main:`
248
+ vColor *= localUniforms.uColor;
249
+ modelMatrix *= localUniforms.uTransformMatrix;
250
+ `,end:`
251
+ if(localUniforms.uRound == 1)
252
+ {
253
+ vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
254
+ }
255
+ `}},ml={...ii,vertex:{...ii.vertex,header:ii.vertex.header.replace("group(1)","group(2)")}},xl={name:"local-uniform-bit",vertex:{header:`
256
+
257
+ uniform mat3 uTransformMatrix;
258
+ uniform vec4 uColor;
259
+ uniform float uRound;
260
+ `,main:`
261
+ vColor *= uColor;
262
+ modelMatrix = uTransformMatrix;
263
+ `,end:`
264
+ if(uRound == 1.)
265
+ {
266
+ gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
267
+ }
268
+ `}};var se=(i=>(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(se||{});var lt=class{constructor(t,e=null,r=0,s=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=r,this._once=s}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));let e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let e=this.next;return this.next=t?null:e,this.previous=null,e}};var rs=class D{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 lt(null,null,1/0),this.deltaMS=1/D.targetFPMS,this.elapsedMS=1/D.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),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(t,e,r=se.NORMAL){return this._addListener(new lt(t,e,r))}addOnce(t,e,r=se.NORMAL){return this._addListener(new lt(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(!e)t.connect(r);else{for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r.match(t,e)?r=r.destroy():r=r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){let n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*D.targetFPMS;let r=this._head,s=r.next;for(;s;)s=s.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 e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,D.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{let e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!D._shared){let t=D._shared=new D;t.autoStart=!0,t._protected=!0}return D._shared}static get system(){if(!D._system){let t=D._system=new D;t.autoStart=!0,t._protected=!0}return D._system}};rs.targetFPMS=.06;var vl=rs;function ss(i,t,e){let{width:r,height:s}=e.orig,n=e.trim;if(n){let o=n.width,h=n.height;i.minX=n.x-t._x*r,i.maxX=i.minX+o,i.minY=n.y-t._y*s,i.maxY=i.minY+h}else i.minX=-t._x*r,i.maxX=i.minX+r,i.minY=-t._y*s,i.maxY=i.minY+s}var ne=class extends wt{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new k(0,1,0,0),this._boundsDirty=!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){let e=this.bounds,{x:r,y:s}=t;return r>=e.minX&&r<=e.maxX&&s>=e.minY&&s<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;let t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}destroy(t){super.destroy(t),this._bounds=null;for(let e in this._gpuData)this._gpuData[e].destroy?.();this._gpuData=null}collectRenderablesSimple(t,e,r){let{renderPipes:s}=e;s.blendMode.pushBlendMode(this,this.groupBlendMode,t),s[this.renderPipeId].addRenderable(this,t),this.didViewUpdate=!1;let o=this.children,h=o.length;for(let a=0;a<h;a++)o[a].collectRenderables(t,e,r);s.blendMode.popBlendMode(t)}};var ns=class i extends ne{constructor(t=R.EMPTY){t instanceof R&&(t={texture:t});let{texture:e=R.EMPTY,anchor:r,roundPixels:s,width:n,height:o,...h}=t;super({label:"Sprite",...h}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new A({_onUpdate:()=>{this.onViewUpdate()}}),r?this.anchor=r:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=s??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof R?new i(t):new i(R.from(t,e))}set texture(t){t||(t=R.EMPTY);let e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,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 ss(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return T("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){let t=this._anchor,e=this._texture,r=this._bounds,{width:s,height:n}=e.orig;r.minX=-t._x*s,r.maxX=r.minX+s,r.minY=-t._y*n,r.maxY=r.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){let r=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(r)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}};function ri(i,t){return t.alphaMode==="no-premultiply-alpha"&&or[i]||i}var Rt=class{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}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(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}};var ct=null;function os(){if(ct)return ct;let i=Kt();return ct=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),ct=hr(ct,i),i.getExtension("WEBGL_lose_context")?.loseContext(),ct}var oe=class{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){let e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}};var si=class{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new oe,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}},It=[],he=0;it.register({clear:()=>{if(It.length>0)for(let i of It)i&&i.destroy();It.length=0,he=0}});function hs(){return he>0?It[--he]:new si}function as(i){It[he++]=i}var Pt=0,us=class ls{constructor(t){this.uid=M("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...ls.defaultOptions,...t},t.maxTextures||(T("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=os());let{maxTextures:e,attributesInitialSize:r,indicesInitialSize:s}=t;this.attributeBuffer=new Rt(r*4),this.indexBuffer=new Uint16Array(s),this.maxTextures=e}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)as(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){let r=t._batch.textures.ids[e._source.uid];return!r&&r!==0?!1:(t._textureId=r,t.texture=e,!0)}updateElement(t){this.dirty=!0;let e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){let e=this._elements;if(!e[this.elementStart])return;let r=hs(),s=r.textures;s.clear();let n=e[this.elementStart],o=ri(n.blendMode,n.texture._source),h=n.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);let a=this.attributeBuffer.float32View,u=this.attributeBuffer.uint32View,c=this.indexBuffer,l=this._batchIndexSize,d=this._batchIndexStart,f="startBatch",m=this.maxTextures;for(let y=this.elementStart;y<this.elementSize;++y){let p=e[y];e[y]=null;let w=p.texture._source,x=ri(p.blendMode,w),g=o!==x||h!==p.topology;if(w._batchTick===Pt&&!g){p._textureId=w._textureBindLocation,l+=p.indexSize,p.packAsQuad?(this.packQuadAttributes(p,a,u,p._attributeStart,p._textureId),this.packQuadIndex(c,p._indexStart,p._attributeStart/this.vertexSize)):(this.packAttributes(p,a,u,p._attributeStart,p._textureId),this.packIndex(p,c,p._indexStart,p._attributeStart/this.vertexSize)),p._batch=r;continue}w._batchTick=Pt,(s.count>=m||g)&&(this._finishBatch(r,d,l-d,s,o,h,t,f),f="renderBatch",d=l,o=x,h=p.topology,r=hs(),s=r.textures,s.clear(),++Pt),p._textureId=w._textureBindLocation=s.count,s.ids[w.uid]=s.count,s.textures[s.count++]=w,p._batch=r,l+=p.indexSize,p.packAsQuad?(this.packQuadAttributes(p,a,u,p._attributeStart,p._textureId),this.packQuadIndex(c,p._indexStart,p._attributeStart/this.vertexSize)):(this.packAttributes(p,a,u,p._attributeStart,p._textureId),this.packIndex(p,c,p._indexStart,p._attributeStart/this.vertexSize))}s.count>0&&(this._finishBatch(r,d,l-d,s,o,h,t,f),d=l,++Pt),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=l}_finishBatch(t,e,r,s,n,o,h,a){t.gpuBindGroup=null,t.bindGroup=null,t.action=a,t.batcher=this,t.textures=s,t.blendMode=n,t.topology=o,t.start=e,t.size=r,++Pt,this.batches[this.batchIndex++]=t,h.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){let e=Math.max(t,this.attributeBuffer.size*2),r=new Rt(e);Fe(this.attributeBuffer.rawBinaryData,r.rawBinaryData),this.attributeBuffer=r}_resizeIndexBuffer(t){let e=this.indexBuffer,r=Math.max(t,e.length*1.5);r+=r%2;let s=r>65535?new Uint32Array(r):new Uint16Array(r);if(s.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n<e.length;n++)s[n]=e[n];else Fe(e.buffer,s.buffer);this.indexBuffer=s}packQuadIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}packIndex(t,e,r,s){let n=t.indices,o=t.indexSize,h=t.indexOffset,a=t.attributeOffset;for(let u=0;u<o;u++)e[r++]=s+n[u+h]-a}destroy(t={}){if(this.batches!==null){for(let e=0;e<this.batches.length;e++)as(this.batches[e]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&(this.shader?.destroy(),this.shader=null);for(let e=0;e<this._elements.length;e++)this._elements[e]&&(this._elements[e]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};us.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};var cs=us;var Mn=new Float32Array(1),Cn=new Uint32Array(1),ae=class extends qt{constructor(){let e=new N({data:Mn,label:"attribute-batch-buffer",usage:I.VERTEX|I.COPY_DST,shrinkToFit:!1}),r=new N({data:Cn,label:"index-batch-buffer",usage:I.INDEX|I.COPY_DST,shrinkToFit:!1}),s=24;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:s,offset:0},aUV:{buffer:e,format:"float32x2",stride:s,offset:8},aColor:{buffer:e,format:"unorm8x4",stride:s,offset:16},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:s,offset:20}},indexBuffer:r})}};var Gt=class extends at{constructor(t){let e=Yr({name:"batch",bits:[Xr,Or(t),Nr]}),r=Dr({name:"batch",bits:[Ur,zr(t),Lr]});super({glProgram:e,gpuProgram:r,resources:{batchSamplers:qr(t)}}),this.maxTextures=t}};var Et=null,ds=class fs extends cs{constructor(t){super(t),this.geometry=new ae,this.name=fs.extension.name,this.vertexSize=6,Et??(Et=new Gt(t.maxTextures)),this.shader=Et}packAttributes(t,e,r,s,n){let o=n<<16|t.roundPixels&65535,h=t.transform,a=h.a,u=h.b,c=h.c,l=h.d,d=h.tx,f=h.ty,{positions:m,uvs:y}=t,p=t.color,_=t.attributeOffset,w=_+t.attributeSize;for(let x=_;x<w;x++){let g=x*2,z=m[g],dt=m[g+1];e[s++]=a*z+c*dt+d,e[s++]=l*dt+u*z+f,e[s++]=y[g],e[s++]=y[g+1],r[s++]=p,r[s++]=o}}packQuadAttributes(t,e,r,s,n){let o=t.texture,h=t.transform,a=h.a,u=h.b,c=h.c,l=h.d,d=h.tx,f=h.ty,m=t.bounds,y=m.maxX,p=m.minX,_=m.maxY,w=m.minY,x=o.uvs,g=t.color,z=n<<16|t.roundPixels&65535;e[s+0]=a*p+c*w+d,e[s+1]=l*w+u*p+f,e[s+2]=x.x0,e[s+3]=x.y0,r[s+4]=g,r[s+5]=z,e[s+6]=a*y+c*w+d,e[s+7]=l*w+u*y+f,e[s+8]=x.x1,e[s+9]=x.y1,r[s+10]=g,r[s+11]=z,e[s+12]=a*y+c*_+d,e[s+13]=l*_+u*y+f,e[s+14]=x.x2,e[s+15]=x.y2,r[s+16]=g,r[s+17]=z,e[s+18]=a*p+c*_+d,e[s+19]=l*_+u*p+f,e[s+20]=x.x3,e[s+21]=x.y3,r[s+22]=g,r[s+23]=z}_updateMaxTextures(t){this.shader.maxTextures!==t&&(Et=new Gt(t),this.shader=Et)}destroy(){this.shader=null,super.destroy()}};ds.extension={type:[V.Batcher],name:"default"};var cc=ds;function fc(i,t,e){let r=(i>>24&255)/255;t[e++]=(i&255)/255*r,t[e++]=(i>>8&255)/255*r,t[e++]=(i>>16&255)/255*r,t[e++]=r}var ps=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){}};var ms=class ni extends at{constructor(t){t={...ni.defaultOptions,...t},super(t),this.enabled=!0,this._state=is.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,typeof t.antialias=="boolean"?this.antialias=t.antialias?"on":"off":this.antialias=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(t,e,r,s){t.applyFilter(this,e,r,s)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(t){let{gpu:e,gl:r,...s}=t,n,o;return e&&(n=W.from(e)),r&&(o=ot.from(r)),new ni({gpuProgram:n,glProgram:o,...s})}};ms.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};var bc=ms;export{Ms as a,An as b,Ts as c,V as d,ft as e,B as f,vi as g,F as h,b as i,A as j,M as k,X as l,Vn as m,T as n,gt as o,it as p,O as q,Ui as r,_t as s,rt as t,k as u,P as v,L as w,$i as x,Wi as y,Se as z,Zi as A,Vt as B,ve as C,Ri as D,Xt as E,H as F,yt as G,Lt as H,R as I,Pe as J,$t as K,rr as L,Ns as M,Ee as N,wt as O,se as P,vl as Q,ne as R,jt as S,ss as T,ns as U,Be as V,st as W,Rt as X,Fe as Y,Vs as Z,ri as _,hr as $,I as aa,N as ba,qt as ca,nt as da,ot as ea,yr as fa,W as ga,Dr as ha,Yr as ia,Ur as ja,Xr as ka,zr as la,Or as ma,Lr as na,Nr as oa,te as pa,qr as qa,Ft as ra,at as sa,cc as ta,cl as ua,is as va,fc as wa,ps as xa,ii as ya,ml as za,xl as Aa,bc as Ba};
269
+ //# sourceMappingURL=chunk-LQU5JKKZ.js.map