@loaders.gl/3d-tiles 4.2.0-alpha.3 → 4.2.0-alpha.5

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 (141) hide show
  1. package/dist/3d-tiles-archive/3d-tiles-archive-archive.js +66 -41
  2. package/dist/3d-tiles-archive/3d-tiles-archive-parser.d.ts +1 -1
  3. package/dist/3d-tiles-archive/3d-tiles-archive-parser.d.ts.map +1 -1
  4. package/dist/3d-tiles-archive/3d-tiles-archive-parser.js +26 -16
  5. package/dist/3d-tiles-archive-loader.js +26 -15
  6. package/dist/cesium-ion-loader.js +34 -30
  7. package/dist/dist.dev.js +1963 -1037
  8. package/dist/dist.min.js +32 -0
  9. package/dist/index.cjs +122 -337
  10. package/dist/index.cjs.map +7 -0
  11. package/dist/index.d.ts +13 -13
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +7 -1
  14. package/dist/lib/classes/helpers/tile-3d-accessor-utils.js +103 -87
  15. package/dist/lib/classes/tile-3d-batch-table-hierarchy.js +179 -155
  16. package/dist/lib/classes/tile-3d-batch-table.js +232 -217
  17. package/dist/lib/classes/tile-3d-feature-table.js +62 -59
  18. package/dist/lib/constants.js +19 -15
  19. package/dist/lib/encoders/encode-3d-tile-batched-model.js +40 -35
  20. package/dist/lib/encoders/encode-3d-tile-composite.js +19 -17
  21. package/dist/lib/encoders/encode-3d-tile-instanced-model.js +32 -31
  22. package/dist/lib/encoders/encode-3d-tile-point-cloud.js +31 -32
  23. package/dist/lib/encoders/encode-3d-tile.js +23 -19
  24. package/dist/lib/encoders/helpers/encode-3d-tile-header.js +23 -23
  25. package/dist/lib/ion/ion.js +55 -54
  26. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts +1 -1
  27. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
  28. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.js +57 -51
  29. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts +1 -1
  30. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
  31. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.js +21 -18
  32. package/dist/lib/parsers/helpers/normalize-3d-tile-positions.js +35 -20
  33. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts +4 -4
  34. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
  35. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +269 -234
  36. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts +2 -2
  37. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts.map +1 -1
  38. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.js +83 -55
  39. package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts +1 -1
  40. package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts.map +1 -1
  41. package/dist/lib/parsers/helpers/parse-3d-tile-header.js +23 -14
  42. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts +1 -1
  43. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
  44. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +82 -54
  45. package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts +2 -2
  46. package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts.map +1 -1
  47. package/dist/lib/parsers/helpers/parse-3d-tile-tables.js +79 -68
  48. package/dist/lib/parsers/helpers/parse-utils.js +19 -14
  49. package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts +2 -2
  50. package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
  51. package/dist/lib/parsers/parse-3d-tile-batched-model.js +21 -17
  52. package/dist/lib/parsers/parse-3d-tile-composite.d.ts +2 -2
  53. package/dist/lib/parsers/parse-3d-tile-composite.d.ts.map +1 -1
  54. package/dist/lib/parsers/parse-3d-tile-composite.js +18 -14
  55. package/dist/lib/parsers/parse-3d-tile-gltf.d.ts +2 -2
  56. package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -1
  57. package/dist/lib/parsers/parse-3d-tile-gltf.js +22 -14
  58. package/dist/lib/parsers/parse-3d-tile-header.d.ts +2 -2
  59. package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
  60. package/dist/lib/parsers/parse-3d-tile-header.js +168 -159
  61. package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts +2 -2
  62. package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts.map +1 -1
  63. package/dist/lib/parsers/parse-3d-tile-instanced-model.js +153 -123
  64. package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts +2 -2
  65. package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
  66. package/dist/lib/parsers/parse-3d-tile-point-cloud.js +380 -174
  67. package/dist/lib/parsers/parse-3d-tile.d.ts +2 -2
  68. package/dist/lib/parsers/parse-3d-tile.d.ts.map +1 -1
  69. package/dist/lib/parsers/parse-3d-tile.js +24 -24
  70. package/dist/lib/utils/obb/s2-corners-to-obb.js +29 -16
  71. package/dist/lib/utils/s2/converters/s2-to-boundary.d.ts +1 -1
  72. package/dist/lib/utils/s2/converters/s2-to-boundary.d.ts.map +1 -1
  73. package/dist/lib/utils/s2/converters/s2-to-boundary.js +55 -35
  74. package/dist/lib/utils/s2/converters/s2-to-obb-points.js +31 -20
  75. package/dist/lib/utils/s2/converters/s2-to-region.d.ts +1 -1
  76. package/dist/lib/utils/s2/converters/s2-to-region.d.ts.map +1 -1
  77. package/dist/lib/utils/s2/converters/s2-to-region.js +51 -35
  78. package/dist/lib/utils/s2/index.d.ts +7 -7
  79. package/dist/lib/utils/s2/index.d.ts.map +1 -1
  80. package/dist/lib/utils/s2/index.js +3 -1
  81. package/dist/lib/utils/s2/s2-geometry-functions.js +19 -5
  82. package/dist/lib/utils/s2/s2-token-functions.js +51 -22
  83. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.d.ts +1 -1
  84. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.d.ts.map +1 -1
  85. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.js +23 -9
  86. package/dist/lib/utils/s2/s2geometry/s2-geometry.js +218 -157
  87. package/dist/lib/utils/version.js +4 -2
  88. package/dist/tile-3d-subtree-loader.d.ts +1 -1
  89. package/dist/tile-3d-subtree-loader.d.ts.map +1 -1
  90. package/dist/tile-3d-subtree-loader.js +15 -10
  91. package/dist/tile-3d-writer.js +19 -14
  92. package/dist/tiles-3d-loader.js +65 -55
  93. package/dist/types.js +3 -1
  94. package/package.json +11 -10
  95. package/dist/3d-tiles-archive/3d-tiles-archive-archive.js.map +0 -1
  96. package/dist/3d-tiles-archive/3d-tiles-archive-parser.js.map +0 -1
  97. package/dist/3d-tiles-archive-loader.js.map +0 -1
  98. package/dist/cesium-ion-loader.js.map +0 -1
  99. package/dist/index.js.map +0 -1
  100. package/dist/lib/classes/helpers/tile-3d-accessor-utils.js.map +0 -1
  101. package/dist/lib/classes/tile-3d-batch-table-hierarchy.js.map +0 -1
  102. package/dist/lib/classes/tile-3d-batch-table.js.map +0 -1
  103. package/dist/lib/classes/tile-3d-feature-table.js.map +0 -1
  104. package/dist/lib/constants.js.map +0 -1
  105. package/dist/lib/encoders/encode-3d-tile-batched-model.js.map +0 -1
  106. package/dist/lib/encoders/encode-3d-tile-composite.js.map +0 -1
  107. package/dist/lib/encoders/encode-3d-tile-instanced-model.js.map +0 -1
  108. package/dist/lib/encoders/encode-3d-tile-point-cloud.js.map +0 -1
  109. package/dist/lib/encoders/encode-3d-tile.js.map +0 -1
  110. package/dist/lib/encoders/helpers/encode-3d-tile-header.js.map +0 -1
  111. package/dist/lib/ion/ion.js.map +0 -1
  112. package/dist/lib/parsers/helpers/normalize-3d-tile-colors.js.map +0 -1
  113. package/dist/lib/parsers/helpers/normalize-3d-tile-normals.js.map +0 -1
  114. package/dist/lib/parsers/helpers/normalize-3d-tile-positions.js.map +0 -1
  115. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +0 -1
  116. package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +0 -1
  117. package/dist/lib/parsers/helpers/parse-3d-tile-header.js.map +0 -1
  118. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js.map +0 -1
  119. package/dist/lib/parsers/helpers/parse-3d-tile-tables.js.map +0 -1
  120. package/dist/lib/parsers/helpers/parse-utils.js.map +0 -1
  121. package/dist/lib/parsers/parse-3d-tile-batched-model.js.map +0 -1
  122. package/dist/lib/parsers/parse-3d-tile-composite.js.map +0 -1
  123. package/dist/lib/parsers/parse-3d-tile-gltf.js.map +0 -1
  124. package/dist/lib/parsers/parse-3d-tile-header.js.map +0 -1
  125. package/dist/lib/parsers/parse-3d-tile-instanced-model.js.map +0 -1
  126. package/dist/lib/parsers/parse-3d-tile-point-cloud.js.map +0 -1
  127. package/dist/lib/parsers/parse-3d-tile.js.map +0 -1
  128. package/dist/lib/utils/obb/s2-corners-to-obb.js.map +0 -1
  129. package/dist/lib/utils/s2/converters/s2-to-boundary.js.map +0 -1
  130. package/dist/lib/utils/s2/converters/s2-to-obb-points.js.map +0 -1
  131. package/dist/lib/utils/s2/converters/s2-to-region.js.map +0 -1
  132. package/dist/lib/utils/s2/index.js.map +0 -1
  133. package/dist/lib/utils/s2/s2-geometry-functions.js.map +0 -1
  134. package/dist/lib/utils/s2/s2-token-functions.js.map +0 -1
  135. package/dist/lib/utils/s2/s2geometry/s2-cell-utils.js.map +0 -1
  136. package/dist/lib/utils/s2/s2geometry/s2-geometry.js.map +0 -1
  137. package/dist/lib/utils/version.js.map +0 -1
  138. package/dist/tile-3d-subtree-loader.js.map +0 -1
  139. package/dist/tile-3d-writer.js.map +0 -1
  140. package/dist/tiles-3d-loader.js.map +0 -1
  141. package/dist/types.js.map +0 -1
@@ -0,0 +1,32 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if (typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if (typeof define === 'function' && define.amd) define([], factory);
5
+ else if (typeof exports === 'object') exports['loaders'] = factory();
6
+ else root['loaders'] = factory();})(globalThis, function () {
7
+ "use strict";var __exports__=(()=>{var Ad=Object.create;var ho=Object.defineProperty;var md=Object.getOwnPropertyDescriptor;var pd=Object.getOwnPropertyNames;var gd=Object.getPrototypeOf,Bd=Object.prototype.hasOwnProperty;var at=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ht=(t,e)=>{for(var r in e)ho(t,r,{get:e[r],enumerable:!0})},lo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pd(e))!Bd.call(t,o)&&o!==r&&ho(t,o,{get:()=>e[o],enumerable:!(n=md(e,o))||n.enumerable});return t},uo=(t,e,r)=>(lo(t,e,"default"),r&&lo(r,e,"default")),mr=(t,e,r)=>(r=t!=null?Ad(gd(t)):{},lo(e||!t||!t.__esModule?ho(r,"default",{value:t,enumerable:!0}):r,t)),xd=t=>lo(ho({},"__esModule",{value:!0}),t);var hn=at((VE,Nc)=>{Nc.exports=globalThis.loaders});var me=at(pt=>{"use strict";var Vx=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function jx(t,e){return Object.prototype.hasOwnProperty.call(t,e)}pt.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)jx(r,n)&&(t[n]=r[n])}}return t};pt.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var Kx={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){var e,r,n,o,s,i;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(i=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)s=t[e],i.set(s,o),o+=s.length;return i}},Xx={arraySet:function(t,e,r,n,o){for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};pt.setTyped=function(t){t?(pt.Buf8=Uint8Array,pt.Buf16=Uint16Array,pt.Buf32=Int32Array,pt.assign(pt,Kx)):(pt.Buf8=Array,pt.Buf16=Array,pt.Buf32=Array,pt.assign(pt,Xx))};pt.setTyped(Vx)});var Pu=at(tn=>{"use strict";var Zx=me(),Yx=4,gu=0,Bu=1,Wx=2;function $r(t){for(var e=t.length;--e>=0;)t[e]=0}var qx=0,Tu=1,$x=2,t_=3,e_=258,ec=29,Zn=256,Vn=Zn+1+ec,qr=30,rc=19,bu=2*Vn+1,nr=15,Za=16,r_=7,nc=256,wu=16,Mu=17,Iu=18,$a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],gs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Su=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],o_=512,pe=new Array((Vn+2)*2);$r(pe);var Qn=new Array(qr*2);$r(Qn);var jn=new Array(o_);$r(jn);var Kn=new Array(e_-t_+1);$r(Kn);var oc=new Array(ec);$r(oc);var Bs=new Array(qr);$r(Bs);function Ya(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}var Fu,Du,Ru;function Wa(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Lu(t){return t<256?jn[t]:jn[256+(t>>>7)]}function Xn(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function bt(t,e,r){t.bi_valid>Za-r?(t.bi_buf|=e<<t.bi_valid&65535,Xn(t,t.bi_buf),t.bi_buf=e>>Za-t.bi_valid,t.bi_valid+=r-Za):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function ne(t,e,r){bt(t,r[e*2],r[e*2+1])}function Ou(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function s_(t){t.bi_valid===16?(Xn(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function i_(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,h,u,d,A,m=0;for(u=0;u<=nr;u++)t.bl_count[u]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<bu;c++)l=t.heap[c],u=r[r[l*2+1]*2+1]+1,u>f&&(u=f,m++),r[l*2+1]=u,!(l>n)&&(t.bl_count[u]++,d=0,l>=a&&(d=i[l-a]),A=r[l*2],t.opt_len+=A*(u+d),s&&(t.static_len+=A*(o[l*2+1]+d)));if(m!==0){do{for(u=f-1;t.bl_count[u]===0;)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[f]--,m-=2}while(m>0);for(u=f;u!==0;u--)for(l=t.bl_count[u];l!==0;)h=t.heap[--c],!(h>n)&&(r[h*2+1]!==u&&(t.opt_len+=(u-r[h*2+1])*r[h*2],r[h*2+1]=u),l--)}}function vu(t,e,r){var n=new Array(nr+1),o=0,s,i;for(s=1;s<=nr;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=e;i++){var a=t[i*2+1];a!==0&&(t[i*2]=Ou(n[a]++,a))}}function a_(){var t,e,r,n,o,s=new Array(nr+1);for(r=0,n=0;n<ec-1;n++)for(oc[n]=r,t=0;t<1<<$a[n];t++)Kn[r++]=n;for(Kn[r-1]=n,o=0,n=0;n<16;n++)for(Bs[n]=o,t=0;t<1<<gs[n];t++)jn[o++]=n;for(o>>=7;n<qr;n++)for(Bs[n]=o<<7,t=0;t<1<<gs[n]-7;t++)jn[256+o++]=n;for(e=0;e<=nr;e++)s[e]=0;for(t=0;t<=143;)pe[t*2+1]=8,t++,s[8]++;for(;t<=255;)pe[t*2+1]=9,t++,s[9]++;for(;t<=279;)pe[t*2+1]=7,t++,s[7]++;for(;t<=287;)pe[t*2+1]=8,t++,s[8]++;for(vu(pe,Vn+1,s),t=0;t<qr;t++)Qn[t*2+1]=5,Qn[t*2]=Ou(t,5);Fu=new Ya(pe,$a,Zn+1,Vn,nr),Du=new Ya(Qn,gs,0,qr,nr),Ru=new Ya(new Array(0),n_,0,rc,r_)}function Gu(t){var e;for(e=0;e<Vn;e++)t.dyn_ltree[e*2]=0;for(e=0;e<qr;e++)t.dyn_dtree[e*2]=0;for(e=0;e<rc;e++)t.bl_tree[e*2]=0;t.dyn_ltree[nc*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Nu(t){t.bi_valid>8?Xn(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function c_(t,e,r,n){Nu(t),n&&(Xn(t,r),Xn(t,~r)),Zx.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function xu(t,e,r,n){var o=e*2,s=r*2;return t[o]<t[s]||t[o]===t[s]&&n[e]<=n[r]}function qa(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&xu(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!xu(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function _u(t,e,r){var n,o,s=0,i,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],o=t.pending_buf[t.l_buf+s],s++,n===0?ne(t,o,e):(i=Kn[o],ne(t,i+Zn+1,e),a=$a[i],a!==0&&(o-=oc[i],bt(t,o,a)),n--,i=Lu(n),ne(t,i,r),a=gs[i],a!==0&&(n-=Bs[i],bt(t,n,a)));while(s<t.last_lit);ne(t,nc,e)}function tc(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,i,a,f=-1,c;for(t.heap_len=0,t.heap_max=bu,i=0;i<s;i++)r[i*2]!==0?(t.heap[++t.heap_len]=f=i,t.depth[i]=0):r[i*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,o&&(t.static_len-=n[c*2+1]);for(e.max_code=f,i=t.heap_len>>1;i>=1;i--)qa(t,r,i);c=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],qa(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=a,r[c*2]=r[i*2]+r[a*2],t.depth[c]=(t.depth[i]>=t.depth[a]?t.depth[i]:t.depth[a])+1,r[i*2+1]=r[a*2+1]=c,t.heap[1]=c++,qa(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],i_(t,e),vu(r,f,t.bl_count)}function Eu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)&&(a<c?t.bl_tree[s*2]+=a:s!==0?(s!==o&&t.bl_tree[s*2]++,t.bl_tree[wu*2]++):a<=10?t.bl_tree[Mu*2]++:t.bl_tree[Iu*2]++,a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4))}function yu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)){if(a<c)do ne(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==o&&(ne(t,s,t.bl_tree),a--),ne(t,wu,t.bl_tree),bt(t,a-3,2)):a<=10?(ne(t,Mu,t.bl_tree),bt(t,a-3,3)):(ne(t,Iu,t.bl_tree),bt(t,a-11,7));a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4)}}function f_(t){var e;for(Eu(t,t.dyn_ltree,t.l_desc.max_code),Eu(t,t.dyn_dtree,t.d_desc.max_code),tc(t,t.bl_desc),e=rc-1;e>=3&&t.bl_tree[Su[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function l_(t,e,r,n){var o;for(bt(t,e-257,5),bt(t,r-1,5),bt(t,n-4,4),o=0;o<n;o++)bt(t,t.bl_tree[Su[o]*2+1],3);yu(t,t.dyn_ltree,e-1),yu(t,t.dyn_dtree,r-1)}function h_(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return gu;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Bu;for(r=32;r<Zn;r++)if(t.dyn_ltree[r*2]!==0)return Bu;return gu}var Cu=!1;function u_(t){Cu||(a_(),Cu=!0),t.l_desc=new Wa(t.dyn_ltree,Fu),t.d_desc=new Wa(t.dyn_dtree,Du),t.bl_desc=new Wa(t.bl_tree,Ru),t.bi_buf=0,t.bi_valid=0,Gu(t)}function Uu(t,e,r,n){bt(t,(qx<<1)+(n?1:0),3),c_(t,e,r,!0)}function d_(t){bt(t,Tu<<1,3),ne(t,nc,pe),s_(t)}function A_(t,e,r,n){var o,s,i=0;t.level>0?(t.strm.data_type===Wx&&(t.strm.data_type=h_(t)),tc(t,t.l_desc),tc(t,t.d_desc),i=f_(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&e!==-1?Uu(t,e,r,n):t.strategy===Yx||s===o?(bt(t,(Tu<<1)+(n?1:0),3),_u(t,pe,Qn)):(bt(t,($x<<1)+(n?1:0),3),l_(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),_u(t,t.dyn_ltree,t.dyn_dtree)),Gu(t),n&&Nu(t)}function m_(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Kn[r]+Zn+1)*2]++,t.dyn_dtree[Lu(e)*2]++),t.last_lit===t.lit_bufsize-1}tn._tr_init=u_;tn._tr_stored_block=Uu;tn._tr_flush_block=A_;tn._tr_tally=m_;tn._tr_align=d_});var sc=at((yD,Hu)=>{"use strict";function p_(t,e,r,n){for(var o=t&65535|0,s=t>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+e[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}Hu.exports=p_});var ic=at((CD,ku)=>{"use strict";function g_(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var B_=g_();function x_(t,e,r,n){var o=B_,s=n+r;t^=-1;for(var i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1}ku.exports=x_});var xs=at((TD,Ju)=>{"use strict";Ju.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Wu=at(ie=>{"use strict";var gt=me(),Nt=Pu(),ju=sc(),Re=ic(),__=xs(),ar=0,E_=1,y_=3,Ne=4,zu=5,se=0,Qu=1,Ut=-2,C_=-3,ac=-5,T_=-1,b_=1,_s=2,w_=3,M_=4,I_=0,S_=2,Ts=8,F_=9,D_=15,R_=8,L_=29,O_=256,fc=O_+1+L_,v_=30,G_=19,N_=2*fc+1,U_=15,J=3,ve=258,Kt=ve+J+1,P_=32,bs=42,lc=69,Es=73,ys=91,Cs=103,or=113,Wn=666,st=1,qn=2,sr=3,nn=4,H_=3;function Ge(t,e){return t.msg=__[e],e}function Vu(t){return(t<<1)-(t>4?9:0)}function Oe(t){for(var e=t.length;--e>=0;)t[e]=0}function Le(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(gt.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function lt(t,e){Nt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Le(t.strm)}function V(t,e){t.pending_buf[t.pending++]=e}function Yn(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function k_(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,gt.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=ju(t.adler,e,o,r):t.state.wrap===2&&(t.adler=Re(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function Ku(t,e){var r=t.max_chain_length,n=t.strstart,o,s,i=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,c=t.window,l=t.w_mask,h=t.prev,u=t.strstart+ve,d=c[n+i-1],A=c[n+i];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+i]!==A||c[o+i-1]!==d||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<u);if(s=ve-(u-n),n=u-ve,s>i){if(t.match_start=e,i=s,s>=a)break;d=c[n+i-1],A=c[n+i]}}while((e=h[e&l])>f&&--r!==0);return i<=t.lookahead?i:t.lookahead}function ir(t){var e=t.w_size,r,n,o,s,i;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)){gt.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do o=t.head[--r],t.head[r]=o>=e?o-e:0;while(--n);n=e,r=n;do o=t.prev[--r],t.prev[r]=o>=e?o-e:0;while(--n);s+=e}if(t.strm.avail_in===0)break;if(n=k_(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=J)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+J-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<J)););}while(t.lookahead<Kt&&t.strm.avail_in!==0)}function J_(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ir(t),t.lookahead===0&&e===ar)return st;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,lt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Kt&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):(t.strstart>t.block_start&&(lt(t,!1),t.strm.avail_out===0),st)}function cc(t,e){for(var r,n;;){if(t.lookahead<Kt){if(ir(t),t.lookahead<Kt&&e===ar)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Ku(t,r)),t.match_length>=J)if(n=Nt._tr_tally(t,t.strstart-t.match_start,t.match_length-J),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=J){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=Nt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=t.strstart<J-1?t.strstart:J-1,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function en(t,e){for(var r,n,o;;){if(t.lookahead<Kt){if(ir(t),t.lookahead<Kt&&e===ar)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=J-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Ku(t,r),t.match_length<=5&&(t.strategy===b_||t.match_length===J&&t.strstart-t.match_start>4096)&&(t.match_length=J-1)),t.prev_length>=J&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-J,n=Nt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-J),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=J-1,t.strstart++,n&&(lt(t,!1),t.strm.avail_out===0))return st}else if(t.match_available){if(n=Nt._tr_tally(t,0,t.window[t.strstart-1]),n&&lt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return st}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Nt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<J-1?t.strstart:J-1,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function z_(t,e){for(var r,n,o,s,i=t.window;;){if(t.lookahead<=ve){if(ir(t),t.lookahead<=ve&&e===ar)return st;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=J&&t.strstart>0&&(o=t.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=t.strstart+ve;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);t.match_length=ve-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=J?(r=Nt._tr_tally(t,1,t.match_length-J),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Nt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function Q_(t,e){for(var r;;){if(t.lookahead===0&&(ir(t),t.lookahead===0)){if(e===ar)return st;break}if(t.match_length=0,r=Nt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function oe(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}var rn;rn=[new oe(0,0,0,0,J_),new oe(4,4,8,4,cc),new oe(4,5,16,8,cc),new oe(4,6,32,32,cc),new oe(4,4,16,16,en),new oe(8,16,32,32,en),new oe(8,16,128,128,en),new oe(8,32,128,256,en),new oe(32,128,258,1024,en),new oe(32,258,258,4096,en)];function V_(t){t.window_size=2*t.w_size,Oe(t.head),t.max_lazy_match=rn[t.level].max_lazy,t.good_match=rn[t.level].good_length,t.nice_match=rn[t.level].nice_length,t.max_chain_length=rn[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=J-1,t.match_available=0,t.ins_h=0}function j_(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ts,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new gt.Buf16(N_*2),this.dyn_dtree=new gt.Buf16((2*v_+1)*2),this.bl_tree=new gt.Buf16((2*G_+1)*2),Oe(this.dyn_ltree),Oe(this.dyn_dtree),Oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new gt.Buf16(U_+1),this.heap=new gt.Buf16(2*fc+1),Oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new gt.Buf16(2*fc+1),Oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Xu(t){var e;return!t||!t.state?Ge(t,Ut):(t.total_in=t.total_out=0,t.data_type=S_,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?bs:or,t.adler=e.wrap===2?0:1,e.last_flush=ar,Nt._tr_init(e),se)}function Zu(t){var e=Xu(t);return e===se&&V_(t.state),e}function K_(t,e){return!t||!t.state||t.state.wrap!==2?Ut:(t.state.gzhead=e,se)}function Yu(t,e,r,n,o,s){if(!t)return Ut;var i=1;if(e===T_&&(e=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>F_||r!==Ts||n<8||n>15||e<0||e>9||s<0||s>M_)return Ge(t,Ut);n===8&&(n=9);var a=new j_;return t.state=a,a.strm=t,a.wrap=i,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+J-1)/J),a.window=new gt.Buf8(a.w_size*2),a.head=new gt.Buf16(a.hash_size),a.prev=new gt.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new gt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=s,a.method=r,Zu(t)}function X_(t,e){return Yu(t,e,Ts,D_,R_,I_)}function Z_(t,e){var r,n,o,s;if(!t||!t.state||e>zu||e<0)return t?Ge(t,Ut):Ut;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Wn&&e!==Ne)return Ge(t,t.avail_out===0?ac:Ut);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===bs)if(n.wrap===2)t.adler=0,V(n,31),V(n,139),V(n,8),n.gzhead?(V(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),V(n,n.gzhead.time&255),V(n,n.gzhead.time>>8&255),V(n,n.gzhead.time>>16&255),V(n,n.gzhead.time>>24&255),V(n,n.level===9?2:n.strategy>=_s||n.level<2?4:0),V(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(V(n,n.gzhead.extra.length&255),V(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Re(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=lc):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,n.level===9?2:n.strategy>=_s||n.level<2?4:0),V(n,H_),n.status=or);else{var i=Ts+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=_s||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=P_),i+=31-i%31,n.status=or,Yn(n,i),n.strstart!==0&&(Yn(n,t.adler>>>16),Yn(n,t.adler&65535)),t.adler=1}if(n.status===lc)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),Le(t),o=n.pending,n.pending===n.pending_buf_size));)V(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Es)}else n.status=Es;if(n.status===Es)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),Le(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,V(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=ys)}else n.status=ys;if(n.status===ys)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),Le(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,V(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=Cs)}else n.status=Cs;if(n.status===Cs&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Le(t),n.pending+2<=n.pending_buf_size&&(V(n,t.adler&255),V(n,t.adler>>8&255),t.adler=0,n.status=or)):n.status=or),n.pending!==0){if(Le(t),t.avail_out===0)return n.last_flush=-1,se}else if(t.avail_in===0&&Vu(e)<=Vu(r)&&e!==Ne)return Ge(t,ac);if(n.status===Wn&&t.avail_in!==0)return Ge(t,ac);if(t.avail_in!==0||n.lookahead!==0||e!==ar&&n.status!==Wn){var f=n.strategy===_s?Q_(n,e):n.strategy===w_?z_(n,e):rn[n.level].func(n,e);if((f===sr||f===nn)&&(n.status=Wn),f===st||f===sr)return t.avail_out===0&&(n.last_flush=-1),se;if(f===qn&&(e===E_?Nt._tr_align(n):e!==zu&&(Nt._tr_stored_block(n,0,0,!1),e===y_&&(Oe(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Le(t),t.avail_out===0))return n.last_flush=-1,se}return e!==Ne?se:n.wrap<=0?Qu:(n.wrap===2?(V(n,t.adler&255),V(n,t.adler>>8&255),V(n,t.adler>>16&255),V(n,t.adler>>24&255),V(n,t.total_in&255),V(n,t.total_in>>8&255),V(n,t.total_in>>16&255),V(n,t.total_in>>24&255)):(Yn(n,t.adler>>>16),Yn(n,t.adler&65535)),Le(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?se:Qu)}function Y_(t){var e;return!t||!t.state?Ut:(e=t.state.status,e!==bs&&e!==lc&&e!==Es&&e!==ys&&e!==Cs&&e!==or&&e!==Wn?Ge(t,Ut):(t.state=null,e===or?Ge(t,C_):se))}function W_(t,e){var r=e.length,n,o,s,i,a,f,c,l;if(!t||!t.state||(n=t.state,i=n.wrap,i===2||i===1&&n.status!==bs||n.lookahead))return Ut;for(i===1&&(t.adler=ju(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(Oe(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new gt.Buf8(n.w_size),gt.arraySet(l,e,r-n.w_size,n.w_size,0),e=l,r=n.w_size),a=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,ir(n);n.lookahead>=J;){o=n.strstart,s=n.lookahead-(J-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+J-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=J-1,ir(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=J-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=i,se}ie.deflateInit=X_;ie.deflateInit2=Yu;ie.deflateReset=Zu;ie.deflateResetKeep=Xu;ie.deflateSetHeader=K_;ie.deflate=Z_;ie.deflateEnd=Y_;ie.deflateSetDictionary=W_;ie.deflateInfo="pako deflate (from Nodeca project)"});var hc=at(on=>{"use strict";var ws=me(),qu=!0,$u=!0;try{String.fromCharCode.apply(null,[0])}catch{qu=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{$u=!1}var $n=new ws.Buf8(256);for(ge=0;ge<256;ge++)$n[ge]=ge>=252?6:ge>=248?5:ge>=240?4:ge>=224?3:ge>=192?2:1;var ge;$n[254]=$n[254]=1;on.string2buf=function(t){var e,r,n,o,s,i=t.length,a=0;for(o=0;o<i;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new ws.Buf8(a),s=0,o=0;s<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function t0(t,e){if(e<65534&&(t.subarray&&$u||!t.subarray&&qu))return String.fromCharCode.apply(null,ws.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}on.buf2binstring=function(t){return t0(t,t.length)};on.binstring2buf=function(t){for(var e=new ws.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};on.buf2string=function(t,e){var r,n,o,s,i=e||t.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=t[r++],o<128){a[n++]=o;continue}if(s=$n[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|t[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return t0(a,n)};on.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+$n[t[r]]>e?r:e}});var uc=at((MD,e0)=>{"use strict";function q_(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e0.exports=q_});var s0=at(ro=>{"use strict";var to=Wu(),eo=me(),Ac=hc(),mc=xs(),$_=uc(),o0=Object.prototype.toString,tE=0,dc=4,sn=0,r0=1,n0=2,eE=-1,rE=0,nE=8;function cr(t){if(!(this instanceof cr))return new cr(t);this.options=eo.assign({level:eE,method:nE,chunkSize:16384,windowBits:15,memLevel:8,strategy:rE,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $_,this.strm.avail_out=0;var r=to.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==sn)throw new Error(mc[r]);if(e.header&&to.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=Ac.string2buf(e.dictionary):o0.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=to.deflateSetDictionary(this.strm,n),r!==sn)throw new Error(mc[r]);this._dict_set=!0}}cr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=e===~~e?e:e===!0?dc:tE,typeof t=="string"?r.input=Ac.string2buf(t):o0.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new eo.Buf8(n),r.next_out=0,r.avail_out=n),o=to.deflate(r,s),o!==r0&&o!==sn)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===dc||s===n0))&&(this.options.to==="string"?this.onData(Ac.buf2binstring(eo.shrinkBuf(r.output,r.next_out))):this.onData(eo.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==r0);return s===dc?(o=to.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===sn):(s===n0&&(this.onEnd(sn),r.avail_out=0),!0)};cr.prototype.onData=function(t){this.chunks.push(t)};cr.prototype.onEnd=function(t){t===sn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=eo.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pc(t,e){var r=new cr(e);if(r.push(t,!0),r.err)throw r.msg||mc[r.err];return r.result}function oE(t,e){return e=e||{},e.raw=!0,pc(t,e)}function sE(t,e){return e=e||{},e.gzip=!0,pc(t,e)}ro.Deflate=cr;ro.deflate=pc;ro.deflateRaw=oE;ro.gzip=sE});var a0=at((SD,i0)=>{"use strict";var Ms=30,iE=12;i0.exports=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,g,_,y,T,b,C,I,M,L,B,p,x;n=e.state,o=e.next_in,p=e.input,s=o+(e.avail_in-5),i=e.next_out,x=e.output,a=i-(r-e.avail_out),f=i+(e.avail_out-257),c=n.dmax,l=n.wsize,h=n.whave,u=n.wnext,d=n.window,A=n.hold,m=n.bits,g=n.lencode,_=n.distcode,y=(1<<n.lenbits)-1,T=(1<<n.distbits)-1;t:do{m<15&&(A+=p[o++]<<m,m+=8,A+=p[o++]<<m,m+=8),b=g[A&y];e:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C===0)x[i++]=b&65535;else if(C&16){I=b&65535,C&=15,C&&(m<C&&(A+=p[o++]<<m,m+=8),I+=A&(1<<C)-1,A>>>=C,m-=C),m<15&&(A+=p[o++]<<m,m+=8,A+=p[o++]<<m,m+=8),b=_[A&T];r:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C&16){if(M=b&65535,C&=15,m<C&&(A+=p[o++]<<m,m+=8,m<C&&(A+=p[o++]<<m,m+=8)),M+=A&(1<<C)-1,M>c){e.msg="invalid distance too far back",n.mode=Ms;break t}if(A>>>=C,m-=C,C=i-a,M>C){if(C=M-C,C>h&&n.sane){e.msg="invalid distance too far back",n.mode=Ms;break t}if(L=0,B=d,u===0){if(L+=l-C,C<I){I-=C;do x[i++]=d[L++];while(--C);L=i-M,B=x}}else if(u<C){if(L+=l+u-C,C-=u,C<I){I-=C;do x[i++]=d[L++];while(--C);if(L=0,u<I){C=u,I-=C;do x[i++]=d[L++];while(--C);L=i-M,B=x}}}else if(L+=u-C,C<I){I-=C;do x[i++]=d[L++];while(--C);L=i-M,B=x}for(;I>2;)x[i++]=B[L++],x[i++]=B[L++],x[i++]=B[L++],I-=3;I&&(x[i++]=B[L++],I>1&&(x[i++]=B[L++]))}else{L=i-M;do x[i++]=x[L++],x[i++]=x[L++],x[i++]=x[L++],I-=3;while(I>2);I&&(x[i++]=x[L++],I>1&&(x[i++]=x[L++]))}}else if(C&64){e.msg="invalid distance code",n.mode=Ms;break t}else{b=_[(b&65535)+(A&(1<<C)-1)];continue r}break}}else if(C&64)if(C&32){n.mode=iE;break t}else{e.msg="invalid literal/length code",n.mode=Ms;break t}else{b=g[(b&65535)+(A&(1<<C)-1)];continue e}break}}while(o<s&&i<f);I=m>>3,o-=I,m-=I<<3,A&=(1<<m)-1,e.next_in=o,e.next_out=i,e.avail_in=o<s?5+(s-o):5-(o-s),e.avail_out=i<f?257+(f-i):257-(i-f),n.hold=A,n.bits=m}});var A0=at((FD,d0)=>{"use strict";var c0=me(),an=15,f0=852,l0=592,h0=0,gc=1,u0=2,aE=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],cE=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],fE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],lE=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];d0.exports=function(e,r,n,o,s,i,a,f){var c=f.bits,l=0,h=0,u=0,d=0,A=0,m=0,g=0,_=0,y=0,T=0,b,C,I,M,L,B=null,p=0,x,E=new c0.Buf16(an+1),U=new c0.Buf16(an+1),N=null,P=0,v,it,At;for(l=0;l<=an;l++)E[l]=0;for(h=0;h<o;h++)E[r[n+h]]++;for(A=c,d=an;d>=1&&E[d]===0;d--);if(A>d&&(A=d),d===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,f.bits=1,0;for(u=1;u<d&&E[u]===0;u++);for(A<u&&(A=u),_=1,l=1;l<=an;l++)if(_<<=1,_-=E[l],_<0)return-1;if(_>0&&(e===h0||d!==1))return-1;for(U[1]=0,l=1;l<an;l++)U[l+1]=U[l]+E[l];for(h=0;h<o;h++)r[n+h]!==0&&(a[U[r[n+h]]++]=h);if(e===h0?(B=N=a,x=19):e===gc?(B=aE,p-=257,N=cE,P-=257,x=256):(B=fE,N=lE,x=-1),T=0,h=0,l=u,L=i,m=A,g=0,I=-1,y=1<<A,M=y-1,e===gc&&y>f0||e===u0&&y>l0)return 1;for(;;){v=l-g,a[h]<x?(it=0,At=a[h]):a[h]>x?(it=N[P+a[h]],At=B[p+a[h]]):(it=32+64,At=0),b=1<<l-g,C=1<<m,u=C;do C-=b,s[L+(T>>g)+C]=v<<24|it<<16|At|0;while(C!==0);for(b=1<<l-1;T&b;)b>>=1;if(b!==0?(T&=b-1,T+=b):T=0,h++,--E[l]===0){if(l===d)break;l=r[n+a[h]]}if(l>A&&(T&M)!==I){for(g===0&&(g=A),L+=u,m=l-g,_=1<<m;m+g<d&&(_-=E[m+g],!(_<=0));)m++,_<<=1;if(y+=1<<m,e===gc&&y>f0||e===u0&&y>l0)return 1;I=T&M,s[I]=A<<24|m<<16|L-i|0}}return T!==0&&(s[L+T]=l-g<<24|64<<16|0),f.bits=A,0}});var Z0=at(Xt=>{"use strict";var St=me(),Cc=sc(),ae=ic(),hE=a0(),no=A0(),uE=0,H0=1,k0=2,m0=4,dE=5,Is=6,fr=0,AE=1,mE=2,Pt=-2,J0=-3,Tc=-4,pE=-5,p0=8,z0=1,g0=2,B0=3,x0=4,_0=5,E0=6,y0=7,C0=8,T0=9,b0=10,Ds=11,Be=12,Bc=13,w0=14,xc=15,M0=16,I0=17,S0=18,F0=19,Ss=20,Fs=21,D0=22,R0=23,L0=24,O0=25,v0=26,_c=27,G0=28,N0=29,tt=30,bc=31,gE=32,BE=852,xE=592,_E=15,EE=_E;function U0(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function yE(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new St.Buf16(320),this.work=new St.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Q0(t){var e;return!t||!t.state?Pt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=z0,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new St.Buf32(BE),e.distcode=e.distdyn=new St.Buf32(xE),e.sane=1,e.back=-1,fr)}function V0(t){var e;return!t||!t.state?Pt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Q0(t))}function j0(t,e){var r,n;return!t||!t.state||(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Pt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,V0(t))}function K0(t,e){var r,n;return t?(n=new yE,t.state=n,n.window=null,r=j0(t,e),r!==fr&&(t.state=null),r):Pt}function CE(t){return K0(t,EE)}var P0=!0,Ec,yc;function TE(t){if(P0){var e;for(Ec=new St.Buf32(512),yc=new St.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(no(H0,t.lens,0,288,Ec,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;no(k0,t.lens,0,32,yc,0,t.work,{bits:5}),P0=!1}t.lencode=Ec,t.lenbits=9,t.distcode=yc,t.distbits=5}function X0(t,e,r,n){var o,s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new St.Buf8(s.wsize)),n>=s.wsize?(St.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),St.arraySet(s.window,e,r-n,o,s.wnext),n-=o,n?(St.arraySet(s.window,e,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function bE(t,e){var r,n,o,s,i,a,f,c,l,h,u,d,A,m,g=0,_,y,T,b,C,I,M,L,B=new St.Buf8(4),p,x,E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Pt;r=t.state,r.mode===Be&&(r.mode=Bc),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,h=a,u=f,L=fr;t:for(;;)switch(r.mode){case z0:if(r.wrap===0){r.mode=Bc;break}for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,B[0]=c&255,B[1]=c>>>8&255,r.check=ae(r.check,B,2,0),c=0,l=0,r.mode=g0;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=tt;break}if((c&15)!==p0){t.msg="unknown compression method",r.mode=tt;break}if(c>>>=4,l-=4,M=(c&15)+8,r.wbits===0)r.wbits=M;else if(M>r.wbits){t.msg="invalid window size",r.mode=tt;break}r.dmax=1<<M,t.adler=r.check=1,r.mode=c&512?b0:Be,c=0,l=0;break;case g0:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==p0){t.msg="unknown compression method",r.mode=tt;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=tt;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=ae(r.check,B,2,0)),c=0,l=0,r.mode=B0;case B0:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,B[2]=c>>>16&255,B[3]=c>>>24&255,r.check=ae(r.check,B,4,0)),c=0,l=0,r.mode=x0;case x0:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=ae(r.check,B,2,0)),c=0,l=0,r.mode=_0;case _0:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=ae(r.check,B,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=E0;case E0:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(M=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),St.arraySet(r.head.extra,n,s,d,M)),r.flags&512&&(r.check=ae(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break t;r.length=0,r.mode=y0;case y0:if(r.flags&2048){if(a===0)break t;d=0;do M=n[s+d++],r.head&&M&&r.length<65536&&(r.head.name+=String.fromCharCode(M));while(M&&d<a);if(r.flags&512&&(r.check=ae(r.check,n,d,s)),a-=d,s+=d,M)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=C0;case C0:if(r.flags&4096){if(a===0)break t;d=0;do M=n[s+d++],r.head&&M&&r.length<65536&&(r.head.comment+=String.fromCharCode(M));while(M&&d<a);if(r.flags&512&&(r.check=ae(r.check,n,d,s)),a-=d,s+=d,M)break t}else r.head&&(r.head.comment=null);r.mode=T0;case T0:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=tt;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Be;break;case b0:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}t.adler=r.check=U0(c),c=0,l=0,r.mode=Ds;case Ds:if(r.havedict===0)return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,mE;t.adler=r.check=1,r.mode=Be;case Be:if(e===dE||e===Is)break t;case Bc:if(r.last){c>>>=l&7,l-=l&7,r.mode=_c;break}for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=w0;break;case 1:if(TE(r),r.mode=Ss,e===Is){c>>>=2,l-=2;break t}break;case 2:r.mode=I0;break;case 3:t.msg="invalid block type",r.mode=tt}c>>>=2,l-=2;break;case w0:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=tt;break}if(r.length=c&65535,c=0,l=0,r.mode=xc,e===Is)break t;case xc:r.mode=M0;case M0:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;St.arraySet(o,n,s,d,i),a-=d,s+=d,f-=d,i+=d,r.length-=d;break}r.mode=Be;break;case I0:for(;l<14;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=tt;break}r.have=0,r.mode=S0;case S0:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.lens[E[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,p={bits:r.lenbits},L=no(uE,r.lens,0,19,r.lencode,0,r.work,p),r.lenbits=p.bits,L){t.msg="invalid code lengths set",r.mode=tt;break}r.have=0,r.mode=F0;case F0:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[c&(1<<r.lenbits)-1],_=g>>>24,y=g>>>16&255,T=g&65535,!(_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(T<16)c>>>=_,l-=_,r.lens[r.have++]=T;else{if(T===16){for(x=_+2;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c>>>=_,l-=_,r.have===0){t.msg="invalid bit length repeat",r.mode=tt;break}M=r.lens[r.have-1],d=3+(c&3),c>>>=2,l-=2}else if(T===17){for(x=_+3;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=_,l-=_,M=0,d=3+(c&7),c>>>=3,l-=3}else{for(x=_+7;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=_,l-=_,M=0,d=11+(c&127),c>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=tt;break}for(;d--;)r.lens[r.have++]=M}}if(r.mode===tt)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=tt;break}if(r.lenbits=9,p={bits:r.lenbits},L=no(H0,r.lens,0,r.nlen,r.lencode,0,r.work,p),r.lenbits=p.bits,L){t.msg="invalid literal/lengths set",r.mode=tt;break}if(r.distbits=6,r.distcode=r.distdyn,p={bits:r.distbits},L=no(k0,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,p),r.distbits=p.bits,L){t.msg="invalid distances set",r.mode=tt;break}if(r.mode=Ss,e===Is)break t;case Ss:r.mode=Fs;case Fs:if(a>=6&&f>=258){t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,hE(t,u),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===Be&&(r.back=-1);break}for(r.back=0;g=r.lencode[c&(1<<r.lenbits)-1],_=g>>>24,y=g>>>16&255,T=g&65535,!(_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(y&&!(y&240)){for(b=_,C=y,I=T;g=r.lencode[I+((c&(1<<b+C)-1)>>b)],_=g>>>24,y=g>>>16&255,T=g&65535,!(b+_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=_,l-=_,r.back+=_,r.length=T,y===0){r.mode=v0;break}if(y&32){r.back=-1,r.mode=Be;break}if(y&64){t.msg="invalid literal/length code",r.mode=tt;break}r.extra=y&15,r.mode=D0;case D0:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=R0;case R0:for(;g=r.distcode[c&(1<<r.distbits)-1],_=g>>>24,y=g>>>16&255,T=g&65535,!(_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(!(y&240)){for(b=_,C=y,I=T;g=r.distcode[I+((c&(1<<b+C)-1)>>b)],_=g>>>24,y=g>>>16&255,T=g&65535,!(b+_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=_,l-=_,r.back+=_,y&64){t.msg="invalid distance code",r.mode=tt;break}r.offset=T,r.extra=y&15,r.mode=L0;case L0:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=tt;break}r.mode=O0;case O0:if(f===0)break t;if(d=u-f,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=tt;break}d>r.wnext?(d-=r.wnext,A=r.wsize-d):A=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=o,A=i-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do o[i++]=m[A++];while(--d);r.length===0&&(r.mode=Fs);break;case v0:if(f===0)break t;o[i++]=r.length,f--,r.mode=Fs;break;case _c:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[s++]<<l,l+=8}if(u-=f,t.total_out+=u,r.total+=u,u&&(t.adler=r.check=r.flags?ae(r.check,o,u,i-u):Cc(r.check,o,u,i-u)),u=f,(r.flags?c:U0(c))!==r.check){t.msg="incorrect data check",r.mode=tt;break}c=0,l=0}r.mode=G0;case G0:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=tt;break}c=0,l=0}r.mode=N0;case N0:L=AE;break t;case tt:L=J0;break t;case bc:return Tc;case gE:default:return Pt}return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||u!==t.avail_out&&r.mode<tt&&(r.mode<_c||e!==m0))&&X0(t,t.output,t.next_out,u-t.avail_out)?(r.mode=bc,Tc):(h-=t.avail_in,u-=t.avail_out,t.total_in+=h,t.total_out+=u,r.total+=u,r.wrap&&u&&(t.adler=r.check=r.flags?ae(r.check,o,u,t.next_out-u):Cc(r.check,o,u,t.next_out-u)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Be?128:0)+(r.mode===Ss||r.mode===xc?256:0),(h===0&&u===0||e===m0)&&L===fr&&(L=pE),L)}function wE(t){if(!t||!t.state)return Pt;var e=t.state;return e.window&&(e.window=null),t.state=null,fr}function ME(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Pt:(r.head=e,e.done=!1,fr)}function IE(t,e){var r=e.length,n,o,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==Ds)?Pt:n.mode===Ds&&(o=1,o=Cc(o,e,r,0),o!==n.check)?J0:(s=X0(t,e,r,r),s?(n.mode=bc,Tc):(n.havedict=1,fr))}Xt.inflateReset=V0;Xt.inflateReset2=j0;Xt.inflateResetKeep=Q0;Xt.inflateInit=CE;Xt.inflateInit2=K0;Xt.inflate=bE;Xt.inflateEnd=wE;Xt.inflateGetHeader=ME;Xt.inflateSetDictionary=IE;Xt.inflateInfo="pako inflate (from Nodeca project)"});var wc=at((RD,Y0)=>{"use strict";Y0.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var q0=at((LD,W0)=>{"use strict";function SE(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}W0.exports=SE});var td=at(so=>{"use strict";var cn=Z0(),oo=me(),Rs=hc(),nt=wc(),Mc=xs(),FE=uc(),DE=q0(),$0=Object.prototype.toString;function lr(t){if(!(this instanceof lr))return new lr(t);this.options=oo.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new FE,this.strm.avail_out=0;var r=cn.inflateInit2(this.strm,e.windowBits);if(r!==nt.Z_OK)throw new Error(Mc[r]);if(this.header=new DE,cn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Rs.string2buf(e.dictionary):$0.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cn.inflateSetDictionary(this.strm,e.dictionary),r!==nt.Z_OK)))throw new Error(Mc[r])}lr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,f,c,l=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?nt.Z_FINISH:nt.Z_NO_FLUSH,typeof t=="string"?r.input=Rs.binstring2buf(t):$0.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new oo.Buf8(n),r.next_out=0,r.avail_out=n),s=cn.inflate(r,nt.Z_NO_FLUSH),s===nt.Z_NEED_DICT&&o&&(s=cn.inflateSetDictionary(this.strm,o)),s===nt.Z_BUF_ERROR&&l===!0&&(s=nt.Z_OK,l=!1),s!==nt.Z_STREAM_END&&s!==nt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===nt.Z_STREAM_END||r.avail_in===0&&(i===nt.Z_FINISH||i===nt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=Rs.utf8border(r.output,r.next_out),f=r.next_out-a,c=Rs.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&oo.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(oo.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(l=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==nt.Z_STREAM_END);return s===nt.Z_STREAM_END&&(i=nt.Z_FINISH),i===nt.Z_FINISH?(s=cn.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===nt.Z_OK):(i===nt.Z_SYNC_FLUSH&&(this.onEnd(nt.Z_OK),r.avail_out=0),!0)};lr.prototype.onData=function(t){this.chunks.push(t)};lr.prototype.onEnd=function(t){t===nt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=oo.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Ic(t,e){var r=new lr(e);if(r.push(t,!0),r.err)throw r.msg||Mc[r.err];return r.result}function RE(t,e){return e=e||{},e.raw=!0,Ic(t,e)}so.Inflate=lr;so.inflate=Ic;so.inflateRaw=RE;so.ungzip=Ic});var nd=at((vD,rd)=>{"use strict";var LE=me().assign,OE=s0(),vE=td(),GE=wc(),ed={};LE(ed,OE,vE,GE);rd.exports=ed});var od=at(()=>{});var io={};ht(io,{CesiumIonLoader:()=>za,TILE3D_TYPE:()=>Et,Tile3DBatchTable:()=>de,Tile3DFeatureTable:()=>zt,Tile3DSubtreeLoader:()=>Jr,Tile3DWriter:()=>ud,Tiles3DArchive:()=>fn,Tiles3DArchiveFileLoader:()=>id,Tiles3DLoader:()=>tr,_getIonTilesetMetadata:()=>As});uo(io,mr(hn(),1));async function Ht(t,e,r,n){return n._parse(t,e,r,n)}function z(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var Yt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},_d=Yt.self||Yt.window||Yt.global||{},Ed=Yt.window||Yt.self||Yt.global||{},yd=Yt.global||Yt.self||Yt.window||{},Cd=Yt.document||{};var xt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Td=Uc&&parseFloat(Uc[1])||0;function bd(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-alpha.4"),globalThis._loadersgl_.version}var Pc=bd();function Hc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var Wt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},WE=Wt.self||Wt.window||Wt.global||{},qE=Wt.window||Wt.self||Wt.global||{},$E=Wt.global||Wt.self||Wt.window||{},t2=Wt.document||{};var pr=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ao=typeof importScripts=="function",e2=typeof window<"u"&&typeof window.orientation<"u",kc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),r2=kc&&parseFloat(kc[1])||0;var _t={};var vs={};async function qt(t,e=null,r={},n=null){return e&&(t=Jc(t,e,r,n)),vs[t]=vs[t]||wd(t),await vs[t]}function Jc(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let o=r.modules||{};return o[n]?o[n]:pr?r.CDN?(Hc(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Pc}/dist/libs/${n}`):Ao?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function wd(t){if(t.endsWith("wasm"))return await Id(t);if(!pr)try{return _t&&void 0&&await(void 0)(t)}catch(r){return console.error(r),null}if(Ao)return importScripts(t);let e=await Sd(t);return Md(e,t)}function Md(t,e){if(!pr)return void 0&&(void 0)(t,e);if(Ao)return eval.call(globalThis,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function Id(t){return pr||!void 0||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await(void 0)(t)}async function Sd(t){return pr||!void 0||t.startsWith("http")?await(await fetch(t)).text():await(void 0)(t)}function Qc(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?zc(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?zc(t,0,e):""}function zc(t,e,r){if(t.byteLength<=e+r)return"";let n=new DataView(t),o="";for(let s=0;s<r;s++)o+=String.fromCharCode(n.getUint8(e+s));return o}function Gs(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${Qc(t)}"`)}}function _e(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),o=new Uint8Array(e);for(let s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function gr(...t){return Vc(t)}function Vc(t){let e=t.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=e.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.byteLength;return n.buffer}function ke(t,e,r){let n=r!==void 0?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function wt(t,e){return z(t>=0),z(e>0),t+(e-1)&~(e-1)}function Ns(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{let o=t.byteOffset,s=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,o,s)}return e.set(n,r),r+wt(n.byteLength,4)}function Us(t,e){let r=t.length,o=Math.ceil(r/e)*e-r,s="";for(let i=0;i<o;++i)s+=" ";return t+s}function Br(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r.charCodeAt(o));return e+n}function un(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r[o]);return e+n}function jc(t,e,r,n){let o=wt(r.byteLength,n),s=o-r.byteLength;if(t){let i=new Uint8Array(t.buffer,t.byteOffset+e,r.byteLength),a=new Uint8Array(r);i.set(a);for(let f=0;f<s;++f)t.setUint8(e+r.byteLength+f,32)}return e+=o,e}function mo(t,e,r,n){let s=new TextEncoder().encode(r);return e=jc(t,e,s,n),e}async function dn(t){let e=[];for await(let r of t)e.push(r);return gr(...e)}function Ee(t){return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(t)}function Ps(t,e){if(Ee(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hs(t){var e=Ps(t,"string");return Ee(e)==="symbol"?e:String(e)}function X(t,e,r){return e=Hs(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kc(t){return t&&typeof t=="object"&&t.isBuffer}function xr(t){if(Kc(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){let e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function _r(t){return e=>new Promise((r,n)=>t(e,(o,s)=>o?n(o):r(s)))}var Er={};ht(Er,{dirname:()=>Dd,filename:()=>Fd,join:()=>Rd,resolve:()=>Ld});function Xc(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let t=window.location?.pathname;return t?.slice(0,t.lastIndexOf("/")+1)||""}function Fd(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function Dd(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}function Rd(...t){let e="/";return t=t.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${e}`),"")),n!==t.length-1&&(r=r.replace(new RegExp(`${e}$`),"")),r)),t.join(e)}function Ld(...t){let e=[];for(let s=0;s<t.length;s++)e[s]=t[s];let r="",n=!1,o;for(let s=e.length-1;s>=-1&&!n;s--){let i;s>=0?i=e[s]:(o===void 0&&(o=Xc()),i=o),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===An)}return r=Od(r,!n),n?`/${r}`:r.length>0?r:"."}var An=47,ks=46;function Od(t,e){let r="",n=-1,o=0,s,i=!1;for(let a=0;a<=t.length;++a){if(a<t.length)s=t.charCodeAt(a);else{if(s===An)break;s=An}if(s===An){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==ks||r.charCodeAt(r.length-2)!==ks){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==An;--c);if(c!==f){r=c===-1?"":r.slice(0,c),n=a,o=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,o=0,i=!1;continue}}e&&(r.length>0?r+="/..":r="..",i=!0)}else{let f=t.slice(n+1,a);r.length>0?r+=`/${f}`:r=f,i=!1}n=a,o=0}else s===ks&&o!==-1?++o:o=-1}return r}var mn=new Error("Not implemented"),po=class{constructor(e,r,n){if(this.size=0,this.bigsize=0n,this.url="",globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw xt?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(e,r){throw mn}async write(e,r,n){throw mn}async stat(){throw mn}async truncate(e){throw mn}async append(e){throw mn}async close(){}};var Js=t=>t?.getUint8&&t?.slice&&t?.length;var pn=class{constructor(e,r=!1){this.file=new po(e,r?"a+":"r")}async truncate(e){await this.file.truncate(e)}async append(e){await this.file.append(e)}async destroy(){await this.file.close()}async getUint8(e){let r=await this.file.read(e,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(e){let r=await this.file.read(e,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(e){let r=await this.file.read(e,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(e){let r=await this.file.read(e,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(e,r){let n=r-e;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let o=Number(n);return await this.file.read(e,o)}get length(){return this.file.bigsize}};var yr=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},gn=class{constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(yr(e))}async getUint16(e){return this.file.getUint16(yr(e),!0)}async getUint32(e){return this.file.getUint32(yr(e),!0)}async getBigUint64(e){return this.file.getBigUint64(yr(e),!0)}async slice(e,r){return this.file.buffer.slice(yr(e),yr(r))}get length(){return BigInt(this.file.byteLength)}};var vd=1/Math.PI*180,Gd=1/180*Math.PI,Nd={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Nd}};var W=globalThis.mathgl.config;function zs(t,{precision:e=W.precision}={}){return t=Ud(t),"".concat(parseFloat(t.toPrecision(e)))}function Ft(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Qs(t){return Zc(t)}function Vs(t){return Yc(t)}function Zc(t,e){return Ks(t,r=>r*Gd,e)}function Yc(t,e){return Ks(t,r=>r*vd,e)}function js(t,e,r){return Ks(t,n=>Math.max(e,Math.min(r,n)))}function Mt(t,e,r){let n=W.EPSILON;r&&(W.EPSILON=r);try{if(t===e)return!0;if(Ft(t)&&Ft(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!Mt(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=W.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{W.EPSILON=n}}function Ud(t){return Math.round(t/W.EPSILON)*W.EPSILON}function Pd(t){return t.clone?t.clone():new Array(t.length)}function Ks(t,e,r){if(Ft(t)){let n=t;r=r||Pd(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof t=="number"?t:t[o];r[o]=e(s,o,r)}return r}return e(t)}function Hd(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var ye=class extends Hd(Array){clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Ft(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(W)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+zs(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Mt(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let o=0;o<this.ELEMENTS;++o){let s=e[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(W.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function kd(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function k(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function Ce(t,e,r=""){if(W.debug&&!kd(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function ct(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Te=class extends ye{get x(){return this[0]}set x(e){this[0]=k(e)}get y(){return this[1]}set y(e){this[1]=k(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-e[n];r+=o*o}return k(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return k(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return ct(e>=0&&e<this.ELEMENTS,"index is out of range"),k(this[e])}setComponent(e,r){return ct(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var $=typeof Float32Array<"u"?Float32Array:Array,Bn=Math.random;function Cr(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var py=Math.PI/180;function Jd(){let t=new $(2);return $!=Float32Array&&(t[0]=0,t[1]=0),t}function Wc(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t}function qc(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o+r[4],t[1]=r[1]*n+r[3]*o+r[5],t}function go(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}function Bo(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[4]*o+r[12],t[1]=r[1]*n+r[5]*o+r[13],t}var gy=function(){let t=Jd();return function(e,r,n,o,s,i){let a,f;for(r||(r=2),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],s(t,t,i),e[a]=t[0],e[a+1]=t[1];return e}}();function xo(t,e,r){let n=e[0],o=e[1],s=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/s,t[1]=(r[1]*n+r[5]*o)/s,t}function _o(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s||1;return t[0]=(r[0]*n+r[4]*o+r[8]*s)/i,t[1]=(r[1]*n+r[5]*o+r[9]*s)/i,t[2]=(r[2]*n+r[6]*o+r[10]*s)/i,t}function $c(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t}function tf(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t[3]=e[3],t}function Eo(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*s,t[1]=r[1]*n+r[4]*o+r[7]*s,t[2]=r[2]*n+r[5]*o+r[8]*s,t[3]=e[3],t}var Je=class extends Te{constructor(e=0,r=0){super(2),Ft(e)&&arguments.length===1?this.copy(e):(W.debug&&(k(e),k(r)),this[0]=e,this[1]=r)}set(e,r){return this[0]=e,this[1]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return W.debug&&(k(e.x),k(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Bo(this,this,e),this.check()}transformAsVector(e){return xo(this,this,e),this.check()}transformByMatrix3(e){return go(this,this,e),this.check()}transformByMatrix2x3(e){return qc(this,this,e),this.check()}transformByMatrix2(e){return Wc(this,this,e),this.check()}};var br={};ht(br,{add:()=>jd,angle:()=>qs,bezier:()=>sA,ceil:()=>Kd,clone:()=>zd,copy:()=>Qd,create:()=>yo,cross:()=>ze,dist:()=>AA,distance:()=>sf,div:()=>dA,divide:()=>of,dot:()=>xn,equals:()=>lA,exactEquals:()=>fA,floor:()=>Xd,forEach:()=>gA,fromValues:()=>Co,hermite:()=>oA,inverse:()=>eA,len:()=>$s,length:()=>ef,lerp:()=>rA,max:()=>Yd,min:()=>Zd,mul:()=>uA,multiply:()=>nf,negate:()=>tA,normalize:()=>Xs,random:()=>iA,rotateX:()=>Zs,rotateY:()=>Ys,rotateZ:()=>Ws,round:()=>Wd,scale:()=>qd,scaleAndAdd:()=>$d,set:()=>Vd,slerp:()=>nA,sqrDist:()=>mA,sqrLen:()=>pA,squaredDistance:()=>af,squaredLength:()=>cf,str:()=>cA,sub:()=>hA,subtract:()=>rf,transformMat3:()=>_n,transformMat4:()=>Qe,transformQuat:()=>En,zero:()=>aA});function yo(){let t=new $(3);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function zd(t){let e=new $(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ef(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function Co(t,e,r){let n=new $(3);return n[0]=t,n[1]=e,n[2]=r,n}function Qd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Vd(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function jd(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function rf(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function nf(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function of(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Kd(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Xd(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function Zd(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function Yd(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function Wd(t,e){return t[0]=Cr(e[0]),t[1]=Cr(e[1]),t[2]=Cr(e[2]),t}function qd(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function $d(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function sf(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(r*r+n*n+o*o)}function af(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return r*r+n*n+o*o}function cf(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function tA(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function eA(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Xs(t,e){let r=e[0],n=e[1],o=e[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function xn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ze(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2];return t[0]=o*f-s*a,t[1]=s*i-n*f,t[2]=n*a-o*i,t}function rA(t,e,r,n){let o=e[0],s=e[1],i=e[2];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t}function nA(t,e,r,n){let o=Math.acos(Math.min(Math.max(xn(e,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return t[0]=i*e[0]+a*r[0],t[1]=i*e[1]+a*r[1],t[2]=i*e[2]+a*r[2],t}function oA(t,e,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,f=i*(s-2)+s,c=i*(s-1),l=i*(3-2*s);return t[0]=e[0]*a+r[0]*f+n[0]*c+o[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+o[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+o[2]*l,t}function sA(t,e,r,n,o,s){let i=1-s,a=i*i,f=s*s,c=a*i,l=3*s*a,h=3*f*i,u=f*s;return t[0]=e[0]*c+r[0]*l+n[0]*h+o[0]*u,t[1]=e[1]*c+r[1]*l+n[1]*h+o[1]*u,t[2]=e[2]*c+r[2]*l+n[2]*h+o[2]*u,t}function iA(t,e){e=e===void 0?1:e;let r=Bn()*2*Math.PI,n=Bn()*2-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function Qe(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,t[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,t[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,t[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,t}function _n(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=n*r[0]+o*r[3]+s*r[6],t[1]=n*r[1]+o*r[4]+s*r[7],t[2]=n*r[2]+o*r[5]+s*r[8],t}function En(t,e,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=e[0],f=e[1],c=e[2],l=o*c-s*f,h=s*a-n*c,u=n*f-o*a,d=o*u-s*h,A=s*l-n*u,m=n*h-o*l,g=i*2;return l*=g,h*=g,u*=g,d*=2,A*=2,m*=2,t[0]=a+l+d,t[1]=f+h+A,t[2]=c+u+m,t}function Zs(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ys(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ws(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function qs(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),c=f&&xn(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function aA(t){return t[0]=0,t[1]=0,t[2]=0,t}function cA(t){return"vec3(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")}function fA(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function lA(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var hA=rf,uA=nf,dA=of,AA=sf,mA=af,$s=ef,pA=cf,gA=function(){let t=yo();return function(e,r,n,o,s,i){let a,f;for(r||(r=3),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var ti=[0,0,0],To,w=class extends Te{static get ZERO(){return To||(To=new w(0,0,0),Object.freeze(To)),To}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Ft(e)?this.copy(e):(W.debug&&(k(e),k(r),k(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return W.debug&&(k(e.x),k(e.y),k(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=k(e)}angle(e){return qs(this,e)}cross(e){return ze(this,this,e),this.check()}rotateX({radians:e,origin:r=ti}){return Zs(this,this,r,e),this.check()}rotateY({radians:e,origin:r=ti}){return Ys(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=ti}){return Ws(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Qe(this,this,e),this.check()}transformAsVector(e){return _o(this,this,e),this.check()}transformByMatrix3(e){return _n(this,this,e),this.check()}transformByMatrix2(e){return $c(this,this,e),this.check()}transformByQuaternion(e){return En(this,this,e),this.check()}};var bo,wr=class extends Te{static get ZERO(){return bo||(bo=new wr(0,0,0,0),Object.freeze(bo)),bo}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),Ft(e)&&arguments.length===1?this.copy(e):(W.debug&&(k(e),k(r),k(n),k(o)),this[0]=e,this[1]=r,this[2]=n,this[3]=o)}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return W.debug&&(k(e.x),k(e.y),k(e.z),k(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}transform(e){return Qe(this,this,e),this.check()}transformByMatrix3(e){return Eo(this,this,e),this.check()}transformByMatrix2(e){return tf(this,this,e),this.check()}transformByQuaternion(e){return En(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Mr=class extends ye{toString(){let e="[";if(W.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=k(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(e,r){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function ff(){let t=new $(9);return $!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function lf(t,e){if(t===e){let r=e[1],n=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function hf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=l*i-a*c,u=-l*s+a*f,d=c*s-i*f,A=r*h+n*u+o*d;return A?(A=1/A,t[0]=h*A,t[1]=(-l*n+o*c)*A,t[2]=(a*n-o*i)*A,t[3]=u*A,t[4]=(l*r-o*f)*A,t[5]=(-a*r+o*s)*A,t[6]=d*A,t[7]=(-c*r+n*f)*A,t[8]=(i*r-n*s)*A,t):null}function uf(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8];return e*(c*s-i*f)+r*(-c*o+i*a)+n*(f*o-s*a)}function ei(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1],A=r[2],m=r[3],g=r[4],_=r[5],y=r[6],T=r[7],b=r[8];return t[0]=u*n+d*i+A*c,t[1]=u*o+d*a+A*l,t[2]=u*s+d*f+A*h,t[3]=m*n+g*i+_*c,t[4]=m*o+g*a+_*l,t[5]=m*s+g*f+_*h,t[6]=y*n+T*i+b*c,t[7]=y*o+T*a+b*l,t[8]=y*s+T*f+b*h,t}function df(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1];return t[0]=n,t[1]=o,t[2]=s,t[3]=i,t[4]=a,t[5]=f,t[6]=u*n+d*i+c,t[7]=u*o+d*a+l,t[8]=u*s+d*f+h,t}function Af(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=Math.sin(r),d=Math.cos(r);return t[0]=d*n+u*i,t[1]=d*o+u*a,t[2]=d*s+u*f,t[3]=d*i-u*n,t[4]=d*a-u*o,t[5]=d*f-u*s,t[6]=c,t[7]=l,t[8]=h,t}function ri(t,e,r){let n=r[0],o=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function mf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,g=s*a,_=s*f;return t[0]=1-h-A,t[3]=l-_,t[6]=u+g,t[1]=l+_,t[4]=1-c-A,t[7]=d-m,t[2]=u-g,t[5]=d+m,t[8]=1-c-h,t}var ni;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(ni||(ni={}));var xA=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends Mr{static get IDENTITY(){return EA()}static get ZERO(){return _A()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ni}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(xA)}fromObject(e){return this.check()}fromQuaternion(e){return mf(this,e),this.check()}set(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return uf(this)}transpose(){return lf(this,this),this.check()}invert(){return hf(this,this),this.check()}multiplyLeft(e){return ei(this,e,this),this.check()}multiplyRight(e){return ei(this,this,e),this.check()}rotate(e){return Af(this,this,e),this.check()}scale(e){return Array.isArray(e)?ri(this,this,e):ri(this,this,[e,e]),this.check()}translate(e){return df(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=go(r||[-0,-0],e,this);break;case 3:n=_n(r||[-0,-0,-0],e,this);break;case 4:n=Eo(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ce(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},wo,Mo=null;function _A(){return wo||(wo=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function EA(){return Mo||(Mo=new Z,Object.freeze(Mo)),Mo}var Io={};ht(Io,{add:()=>jA,adjoint:()=>MA,clone:()=>CA,copy:()=>TA,create:()=>yA,decompose:()=>NA,determinant:()=>ii,equals:()=>YA,exactEquals:()=>ZA,frob:()=>VA,fromQuat:()=>di,fromQuat2:()=>OA,fromRotation:()=>FA,fromRotationTranslation:()=>gf,fromRotationTranslationScale:()=>UA,fromRotationTranslationScaleOrigin:()=>PA,fromScaling:()=>SA,fromTranslation:()=>IA,fromValues:()=>bA,fromXRotation:()=>DA,fromYRotation:()=>RA,fromZRotation:()=>LA,frustum:()=>Ai,getRotation:()=>GA,getScaling:()=>Bf,getTranslation:()=>vA,identity:()=>pf,invert:()=>si,lookAt:()=>gi,mul:()=>WA,multiply:()=>yn,multiplyScalar:()=>KA,multiplyScalarAndAdd:()=>XA,ortho:()=>pi,orthoNO:()=>_f,orthoZO:()=>JA,perspective:()=>mi,perspectiveFromFieldOfView:()=>kA,perspectiveNO:()=>xf,perspectiveZO:()=>HA,rotate:()=>fi,rotateX:()=>li,rotateY:()=>hi,rotateZ:()=>ui,scale:()=>ci,set:()=>wA,str:()=>QA,sub:()=>qA,subtract:()=>Ef,targetTo:()=>zA,translate:()=>ai,transpose:()=>oi});function yA(){let t=new $(16);return $!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function CA(t){let e=new $(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function TA(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function bA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m){let g=new $(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=n,g[4]=o,g[5]=s,g[6]=i,g[7]=a,g[8]=f,g[9]=c,g[10]=l,g[11]=h,g[12]=u,g[13]=d,g[14]=A,g[15]=m,g}function wA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=s,t[5]=i,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=h,t[11]=u,t[12]=d,t[13]=A,t[14]=m,t[15]=g,t}function pf(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function oi(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],s=e[6],i=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=o,t[13]=i,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function si(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=e[9],u=e[10],d=e[11],A=e[12],m=e[13],g=e[14],_=e[15],y=r*a-n*i,T=r*f-o*i,b=r*c-s*i,C=n*f-o*a,I=n*c-s*a,M=o*c-s*f,L=l*m-h*A,B=l*g-u*A,p=l*_-d*A,x=h*g-u*m,E=h*_-d*m,U=u*_-d*g,N=y*U-T*E+b*x+C*p-I*B+M*L;return N?(N=1/N,t[0]=(a*U-f*E+c*x)*N,t[1]=(o*E-n*U-s*x)*N,t[2]=(m*M-g*I+_*C)*N,t[3]=(u*I-h*M-d*C)*N,t[4]=(f*p-i*U-c*B)*N,t[5]=(r*U-o*p+s*B)*N,t[6]=(g*b-A*M-_*T)*N,t[7]=(l*M-u*b+d*T)*N,t[8]=(i*E-a*p+c*L)*N,t[9]=(n*p-r*E-s*L)*N,t[10]=(A*I-m*b+_*y)*N,t[11]=(h*b-l*I-d*y)*N,t[12]=(a*B-i*x-f*L)*N,t[13]=(r*x-n*B+o*L)*N,t[14]=(m*T-A*C-g*y)*N,t[15]=(l*C-h*T+u*y)*N,t):null}function MA(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=e[9],u=e[10],d=e[11],A=e[12],m=e[13],g=e[14],_=e[15],y=r*a-n*i,T=r*f-o*i,b=r*c-s*i,C=n*f-o*a,I=n*c-s*a,M=o*c-s*f,L=l*m-h*A,B=l*g-u*A,p=l*_-d*A,x=h*g-u*m,E=h*_-d*m,U=u*_-d*g;return t[0]=a*U-f*E+c*x,t[1]=o*E-n*U-s*x,t[2]=m*M-g*I+_*C,t[3]=u*I-h*M-d*C,t[4]=f*p-i*U-c*B,t[5]=r*U-o*p+s*B,t[6]=g*b-A*M-_*T,t[7]=l*M-u*b+d*T,t[8]=i*E-a*p+c*L,t[9]=n*p-r*E-s*L,t[10]=A*I-m*b+_*y,t[11]=h*b-l*I-d*y,t[12]=a*B-i*x-f*L,t[13]=r*x-n*B+o*L,t[14]=m*T-A*C-g*y,t[15]=l*C-h*T+u*y,t}function ii(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8],l=t[9],h=t[10],u=t[11],d=t[12],A=t[13],m=t[14],g=t[15],_=e*i-r*s,y=e*a-n*s,T=r*a-n*i,b=c*A-l*d,C=c*m-h*d,I=l*m-h*A,M=e*I-r*C+n*b,L=s*I-i*C+a*b,B=c*T-l*y+h*_,p=d*T-A*y+m*_;return f*M-o*L+g*B-u*p}function yn(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],A=e[11],m=e[12],g=e[13],_=e[14],y=e[15],T=r[0],b=r[1],C=r[2],I=r[3];return t[0]=T*n+b*a+C*h+I*m,t[1]=T*o+b*f+C*u+I*g,t[2]=T*s+b*c+C*d+I*_,t[3]=T*i+b*l+C*A+I*y,T=r[4],b=r[5],C=r[6],I=r[7],t[4]=T*n+b*a+C*h+I*m,t[5]=T*o+b*f+C*u+I*g,t[6]=T*s+b*c+C*d+I*_,t[7]=T*i+b*l+C*A+I*y,T=r[8],b=r[9],C=r[10],I=r[11],t[8]=T*n+b*a+C*h+I*m,t[9]=T*o+b*f+C*u+I*g,t[10]=T*s+b*c+C*d+I*_,t[11]=T*i+b*l+C*A+I*y,T=r[12],b=r[13],C=r[14],I=r[15],t[12]=T*n+b*a+C*h+I*m,t[13]=T*o+b*f+C*u+I*g,t[14]=T*s+b*c+C*d+I*_,t[15]=T*i+b*l+C*A+I*y,t}function ai(t,e,r){let n=r[0],o=r[1],s=r[2],i,a,f,c,l,h,u,d,A,m,g,_;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*s+e[12],t[13]=e[1]*n+e[5]*o+e[9]*s+e[13],t[14]=e[2]*n+e[6]*o+e[10]*s+e[14],t[15]=e[3]*n+e[7]*o+e[11]*s+e[15]):(i=e[0],a=e[1],f=e[2],c=e[3],l=e[4],h=e[5],u=e[6],d=e[7],A=e[8],m=e[9],g=e[10],_=e[11],t[0]=i,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=h,t[6]=u,t[7]=d,t[8]=A,t[9]=m,t[10]=g,t[11]=_,t[12]=i*n+l*o+A*s+e[12],t[13]=a*n+h*o+m*s+e[13],t[14]=f*n+u*o+g*s+e[14],t[15]=c*n+d*o+_*s+e[15]),t}function ci(t,e,r){let n=r[0],o=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function fi(t,e,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),f,c,l,h,u,d,A,m,g,_,y,T,b,C,I,M,L,B,p,x,E,U,N,P;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,h=e[0],u=e[1],d=e[2],A=e[3],m=e[4],g=e[5],_=e[6],y=e[7],T=e[8],b=e[9],C=e[10],I=e[11],M=o*o*l+f,L=s*o*l+i*c,B=i*o*l-s*c,p=o*s*l-i*c,x=s*s*l+f,E=i*s*l+o*c,U=o*i*l+s*c,N=s*i*l-o*c,P=i*i*l+f,t[0]=h*M+m*L+T*B,t[1]=u*M+g*L+b*B,t[2]=d*M+_*L+C*B,t[3]=A*M+y*L+I*B,t[4]=h*p+m*x+T*E,t[5]=u*p+g*x+b*E,t[6]=d*p+_*x+C*E,t[7]=A*p+y*x+I*E,t[8]=h*U+m*N+T*P,t[9]=u*U+g*N+b*P,t[10]=d*U+_*N+C*P,t[11]=A*U+y*N+I*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function li(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[4],i=e[5],a=e[6],f=e[7],c=e[8],l=e[9],h=e[10],u=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*o+c*n,t[5]=i*o+l*n,t[6]=a*o+h*n,t[7]=f*o+u*n,t[8]=c*o-s*n,t[9]=l*o-i*n,t[10]=h*o-a*n,t[11]=u*o-f*n,t}function hi(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[8],l=e[9],h=e[10],u=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o-c*n,t[1]=i*o-l*n,t[2]=a*o-h*n,t[3]=f*o-u*n,t[8]=s*n+c*o,t[9]=i*n+l*o,t[10]=a*n+h*o,t[11]=f*n+u*o,t}function ui(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[4],l=e[5],h=e[6],u=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o+c*n,t[1]=i*o+l*n,t[2]=a*o+h*n,t[3]=f*o+u*n,t[4]=c*o-s*n,t[5]=l*o-i*n,t[6]=h*o-a*n,t[7]=u*o-f*n,t}function IA(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function SA(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function FA(t,e,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,f,c;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+s*f,t[2]=s*n*c-o*f,t[3]=0,t[4]=n*o*c-s*f,t[5]=o*o*c+a,t[6]=s*o*c+n*f,t[7]=0,t[8]=n*s*c+o*f,t[9]=o*s*c-n*f,t[10]=s*s*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function DA(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function RA(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function LA(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function gf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=n+n,f=o+o,c=s+s,l=n*a,h=n*f,u=n*c,d=o*f,A=o*c,m=s*c,g=i*a,_=i*f,y=i*c;return t[0]=1-(d+m),t[1]=h+y,t[2]=u-_,t[3]=0,t[4]=h-y,t[5]=1-(l+m),t[6]=A+g,t[7]=0,t[8]=u+_,t[9]=A-g,t[10]=1-(l+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function OA(t,e){let r=new $(3),n=-e[0],o=-e[1],s=-e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=n*n+o*o+s*s+i*i;return h>0?(r[0]=(a*i+l*n+f*s-c*o)*2/h,r[1]=(f*i+l*o+c*n-a*s)*2/h,r[2]=(c*i+l*s+a*o-f*n)*2/h):(r[0]=(a*i+l*n+f*s-c*o)*2,r[1]=(f*i+l*o+c*n-a*s)*2,r[2]=(c*i+l*s+a*o-f*n)*2),gf(t,e,r),t}function vA(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Bf(t,e){let r=e[0],n=e[1],o=e[2],s=e[4],i=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+o*o),t[1]=Math.sqrt(s*s+i*i+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function GA(t,e){let r=new $(3);Bf(r,e);let n=1/r[0],o=1/r[1],s=1/r[2],i=e[0]*n,a=e[1]*o,f=e[2]*s,c=e[4]*n,l=e[5]*o,h=e[6]*s,u=e[8]*n,d=e[9]*o,A=e[10]*s,m=i+l+A,g=0;return m>0?(g=Math.sqrt(m+1)*2,t[3]=.25*g,t[0]=(h-d)/g,t[1]=(u-f)/g,t[2]=(a-c)/g):i>l&&i>A?(g=Math.sqrt(1+i-l-A)*2,t[3]=(h-d)/g,t[0]=.25*g,t[1]=(a+c)/g,t[2]=(u+f)/g):l>A?(g=Math.sqrt(1+l-i-A)*2,t[3]=(u-f)/g,t[0]=(a+c)/g,t[1]=.25*g,t[2]=(h+d)/g):(g=Math.sqrt(1+A-i-l)*2,t[3]=(a-c)/g,t[0]=(u+f)/g,t[1]=(h+d)/g,t[2]=.25*g),t}function NA(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],f=n[5],c=n[6],l=n[8],h=n[9],u=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+h*h+u*u);let d=1/r[0],A=1/r[1],m=1/r[2],g=o*d,_=s*A,y=i*m,T=a*d,b=f*A,C=c*m,I=l*d,M=h*A,L=u*m,B=g+b+L,p=0;return B>0?(p=Math.sqrt(B+1)*2,t[3]=.25*p,t[0]=(C-M)/p,t[1]=(I-y)/p,t[2]=(_-T)/p):g>b&&g>L?(p=Math.sqrt(1+g-b-L)*2,t[3]=(C-M)/p,t[0]=.25*p,t[1]=(_+T)/p,t[2]=(I+y)/p):b>L?(p=Math.sqrt(1+b-g-L)*2,t[3]=(I-y)/p,t[0]=(_+T)/p,t[1]=.25*p,t[2]=(C+M)/p):(p=Math.sqrt(1+L-g-b)*2,t[3]=(_-T)/p,t[0]=(I+y)/p,t[1]=(C+M)/p,t[2]=.25*p),t}function UA(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=o+o,c=s+s,l=i+i,h=o*f,u=o*c,d=o*l,A=s*c,m=s*l,g=i*l,_=a*f,y=a*c,T=a*l,b=n[0],C=n[1],I=n[2];return t[0]=(1-(A+g))*b,t[1]=(u+T)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(u-T)*C,t[5]=(1-(h+g))*C,t[6]=(m+_)*C,t[7]=0,t[8]=(d+y)*I,t[9]=(m-_)*I,t[10]=(1-(h+A))*I,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function PA(t,e,r,n,o){let s=e[0],i=e[1],a=e[2],f=e[3],c=s+s,l=i+i,h=a+a,u=s*c,d=s*l,A=s*h,m=i*l,g=i*h,_=a*h,y=f*c,T=f*l,b=f*h,C=n[0],I=n[1],M=n[2],L=o[0],B=o[1],p=o[2],x=(1-(m+_))*C,E=(d+b)*C,U=(A-T)*C,N=(d-b)*I,P=(1-(u+_))*I,v=(g+y)*I,it=(A+T)*M,At=(g-y)*M,Y=(1-(u+m))*M;return t[0]=x,t[1]=E,t[2]=U,t[3]=0,t[4]=N,t[5]=P,t[6]=v,t[7]=0,t[8]=it,t[9]=At,t[10]=Y,t[11]=0,t[12]=r[0]+L-(x*L+N*B+it*p),t[13]=r[1]+B-(E*L+P*B+At*p),t[14]=r[2]+p-(U*L+v*B+Y*p),t[15]=1,t}function di(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,g=s*a,_=s*f;return t[0]=1-h-A,t[1]=l+_,t[2]=u-g,t[3]=0,t[4]=l-_,t[5]=1-c-A,t[6]=d+m,t[7]=0,t[8]=u+g,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ai(t,e,r,n,o,s,i){let a=1/(r-e),f=1/(o-n),c=1/(s-i);return t[0]=s*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(i+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*s*2*c,t[15]=0,t}function xf(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=(o+n)*i,t[14]=2*o*n*i}else t[10]=-1,t[14]=-2*n;return t}var mi=xf;function HA(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=o*i,t[14]=o*n*i}else t[10]=-1,t[14]=-n;return t}function kA(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(o+s);return t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((i-a)*f*.5),t[9]=(o-s)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function _f(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=(i+s)*c,t[15]=1,t}var pi=_f;function JA(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=s*c,t[15]=1,t}function gi(t,e,r,n){let o,s,i,a,f,c,l,h,u,d,A=e[0],m=e[1],g=e[2],_=n[0],y=n[1],T=n[2],b=r[0],C=r[1],I=r[2];return Math.abs(A-b)<1e-6&&Math.abs(m-C)<1e-6&&Math.abs(g-I)<1e-6?pf(t):(h=A-b,u=m-C,d=g-I,o=1/Math.sqrt(h*h+u*u+d*d),h*=o,u*=o,d*=o,s=y*d-T*u,i=T*h-_*d,a=_*u-y*h,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),f=u*a-d*i,c=d*s-h*a,l=h*i-u*s,o=Math.sqrt(f*f+c*c+l*l),o?(o=1/o,f*=o,c*=o,l*=o):(f=0,c=0,l=0),t[0]=s,t[1]=f,t[2]=h,t[3]=0,t[4]=i,t[5]=c,t[6]=u,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(s*A+i*m+a*g),t[13]=-(f*A+c*m+l*g),t[14]=-(h*A+u*m+d*g),t[15]=1,t)}function zA(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],h=s-r[1],u=i-r[2],d=l*l+h*h+u*u;d>0&&(d=1/Math.sqrt(d),l*=d,h*=d,u*=d);let A=f*u-c*h,m=c*l-a*u,g=a*h-f*l;return d=A*A+m*m+g*g,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,g*=d),t[0]=A,t[1]=m,t[2]=g,t[3]=0,t[4]=h*g-u*m,t[5]=u*A-l*g,t[6]=l*m-h*A,t[7]=0,t[8]=l,t[9]=h,t[10]=u,t[11]=0,t[12]=o,t[13]=s,t[14]=i,t[15]=1,t}function QA(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function VA(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function jA(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Ef(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function KA(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function XA(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function ZA(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function YA(t,e){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],f=t[6],c=t[7],l=t[8],h=t[9],u=t[10],d=t[11],A=t[12],m=t[13],g=t[14],_=t[15],y=e[0],T=e[1],b=e[2],C=e[3],I=e[4],M=e[5],L=e[6],B=e[7],p=e[8],x=e[9],E=e[10],U=e[11],N=e[12],P=e[13],v=e[14],it=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-T)<=1e-6*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(o-b)<=1e-6*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-C)<=1e-6*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(i-I)<=1e-6*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(l-p)<=1e-6*Math.max(1,Math.abs(l),Math.abs(p))&&Math.abs(h-x)<=1e-6*Math.max(1,Math.abs(h),Math.abs(x))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(A-N)<=1e-6*Math.max(1,Math.abs(A),Math.abs(N))&&Math.abs(m-P)<=1e-6*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(g-v)<=1e-6*Math.max(1,Math.abs(g),Math.abs(v))&&Math.abs(_-it)<=1e-6*Math.max(1,Math.abs(_),Math.abs(it))}var WA=yn,qA=Ef;function $A(){let t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function yf(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Cf(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function Tf(t){let e=t[0],r=t[1],n=t[2],o=t[3];return Math.sqrt(e*e+r*r+n*n+o*o)}function bf(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function wf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=r*i,t[1]=n*i,t[2]=o*i,t[3]=s*i,t}function Mf(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function If(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t[3]=a+n*(r[3]-a),t}function Sf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,t[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,t[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,t[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,t}function Ff(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*s-f*o,h=c*o+f*n-i*s,u=c*s+i*o-a*n,d=-i*n-a*o-f*s;return t[0]=l*c+d*-i+h*-f-u*-a,t[1]=h*c+d*-a+u*-i-l*-f,t[2]=u*c+d*-f+l*-a-h*-i,t[3]=e[3],t}var Zy=function(){let t=$A();return function(e,r,n,o,s,i){let a,f;for(r||(r=4),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var _i;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(_i||(_i={}));var em=45*Math.PI/180,rm=1,Bi=.1,xi=500,nm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Dt=class extends Mr{static get IDENTITY(){return sm()}static get ZERO(){return om()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return _i}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,g){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=h,this[11]=u,this[12]=d,this[13]=A,this[14]=m,this[15]=g,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,g){return this[0]=e,this[1]=s,this[2]=c,this[3]=d,this[4]=r,this[5]=i,this[6]=l,this[7]=A,this[8]=n,this[9]=a,this[10]=h,this[11]=m,this[12]=o,this[13]=f,this[14]=u,this[15]=g,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(nm)}fromObject(e){return this.check()}fromQuaternion(e){return di(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:s,near:i=Bi,far:a=xi}=e;return a===1/0?im(this,r,n,o,s,i):Ai(this,r,n,o,s,i,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return gi(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:s,near:i=Bi,far:a=xi}=e;return pi(this,r,n,o,s,i,a),this.check()}orthographic(e){let{fovy:r=em,aspect:n=rm,focalDistance:o=1,near:s=Bi,far:i=xi}=e;Df(r);let a=r/2,f=o*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:s,far:i})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=e;return Df(r),mi(this,r,n,o,s),this.check()}determinant(){return ii(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*s,e[6]=this[6]*i,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*s,e[10]=this[10]*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=this[4]*o,e[4]=this[5]*s,e[5]=this[6]*i,e[6]=this[8]*o,e[7]=this[9]*s,e[8]=this[10]*i,e}transpose(){return oi(this,this),this.check()}invert(){return si(this,this),this.check()}multiplyLeft(e){return yn(this,e,this),this.check()}multiplyRight(e){return yn(this,this,e),this.check()}rotateX(e){return li(this,this,e),this.check()}rotateY(e){return hi(this,this,e),this.check()}rotateZ(e){return ui(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return fi(this,this,e,r),this.check()}scale(e){return ci(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return ai(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Sf(r||[-0,-0,-0,-0],e,this),Ce(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=Bo(r||[-0,-0],e,this);break;case 3:o=Qe(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ce(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=xo(r||[-0,-0],e,this);break;case 3:n=_o(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ce(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},So,Fo;function om(){return So||(So=new Dt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(So)),So}function sm(){return Fo||(Fo=new Dt,Object.freeze(Fo)),Fo}function Df(t){if(t>Math.PI*2)throw Error("expected radians")}function im(t,e,r,n,o,s){let i=2*s/(r-e),a=2*s/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,h=-1,u=-2*s;return t[0]=i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=f,t[9]=c,t[10]=l,t[11]=h,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}function Rf(){let t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Lf(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ei(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function yi(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+i*a+o*c-s*f,t[1]=o*l+i*f+s*a-n*c,t[2]=s*l+i*c+n*f-o*a,t[3]=i*l-n*a-o*f-s*c,t}function Of(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+i*a,t[1]=o*f+s*a,t[2]=s*f-o*a,t[3]=i*f-n*a,t}function vf(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-s*a,t[1]=o*f+i*a,t[2]=s*f+n*a,t[3]=i*f-o*a,t}function Gf(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+o*a,t[1]=o*f-n*a,t[2]=s*f+i*a,t[3]=i*f-s*a,t}function Nf(t,e){let r=e[0],n=e[1],o=e[2];return t[0]=r,t[1]=n,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t}function Cn(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=r[0],c=r[1],l=r[2],h=r[3],u,d,A,m,g;return u=o*f+s*c+i*l+a*h,u<0&&(u=-u,f=-f,c=-c,l=-l,h=-h),1-u>1e-6?(d=Math.acos(u),g=Math.sin(d),A=Math.sin((1-n)*d)/g,m=Math.sin(n*d)/g):(A=1-n,m=n),t[0]=A*o+m*f,t[1]=A*s+m*c,t[2]=A*i+m*l,t[3]=A*a+m*h,t}function Uf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=s*a,t}function Pf(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ci(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let o=0;e[4]>e[0]&&(o=1),e[8]>e[o*3+o]&&(o=2);let s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[s*3+s]-e[i*3+i]+1),t[o]=.5*n,n=.5/n,t[3]=(e[s*3+i]-e[i*3+s])*n,t[s]=(e[s*3+o]+e[o*3+s])*n,t[i]=(e[i*3+o]+e[o*3+i])*n}return t}var Hf=yf;var kf=Cf,Jf=Mf,zf=If,Qf=Tf;var Vf=bf;var jf=wf;var Kf=function(){let t=yo(),e=Co(1,0,0),r=Co(0,1,0);return function(n,o,s){let i=xn(o,s);return i<-.999999?(ze(t,e,o),$s(t)<1e-6&&ze(t,r,o),Xs(t,t),Ei(n,t,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ze(t,o,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+i,jf(n,n))}}(),fC=function(){let t=Rf(),e=Rf();return function(r,n,o,s,i,a){return Cn(t,n,i,a),Cn(e,o,s,a),Cn(r,t,e,2*a*(1-a)),r}}(),lC=function(){let t=ff();return function(e,r,n,o){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],jf(e,Ci(e,t))}}();var am=[0,0,0,1],be=class extends ye{constructor(e=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,o)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Ci(this,e),this.check()}fromAxisRotation(e,r){return Ei(this,e,r),this.check()}identity(){return Lf(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=k(e)}get y(){return this[1]}set y(e){this[1]=k(e)}get z(){return this[2]}set z(e){this[2]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}len(){return Qf(this)}lengthSquared(){return Vf(this)}dot(e){return Jf(this,e)}rotationTo(e,r){return Kf(this,e,r),this.check()}add(e){return Hf(this,this,e),this.check()}calculateW(){return Nf(this,this),this.check()}conjugate(){return Pf(this,this),this.check()}invert(){return Uf(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(zf(this,e,r,n),this.check())}multiplyRight(e){return yi(this,this,e),this.check()}multiplyLeft(e){return yi(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return Of(this,this,e),this.check()}rotateY(e){return vf(this,this,e),this.check()}rotateZ(e){return Gf(this,this,e),this.check()}scale(e){return kf(this,this,e),this.check()}slerp(e,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=am,target:s,ratio:i}=e);break;case 2:o=this,s=e,i=r;break;default:o=e,s=r,i=n}return Cn(this,o,s,i),this.check()}transformVector4(e,r=new wr){return Ff(r,e,this),Ce(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var kt={};ht(kt,{EPSILON1:()=>cm,EPSILON10:()=>gm,EPSILON11:()=>Bm,EPSILON12:()=>xm,EPSILON13:()=>_m,EPSILON14:()=>Em,EPSILON15:()=>ym,EPSILON16:()=>Cm,EPSILON17:()=>Tm,EPSILON18:()=>bm,EPSILON19:()=>wm,EPSILON2:()=>fm,EPSILON20:()=>Mm,EPSILON3:()=>lm,EPSILON4:()=>hm,EPSILON5:()=>um,EPSILON6:()=>dm,EPSILON7:()=>Am,EPSILON8:()=>mm,EPSILON9:()=>pm,PI_OVER_FOUR:()=>Sm,PI_OVER_SIX:()=>Fm,PI_OVER_TWO:()=>Im,TWO_PI:()=>Dm});var cm=.1,fm=.01,lm=.001,hm=1e-4,um=1e-5,dm=1e-6,Am=1e-7,mm=1e-8,pm=1e-9,gm=1e-10,Bm=1e-11,xm=1e-12,_m=1e-13,Em=1e-14,ym=1e-15,Cm=1e-16,Tm=1e-17,bm=1e-18,wm=1e-19,Mm=1e-20,Im=Math.PI/2,Sm=Math.PI/4,Fm=Math.PI/6,Dm=Math.PI*2;var ce=6356752314245179e-9,Rm={radii:[6378137,6378137,ce],radiiSquared:[6378137*6378137,6378137*6378137,ce*ce],oneOverRadii:[1/6378137,1/6378137,1/ce],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(ce*ce)],maximumRadius:Math.max(6378137,6378137,ce),centerToleranceSquared:.1};function Do(t){return t}var HC=new w;function Lm(t,e=[],r=Do){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function Xf(t,e=[]){return Lm(t,e,W._cartographicRadians?Do:Qs)}function Om(t,e,r=Do){return"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):"x"in e?(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function Zf(t,e){return Om(t,e,W._cartographicRadians?Do:Vs)}var Yf=1e-14,vm=new w,Wf={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Ti={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Tn={east:new w,north:new w,up:new w,west:new w,south:new w,down:new w},Gm=new w,Nm=new w,Um=new w;function bi(t,e,r,n,o,s){let i=Wf[e]&&Wf[e][r];ct(i&&(!n||n===i));let a,f,c,l=vm.copy(o);if(Mt(l.x,0,Yf)&&Mt(l.y,0,Yf)){let u=Math.sign(l.z);a=Gm.fromArray(Ti[e]),e!=="east"&&e!=="west"&&a.scale(u),f=Nm.fromArray(Ti[r]),r!=="east"&&r!=="west"&&f.scale(u),c=Um.fromArray(Ti[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=Tn;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,u),A.copy(u).cross(d);let{down:m,west:g,south:_}=Tn;m.copy(u).scale(-1),g.copy(d).scale(-1),_.copy(A).scale(-1),a=Tn[e],f=Tn[r],c=Tn[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=c.x,s[9]=c.y,s[10]=c.z,s[11]=0,s[12]=l.x,s[13]=l.y,s[14]=l.z,s[15]=1,s}var Ir=new w,Pm=new w,Hm=new w;function qf(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=e;Ir.from(t);let i=Ir.x,a=Ir.y,f=Ir.z,c=n.x,l=n.y,h=n.z,u=i*i*c*c,d=a*a*l*l,A=f*f*h*h,m=u+d+A,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;let _=Pm;if(_.copy(t).scale(g),m<s)return _.to(r);let y=o.x,T=o.y,b=o.z,C=Hm;C.set(_.x*y*2,_.y*T*2,_.z*b*2);let I=(1-g)*Ir.len()/(.5*C.len()),M=0,L,B,p,x;do{I-=M,L=1/(1+I*y),B=1/(1+I*T),p=1/(1+I*b);let E=L*L,U=B*B,N=p*p,P=E*L,v=U*B,it=N*p;x=u*E+d*U+A*N-1;let Y=-2*(u*P*y+d*v*T+A*it*b);M=x/Y}while(Math.abs(x)>kt.EPSILON12);return Ir.scale([L,B,p]).to(r)}var Ro=new w,$f=new w,zm=new w,Jt=new w,Qm=new w,Lo=new w,fe=class{constructor(e=0,r=0,n=0){X(this,"radii",void 0),X(this,"radiiSquared",void 0),X(this,"radiiToTheFourth",void 0),X(this,"oneOverRadii",void 0),X(this,"oneOverRadiiSquared",void 0),X(this,"minimumRadius",void 0),X(this,"maximumRadius",void 0),X(this,"centerToleranceSquared",kt.EPSILON1),X(this,"squaredXOverSquaredZ",void 0),ct(e>=0),ct(r>=0),ct(n>=0),this.radii=new w(e,r,n),this.radiiSquared=new w(e*e,r*r,n*n),this.radiiToTheFourth=new w(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new w(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new w(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=$f,o=zm,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){Lo.from(e);let n=this.scaleToGeodeticSurface(Lo,Jt);if(!n)return;let o=this.geodeticSurfaceNormal(n,$f),s=Qm;s.copy(Lo).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(br.dot(s,Lo))*br.length(s);return Zf([i,a,f],r)}eastNorthUpToFixedFrame(e,r=new Dt){return bi(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,s=new Dt){return bi(this,e,r,n,o,s)}geocentricSurfaceNormal(e,r=[0,0,0]){return Ro.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Xf(e),o=n[0],s=n[1],i=Math.cos(s);return Ro.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),Ro.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return Ro.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return qf(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){Jt.from(e);let n=Jt.x,o=Jt.y,s=Jt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*i.z);return Jt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return Jt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return Jt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){ct(Mt(this.radii.x,this.radii.y,kt.EPSILON15)),ct(this.radii.z>0),Jt.from(e);let o=Jt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Jt.set(0,0,o).to(n)}};X(fe,"WGS84",new fe(6378137,6378137,ce));var ft={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var aT=new w,cT=new w;var bn=new w,tl=new w,we=class{constructor(e=[0,0,0],r=0){X(this,"center",void 0),X(this,"radius",void 0),this.radius=-0,this.center=new w,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=bn.from(r),this.center=new w().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new we(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,s=e.radius,i=bn.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return e.clone();let f=(n+a+s)*.5;return tl.copy(i).scale((-n+f)/a).add(r),this.center.copy(tl),this.radius=f,this}expand(e){let n=bn.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Io.getScaling(bn,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=bn.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,s=e.normal.dot(r)+e.distance;return s<-n?ft.OUTSIDE:s<n?ft.INTERSECTING:ft.INSIDE}};var Vm=new w,jm=new w,Oo=new w,vo=new w,Go=new w,Km=new w,Xm=new w,le={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Ve=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){X(this,"center",void 0),X(this,"halfAxes",void 0),this.center=new w().from(e),this.halfAxes=new Z(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new w(e).len(),new w(r).len(),new w(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new w(e).normalize(),s=new w(r).normalize(),i=new w(n).normalize();return new be().fromMatrix3(new Z([...o,...s,...i]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new be(n),s=new Z().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new w().from(e),this.halfAxes=s,this}clone(){return new Ve(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new we){let r=this.halfAxes,n=r.getColumn(0,Oo),o=r.getColumn(1,vo),s=r.getColumn(2,Go),i=Vm.copy(n).add(o).add(s);return e.center.copy(this.center),e.radius=i.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,f=Math.abs(s*o[le.COLUMN0ROW0]+i*o[le.COLUMN0ROW1]+a*o[le.COLUMN0ROW2])+Math.abs(s*o[le.COLUMN1ROW0]+i*o[le.COLUMN1ROW1]+a*o[le.COLUMN1ROW2])+Math.abs(s*o[le.COLUMN2ROW0]+i*o[le.COLUMN2ROW1]+a*o[le.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?ft.OUTSIDE:c>=f?ft.INSIDE:ft.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=jm.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Oo),s=n.getColumn(1,vo),i=n.getColumn(2,Go),a=o.magnitude(),f=s.magnitude(),c=i.magnitude();o.normalize(),s.normalize(),i.normalize();let l=0,h;return h=Math.abs(r.dot(o))-a,h>0&&(l+=h*h),h=Math.abs(r.dot(s))-f,h>0&&(l+=h*h),h=Math.abs(r.dot(i))-c,h>0&&(l+=h*h),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,Oo),c=a.getColumn(1,vo),l=a.getColumn(2,Go),h=Km.copy(f).add(c).add(l).add(i),u=Xm.copy(h).subtract(e),d=r.dot(u);return o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),n[0]=o,n[1]=s,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Oo);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,vo);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,Go);return o.transformAsPoint(e),this.halfAxes=new Z([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var el=new w,rl=new w,he=class{constructor(e=[0,0,1],r=0){X(this,"normal",void 0),X(this,"distance",void 0),this.normal=new w,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return ct(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=el.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,o){return this.normal.set(e,r,n),ct(Mt(this.normal.len(),1)),this.distance=o,this}clone(){return new he(this.normal,this.distance)}equals(e){return Mt(this.distance,e.distance)&&Mt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=rl.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=el.from(e),o=this.getPointDistance(n),s=rl.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var nl=[new w([1,0,0]),new w([0,1,0]),new w([0,0,1])],ol=new w,Zm=new w,Rt=class{constructor(e=[]){X(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*nl.length;let r=e.center,n=e.radius,o=0;for(let s of nl){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new he),a||(a=this.planes[o+1]=new he);let f=ol.copy(s).scale(-n).add(r);i.fromPointNormal(f,s);let c=ol.copy(s).scale(n).add(r),l=Zm.copy(s).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=ft.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case ft.OUTSIDE:return ft.OUTSIDE;case ft.INTERSECTING:r=ft.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(ct(Number.isFinite(r),"parentPlaneMask is required."),r===Rt.MASK_OUTSIDE||r===Rt.MASK_INSIDE)return r;let n=Rt.MASK_INSIDE,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],f=e.intersectPlane(a);if(f===ft.OUTSIDE)return Rt.MASK_OUTSIDE;f===ft.INTERSECTING&&(n|=i)}return n}};X(Rt,"MASK_OUTSIDE",4294967295);X(Rt,"MASK_INSIDE",0);X(Rt,"MASK_INDETERMINATE",2147483647);var DT=new w,RT=new w,LT=new w,OT=new w,vT=new w;var JT=new w,zT=new w,QT=new w,VT=new w,jT=new w,KT=new w,XT=new w,ZT=new w,YT=new w,WT=new w,qT=new w,$T=new w;var $t=new Z,Wm=new Z,qm=new Z,No=new Z,sl=new Z;function Ii(t,e={}){let r=kt.EPSILON20,n=10,o=0,s=0,i=Wm,a=qm;i.identity(),a.copy(t);let f=r*$m(a);for(;s<n&&tp(a)>f;)ep(a,No),sl.copy(No).transpose(),a.multiplyRight(No),a.multiplyLeft(sl),i.multiplyRight(No),++o>2&&(++s,o=0);return e.unitary=i.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function $m(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var wi=[1,0,0],Mi=[2,2,1];function tp(t){let e=0;for(let r=0;r<3;++r){let n=t[$t.getElementIndex(Mi[r],wi[r])];e+=2*n*n}return Math.sqrt(e)}function ep(t,e){let r=kt.EPSILON15,n=0,o=1;for(let c=0;c<3;++c){let l=Math.abs(t[$t.getElementIndex(Mi[c],wi[c])]);l>n&&(o=c,n=l)}let s=wi[o],i=Mi[o],a=1,f=0;if(Math.abs(t[$t.getElementIndex(i,s)])>r){let c=t[$t.getElementIndex(i,i)],l=t[$t.getElementIndex(s,s)],h=t[$t.getElementIndex(i,s)],u=(c-l)/2/h,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),f=d*a}return Z.IDENTITY.to(e),e[$t.getElementIndex(s,s)]=e[$t.getElementIndex(i,i)]=a,e[$t.getElementIndex(i,s)]=f,e[$t.getElementIndex(s,i)]=-f,e}var Me=new w,np=new w,op=new w,sp=new w,ip=new w,ap=new Z,cp={diagonal:new Z,unitary:new Z};function Si(t,e=new Ve){if(!t||t.length===0)return e.halfAxes=new Z([0,0,0,0,0,0,0,0,0]),e.center=new w,e;let r=t.length,n=new w(0,0,0);for(let B of t)n.add(B);let o=1/r;n.multiplyByScalar(o);let s=0,i=0,a=0,f=0,c=0,l=0;for(let B of t){let p=Me.copy(B).subtract(n);s+=p.x*p.x,i+=p.x*p.y,a+=p.x*p.z,f+=p.y*p.y,c+=p.y*p.z,l+=p.z*p.z}s*=o,i*=o,a*=o,f*=o,c*=o,l*=o;let h=ap;h[0]=s,h[1]=i,h[2]=a,h[3]=i,h[4]=f,h[5]=c,h[6]=a,h[7]=c,h[8]=l;let{unitary:u}=Ii(h,cp),d=e.halfAxes.copy(u),A=d.getColumn(0,op),m=d.getColumn(1,sp),g=d.getColumn(2,ip),_=-Number.MAX_VALUE,y=-Number.MAX_VALUE,T=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=Number.MAX_VALUE,I=Number.MAX_VALUE;for(let B of t)Me.copy(B),_=Math.max(Me.dot(A),_),y=Math.max(Me.dot(m),y),T=Math.max(Me.dot(g),T),b=Math.min(Me.dot(A),b),C=Math.min(Me.dot(m),C),I=Math.min(Me.dot(g),I);A=A.multiplyByScalar(.5*(b+_)),m=m.multiplyByScalar(.5*(C+y)),g=g.multiplyByScalar(.5*(I+T)),e.center.copy(A).add(m).add(g);let M=np.set(_-b,y-C,T-I).multiplyByScalar(.5),L=new Z([M[0],0,0,0,M[1],0,0,0,M[2]]);return e.halfAxes.multiplyRight(L),e}var Sr;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Sr||(Sr={}));var Ie;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Ie||(Ie={}));var wn;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(wn||(wn={}));var ue;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(ue||(ue={}));var Fr="4.2.0-alpha.4";var Et={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Ib=Object.keys(Et),Se={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Fi(t,e,r){z(t instanceof ArrayBuffer);let n=new TextDecoder("utf8"),o=new Uint8Array(t,e,r);return n.decode(o)}function il(t,e=0){let r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}var al="4.2.0-alpha.4";var cl={name:"Draco",id:"draco",module:"draco",version:al,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function fl(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Di(t){let e=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],h=a[c+1],u=a[c+2];e=l<e?l:e,r=h<r?h:r,n=u<n?u:n,o=l>o?l:o,s=h>s?h:s,i=u>i?u:i}return[[e,r,n],[o,s,i]]}function Ri(t,e,r){let n=fl(e.value),o=r||ll(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function ll(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}function ul(t,e,r){let n=dl(e.metadata),o=[],s=fp(e.attributes);for(let i in t){let a=t[i],f=hl(i,a,s[i]);o.push(f)}if(r){let i=hl("indices",r);o.push(i)}return{fields:o,metadata:n}}function fp(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function hl(t,e,r){let n=r?dl(r.metadata):void 0;return Ri(t,e,n)}function dl(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Al={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},lp={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},hp=4,Mn=class{constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let o=this.decoder.GetEncodedGeometryType(n),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let u=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(u)}let a=this._getDracoLoaderData(s,o,r),f=this._getMeshData(s,a,r),c=Di(f.attributes),l=ul(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:s}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let s=this.decoder.GetAttribute(e,o),i=this._getAttributeMetadata(e,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(s,r);f&&(n[s.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let o=this._getMeshAttributes(r,e,n);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,r,n){let o={};for(let s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let{value:a,size:f}=this._getAttributeValues(r,s);o[i]={value:a,size:f,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*hp,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),Ap(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=lp[r.data_type],o=r.num_components,i=e.num_points()*o,a=i*n.BYTES_PER_ELEMENT,f=up(this.draco,n),c,l=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,h,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,i).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=e.attribute_type;for(let i in Al)if(this.draco[i]===o)return Al[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let o=0;o<n;o++){let s=this.metadataQuerier.GetEntryName(e,o);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=dp(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,o=[...r,...n];for(let s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function up(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function dp(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function Ap(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var mp="1.5.6",pp="1.4.1",Li=`https://www.gstatic.com/draco/versioned/decoders/${mp}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Oi={[yt.DECODER]:`${Li}/${yt.DECODER}`,[yt.DECODER_WASM]:`${Li}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${Li}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${pp}/javascript/${yt.ENCODER}`},In;async function ml(t){let e=t.modules||{};return e.draco3d?In=In||e.draco3d.createDecoderModule({}).then(r=>({draco:r})):In=In||gp(t),await In}async function gp(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await qt(Oi[yt.FALLBACK_DECODER],"draco",t,yt.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await qt(Oi[yt.DECODER],"draco",t,yt.DECODER),await qt(Oi[yt.DECODER_WASM],"draco",t,yt.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await Bp(e,r)}function Bp(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var Uo={...cl,parse:xp};async function xp(t,e){let{draco:r}=await ml(e),n=new Mn(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var _p={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},rt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={..._p,...rt};var vi={[rt.DOUBLE]:Float64Array,[rt.FLOAT]:Float32Array,[rt.UNSIGNED_SHORT]:Uint16Array,[rt.UNSIGNED_INT]:Uint32Array,[rt.UNSIGNED_BYTE]:Uint8Array,[rt.BYTE]:Int8Array,[rt.SHORT]:Int16Array,[rt.INT]:Int32Array},Ep={DOUBLE:rt.DOUBLE,FLOAT:rt.FLOAT,UNSIGNED_SHORT:rt.UNSIGNED_SHORT,UNSIGNED_INT:rt.UNSIGNED_INT,UNSIGNED_BYTE:rt.UNSIGNED_BYTE,BYTE:rt.BYTE,SHORT:rt.SHORT,INT:rt.INT},Gi="Failed to convert GL type",ut=class{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(let r in vi)if(vi[r]===e)return r;throw new Error(Gi)}static fromName(e){let r=Ep[e];if(!r)throw new Error(Gi);return r}static getArrayType(e){switch(e){case rt.UNSIGNED_SHORT_5_6_5:case rt.UNSIGNED_SHORT_4_4_4_4:case rt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=vi[e];if(!r)throw new Error(Gi);return r}}static getByteSize(e){return ut.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(ut.getArrayType(e))}static createTypedArray(e,r,n=0,o){o===void 0&&(o=(r.byteLength-n)/ut.getByteSize(e));let s=ut.getArrayType(e);return new s(r,n,o)}};function pl(t,e){if(!t)throw new Error(`math.gl assertion failed. ${e}`)}function Ni(t,e=[0,0,0]){let r=t>>11&31,n=t>>5&63,o=t&31;return e[0]=r<<3,e[1]=n<<2,e[2]=o<<3,e}var cw=1/256;var fw=new Je,lw=new w,hw=new Je,uw=new Je,dw=new Uint8Array(1);function gl(t,e=255){return js(t,0,e)/e*2-1}function Bl(t){return t<0?-1:1}function xl(t,e,r,n){if(pl(n),t<0||t>r||e<0||e>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=gl(t,r),n.y=gl(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let o=n.x;n.x=(1-Math.abs(n.y))*Bl(o),n.y=(1-Math.abs(o))*Bl(n.y)}return n.normalize()}function Ui(t,e,r){return xl(t,e,255,r)}var zt=class{constructor(e,r){this.featuresLength=0,this._cachedTypedArrays={},this.json=e,this.buffer=r}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,r=H.UNSIGNED_INT,n=1){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?this._getTypedArrayFromBinary(e,r,n,1,o.byteOffset):o}getPropertyArray(e,r,n){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?("componentType"in o&&(r=ut.fromName(o.componentType)),this._getTypedArrayFromBinary(e,r,n,this.featuresLength,o.byteOffset)):this._getTypedArrayFromArray(e,r,o)}getProperty(e,r,n,o,s){let i=this.json[e];if(!i)return i;let a=this.getPropertyArray(e,r,n);if(n===1)return a[o];for(let f=0;f<n;++f)s[f]=a[n*o+f];return s}_getTypedArrayFromBinary(e,r,n,o,s){let i=this._cachedTypedArrays,a=i[e];return a||(a=ut.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+s,o*n),i[e]=a),a}_getTypedArrayFromArray(e,r,n){let o=this._cachedTypedArrays,s=o[e];return s||(s=ut.createTypedArray(r,n),o[e]=s),s}};var yp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cp={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},Tp={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};function _l(t,e,r,n){let{componentType:o}=t;z(t.componentType);let s=typeof o=="string"?ut.fromName(o):o,i=yp[t.type],a=Cp[t.type],f=Tp[t.type];return r+=t.byteOffset,{values:ut.createTypedArray(s,e,r,i*n),type:s,size:i,unpacker:a,packer:f}}var te=t=>t!==void 0;function El(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy"),o=e.HIERARCHY;return o&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=o,n=o),n?bp(n,r):null}function bp(t,e){let r,n,o,s=t.instancesLength,i=t.classes,a=t.classIds,f=t.parentCounts,c=t.parentIds,l=s;te(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,o=getBinaryAccessor(a),a=o.createArrayBufferView(e.buffer,e.byteOffset+a.byteOffset,s));let h;if(te(f))for(te(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,o=getBinaryAccessor(f),f=o.createArrayBufferView(e.buffer,e.byteOffset+f.byteOffset,s)),h=new Uint16Array(s),l=0,r=0;r<s;++r)h[r]=l,l+=f[r];te(c)&&te(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,o=getBinaryAccessor(c),c=o.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,l));let u=i.length;for(r=0;r<u;++r){let g=i[r].length,_=i[r].instances,y=getBinaryProperties(g,_,e);i[r].instances=combine(y,_)}let d=new Array(u).fill(0),A=new Uint16Array(s);for(r=0;r<s;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:f,parentIndexes:h,parentIds:c};return Ip(m),m}function Dr(t,e,r){if(!t)return;let n=t.parentCounts;return t.parentIds?r(t,e):n>0?wp(t,e,r):Mp(t,e,r)}function wp(t,e,r){let n=t.classIds,o=t.parentCounts,s=t.parentIds,i=t.parentIndexes,a=n.length,f=scratchVisited;f.length=Math.max(f.length,a);let c=++marker,l=scratchStack;for(l.length=0,l.push(e);l.length>0;){if(e=l.pop(),f[e]===c)continue;f[e]=c;let h=r(t,e);if(te(h))return h;let u=o[e],d=i[e];for(let A=0;A<u;++A){let m=s[d+A];m!==e&&l.push(m)}}return null}function Mp(t,e,r){let n=!0;for(;n;){let o=r(t,e);if(te(o))return o;let s=t.parentIds[e];n=s!==e,e=s}throw new Error("traverseHierarchySingleParent")}function Ip(t){let e=[],n=t.classIds.length;for(let o=0;o<n;++o)yl(t,o,stack)}function yl(t,e,r){let n=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=t.classIds.length;if(!te(o))return;assert(e<a,`Parent index ${e} exceeds the total number of instances: ${a}`),assert(r.indexOf(e)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(e);let f=te(n)?n[e]:1,c=te(n)?s[e]:e;for(let l=0;l<f;++l){let h=o[c+l];h!==e&&yl(t,h,r)}r.pop(e)}function Ct(t){return t!=null}var Po=(t,e)=>t,Sp={HIERARCHY:!0,extensions:!0,extras:!0},de=class{constructor(e,r,n,o={}){z(n>=0),this.json=e||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let s in this.json)Sp[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=El(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._hierarchy){let n=Dr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s];return o.classes[i].name===r});return Ct(n)}return!1}isExactClass(e,r){return z(typeof r=="string",r),this.getExactClassName(e)===r}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){let r=this._hierarchy.classIds[e];return this._hierarchy.classes[r].name}}hasProperty(e,r){return this._checkBatchId(e),z(typeof r=="string",r),Ct(this._properties[r])||this._hasPropertyInHierarchy(e,r)}getPropertyNames(e,r){this._checkBatchId(e),r=Ct(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,r),r}getProperty(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(Ct(o))return this._getBinaryProperty(o,e)}let n=this._properties[r];if(Ct(n))return Po(n[e],!0);if(this._hierarchy){let o=this._getHierarchyProperty(e,r);if(Ct(o))return o}}setProperty(e,r,n){let o=this.featureCount;if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,r,n))return;let s=this._properties[r];Ct(s)||(this._properties[r]=new Array(o),s=this._properties[r]),s[e]=Po(n,!0)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,r){return e.unpack(e.typedArray,r)}_setBinaryProperty(e,r,n){e.pack(n,e.typedArray,r)}_initializeBinaryProperties(){let e=null;for(let r in this._properties){let n=this._properties[r],o=this._initializeBinaryProperty(r,n);o&&(e=e||{},e[r]=o)}return e}_initializeBinaryProperty(e,r){if("byteOffset"in r){let n=r;z(this.binary,`Property ${e} requires a batch table binary.`),z(n.type,`Property ${e} requires a type.`);let o=_l(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:o.values,componentCount:o.size,unpack:o.unpacker,pack:o.packer}}return null}_hasPropertyInHierarchy(e,r){if(!this._hierarchy)return!1;let n=Dr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s],a=o.classes[i].instances;return Ct(a[r])});return Ct(n)}_getPropertyNamesInHierarchy(e,r){Dr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(e,r){return Dr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s],a=n.classIndexes[o],f=i.instances[r];return Ct(f)?Ct(f.typedArray)?this._getBinaryProperty(f,a):Po(f[a],!0):null})}_setHierarchyProperty(e,r,n,o){let s=Dr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],l=i.classIndexes[a],h=c.instances[n];return Ct(h)?(z(a===r,`Inherited property "${n}" is read-only.`),Ct(h.typedArray)?this._setBinaryProperty(h,l,o):h[l]=Po(o,!0),!0):!1});return Ct(s)}};function Fe(t,e,r=0){let n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,t.version!==1)throw new Error(`3D Tile Version ${t.version} not supported`);return r}var Rr=4,Cl="b3dm tile in legacy format.";function Lr(t,e,r){let n=new DataView(e),o;t.header=t.header||{};let s=n.getUint32(r,!0);r+=Rr;let i=n.getUint32(r,!0);r+=Rr;let a=n.getUint32(r,!0);r+=Rr;let f=n.getUint32(r,!0);return r+=Rr,a>=570425344?(r-=Rr*2,o=s,a=i,f=0,s=0,i=0,console.warn(Cl)):f>=570425344&&(r-=Rr,o=a,a=s,f=i,s=0,i=0,console.warn(Cl)),t.header.featureTableJsonByteLength=s,t.header.featureTableBinaryByteLength=i,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=f,t.header.batchLength=o,r}function Or(t,e,r,n){return r=Fp(t,e,r,n),r=Dp(t,e,r,n),r}function Fp(t,e,r,n){let{featureTableJsonByteLength:o,featureTableBinaryByteLength:s,batchLength:i}=t.header||{};if(t.featureTableJson={BATCH_LENGTH:i||0},o&&o>0){let a=Fi(e,r,o);t.featureTableJson=JSON.parse(a)}return r+=o||0,t.featureTableBinary=new Uint8Array(e,r,s),r+=s||0,r}function Dp(t,e,r,n){let{batchTableJsonByteLength:o,batchTableBinaryByteLength:s}=t.header||{};if(o&&o>0){let i=Fi(e,r,o);t.batchTableJson=JSON.parse(i),r+=o,s&&s>0&&(t.batchTableBinary=new Uint8Array(e,r,s),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=s)}return r}function Pi(t,e,r){if(!e&&(!t||!t.batchIds||!r))return null;let{batchIds:n,isRGB565:o,pointCount:s=0}=t;if(n&&r){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=n[a],l=r.getProperty(f,"dimensions").map(h=>h*255);i[a*3]=l[0],i[a*3+1]=l[1],i[a*3+2]=l[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(e&&o){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=Ni(e[a]);i[a*3]=f[0],i[a*3+1]=f[1],i[a*3+2]=f[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return e&&e.length===s*3?{type:H.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}var Tl=new w;function bl(t,e){if(!e)return null;if(t.isOctEncoded16P){let r=new Float32Array((t.pointsLength||0)*3);for(let n=0;n<(t.pointsLength||0);n++)Ui(e[n*2],e[n*2+1],Tl),Tl.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:e}}function wl(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,Rp(t,e)):{type:H.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function Rp(t,e){let r=new w,n=new Float32Array(t.pointCount*3);for(let o=0;o<t.pointCount;o++)r.set(e[o*3],e[o*3+1],e[o*3+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,o*3);return n}async function Ml(t,e,r,n,o){r=Fe(t,e,r),r=Lr(t,e,r),r=Or(t,e,r,n),Lp(t);let{featureTable:s,batchTable:i}=Op(t);return await Pp(t,s,i,n,o),vp(t,s,n),Gp(t,s,i),Np(t,s),r}function Lp(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function Op(t){let e=new zt(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=Up(t,e);return{featureTable:e,batchTable:n}}function vp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.positions){if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",H.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=(1<<16)-1,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=wl(t,n,r)}}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Gp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Pi(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function Np(t,e){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",H.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=bl(t,r)}}function Up(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),t.batchIds)){let n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:o,batchTableBinary:s}=t;r=new de(o,s,n)}return r}async function Pp(t,e,r,n,o){let s,i,a,f=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(a=f.properties);let c=e.getExtension("3DTILES_draco_point_compression");if(c){i=c.properties;let h=c.byteOffset,u=c.byteLength;if(!i||!Number.isFinite(h)||!u)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(t.featureTableBinary||[]).slice(h,h+u),t.hasPositions=Number.isFinite(i.POSITION),t.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),t.hasNormals=Number.isFinite(i.NORMAL),t.hasBatchIds=Number.isFinite(i.BATCH_ID),t.isTranslucent=Number.isFinite(i.RGBA)}if(!s)return!0;let l={buffer:s,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await Hp(t,l,n,o)}async function Hp(t,e,r,n){if(!n)return;let o={...r,draco:{...r?.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];let s=await Ht(e.buffer,Uo,o,n),i=s.attributes.POSITION&&s.attributes.POSITION.value,a=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,c=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,l=i&&s.attributes.POSITION.value.quantization,h=f&&s.attributes.NORMAL.value.quantization;if(l){let d=s.POSITION.data.quantization,A=d.range;t.quantizedVolumeScale=new w(A,A,A),t.quantizedVolumeOffset=new w(d.minValues),t.quantizedRange=(1<<d.quantizationBits)-1,t.isQuantizedDraco=!0}h&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);let u={};if(e.batchTableProperties)for(let d of Object.keys(e.batchTableProperties))s.attributes[d]&&s.attributes[d].value&&(u[d.toLowerCase()]=s.attributes[d].value);t.attributes={positions:i,colors:Pi(t,a,void 0),normals:f,batchIds:c,...u}}var Ki={};ht(Ki,{decode:()=>T1,name:()=>C1});var Il="4.2.0-alpha.4";var kp=globalThis.loaders?.parseImageNode,Hi=typeof Image<"u",ki=typeof ImageBitmap<"u",Jp=Boolean(kp),Ji=xt?!0:Jp;function Sl(t){switch(t){case"auto":return ki||Hi||Ji;case"imagebitmap":return ki;case"image":return Hi;case"data":return Ji;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Fl(){if(ki)return"imagebitmap";if(Hi)return"image";if(Ji)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Dl(t){let e=zp(t);if(!e)throw new Error("Not an image");return e}function Sn(t){switch(Dl(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function zp(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Qp=/^data:image\/svg\+xml/,Vp=/\.svg((\?|#).*)?$/;function Ho(t){return t&&(Qp.test(t)||Vp.test(t))}function Rl(t,e){if(Ho(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return zi(t,e)}function zi(t,e){if(Ho(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ko(t,e,r){let n=Rl(t,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await jp(s||n,e)}finally{s&&o.revokeObjectURL(s)}}async function jp(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var Kp={},Ll=!0;async function Ol(t,e,r){let n;Ho(r)?n=await ko(t,e,r):n=zi(t,r);let o=e&&e.imagebitmap;return await Xp(n,o)}async function Xp(t,e=null){if((Zp(e)||!Ll)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Ll=!1}return await createImageBitmap(t)}function Zp(t){for(let e in t||Kp)return!1;return!0}function vl(t){return!$p(t,"ftyp",4)||!(t[8]&96)?null:Yp(t)}function Yp(t){switch(Wp(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Wp(t,e,r){return String.fromCharCode(...t.slice(e,r))}function qp(t){return[...t].map(e=>e.charCodeAt(0))}function $p(t,e,r=0){let n=qp(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var ee=!1,Fn=!0;function je(t){let e=Dn(t);return e1(e)||o1(e)||r1(e)||n1(e)||t1(e)}function t1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=vl(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function e1(t){let e=Dn(t);return e.byteLength>=24&&e.getUint32(0,ee)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ee),height:e.getUint32(20,ee)}:null}function r1(t){let e=Dn(t);return e.byteLength>=10&&e.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Fn),height:e.getUint16(8,Fn)}:null}function n1(t){let e=Dn(t);return e.byteLength>=14&&e.getUint16(0,ee)===16973&&e.getUint32(2,Fn)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Fn),height:e.getUint32(22,Fn)}:null}function o1(t){let e=Dn(t);if(!(e.byteLength>=3&&e.getUint16(0,ee)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=s1(),s=2;for(;s+9<e.byteLength;){let i=e.getUint16(s,ee);if(o.has(i))return{mimeType:"image/jpeg",height:e.getUint16(s+5,ee),width:e.getUint16(s+7,ee)};if(!n.has(i))return null;s+=2,s+=e.getUint16(s,ee)}return null}function s1(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Dn(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function Gl(t,e){let{mimeType:r}=je(t)||{},n=globalThis.loaders?.parseImageNode;return z(n),await n(t,r)}async function Nl(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:s}=r||{},i=i1(o),a;switch(i){case"imagebitmap":a=await Ol(t,e,s);break;case"image":a=await ko(t,e,s);break;case"data":a=await Gl(t,e);break;default:z(!1)}return o==="data"&&(a=Sn(a)),a}function i1(t){switch(t){case"auto":case"data":return Fl();default:return Sl(t),t}}var a1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],c1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],f1={image:{type:"auto",decode:!0}},Qi={id:"image",module:"images",name:"Images",version:Il,mimeTypes:c1,extensions:a1,parse:Nl,tests:[t=>Boolean(je(new DataView(t)))],options:f1};var Vi={};function ji(t){if(Vi[t]===void 0){let e=xt?h1(t):l1(t);Vi[t]=e}return Vi[t]}function l1(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(t)}function h1(t){switch(t){case"image/avif":case"image/webp":return u1(t);default:return!0}}function u1(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}function ot(t,e){if(!t)throw new Error(e||"assert failed: gltf")}var Jo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zo={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var d1=1.33,Ul=["SCALAR","VEC2","VEC3","VEC4"],A1=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],m1=new Map(A1),p1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},g1={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},B1={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Qo(t){return Ul[t-1]||Ul[0]}function vr(t){let e=m1.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Gr(t,e){let r=B1[t.componentType],n=p1[t.type],o=g1[t.componentType],s=t.count*n,i=t.count*n*o;ot(i>=0&&i<=e.byteLength);let a=zo[t.componentType],f=Jo[t.type];return{ArrayType:r,length:s,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function Rn(t){let{images:e,bufferViews:r}=t;e=e||[],r=r||[];let n=e.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let o=r.reduce((i,a)=>i+a.byteLength,0),s=e.reduce((i,a)=>{let{width:f,height:c}=a.image;return i+f*c},0);return o+Math.ceil(4*s*d1)}function Pl(t,e,r){let n=t.bufferViews[r];ot(n);let o=n.buffer,s=e[o];ot(s);let i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,n.byteLength)}function Hl(t,e,r){let n=typeof r=="number"?t.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let o=t.bufferViews?.[n.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);let{arrayBuffer:s,byteOffset:i}=e[o.buffer],a=(i||0)+(n.byteOffset||0)+(o.byteOffset||0),{ArrayType:f,length:c,componentByteSize:l,numberOfComponentsInElement:h}=Gr(n,o),u=l*h,d=o.byteStride||u;if(typeof o.byteStride>"u"||o.byteStride===u)return new f(s,a,c);let A=new f(c);for(let m=0;m<n.count;m++){let g=new f(s,a+m*d,h);A.set(g,m*h)}return A}function x1(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var K=class{constructor(e){this.gltf={json:e?.json||x1(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.getRequiredExtensions().find(o=>o===e);return typeof r=="string"||typeof n=="string"}getExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.json.extensions||{};return r?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,r){return(e.extensions||{})[r]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,r){if(typeof r=="object")return r;let n=this.json[e]&&this.json[e][r];if(!n)throw new Error(`glTF file error: Could not find ${e}[${r}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);let r=e.buffer,n=this.gltf.buffers[r];ot(n);let o=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,o,e.byteLength)}getTypedArrayForAccessor(e){let r=this.getAccessor(e);return Hl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(e){e=this.getAccessor(e);let r=this.getBufferView(e.bufferView),o=this.getBuffer(r.buffer).data,s=r.byteOffset||0;return new Uint8Array(o,s,r.byteLength)}addApplicationData(e,r){return this.json[e]=r,this}addExtraData(e,r){return this.json.extras=this.json.extras||{},this.json.extras[e]=r,this}addObjectExtension(e,r,n){return e.extensions=e.extensions||{},e.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(e,r,n){let o=e.extensions||{};o[r]=n}removeObjectExtension(e,r){let n=e?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let o=this.json.extensionsRemoved;o.includes(r)||o.push(r)}delete n[r]}addExtension(e,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=r,this.registerUsedExtension(e),r}addRequiredExtension(e,r={}){return ot(r),this.addExtension(e,r),this.registerRequiredExtension(e),r}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(e)||r.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:r}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(e){let{meshIndex:r,matrix:n}=e;this.json.nodes=this.json.nodes||[];let o={mesh:r};return n&&(o.matrix=n),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(e){let{attributes:r,indices:n,material:o,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(r),mode:s}]};if(n){let f=this._addIndices(n);a.primitives[0].indices=f}return Number.isFinite(o)&&(a.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,r){let n=je(e),o=r||n?.mimeType,i={bufferView:this.addBufferView(e),mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e,r=0,n=this.byteLength){let o=e.byteLength;ot(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let s={buffer:r,byteOffset:n,byteLength:o};return this.byteLength+=wt(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(e,r){let n={bufferView:e,type:Qo(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,r={size:3}){let n=this.addBufferView(e),o={min:r.min,max:r.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(e,r.size));let s={size:r.size,componentType:vr(e),count:Math.round(e.length/r.size),min:o.min,max:o.max};return this.addAccessor(n,Object.assign(s,r))}addTexture(e){let{imageIndex:r}=e,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];let e=this.byteLength,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;for(let s of this.sourceBuffers||[])o=Ns(s,n,o);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,r){let n=!0;for(;n;){let o=e.indexOf(r);o>-1?e.splice(o,1):n=!1}}_addAttributes(e={}){let r={};for(let n in e){let o=e[n],s=this._getGltfAttributeName(n),i=this.addBinaryBuffer(o.value,o);r[s]=i}return r}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,r){let n={min:null,max:null};if(e.length<r)return n;n.min=[],n.max=[];let o=e.subarray(0,r);for(let s of o)n.min.push(s),n.max.push(s);for(let s=r;s<e.length;s+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],e[s+i]),n.max[0+i]=Math.max(n.max[0+i],e[s+i]);return n}};function kl(t){return(t%1+1)%1}var Jl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},_1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},zl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Ln(t,e){return zl[e]*Jl[t]}function Nr(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let o=t.getTypedArrayForBufferView(e),s=Ur(o,"SCALAR",r,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function Ur(t,e,r,n=1){let o=Jl[e],s=_1[r],i=zl[r],a=n*o,f=a*i,c=t.buffer,l=t.byteOffset;return l%i!==0&&(c=new Uint8Array(c).slice(l,l+f).buffer,l=0),new s(c,l,a)}function Pr(t,e,r){let n=`TEXCOORD_${e.texCoord||0}`,o=r.attributes[n],s=t.getTypedArrayForAccessor(o),i=t.gltf.json,a=e.index,f=i.textures?.[a]?.source;if(typeof f<"u"){let c=i.images?.[f]?.mimeType,l=t.gltf.images?.[f];if(l&&typeof l.width<"u"){let h=[];for(let u=0;u<s.length;u+=2){let d=E1(l,c,s,u,e.channels);h.push(d)}return h}}return[]}function Vo(t,e,r,n,o){if(!r?.length)return;let s=[];for(let l of r){let h=n.findIndex(u=>u===l);h===-1&&(h=n.push(l)-1),s.push(h)}let i=new Uint32Array(s),a=t.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=t.addBufferView(i,a,0),c=t.addAccessor(f,{size:1,componentType:vr(i),count:i.length});o.attributes[e]=c}function E1(t,e,r,n,o=[0]){let s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],f=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(f=4);let c=y1(i,a,t,f),l=0;for(let h of o){let u=typeof h=="number"?Object.values(s)[h]:s[h],d=c+u.offset,A=Sn(t);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];l|=m<<u.shift}return l}function y1(t,e,r,n=1){let o=r.width,s=kl(t)*(o-1),i=Math.round(s),a=r.height,f=kl(e)*(a-1),c=Math.round(f),l=r.components?r.components:n;return(c*o+i)*l}function jo(t,e,r,n,o){let s=[];for(let i=0;i<e;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/o,l=f/o;s.push(t.slice(c,c+l))}return s}function Ko(t,e,r){let n=[];for(let o=0;o<e;o++){let s=o*r;n.push(t.slice(s,s+r))}return n}function Xo(t,e,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let o=[],s=new TextDecoder("utf8"),i=0;for(let a=0;a<t;a++){let f=n[a+1]-n[a];if(f+i<=e.length){let c=e.subarray(i,f+i),l=s.decode(c);o.push(l),i+=f}}return o}return[]}var Ql="EXT_mesh_features",C1=Ql;async function T1(t,e){let r=new K(t);b1(r,e)}function b1(t,e){let r=t.gltf.json;if(r.meshes)for(let n of r.meshes)for(let o of n.primitives)w1(t,o,e)}function w1(t,e,r){if(!r?.gltf?.loadBuffers)return;let o=e.extensions?.[Ql]?.featureIds;if(o)for(let s of o){let i;if(typeof s.attribute<"u"){let a=`_FEATURE_ID_${s.attribute}`,f=e.attributes[a];i=t.getTypedArrayForAccessor(f)}else typeof s.texture<"u"&&r?.gltf?.loadImages?i=Pr(t,s.texture,e):i=[];s.data=i}}var Yi={};ht(Yi,{decode:()=>I1,name:()=>M1});var Xi="EXT_structural_metadata",M1=Xi;async function I1(t,e){let r=new K(t);S1(r,e)}function S1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Xi);r&&(e.gltf?.loadImages&&F1(t,r),D1(t,r))}function F1(t,e){let r=e.propertyTextures,n=t.gltf.json;if(r&&n.meshes)for(let o of n.meshes)for(let s of o.primitives)L1(t,r,s,e)}function D1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.propertyTables;if(n&&o)for(let s in n){let i=R1(o,s);i&&v1(t,r,i)}}function R1(t,e){for(let r of t)if(r.class===e)return r;return null}function L1(t,e,r,n){if(!e)return;let s=r.extensions?.[Xi]?.propertyTextures;if(s)for(let i of s){let a=e[i];O1(t,a,r,n)}}function O1(t,e,r,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let o=e.class;for(let s in e.properties){let i=`${o}_${s}`,a=e.properties?.[s];if(!a)continue;a.data||(a.data=[]);let f=a.data,c=Pr(t,a,r);c!==null&&(Vo(t,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function v1(t,e,r){let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=G1(t,e,i,o,a);a.data=f}}}function G1(t,e,r,n,o){let s=[],i=o.values,a=t.getTypedArrayForBufferView(i),f=N1(t,r,o,n),c=U1(t,o,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=P1(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{s=Xo(n,a,f,c);break}case"ENUM":{s=H1(e,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return s}function N1(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?Nr(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function U1(t,e,r){return typeof e.stringOffsets<"u"?Nr(t,e.stringOffsets,e.stringOffsetType||"UINT32",r):null}function P1(t,e,r,n){let o=t.array,s=t.count,i=Ln(t.type,t.componentType),a=r.byteLength/i,f;return t.componentType?f=Ur(r,t.type,t.componentType,a):f=r,o?n?jo(f,e,n,r.length,i):s?Ko(f,e,s):[]:f}function H1(t,e,r,n,o){let s=e.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=t.enums?.[s];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);let a=i.valueType||"UINT16",f=Ln(e.type,a),c=n.byteLength/f,l=Ur(n,e.type,a,c);if(l||(l=n),e.array){if(o)return k1({valuesData:l,numberOfElements:r,arrayOffsets:o,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let h=e.count;return h?J1(l,r,h,i):[]}return Zi(l,0,r,i)}function k1(t){let{valuesData:e,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:o,elementSize:s,enumEntry:i}=t,a=[];for(let f=0;f<r;f++){let c=n[f],l=n[f+1]-n[f];if(l+c>o)break;let h=c/s,u=l/s,d=Zi(e,h,u,i);a.push(d)}return a}function J1(t,e,r,n){let o=[];for(let s=0;s<e;s++){let i=r*s,a=Zi(t,i,r,n);o.push(a)}return o}function Zi(t,e,r,n){let o=[];for(let s=0;s<r;s++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)o.push("");else{let i=t[e+s],a=z1(n,i);a?o.push(a.name):o.push("")}return o}function z1(t,e){for(let r of t.values)if(r.value===e)return r;return null}var Wi={};ht(Wi,{decode:()=>V1,name:()=>Q1});var Vl="EXT_feature_metadata",Q1=Vl;async function V1(t,e){let r=new K(t);j1(r,e)}function j1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Vl);r&&(e.gltf?.loadImages&&K1(t,r),X1(t,r))}function K1(t,e){let r=e.schema;if(!r)return;let n=r.classes,{featureTextures:o}=e;if(n&&o)for(let s in n){let i=n[s],a=Y1(o,s);a&&q1(t,a,i)}}function X1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.featureTables;if(n&&o)for(let s in n){let i=Z1(o,s);i&&W1(t,r,i)}}function Z1(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function Y1(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function W1(t,e,r){if(!r.class)return;let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=$1(t,e,i,o,a);a.data=f}}}function q1(t,e,r){let n=e.class;for(let o in r.properties){let s=e?.properties?.[o];if(s){let i=og(t,s,n);s.data=i}}}function $1(t,e,r,n,o){let s=[],i=o.bufferView,a=t.getTypedArrayForBufferView(i),f=tg(t,r,o,n),c=eg(t,r,o,n);return r.type==="STRING"||r.componentType==="STRING"?s=Xo(n,a,f,c):rg(r)&&(s=ng(r,n,a,f)),s}function tg(t,e,r,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Nr(t,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function eg(t,e,r,n){return typeof r.stringOffsetBufferView<"u"?Nr(t,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function rg(t){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function ng(t,e,r,n){let o=t.type==="ARRAY",s=t.componentCount,i="SCALAR",a=t.componentType||t.type,f=Ln(i,a),c=r.byteLength/f,l=Ur(r,i,a,c);return o?n?jo(l,e,n,r.length,f):s?Ko(l,e,s):[]:l}function og(t,e,r){let n=t.gltf.json;if(!n.meshes)return[];let o=[];for(let s of n.meshes)for(let i of s.primitives)sg(t,r,e,o,i);return o}function sg(t,e,r,n,o){let s={channels:r.channels,...r.texture},i=Pr(t,s,o);i&&Vo(t,e,i,n,o)}var jl="4.2.0-alpha.4";var Kl="4.2.0-alpha.4";var Zo={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},qi;async function ta(t){let e=t.modules||{};return e.basis?e.basis:(qi=qi||ig(t),await qi)}async function ig(t){let e=null,r=null;return[e,r]=await Promise.all([await qt(Zo.TRANSCODER,"textures",t),await qt(Zo.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await ag(e,r)}function ag(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var $i;async function ea(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:($i=$i||cg(t),await $i)}async function cg(t){let e=null,r=null;return[e,r]=await Promise.all([await qt(Zo.ENCODER,"textures",t),await qt(Zo.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await fg(e,r)}function fg(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:f})})})}var Ke={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var lg=["","WEBKIT_","MOZ_"],Xl={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Yo=null;function Zl(t){if(!Yo){t=t||hg()||void 0,Yo=new Set;for(let e of lg)for(let r in Xl)if(t&&t.getExtension(`${e}${r}`)){let n=Xl[r];Yo.add(n)}}return Yo}function hg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var CI=new Uint8Array([0]);var Yl,Wl,ql,$l,th,eh,rh,nh;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(Yl||(Yl={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(Wl||(Wl={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(ql||(ql={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}($l||($l={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(th||(th={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(eh||(eh={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(rh||(rh={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(nh||(nh={}));var It=[171,75,84,88,32,50,48,187,13,10,26,10];function oh(t){let e=new Uint8Array(t);return!(e.byteLength<It.length||e[0]!==It[0]||e[1]!==It[1]||e[2]!==It[2]||e[3]!==It[3]||e[4]!==It[4]||e[5]!==It[5]||e[6]!==It[6]||e[7]!==It[7]||e[8]!==It[8]||e[9]!==It[9]||e[10]!==It[10]||e[11]!==It[11])}var ug={etc1:{basisFormat:0,compressed:!0,format:Ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ke.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ke.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function na(t,e){if(e.basis.containerFormat==="auto"){if(oh(t)){let n=await ea(e);return sh(n.KTX2File,t,e)}let{BasisFile:r}=await ta(e);return ra(r,t,e)}switch(e.basis.module){case"encoder":let r=await ea(e);switch(e.basis.containerFormat){case"ktx2":return sh(r.KTX2File,t,e);case"basis":default:return ra(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await ta(e);return ra(n,t,e)}}function ra(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(dg(n,i,c,r));s.push(f)}return s}finally{n.close(),n.delete()}}function dg(t,e,r,n){let o=t.getImageWidth(e,r),s=t.getImageHeight(e,r),i=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ih(n,i),l=t.getImageTranscodedSizeInBytes(e,r,c),h=new Uint8Array(l);if(!t.transcodeImage(h,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:h,compressed:a,format:f,hasAlpha:i}}function sh(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),s=[];for(let i=0;i<o;i++){s.push(Ag(n,i,r));break}return[s]}finally{n.close(),n.delete()}}function Ag(t,e,r){let{alphaFlag:n,height:o,width:s}=t.getImageLevelInfo(e,0,0),{compressed:i,format:a,basisFormat:f}=ih(r,n),c=t.getImageTranscodedSizeInBytes(e,0,0,f),l=new Uint8Array(c);if(!t.transcodeImage(l,e,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:s,height:o,data:l,compressed:i,levelSize:c,hasAlpha:n,format:a}}function ih(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=Wo()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),ug[r]}function Wo(){let t=Zl();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var ah={name:"Basis",id:"basis",module:"textures",version:Kl,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},oa={...ah,parse:na};var Hr=!0,ch=1735152710,aa=12,qo=8,mg=1313821514,pg=5130562,gg=0,Bg=0,xg=1;function _g(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function fh(t,e=0,r={}){let n=new DataView(t),{magic:o=ch}=r,s=n.getUint32(e,!1);return s===o||s===ch}function lh(t,e,r=0,n={}){let o=new DataView(e),s=_g(o,r+0),i=o.getUint32(r+4,Hr),a=o.getUint32(r+8,Hr);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:s,version:i,json:{},binChunks:[]}),r+=aa,t.version){case 1:return Eg(t,o,r);case 2:return yg(t,o,r,n={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function Eg(t,e,r){z(t.header.byteLength>aa+qo);let n=e.getUint32(r+0,Hr),o=e.getUint32(r+4,Hr);return r+=qo,z(o===gg),sa(t,e,r,n),r+=n,r+=ia(t,e,r,t.header.byteLength),r}function yg(t,e,r,n){return z(t.header.byteLength>aa+qo),Cg(t,e,r,n),r+t.header.byteLength}function Cg(t,e,r,n){for(;r+8<=t.header.byteLength;){let o=e.getUint32(r+0,Hr),s=e.getUint32(r+4,Hr);switch(r+=qo,s){case mg:sa(t,e,r,o);break;case pg:ia(t,e,r,o);break;case Bg:n.strict||sa(t,e,r,o);break;case xg:n.strict||ia(t,e,r,o);break;default:break}r+=wt(o,4)}return r}function sa(t,e,r,n){let o=new Uint8Array(e.buffer,r,n),i=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(i),wt(n,4)}function ia(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),wt(n,4)}function ca(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;let n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return n.substr(0,n.lastIndexOf("/")+1)+t}var la={};ht(la,{decode:()=>vg,name:()=>Og});var Tg="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9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c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",wg=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Mg=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Ig={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Sg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function hh(t,e,r,n,o,s="NONE"){let i=await Fg();Lg(i,i.exports[Sg[o]],t,e,r,n,i.exports[Ig[s||"NONE"]])}var fa;async function Fg(){return fa||(fa=Dg()),fa}async function Dg(){let t=Tg;WebAssembly.validate(wg)&&(t=bg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let e=await WebAssembly.instantiate(Rg(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function Rg(t){let e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){let o=t.charCodeAt(n);e[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let r=0;for(let n=0;n<t.length;++n)e[r++]=e[n]<60?Mg[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,r)}function Lg(t,e,r,n,o,s,i){let a=t.exports.sbrk,f=n+3&-4,c=a(f*o),l=a(s.length),h=new Uint8Array(t.exports.memory.buffer);h.set(s,l);let u=e(c,n,o,l,s.length);if(u===0&&i&&i(c,f,o),r.set(h.subarray(c,c+n*o)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var $o="EXT_meshopt_compression",Og=$o;async function vg(t,e){let r=new K(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;let n=[];for(let o of t.json.bufferViews||[])n.push(Gg(r,o));await Promise.all(n),r.removeExtension($o)}async function Gg(t,e){let r=t.getObjectExtension(e,$o);if(r){let{byteOffset:n=0,byteLength:o=0,byteStride:s,count:i,mode:a,filter:f="NONE",buffer:c}=r,l=t.gltf.buffers[c],h=new Uint8Array(l.arrayBuffer,l.byteOffset+n,o),u=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await hh(u,i,s,h,a,f),t.removeObjectExtension(e,$o)}}var ha={};ht(ha,{name:()=>Ng,preprocess:()=>Ug});var kr="EXT_texture_webp",Ng=kr;function Ug(t,e){let r=new K(t);if(!ji("image/webp")){if(r.getRequiredExtensions().includes(kr))throw new Error(`gltf: Required extension ${kr} not supported by browser`);return}let{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,kr);s&&(o.source=s.source),r.removeObjectExtension(o,kr)}r.removeExtension(kr)}var ua={};ht(ua,{name:()=>Pg,preprocess:()=>Hg});var ts="KHR_texture_basisu",Pg=ts;function Hg(t,e){let r=new K(t),{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,ts);s&&(o.source=s.source,r.removeObjectExtension(o,ts))}r.removeExtension(ts)}var Aa={};ht(Aa,{decode:()=>Vg,encode:()=>jg,name:()=>zg,preprocess:()=>Qg});function uh(t){let e={};for(let r in t){let n=t[r];if(r!=="indices"){let o=da(n);e[r]=o}}return e}function da(t){let{buffer:e,size:r,count:n}=kg(t);return{value:e,size:r,byteOffset:0,count:n,type:Qo(r),componentType:vr(e)}}function kg(t){let e=t,r=1,n=0;return t&&t.value&&(e=t.value,r=t.size||1),e&&(ArrayBuffer.isView(e)||(e=Jg(e,Float32Array)),n=e.length/r),{buffer:e,size:r,count:n}}function Jg(t,e,r=!1){return t?Array.isArray(t)?new e(t):r&&!(t instanceof e)?new e(t):t:null}var De="KHR_draco_mesh_compression",zg=De;function Qg(t,e,r){let n=new K(t);for(let o of dh(n))n.getObjectExtension(o,De)}async function Vg(t,e,r){if(!e?.gltf?.decompressMeshes)return;let n=new K(t),o=[];for(let s of dh(n))n.getObjectExtension(s,De)&&o.push(Kg(n,s,e,r));await Promise.all(o),n.removeExtension(De)}function jg(t,e={}){let r=new K(t);for(let n of r.json.meshes||[])Xg(n,e),r.addRequiredExtension(De)}async function Kg(t,e,r,n){let o=t.getObjectExtension(e,De);if(!o)return;let s=t.getTypedArrayForBufferView(o.bufferView),i=ke(s.buffer,s.byteOffset),a={...r};delete a["3d-tiles"];let f=await Ht(i,Uo,a,n),c=uh(f.attributes);for(let[l,h]of Object.entries(c))if(l in e.attributes){let u=e.attributes[l],d=t.getAccessor(u);d?.min&&d?.max&&(h.min=d.min,h.max=d.max)}e.attributes=c,f.indices&&(e.indices=da(f.indices)),t.removeObjectExtension(e,De),Zg(e)}function Xg(t,e,r=4,n,o){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let s=n.DracoWriter.encodeSync({attributes:t}),i=o?.parseSync?.({attributes:t}),a=n._addFauxAttributes(i.attributes),f=n.addBufferView(s);return{primitives:[{attributes:a,mode:r,extensions:{[De]:{bufferView:f,attributes:a}}}]}}function Zg(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*dh(t){for(let e of t.json.meshes||[])for(let r of e.primitives)yield r}var pa={};ht(pa,{decode:()=>$g,name:()=>Yg});var ma="KHR_texture_transform",Yg=ma,es=new w,Wg=new Z,qg=new Z;async function $g(t,e){if(!new K(t).hasExtension(ma)||!e.gltf?.loadBuffers)return;let o=t.json.materials||[];for(let s=0;s<o.length;s++)tB(s,t)}function tB(t,e){let r=[],n=e.json.materials?.[t],o=n?.pbrMetallicRoughness?.baseColorTexture;o&&On(e,t,o,r);let s=n?.emissiveTexture;s&&On(e,t,s,r);let i=n?.normalTexture;i&&On(e,t,i,r);let a=n?.occlusionTexture;a&&On(e,t,a,r);let f=n?.pbrMetallicRoughness?.metallicRoughnessTexture;f&&On(e,t,f,r)}function On(t,e,r,n){let o=eB(r,n);if(!o)return;let s=t.json.meshes||[];for(let i of s)for(let a of i.primitives){let f=a.material;Number.isFinite(f)&&e===f&&rB(t,a,o)}}function eB(t,e){let r=t.extensions?.[ma],{texCoord:n=0}=t,{texCoord:o=n}=r;if(!(e.findIndex(([i,a])=>i===n&&a===o)!==-1)){let i=sB(r);return n!==o&&(t.texCoord=o),e.push([n,o]),{originalTexCoord:n,texCoord:o,matrix:i}}return null}function rB(t,e,r){let{originalTexCoord:n,texCoord:o,matrix:s}=r,i=e.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=t.json.accessors?.[i];if(a&&a.bufferView){let f=t.json.bufferViews?.[a.bufferView];if(f){let{arrayBuffer:c,byteOffset:l}=t.buffers[f.buffer],h=(l||0)+(a.byteOffset||0)+(f.byteOffset||0),{ArrayType:u,length:d}=Gr(a,f),A=zo[a.componentType],m=Jo[a.type],g=f.byteStride||A*m,_=new Float32Array(d);for(let y=0;y<a.count;y++){let T=new u(c,h+y*g,2);es.set(T[0],T[1],1),es.transformByMatrix3(s),_.set([es[0],es[1]],y*m)}n===o?nB(a,f,t.buffers,_):oB(o,a,e,t,_)}}}}function nB(t,e,r,n){t.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=r.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function oB(t,e,r,n,o){n.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});let s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes[`TEXCOORD_${t}`]=i.length-1)}function sB(t){let{offset:e=[0,0],rotation:r=0,scale:n=[1,1]}=t,o=new Z().set(1,0,0,0,1,0,e[0],e[1],1),s=Wg.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=qg.set(n[0],0,0,0,n[1],0,0,0,1);return o.multiplyRight(s).multiplyRight(i)}var ga={};ht(ga,{decode:()=>aB,encode:()=>cB,name:()=>iB});var Xe="KHR_lights_punctual",iB=Xe;async function aB(t){let e=new K(t),{json:r}=e,n=e.getExtension(Xe);n&&(e.json.lights=n.lights,e.removeExtension(Xe));for(let o of r.nodes||[]){let s=e.getObjectExtension(o,Xe);s&&(o.light=s.light),e.removeObjectExtension(o,Xe)}}async function cB(t){let e=new K(t),{json:r}=e;if(r.lights){let n=e.addExtension(Xe);ot(!n.lights),n.lights=r.lights,delete r.lights}if(e.json.lights){for(let n of e.json.lights){let o=n.node;e.addObjectExtension(o,Xe,n)}delete e.json.lights}}var Ba={};ht(Ba,{decode:()=>lB,encode:()=>hB,name:()=>fB});var vn="KHR_materials_unlit",fB=vn;async function lB(t){let e=new K(t),{json:r}=e;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,vn);e.removeExtension(vn)}function hB(t){let e=new K(t),{json:r}=e;if(e.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,vn,{}),e.addExtension(vn))}var xa={};ht(xa,{decode:()=>dB,encode:()=>AB,name:()=>uB});var Gn="KHR_techniques_webgl",uB=Gn;async function dB(t){let e=new K(t),{json:r}=e,n=e.getExtension(Gn);if(n){let o=mB(n,e);for(let s of r.materials||[]){let i=e.getObjectExtension(s,Gn);i&&(s.technique=Object.assign({},i,o[i.technique]),s.technique.values=pB(s.technique,e)),e.removeObjectExtension(s,Gn)}e.removeExtension(Gn)}}async function AB(t,e){}function mB(t,e){let{programs:r=[],shaders:n=[],techniques:o=[]}=t,s=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=s.decode(e.getTypedArrayForBufferView(i.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(i=>{i.fragmentShader=n[i.fragmentShader],i.vertexShader=n[i.vertexShader]}),o.forEach(i=>{i.program=r[i.program]}),o}function pB(t,e){let r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(n=>{t.uniforms[n].value&&!(n in r)&&(r[n]=t.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=e.getTexture(r[n].index))}),r}var Ah=[Yi,Ki,la,ha,ua,Aa,ga,Ba,xa,pa,Wi];function mh(t,e={},r){let n=Ah.filter(o=>gh(o.name,e));for(let o of n)o.preprocess?.(t,e,r)}async function ph(t,e={},r){let n=Ah.filter(o=>gh(o.name,e));for(let o of n)await o.decode?.(t,e,r)}function gh(t,e){let r=e?.gltf?.excludeExtensions||{};return!(t in r&&!r[t])}var _a="KHR_binary_glTF";function Bh(t){let e=new K(t),{json:r}=e;for(let n of r.images||[]){let o=e.getObjectExtension(n,_a);o&&Object.assign(n,o),e.removeObjectExtension(n,_a)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension(_a)}var xh={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},BB={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Ea=class{constructor(){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,r){this.json=e.json;let n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),Bh(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(let r in xh)this._convertTopLevelObjectToArray(e,r)}_convertTopLevelObjectToArray(e,r){let n=e[r];if(!(!n||Array.isArray(n))){e[r]=[];for(let o in n){let s=n[o];s.id=s.id||o;let i=e[r].length;e[r].push(s),this.idToIndexMap[r][o]=i}}}_convertObjectIdsToArrayIndices(e){for(let r in xh)this._convertIdsToIndices(e,r);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let r of e.textures)this._convertTextureIds(r);for(let r of e.meshes)this._convertMeshIds(r);for(let r of e.nodes)this._convertNodeIds(r);for(let r of e.scenes)this._convertSceneIds(r)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let r of e.primitives){let{attributes:n,indices:o,material:s}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),s&&(r.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(r=>this._convertIdToIndex(r,"node"))),e.meshes&&(e.meshes=e.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(e,r){e[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),e[r]=[]);for(let n of e[r])for(let o in n){let s=n[o],i=this._convertIdToIndex(s,o);n[o]=i}}_convertIdToIndex(e,r){let n=BB[r];if(n in this.idToIndexMap){let o=this.idToIndexMap[n][e];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${r} with id ${e}`);return o}return e}_updateObjects(e){for(let r of this.json.buffers)delete r.type}_updateMaterial(e){for(let r of e.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,o=e.textures.findIndex(s=>s.id===n);o!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:o})}}};function _h(t,e={}){return new Ea().normalize(t,e)}async function Eh(t,e,r=0,n,o){return xB(t,e,r,n),_h(t,{normalize:n?.gltf?.normalize}),mh(t,n,o),n?.gltf?.loadBuffers&&t.json.buffers&&await _B(t,n,o),n?.gltf?.loadImages&&await EB(t,n,o),await ph(t,n,o),t}function xB(t,e,r,n){if(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!fh(e,r,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=Gs(e);else if(e instanceof ArrayBuffer){let i={};r=lh(i,e,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),t._glb=i,t.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){let{binChunks:i}=t._glb;t.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let s=t.json.images||[];t.images=new Array(s.length).fill({})}async function _B(t,e,r){let n=t.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:i}=r;ot(i);let a=ca(s.uri,e),c=await(await r?.fetch?.(a))?.arrayBuffer?.();t.buffers[o]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete s.uri}else t.buffers[o]===null&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function EB(t,e,r){let n=yB(t),o=t.json.images||[],s=[];for(let i of n)s.push(CB(t,o[i],i,e,r));return await Promise.all(s)}function yB(t){let e=new Set,r=t.json.textures||[];for(let n of r)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function CB(t,e,r,n,o){let s;if(e.uri&&!e.hasOwnProperty("bufferView")){let a=ca(e.uri,n),{fetch:f}=o;s=await(await f(a)).arrayBuffer(),e.bufferView={data:s}}if(Number.isFinite(e.bufferView)){let a=Pl(t.json,t.buffers,e.bufferView);s=ke(a.buffer,a.byteOffset,a.byteLength)}ot(s,"glTF image has no data");let i=await Ht(s,[Qi,oa],{...n,mimeType:e.mimeType,basis:n.basis||{format:Wo()}},o);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),t.images=t.images||[],t.images[r]=i}var Ze={name:"glTF",id:"gltf",module:"gltf",version:jl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:TB,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function TB(t,e={},r){e={...Ze.options,...e},e.gltf={...Ze.options.gltf,...e.gltf};let{byteOffset:n=0}=e;return await Eh({},t,n,e,r)}var bB={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wB={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lt={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},MB={magFilter:Lt.TEXTURE_MAG_FILTER,minFilter:Lt.TEXTURE_MIN_FILTER,wrapS:Lt.TEXTURE_WRAP_S,wrapT:Lt.TEXTURE_WRAP_T},IB={[Lt.TEXTURE_MAG_FILTER]:Lt.LINEAR,[Lt.TEXTURE_MIN_FILTER]:Lt.NEAREST_MIPMAP_LINEAR,[Lt.TEXTURE_WRAP_S]:Lt.REPEAT,[Lt.TEXTURE_WRAP_T]:Lt.REPEAT};function SB(){return{id:"default-sampler",parameters:IB}}function FB(t){return wB[t]}function DB(t){return bB[t]}var ya=class{constructor(){this.baseUri="",this.buffers=[],this.images=[]}postProcess(e,r={}){let{json:n,buffers:o=[],images:s=[]}=e,{baseUri:i=""}=e;return ot(n),this.baseUri=i,this.buffers=o,this.images=s,this.jsonUnprocessed=n,this.json=this._resolveTree(e.json,r),this.json}_resolveTree(e,r={}){let n={...e};return this.json=n,e.bufferViews&&(n.bufferViews=e.bufferViews.map((o,s)=>this._resolveBufferView(o,s))),e.images&&(n.images=e.images.map((o,s)=>this._resolveImage(o,s))),e.samplers&&(n.samplers=e.samplers.map((o,s)=>this._resolveSampler(o,s))),e.textures&&(n.textures=e.textures.map((o,s)=>this._resolveTexture(o,s))),e.accessors&&(n.accessors=e.accessors.map((o,s)=>this._resolveAccessor(o,s))),e.materials&&(n.materials=e.materials.map((o,s)=>this._resolveMaterial(o,s))),e.meshes&&(n.meshes=e.meshes.map((o,s)=>this._resolveMesh(o,s))),e.nodes&&(n.nodes=e.nodes.map((o,s)=>this._resolveNode(o,s)),n.nodes=n.nodes.map((o,s)=>this._resolveNodeChildren(o))),e.skins&&(n.skins=e.skins.map((o,s)=>this._resolveSkin(o,s))),e.scenes&&(n.scenes=e.scenes.map((o,s)=>this._resolveScene(o,s))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,r){if(typeof r=="object")return r;let n=e&&e[r];return n||console.warn(`glTF file error: Could not find ${e}[${r}]`),n}_resolveScene(e,r){return{...e,id:e.id||`scene-${r}`,nodes:(e.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(e,r){let n={...e,id:e?.id||`node-${r}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((o,s)=>{let i=this.getMesh(s);return o.id=i.id,o.primitives=o.primitives.concat(i.primitives),o},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(r=>this.getNode(r))),e}_resolveSkin(e,r){let n=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(e,r){let n={...e,id:e.id||`mesh-${r}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(o=>{let s={...o,attributes:{},indices:void 0,material:void 0},i=o.attributes;for(let a in i)s.attributes[a]=this.getAccessor(i[a]);return o.indices!==void 0&&(s.indices=this.getAccessor(o.indices)),o.material!==void 0&&(s.material=this.getMaterial(o.material)),s})),n}_resolveMaterial(e,r){let n={...e,id:e.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let o=n.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,r){let n=FB(e.componentType),o=DB(e.type),s=n*o,i={...e,id:e.id||`accessor-${r}`,bytesPerComponent:n,components:o,bytesPerElement:s,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(i.bufferView=this.getBufferView(e.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:f,byteLength:c}=Gr(i,i.bufferView),l=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,h=a.arrayBuffer.slice(l,l+c);i.bufferView.byteStride&&(h=this._getValueFromInterleavedBuffer(a,l,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new f(h)}return i}_getValueFromInterleavedBuffer(e,r,n,o,s){let i=new Uint8Array(s*o);for(let a=0;a<s;a++){let f=r+a*n;i.set(new Uint8Array(e.arrayBuffer.slice(f,f+o)),a*o)}return i.buffer}_resolveTexture(e,r){return{...e,id:e.id||`texture-${r}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):SB(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,r){let n={id:e.id||`sampler-${r}`,...e,parameters:{}};for(let o in n){let s=this._enumSamplerParameter(o);s!==void 0&&(n.parameters[s]=n[o])}return n}_enumSamplerParameter(e){return MB[e]}_resolveImage(e,r){let n={...e,id:e.id||`image-${r}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},o=this.images[r];return o&&(n.image=o),n}_resolveBufferView(e,r){let n=e.buffer,o=this.buffers[n].arrayBuffer,s=this.buffers[n].byteOffset||0;return e.byteOffset&&(s+=e.byteOffset),{id:`bufferView-${r}`,...e,buffer:this.buffers[n],data:new Uint8Array(o,s,e.byteLength)}}_resolveCamera(e,r){let n={...e,id:e.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Nn(t,e){return new ya().postProcess(t,e)}var rs={URI:0,EMBEDDED:1};function ns(t,e,r,n){t.rotateYtoZ=!0;let o=(t.byteOffset||0)+(t.byteLength||0)-r;if(o===0)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=ke(e,r,o),t.gltfByteOffset=0,t.gltfByteLength=o,r%4===0||console.warn(`${t.type}: embedded glb is not aligned to a 4-byte boundary.`),(t.byteOffset||0)+(t.byteLength||0)}async function os(t,e,r,n){let o=r?.["3d-tiles"]||{};if(RB(t,e,r),o.loadGLTF){if(!n)return;if(t.gltfUrl){let{fetch:s}=n,i=await s(t.gltfUrl,r);t.gltfArrayBuffer=await i.arrayBuffer(),t.gltfByteOffset=0}if(t.gltfArrayBuffer){let s=await Ht(t.gltfArrayBuffer,Ze,r,n);t.gltf=Nn(s),t.gpuMemoryUsageInBytes=Rn(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength}}}function RB(t,e,r){switch(e){case rs.URI:if(t.gltfArrayBuffer){let n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),s=new TextDecoder().decode(n);t.gltfUrl=s.replace(/[\s\0]+$/,"")}delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case rs.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function yh(t,e,r,n,o){r=LB(t,e,r,n,o),await os(t,rs.EMBEDDED,n,o);let s=t?.gltf?.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),r}function LB(t,e,r,n,o){r=Fe(t,e,r),r=Lr(t,e,r),r=Or(t,e,r,n),r=ns(t,e,r,n);let s=new zt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=s.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}async function Ch(t,e,r,n,o){return r=OB(t,e,r,n,o),await os(t,t.gltfFormat||0,n,o),r}function OB(t,e,r,n,o){if(r=Fe(t,e,r),t.version!==1)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Lr(t,e,r);let s=new DataView(e);if(t.gltfFormat=s.getUint32(r,!0),r+=4,r=Or(t,e,r,n),r=ns(t,e,r,n),!t?.header?.featureTableJsonByteLength||t.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new zt(t.featureTableJson,t.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let f=new de(t.batchTableJson,t.batchTableBinary,a);return vB(t,i,f,a),r}function vB(t,e,r,n){let o=new Array(n),s=new w,i=new w,a=new w,f=new w,c=new Z,l=new be,h=new w,u={},d=new Dt,A=[],m=[],g=[],_=[];for(let y=0;y<n;y++){let T;if(e.hasProperty("POSITION"))T=e.getProperty("POSITION",H.FLOAT,3,y,s);else if(e.hasProperty("POSITION_QUANTIZED")){T=e.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,s);let p=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!p)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let x=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!x)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let E=65535;for(let U=0;U<3;U++)T[U]=T[U]/E*x[U]+p[U]}if(!T)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(T),u.translation=s,t.normalUp=e.getProperty("NORMAL_UP",H.FLOAT,3,y,A),t.normalRight=e.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let b=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),t.octNormalUp)throw t.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");t.eastNorthUp?(fe.WGS84.eastNorthUpToFixedFrame(s,d),d.getRotationMatrix3(c)):c.identity()}b&&(f.copy(i).cross(a).normalize(),c.setColumn(0,i),c.setColumn(1,a),c.setColumn(2,f)),l.fromMatrix3(c),u.rotation=l,h.set(1,1,1);let C=e.getProperty("SCALE",H.FLOAT,1,y,g);Number.isFinite(C)&&h.multiplyByScalar(C);let I=e.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&h.scale(I),u.scale=h;let M=e.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,_);M===void 0&&(M=y);let L=new Dt().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(L),d.scale(u.scale);let B=d.clone();o[y]={modelMatrix:B,batchId:M}}t.instances=o}async function Th(t,e,r,n,o,s){r=Fe(t,e,r);let i=new DataView(e);for(t.tilesLength=i.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&(t.byteLength||0)-r>12;){let a={shape:"tile3d"};t.tiles.push(a),r=await s(e,r,n,o,a)}return r}async function bh(t,e,r,n){if(t.rotateYtoZ=!0,t.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return e.byteLength;let o=await Ht(e,Ze,r,n);t.gltf=Nn(o),t.gpuMemoryUsageInBytes=Rn(t.gltf)}else t.gltfArrayBuffer=e;return e.byteLength}async function Ca(t,e=0,r,n,o={shape:"tile3d"}){switch(o.byteOffset=e,o.type=il(t,e),o.type){case Et.COMPOSITE:return await Th(o,t,e,r,n,Ca);case Et.BATCHED_3D_MODEL:return await yh(o,t,e,r,n);case Et.GLTF:return await bh(o,t,r,n);case Et.INSTANCED_3D_MODEL:return await Ch(o,t,e,r,n);case Et.POINT_CLOUD:return await Ml(o,t,e,r,n);default:throw new Error(`3DTileLoader: unknown type ${o.type}`)}}async function Ta(t,e,r){if(new Uint32Array(t.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(t.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let s=wh(t.slice(8,16)),i=new Uint8Array(t,24,s),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),l=wh(t.slice(16,24)),h=new ArrayBuffer(0);if(l&&(h=t.slice(24+s)),await ss(c,c.tileAvailability,h,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await ss(c,u,h,r);else await ss(c,c.contentAvailability,h,r);return await ss(c,c.childSubtreeAvailability,h,r),c}async function ss(t,e,r,n){let o=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if(typeof o!="number")return;let s=t.bufferViews[o],i=t.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let f=`${n?.baseUrl||""}/${i.uri}`,l=await(await n.fetch(f)).arrayBuffer();e.explicitBitstream=new Uint8Array(l,s.byteOffset,s.byteLength);return}let a=t.buffers.slice(0,s.buffer).reduce((f,c)=>f+c.byteLength,0);e.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),s.byteOffset,s.byteLength)}function wh(t){let e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+2**32*n}var Jr={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Fr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Ta,options:{}};var nu=mr(hn(),1);var $h=mr(hn(),1);function ba(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let e=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}function Qt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||ba()}var GB=globalThis.self||globalThis.window||globalThis.global,zr=globalThis.window||globalThis.self||globalThis.global,NB=globalThis.document||{},Ye=globalThis.process||{},UB=globalThis.console,mS=globalThis.navigator||{};var is=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",BS=Qt();function PB(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var as=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=PB(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}};function Mh(t){let e;return t<10?e="".concat(t.toFixed(2),"ms"):t<100?e="".concat(t.toFixed(1),"ms"):t<1e3?e="".concat(t.toFixed(0),"ms"):e="".concat((t/1e3).toFixed(2),"s"),e}function Ih(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}function cs(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));let s=t.width*r,i=t.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(o,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}var fs;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(fs||(fs={}));var HB=10;function Sh(t){return typeof t!="string"?t:(t=t.toUpperCase(),fs[t]||fs.WHITE)}function Fh(t,e,r){if(!Qt&&typeof t=="string"){if(e){let n=Sh(e);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(r){let n=Sh(r);t="\x1B[".concat(n+HB,"m").concat(t,"\x1B[49m")}}return t}function Dh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),o=t;for(let s of n){let i=o[s];typeof i=="function"&&(e.find(a=>s===a)||(o[s]=i.bind(t)))}}function Qr(t,e){if(!t)throw new Error(e||"Assertion failed")}function We(){let t;if(Qt()&&zr.performance){var e,r;t=zr===null||zr===void 0||(e=zr.performance)===null||e===void 0||(r=e.now)===null||r===void 0?void 0:r.call(e)}else if("hrtime"in Ye){var n;let o=Ye===null||Ye===void 0||(n=Ye.hrtime)===null||n===void 0?void 0:n.call(Ye);t=o[0]*1e3+o[1]/1e6}else t=Date.now();return t}var Vr={debug:Qt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},kB={enabled:!0,level:0};function Ot(){}var Rh={},Lh={once:!0},Un=class{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=is,this._startTs=We(),this._deltaTs=We(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new as("__probe-".concat(this.id,"__"),kB),this.timeStamp("".concat(this.id," started")),Dh(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((We()-this._startTs).toPrecision(10))}getDelta(){return Number((We()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){Qr(e,r)}warn(e){return this._getLogFunction(0,e,Vr.warn,arguments,Lh)}error(e){return this._getLogFunction(0,e,Vr.error,arguments)}deprecated(e,r){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(e,r){return this.error("`".concat(e,"` has been removed. Use `").concat(r,"` instead"))}probe(e,r){return this._getLogFunction(e,r,Vr.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,Vr.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,Vr.debug||Vr.info,arguments,Lh)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||Ot,n&&[n],{tag:VB(r)}):Ot}image(e){let{logLevel:r,priority:n,image:o,message:s="",scale:i=1}=e;return this._shouldLog(r||n)?Qt()?QB({image:o,message:s,scale:i}):zB({image:o,message:s,scale:i}):Ot}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||Ot)}group(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Oh({logLevel:e,message:r,opts:n}),{collapsed:s}=n;return o.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Ot)}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=vh(e)}_getLogFunction(e,r,n,o,s){if(this._shouldLog(e)){s=Oh({logLevel:e,message:r,args:o,opts:s}),n=n||s.method,Qr(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=We();let i=s.tag||s.message;if(s.once&&i)if(!Rh[i])Rh[i]=We();else return Ot;return r=JB(this.id,s.message,s),n.bind(console,r,...s.args)}return Ot}};Un.VERSION=is;function vh(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Qr(Number.isFinite(e)&&e>=0),e}function Oh(t){let{logLevel:e,message:r}=t;t.logLevel=vh(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let o=typeof t.message;return Qr(o==="string"||o==="object"),Object.assign(t,{args:n},t.opts)}function JB(t,e,r){if(typeof e=="string"){let n=r.time?Ih(Mh(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=Fh(e,r.color,r.background)}return e}function zB(t){let{image:e,message:r="",scale:n=1}=t;return console.warn("removed"),Ot}function QB(t){let{image:e,message:r="",scale:n=1}=t;if(typeof e=="string"){let s=new Image;return s.onload=()=>{let i=cs(s,r,n);console.log(...i)},s.src=e,Ot}let o=e.nodeName||"";if(o.toLowerCase()==="img")return console.log(...cs(e,r,n)),Ot;if(o.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...cs(s,r,n)),s.src=e.toDataURL(),Ot}return Ot}function VB(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var wa=new Un({id:"@probe.gl/log"});var vt=null;try{vt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function q(t,e,r){this.low=t|0,this.high=e|0,this.unsigned=!!r}q.prototype.__isLong__;Object.defineProperty(q.prototype,"__isLong__",{value:!0});function dt(t){return(t&&t.__isLong__)===!0}function Gh(t){var e=Math.clz32(t&-t);return t?31-e:e}q.isLong=dt;var Nh={},Uh={};function qe(t,e){var r,n,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(n=Uh[t],n)?n:(r=Q(t,0,!0),o&&(Uh[t]=r),r)):(t|=0,(o=-128<=t&&t<128)&&(n=Nh[t],n)?n:(r=Q(t,t<0?-1:0,!1),o&&(Nh[t]=r),r))}q.fromInt=qe;function Gt(t,e){if(isNaN(t))return e?Ae:Vt;if(e){if(t<0)return Ae;if(t>=Jh)return Vh}else{if(t<=-Hh)return Tt;if(t+1>=Hh)return Qh}return t<0?Gt(-t,e).neg():Q(t%Kr|0,t/Kr|0,e)}q.fromNumber=Gt;function Q(t,e,r){return new q(t,e,r)}q.fromBits=Q;var ls=Math.pow;function Ia(t,e,r){if(t.length===0)throw Error("empty string");if(typeof e=="number"?(r=e,e=!1):e=!!e,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e?Ae:Vt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Ia(t.substring(1),e,r).neg();for(var o=Gt(ls(r,8)),s=Vt,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),f=parseInt(t.substring(i,i+a),r);if(a<8){var c=Gt(ls(r,a));s=s.mul(c).add(Gt(f))}else s=s.mul(o),s=s.add(Gt(f))}return s.unsigned=e,s}q.fromString=Ia;function jt(t,e){return typeof t=="number"?Gt(t,e):typeof t=="string"?Ia(t,e):Q(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}q.fromValue=jt;var Ph=1<<16,jB=1<<24,Kr=Ph*Ph,Jh=Kr*Kr,Hh=Jh/2,kh=qe(jB),Vt=qe(0);q.ZERO=Vt;var Ae=qe(0,!0);q.UZERO=Ae;var jr=qe(1);q.ONE=jr;var zh=qe(1,!0);q.UONE=zh;var Ma=qe(-1);q.NEG_ONE=Ma;var Qh=Q(-1,2147483647,!1);q.MAX_VALUE=Qh;var Vh=Q(-1,-1,!0);q.MAX_UNSIGNED_VALUE=Vh;var Tt=Q(0,-2147483648,!1);q.MIN_VALUE=Tt;var O=q.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low};O.toNumber=function(){return this.unsigned?(this.high>>>0)*Kr+(this.low>>>0):this.high*Kr+(this.low>>>0)};O.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Tt)){var r=Gt(e),n=this.div(r),o=n.mul(r).sub(this);return n.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=Gt(ls(e,6),this.unsigned),i=this,a="";;){var f=i.div(s),c=i.sub(f.mul(s)).toInt()>>>0,l=c.toString(e);if(i=f,i.isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}};O.getHighBits=function(){return this.high};O.getHighBitsUnsigned=function(){return this.high>>>0};O.getLowBits=function(){return this.low};O.getLowBitsUnsigned=function(){return this.low>>>0};O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Tt)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,r=31;r>0&&!(e&1<<r);r--);return this.high!=0?r+33:r+1};O.isZero=function(){return this.high===0&&this.low===0};O.eqz=O.isZero;O.isNegative=function(){return!this.unsigned&&this.high<0};O.isPositive=function(){return this.unsigned||this.high>=0};O.isOdd=function(){return(this.low&1)===1};O.isEven=function(){return(this.low&1)===0};O.equals=function(e){return dt(e)||(e=jt(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};O.eq=O.equals;O.notEquals=function(e){return!this.eq(e)};O.neq=O.notEquals;O.ne=O.notEquals;O.lessThan=function(e){return this.comp(e)<0};O.lt=O.lessThan;O.lessThanOrEqual=function(e){return this.comp(e)<=0};O.lte=O.lessThanOrEqual;O.le=O.lessThanOrEqual;O.greaterThan=function(e){return this.comp(e)>0};O.gt=O.greaterThan;O.greaterThanOrEqual=function(e){return this.comp(e)>=0};O.gte=O.greaterThanOrEqual;O.ge=O.greaterThanOrEqual;O.compare=function(e){if(dt(e)||(e=jt(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};O.comp=O.compare;O.negate=function(){return!this.unsigned&&this.eq(Tt)?Tt:this.not().add(jr)};O.neg=O.negate;O.add=function(e){dt(e)||(e=jt(e));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,f=e.low>>>16,c=e.low&65535,l=0,h=0,u=0,d=0;return d+=s+c,u+=d>>>16,d&=65535,u+=o+f,h+=u>>>16,u&=65535,h+=n+a,l+=h>>>16,h&=65535,l+=r+i,l&=65535,Q(u<<16|d,l<<16|h,this.unsigned)};O.subtract=function(e){return dt(e)||(e=jt(e)),this.add(e.neg())};O.sub=O.subtract;O.multiply=function(e){if(this.isZero())return this;if(dt(e)||(e=jt(e)),vt){var r=vt.mul(this.low,this.high,e.low,e.high);return Q(r,vt.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?Ae:Vt;if(this.eq(Tt))return e.isOdd()?Tt:Vt;if(e.eq(Tt))return this.isOdd()?Tt:Vt;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(kh)&&e.lt(kh))return Gt(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,f=e.high&65535,c=e.low>>>16,l=e.low&65535,h=0,u=0,d=0,A=0;return A+=i*l,d+=A>>>16,A&=65535,d+=s*l,u+=d>>>16,d&=65535,d+=i*c,u+=d>>>16,d&=65535,u+=o*l,h+=u>>>16,u&=65535,u+=s*c,h+=u>>>16,u&=65535,u+=i*f,h+=u>>>16,u&=65535,h+=n*l+o*c+s*f+i*a,h&=65535,Q(d<<16|A,h<<16|u,this.unsigned)};O.mul=O.multiply;O.divide=function(e){if(dt(e)||(e=jt(e)),e.isZero())throw Error("division by zero");if(vt){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?vt.div_u:vt.div_s)(this.low,this.high,e.low,e.high);return Q(r,vt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Ae:Vt;var n,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Ae;if(e.gt(this.shru(1)))return zh;s=Ae}else{if(this.eq(Tt)){if(e.eq(jr)||e.eq(Ma))return Tt;if(e.eq(Tt))return jr;var i=this.shr(1);return n=i.div(e).shl(1),n.eq(Vt)?e.isNegative()?jr:Ma:(o=this.sub(e.mul(n)),s=n.add(o.div(e)),s)}else if(e.eq(Tt))return this.unsigned?Ae:Vt;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=Vt}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),f=a<=48?1:ls(2,a-48),c=Gt(n),l=c.mul(e);l.isNegative()||l.gt(o);)n-=f,c=Gt(n,this.unsigned),l=c.mul(e);c.isZero()&&(c=jr),s=s.add(c),o=o.sub(l)}return s};O.div=O.divide;O.modulo=function(e){if(dt(e)||(e=jt(e)),vt){var r=(this.unsigned?vt.rem_u:vt.rem_s)(this.low,this.high,e.low,e.high);return Q(r,vt.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};O.mod=O.modulo;O.rem=O.modulo;O.not=function(){return Q(~this.low,~this.high,this.unsigned)};O.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};O.clz=O.countLeadingZeros;O.countTrailingZeros=function(){return this.low?Gh(this.low):Gh(this.high)+32};O.ctz=O.countTrailingZeros;O.and=function(e){return dt(e)||(e=jt(e)),Q(this.low&e.low,this.high&e.high,this.unsigned)};O.or=function(e){return dt(e)||(e=jt(e)),Q(this.low|e.low,this.high|e.high,this.unsigned)};O.xor=function(e){return dt(e)||(e=jt(e)),Q(this.low^e.low,this.high^e.high,this.unsigned)};O.shiftLeft=function(e){return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Q(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Q(0,this.low<<e-32,this.unsigned)};O.shl=O.shiftLeft;O.shiftRight=function(e){return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Q(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Q(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};O.shr=O.shiftRight;O.shiftRightUnsigned=function(e){return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Q(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?Q(this.high,0,this.unsigned):Q(this.high>>>e-32,0,this.unsigned)};O.shru=O.shiftRightUnsigned;O.shr_u=O.shiftRightUnsigned;O.rotateLeft=function(e){var r;return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Q(this.high,this.low,this.unsigned):e<32?(r=32-e,Q(this.low<<e|this.high>>>r,this.high<<e|this.low>>>r,this.unsigned)):(e-=32,r=32-e,Q(this.high<<e|this.low>>>r,this.low<<e|this.high>>>r,this.unsigned))};O.rotl=O.rotateLeft;O.rotateRight=function(e){var r;return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Q(this.high,this.low,this.unsigned):e<32?(r=32-e,Q(this.high<<r|this.low>>>e,this.low<<r|this.high>>>e,this.unsigned)):(e-=32,r=32-e,Q(this.low<<r|this.high>>>e,this.high<<r|this.low>>>e,this.unsigned))};O.rotr=O.rotateRight;O.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};O.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};O.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};O.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};O.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};q.fromBytes=function(e,r,n){return n?q.fromBytesLE(e,r):q.fromBytesBE(e,r)};q.fromBytesLE=function(e,r){return new q(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)};q.fromBytesBE=function(e,r){return new q(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)};var Xr=q;var KB=16;function Pn(t){t==="X"&&(t="");let e=t.padEnd(KB,"0");return Xr.fromString(e,!0,16)}function Sa(t){if(t.isZero())return"X";let e=t.countTrailingZeros(),r=e%4;e=(e-r)/4;let n=e;e*=4;let s=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function Fa(t,e){let r=XB(t).shiftRightUnsigned(2);return t.add(Xr.fromNumber(2*e+1-4).multiply(r))}function XB(t){return t.and(t.not().add(1))}var ZB=3,YB=30,WB=2*YB+1,jh=180/Math.PI;function Xh(t){if(t.length===0)throw new Error(`Invalid Hilbert quad key ${t}`);let e=t.split("/"),r=parseInt(e[0],10),n=e[1],o=n.length,s=0,i=[0,0];for(let a=o-1;a>=0;a--){s=o-a;let f=n[a],c=0,l=0;f==="1"?l=1:f==="2"?(c=1,l=1):f==="3"&&(c=1);let h=Math.pow(2,s-1);qB(h,i,c,l),i[0]+=h*c,i[1]+=h*l}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:s}}function Zh(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<ZB+WB;)e="0"+e;let r=e.lastIndexOf("1"),n=e.substring(0,3),o=e.substring(3,r),s=o.length/2,i=Xr.fromString(n,!0,2).toString(10),a="";if(s!==0)for(a=Xr.fromString(o,!0,2).toString(4);a.length<s;)a="0"+a;return`${i}/${a}`}function Da(t,e,r){let n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function Kh(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function Ra(t){return[Kh(t[0]),Kh(t[1])]}function La(t,[e,r]){switch(t){case 0:return[1,e,r];case 1:return[-e,1,r];case 2:return[-e,-r,1];case 3:return[-1,-r,-e];case 4:return[r,-1,-e];case 5:return[r,e,-1];default:throw new Error("Invalid face")}}function Oa([t,e,r]){let n=Math.atan2(r,Math.sqrt(t*t+e*e));return[Math.atan2(e,t)*jh,n*jh]}function qB(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);let o=e[0];e[0]=e[1],e[1]=o}}function Yh(t){let e=Da(t.ij,t.level,[.5,.5]),r=Ra(e),n=La(t.face,r);return Oa(n)}var $B=100;function va(t){let{face:e,ij:r,level:n}=t,o=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil($B*Math.pow(2,-n))),i=new Float64Array(4*s*2+2),a=0,f=0;for(let c=0;c<4;c++){let l=o[c].slice(0),h=o[c+1],u=(h[0]-l[0])/s,d=(h[1]-l[1])/s;for(let A=0;A<s;A++){l[0]+=u,l[1]+=d;let m=Da(r,n,l),g=Ra(m),_=La(e,g),y=Oa(_);Math.abs(y[1])>89.999&&(y[0]=f);let T=y[0]-f;y[0]+=T>180?-360:T<-180?360:0,i[a++]=y[0],i[a++]=y[1],f=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function Zr(t){let e=tx(t);return Xh(e)}function tx(t){if(t.indexOf("/")>0)return t;let e=Pn(t);return Zh(e)}function Ga(t){let e=Zr(t);return Yh(e)}function qh(t){let e;if(t.face===2||t.face===5){let r=null,n=0;for(let o=0;o<4;o++){let s=`${t.face}/${o}`,i=Zr(s),a=va(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}e=Wh(r)}else{let r=va(t);e=Wh(r)}return e}function Wh(t){if(t.length%2!==0)throw new Error("Invalid corners");let e=[],r=[];for(let n=0;n<t.length;n+=2)e.push(t[n]),r.push(t[n+1]);return e.sort((n,o)=>n-o),r.sort((n,o)=>n-o),{west:e[0],east:e[e.length-1],north:r[r.length-1],south:r[0]}}function Na(t,e){let r=e?.minimumHeight||0,n=e?.maximumHeight||0,o=Zr(t),s=qh(o),i=s.west,a=s.south,f=s.east,c=s.north,l=[];return l.push(new w(i,c,r)),l.push(new w(f,c,r)),l.push(new w(f,a,r)),l.push(new w(i,a,r)),l.push(new w(i,c,n)),l.push(new w(f,c,n)),l.push(new w(f,a,n)),l.push(new w(i,a,n)),l}function hs(t){let e=t.token,r={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=Na(e,r),o=Ga(e),s=o[0],i=o[1],a=fe.WGS84.cartographicToCartesian([s,i,r.maximumHeight]),f=new w(a[0],a[1],a[2]);n.push(f);let c=Si(n);return[...c.center,...c.halfAxes]}var ex=4,rx=8,nx={QUADTREE:ex,OCTREE:rx};function ox(t,e,r){if(t?.box){let n=Pn(t.s2VolumeInfo.token),o=Fa(n,e),s=Sa(o),i={...t.s2VolumeInfo};switch(i.token=s,r){case"OCTREE":let c=t.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,h=l/2,u=c.minimumHeight+l/2;c.minimumHeight=u-h,c.maximumHeight=u+h;break;default:break}return{box:hs(i),s2VolumeInfo:i}}}async function Pa(t){let{implicitOptions:e,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:o,loaderOptions:s}=t,{subtree:i,level:a=0,globalData:f={level:0,mortonIndex:0,x:0,y:0,z:0}}=t,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:h,contentUrlTemplate:u,subtreesUriTemplate:d,basePath:A}=e,m={children:[],lodMetricValue:0,contentUrl:""};if(!h)return wa.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${u} won't be loaded...`),m;let g=a+f.level;if(g>h)return m;let _=nx[c],y=Math.log2(_),T=n&1,b=n>>1&1,C=n>>2&1,I=(_**a-1)/(_-1),M=$e(r.mortonIndex,n,y),L=I+M,B=$e(r.x,T,1),p=$e(r.y,b,1),x=$e(r.z,C,1),E=!1;a>=l&&(E=Ua(i.childSubtreeAvailability,M));let U=$e(f.x,B,a),N=$e(f.y,p,a),P=$e(f.z,x,a);if(E){let He=`${A}/${d}`,ao=us(He,g,U,N,P);i=await(0,$h.load)(ao,Jr,s),f={mortonIndex:M,x:B,y:p,z:x,level:a},M=0,L=0,B=0,p=0,x=0,a=0}if(!Ua(i.tileAvailability,L))return m;Ua(i.contentAvailability,L)&&(m.contentUrl=us(u,g,U,N,P));let At=a+1,Y={mortonIndex:M,x:B,y:p,z:x};for(let He=0;He<_;He++){let ao=ox(o,He,c),Ar=await Pa({subtree:i,implicitOptions:e,loaderOptions:s,parentData:Y,childIndex:He,level:At,globalData:{...f},s2VolumeBox:ao});if(Ar.contentUrl||Ar.children.length){let S=g+1,F=sx(Ar,S,{childTileX:B,childTileY:p,childTileZ:x},e,o);m.children.push(F)}}return m}function Ua(t,e){let r;return Array.isArray(t)?(r=t[0],t.length>1&&wa.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=t,"constant"in r?Boolean(r.constant):r.explicitBitstream?cx(e,r.explicitBitstream):!1}function sx(t,e,r,n,o){let{basePath:s,refine:i,getRefine:a,lodMetricType:f,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:h}=n,u=t.contentUrl&&t.contentUrl.replace(`${s}/`,""),d=l/2**e,A=o?.box?{box:o.box}:h,m=ix(e,A,r);return{children:t.children,contentUrl:t.contentUrl,content:{uri:u},id:t.contentUrl,refine:a(i),type:c(t),lodMetricType:f,lodMetricValue:d,geometricError:d,transform:t.transform,boundingVolume:m}}function ix(t,e,r){if(e.region){let{childTileX:n,childTileY:o,childTileZ:s}=r,[i,a,f,c,l,h]=e.region,u=2**t,d=(f-i)/u,A=(c-a)/u,m=(h-l)/u,[g,_]=[i+d*n,i+d*(n+1)],[y,T]=[a+A*o,a+A*(o+1)],[b,C]=[l+m*s,l+m*(s+1)];return{region:[g,y,_,T,b,C]}}if(e.box)return e;throw new Error(`Unsupported bounding volume type ${e}`)}function $e(t,e,r){return(t<<r)+e}function us(t,e,r,n,o){let s=ax({level:e,x:r,y:n,z:o});return t.replace(/{level}|{x}|{y}|{z}/gi,i=>s[i])}function ax(t){let e={};for(let r in t)e[`{${r}}`]=t[r];return e}function cx(t,e){let r=Math.floor(t/8),n=t%8;return(e[r]>>n&1)===1}function ka(t,e=""){if(!e)return Ie.EMPTY;let n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return Ie.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ie.SCENEGRAPH;default:return n||Ie.EMPTY}}function Ja(t){switch(t){case"REPLACE":case"replace":return Sr.REPLACE;case"ADD":case"add":return Sr.ADD;default:return t}}function Ha(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){let n=new URL(t,`${e}/`);return decodeURI(n.toString())}else if(t.startsWith("/"))return t;return Er.resolve(e,t)}function tu(t,e){if(!t)return null;let r;if(t.content){let o=t.content.uri||t.content?.url;typeof o<"u"&&(r=Ha(o,e))}return{...t,id:r,contentUrl:r,lodMetricType:ue.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:ka(t,r),refine:Ja(t.refine)}}async function ou(t,e,r){let n=null,o=ru(t.root);o&&t.root?n=await eu(t.root,t,e,o,r):n=tu(t.root,e);let s=[];for(s.push(n);s.length>0;){let i=s.pop()||{},a=i.children||[],f=[];for(let c of a){let l=ru(c),h;l?h=await eu(c,t,e,l,r):h=tu(c,e),h&&(f.push(h),s.push(h))}i.children=f}return n}async function eu(t,e,r,n,o){let{subdivisionScheme:s,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,l=us(c,0,0,0,0),h=Ha(l,r),u=await(0,nu.load)(h,Jr,o),d=t.content?.uri,A=d?Ha(d,r):"",m=e?.root?.refine,g=t.geometricError,_=t.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(_){let C={box:hs(_),s2VolumeInfo:_};t.boundingVolume=C}let y=t.boundingVolume,T={contentUrlTemplate:A,subtreesUriTemplate:c,subdivisionScheme:s,subtreeLevels:f,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:ue.GEOMETRIC_ERROR,rootLodMetricValue:g,rootBoundingVolume:y,getTileType:ka,getRefine:Ja};return await fx(t,r,u,T,o)}async function fx(t,e,r,n,o){if(!t)return null;let{children:s,contentUrl:i}=await Pa({subtree:r,implicitOptions:n,loaderOptions:o}),a,f=null;return i&&(a=i,f={uri:i.replace(`${e}/`,"")}),{...t,id:a,contentUrl:a,lodMetricType:ue.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:ka(t,a),refine:Ja(t.refine),content:f||t.content,children:s}}function ru(t){return t?.extensions?.["3DTILES_implicit_tiling"]||t?.implicitTiling}var tr={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Fr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:lx,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function lx(t,e={},r){let n=e["3d-tiles"]||{},o;return n.isTileset==="auto"?o=r?.url&&r.url.indexOf(".json")!==-1:o=n.isTileset,o?hx(t,e,r):ux(t,e,r)}async function hx(t,e,r){let n=JSON.parse(new TextDecoder().decode(t)),o=r?.url||"",s=dx(o),i=await ou(n,s,e||{});return{...n,shape:"tileset3d",loader:tr,url:o,queryString:r?.queryString||"",basePath:s,root:i||n.root,type:wn.TILES3D,lodMetricType:ue.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function ux(t,e,r){let n={content:{shape:"tile3d",featureIds:null}};return await Ca(t,0,e,r,n.content),n.content}function dx(t){return Er.dirname(t)}var ds=mr(hn(),1);var su="https://api.cesium.com/v1/assets";async function As(t,e){if(!e){let s=await Ax(t);for(let i of s.items)i.type==="3DTILES"&&(e=i.id)}let r=await mx(t,e),{type:n,url:o}=r;return z(n==="3DTILES"&&o),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function Ax(t){z(t);let e=su,r={Authorization:`Bearer ${t}`},n=await(0,ds.fetchFile)(e,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function mx(t,e){z(t,e);let r={Authorization:`Bearer ${t}`},n=`${su}/${e}`,o=await(0,ds.fetchFile)(`${n}`,{headers:r});if(!o.ok)throw new Error(o.statusText);let s=await o.json();if(o=await(0,ds.fetchFile)(`${n}/endpoint`,{headers:r}),!o.ok)throw new Error(o.statusText);let i=await o.json();return s={...s,...i},s}async function px(t,e={}){e=e["cesium-ion"]||{};let{accessToken:r}=e,n=e.assetId;if(!Number.isFinite(n)){let o=t.match(/\/([0-9]+)\/tileset.json/);n=o&&o[1]}return As(r,n)}var za={...tr,id:"cesium-ion",name:"Cesium Ion",preload:px,parse:async(t,e,r)=>(e={...e},e["3d-tiles"]=e["cesium-ion"],e.loader=za,tr.parse(t,e,r)),options:{"cesium-ion":{...tr.options["3d-tiles"],accessToken:null}}};var Hn=async(t,e)=>{let r=[await t.getUint8(t.length-1n),await t.getUint8(t.length-2n),await t.getUint8(t.length-3n),void 0],n=0n;for(let o=t.length-4n;o>-1;o--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await t.getUint8(o),r.every((s,i)=>s===e[i])){n=o;break}return n};var iu=new Uint8Array([80,75,5,6]),au=new Uint8Array([80,75,6,7]),cu=new Uint8Array([80,75,6,6]),gx=8n;var Bx=16n;var xx=8n,_x=24n;var Ex=48n;var fu=async t=>{let e=await Hn(t,iu),r=BigInt(await t.getUint16(e+gx)),n=BigInt(await t.getUint32(e+Bx)),o=e-20n,s=0n,i=await t.slice(o,o+4n);if(_e(i,au)){s=await t.getBigUint64(o+xx);let a=await t.slice(s,s+4n);if(!_e(a,cu.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(s+_x),n=await t.getBigUint64(s+Ex)}else o=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:s,zip64EoCDLocatorOffset:o,zipEoCDOffset:e}}};var jF=[{offset:0,size:4,default:new DataView(iu.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var KF=[{offset:0,size:4,default:new DataView(au.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],XF=[{offset:0,size:4,default:new DataView(cu.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var yx=20n,Cx=24n,Tx=28n,bx=30n,wx=32n,Mx=42n,Qa=46n,Jn=new Uint8Array([80,75,1,2]),kn=async(t,e)=>{let r=await e.slice(t,t+4n);if(!_e(r,Jn.buffer))return null;let n=BigInt(await e.getUint32(t+yx)),o=BigInt(await e.getUint32(t+Cx)),s=await e.getUint16(t+bx),i=BigInt(await e.getUint16(t+wx)),a=await e.getUint16(t+Tx),f=await e.slice(t+Qa,t+Qa+BigInt(a)),c=new TextDecoder().decode(f),l=t+Qa+BigInt(a),h=await e.getUint32(t+Mx),u=BigInt(h),d=new DataView(await e.slice(l,l+BigInt(s))),A={uncompressedSize:o,compressedSize:n,localHeaderOffset:u,startDisk:i},m=Ix(A,d);return{...A,...m,extraFieldLength:s,fileNameLength:a,fileName:c,extraOffset:l}};async function*Yr(t){let{cdStartOffset:e}=await fu(t),r=await kn(e,t);for(;r;)yield r,r=await kn(r.extraOffset+BigInt(r.extraFieldLength),t)}var lu=(...t)=>t[0]+t[1]*16,Ix=(t,e)=>{let r=Sx(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),s=new Uint8Array(e.buffer).findIndex((a,f,c)=>lu(c[f],c[f+1])===1&&lu(c[f+2],c[f+3])===o),i=0;for(let a of r){let f=i;n[a.name]=e.getBigUint64(s+4+f,!0),i=f+a.length}}return n},Sx=t=>{let e=[];return t.uncompressedSize===BigInt(4294967295)&&e.push({name:"uncompressedSize",length:8}),t.compressedSize===BigInt(4294967295)&&e.push({name:"compressedSize",length:8}),t.localHeaderOffset===BigInt(4294967295)&&e.push({name:"localHeaderOffset",length:8}),t.startDisk===BigInt(4294967295)&&e.push({name:"startDisk",length:4}),e};var qF=[{offset:0,size:4,default:new DataView(Jn.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var Fx=8n,Dx=18n,Rx=22n,Lx=26n,Ox=28n,ms=30n,Va=new Uint8Array([80,75,3,4]),er=async(t,e)=>{let r=await e.slice(t,t+4n);if(!_e(r,Va))return null;let n=await e.getUint16(t+Lx),o=new TextDecoder().decode(await e.slice(t+ms,t+ms+BigInt(n))).split("\\").join("/"),s=await e.getUint16(t+Ox),i=t+ms+BigInt(n+s),a=await e.getUint16(t+Fx),f=BigInt(await e.getUint32(t+Dx)),c=BigInt(await e.getUint32(t+Rx)),l=t+ms+BigInt(n),h=4n;return c===BigInt(4294967295)&&(c=await e.getBigUint64(l+h),h+=8n),f===BigInt(4294967295)&&(f=await e.getBigUint64(l+h),h+=8n),i===BigInt(4294967295)&&(i=await e.getBigUint64(l+h)),{fileNameLength:n,fileName:o,extraFieldLength:s,fileDataOffset:i,compressedSize:f,compressionMethod:a}};var eD=[{offset:0,size:4,default:new DataView(Va.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var ps=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let i of e)n.push(i),yield i;let o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(e){return await dn(e)}};function hu(t){t=`${t}`;for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return null;let e="";for(let r=0;r<t.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=t.charCodeAt(r)>>2,n[1]=(t.charCodeAt(r)&3)<<4,t.length>r+1&&(n[1]|=t.charCodeAt(r+1)>>4,n[2]=(t.charCodeAt(r+1)&15)<<2),t.length>r+2&&(n[2]|=t.charCodeAt(r+2)>>6,n[3]=t.charCodeAt(r+2)&63);for(let o=0;o<n.length;o++)typeof n[o]>"u"?e+="=":e+=vx(n[o])}return e}function vx(t){if(t<26)return String.fromCharCode(t+"A".charCodeAt(0));if(t<52)return String.fromCharCode(t-26+"a".charCodeAt(0));if(t<62)return String.fromCharCode(t-52+"0".charCodeAt(0));if(t===62)return"+";if(t===63)return"/"}function uu(t,e){switch(e){case"hex":return t;case"base64":return Gx(t);default:throw new Error(e)}}function Gx(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return hu(r)||""}var Au=typeof atob=="function"?atob:typeof Buffer=="function"?zx:pu,Nx=Au("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUE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WxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),ja=WebAssembly&&Au!==pu?Jx(Nx).buffer:!1,re=Qx(),Ka=240*16*16,mu=Math.floor(Ka*16*1.066666667),Ux=268435456-65536,du="Parameter must be Buffer, ArrayBuffer or Uint8Array",Px="Parameter exceeds max size of 255.9 Mbytes";ja||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Xa(t){var e,r,n,o,s,i,a,f,c,l;let h=kx(),u=Hx(),d={},A=new Date().getTime();return d.then=function(y){return a=y,g(),d},d.catch=function(y){return f=y,d},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?i=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?i=t.constructor===ArrayBuffer?new Uint8Array(t):t:_(new TypeError(du)):_(new TypeError(du)),i&&(s=i.length,ja&&s>mu?s>Ux?_(new Error(Px)):(e=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(ja,n).then(m)):g(h(i))),d;function m(y){g(u(i,y.instance.exports,r))}function g(y){var T=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(T)&&(a(T,l-A),a=f=null):Boolean(y)&&(c=y)}function _(y){typeof f=="function"&&f(y)}}function Hx(){var t,e,r,n,o,s,i,a,f,c,l,h,u,d=function(A){var m,g,_,y,T,b,C,I,M,L,B,p,x,E,U,N,P,v,it,At,Y,He,ao=new Date().getTime(),Ar=0,S=1732584193,D=-271733879,F=-1732584194,R=271733878,et=0,ln=A.length*8,co;for(co=dd(A,u),u[ln>>>5]|=128<<ln%32,u[(ln+64>>>9<<4)+14]=ln,co=(ln+64>>>9<<4)+15,Y=u;et<co;)co>et+mu?(n(S),s(D),a(F),c(R),e(Ka),et=et+Ka*16,S=r(),D=o(),F=i(),R=f(),Ar++):(P=S,v=D,it=F,At=R,m=Y[et+0]>>>0,g=Y[et+1]>>>0,_=Y[et+2]>>>0,y=Y[et+3]>>>0,T=Y[et+4]>>>0,b=Y[et+5]>>>0,C=Y[et+6]>>>0,I=Y[et+7]>>>0,M=Y[et+8]>>>0,L=Y[et+9]>>>0,B=Y[et+10]>>>0,p=Y[et+11]>>>0,x=Y[et+12]>>>0,E=Y[et+13]>>>0,U=Y[et+14]>>>0,N=Y[et+15]>>>0,S=G(7,25,S+(D&F|~D&R)+m-680876936)+D,R=G(12,20,R+(S&D|~S&F)+g-389564586)+S,F=G(17,15,F+(R&S|~R&D)+_+606105819)+R,D=G(22,10,D+(F&R|~F&S)+y-1044525330)+F,S=G(7,25,S+(D&F|~D&R)+T-176418897)+D,R=G(12,20,R+(S&D|~S&F)+b+1200080426)+S,F=G(17,15,F+(R&S|~R&D)+C-1473231341)+R,D=G(22,10,D+(F&R|~F&S)+I-45705983)+F,S=G(7,25,S+(D&F|~D&R)+M+1770035416)+D,R=G(12,20,R+(S&D|~S&F)+L-1958414417)+S,F=G(17,15,F+(R&S|~R&D)+B-42063)+R,D=G(22,10,D+(F&R|~F&S)+p-1990404162)+F,S=G(7,25,S+(D&F|~D&R)+x+1804603682)+D,R=G(12,20,R+(S&D|~S&F)+E-40341101)+S,F=G(17,15,F+(R&S|~R&D)+U-1502002290)+R,D=G(22,10,D+(F&R|~F&S)+N+1236535329)+F,S=G(5,27,S+(D&R|F&~R)+g-165796510)+D,R=G(9,23,R+(S&F|D&~F)+C-1069501632)+S,F=G(14,18,F+(R&D|S&~D)+p+643717713)+R,D=G(20,12,D+(F&S|R&~S)+m-373897302)+F,S=G(5,27,S+(D&R|F&~R)+b-701558691)+D,R=G(9,23,R+(S&F|D&~F)+B+38016083)+S,F=G(14,18,F+(R&D|S&~D)+N-660478335)+R,D=G(20,12,D+(F&S|R&~S)+T-405537848)+F,S=G(5,27,S+(D&R|F&~R)+L+568446438)+D,R=G(9,23,R+(S&F|D&~F)+U-1019803690)+S,F=G(14,18,F+(R&D|S&~D)+y-187363961)+R,D=G(20,12,D+(F&S|R&~S)+M+1163531501)+F,S=G(5,27,S+(D&R|F&~R)+E-1444681467)+D,R=G(9,23,R+(S&F|D&~F)+_-51403784)+S,F=G(14,18,F+(R&D|S&~D)+I+1735328473)+R,D=G(20,12,D+(F&S|R&~S)+x-1926607734)+F,S=G(4,28,S+(D^F^R)+b-378558)+D,R=G(11,21,R+(S^D^F)+M-2022574463)+S,F=G(16,16,F+(R^S^D)+p+1839030562)+R,D=G(23,9,D+(F^R^S)+U-35309556)+F,S=G(4,28,S+(D^F^R)+g-1530992060)+D,R=G(11,21,R+(S^D^F)+T+1272893353)+S,F=G(16,16,F+(R^S^D)+I-155497632)+R,D=G(23,9,D+(F^R^S)+B-1094730640)+F,S=G(4,28,S+(D^F^R)+E+681279174)+D,R=G(11,21,R+(S^D^F)+m-358537222)+S,F=G(16,16,F+(R^S^D)+y-722521979)+R,D=G(23,9,D+(F^R^S)+C+76029189)+F,S=G(4,28,S+(D^F^R)+L-640364487)+D,R=G(11,21,R+(S^D^F)+x-421815835)+S,F=G(16,16,F+(R^S^D)+N+530742520)+R,D=G(23,9,D+(F^R^S)+_-995338651)+F,S=G(6,26,S+(F^(D|~R))+m-198630844)+D,R=G(10,22,R+(D^(S|~F))+I+1126891415)+S,F=G(15,17,F+(S^(R|~D))+U-1416354905)+R,D=G(21,11,D+(R^(F|~S))+b-57434055)+F,S=G(6,26,S+(F^(D|~R))+x+1700485571)+D,R=G(10,22,R+(D^(S|~F))+y-1894986606)+S,F=G(15,17,F+(S^(R|~D))+B-1051523)+R,D=G(21,11,D+(R^(F|~S))+g-2054922799)+F,S=G(6,26,S+(F^(D|~R))+M+1873313359)+D,R=G(10,22,R+(D^(S|~F))+N-30611744)+S,F=G(15,17,F+(S^(R|~D))+C-1560198380)+R,D=G(21,11,D+(R^(F|~S))+E+1309151649)+F,S=G(6,26,S+(F^(D|~R))+T-145523070)+D,R=G(10,22,R+(D^(S|~F))+p-1120210379)+S,F=G(15,17,F+(S^(R|~D))+_+718787259)+R,D=G(21,11,D+(R^(F|~S))+L-343485551)+F,et=et+16,S=S+P>>>0,D=D+v>>>0,F=F+it>>>0,R=R+At>>>0);return re.endian([S,D,F,R]);function G(mt,fo,Zt){return Zt<<mt|Zt>>>fo}function dd(mt,fo){for(var Zt=-1,Os=Math.floor((mt.length-1)/4),Bt=0,Lc,Oc,vc,Gc;Os-8>Zt++;)Bt=Zt<<2,fo[Zt]=mt[Bt+0]|mt[Bt+1]<<8|mt[Bt+2]<<16|mt[Bt+3]<<24;for(Zt--;Os>Zt++;)Bt=Zt<<2,Lc=typeof mt[Bt+0]>"u"?0:mt[Bt+0],Oc=typeof mt[Bt+1]>"u"?0:mt[Bt+1],vc=typeof mt[Bt+2]>"u"?0:mt[Bt+2],Gc=typeof mt[Bt+3]>"u"?0:mt[Bt+3],fo[Zt]=Lc|Oc<<8|vc<<16|Gc<<24;return Os+1}};return function(A,m,g,_){var y;return e=m.loops,t=m.loop,r=m.getA,o=m.getB,i=m.getC,f=m.getD,l=m.getX,n=m.setA,s=m.setB,a=m.setC,c=m.setD,h=m.setX,u=g,y=re.wordsToBytes(d(A)),_&&_.asBytes?y:re.bytesconvertNumberToHex(y)}}function kx(){var t=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,g,_,y,T,b,C,I,M,L=new Date().getTime(),B=1732584193,p=-271733879,x=-1732584194,E=271733878,U=e.length*8;M=re.bytesToWords(e);for(var N=0;N<M.length;N++)M[N]=(M[N]<<8|M[N]>>>24)&16711935|(M[N]<<24|M[N]>>>8)&4278255360;M[U>>>5]|=128<<U%32,M[(U+64>>>9<<4)+14]=U;for(var P=0;P<M.length;P+=16)T=B,b=p,C=x,I=E,n=M[P+0]>>>0,o=M[P+1]>>>0,s=M[P+2]>>>0,i=M[P+3]>>>0,a=M[P+4]>>>0,f=M[P+5]>>>0,c=M[P+6]>>>0,l=M[P+7]>>>0,h=M[P+8]>>>0,u=M[P+9]>>>0,d=M[P+10]>>>0,A=M[P+11]>>>0,m=M[P+12]>>>0,g=M[P+13]>>>0,_=M[P+14]>>>0,y=M[P+15]>>>0,B=v(7,25,B+(p&x|~p&E)+n-680876936)+p,E=v(12,20,E+(B&p|~B&x)+o-389564586)+B,x=v(17,15,x+(E&B|~E&p)+s+606105819)+E,p=v(22,10,p+(x&E|~x&B)+i-1044525330)+x,B=v(7,25,B+(p&x|~p&E)+a-176418897)+p,E=v(12,20,E+(B&p|~B&x)+f+1200080426)+B,x=v(17,15,x+(E&B|~E&p)+c-1473231341)+E,p=v(22,10,p+(x&E|~x&B)+l-45705983)+x,B=v(7,25,B+(p&x|~p&E)+h+1770035416)+p,E=v(12,20,E+(B&p|~B&x)+u-1958414417)+B,x=v(17,15,x+(E&B|~E&p)+d-42063)+E,p=v(22,10,p+(x&E|~x&B)+A-1990404162)+x,B=v(7,25,B+(p&x|~p&E)+m+1804603682)+p,E=v(12,20,E+(B&p|~B&x)+g-40341101)+B,x=v(17,15,x+(E&B|~E&p)+_-1502002290)+E,p=v(22,10,p+(x&E|~x&B)+y+1236535329)+x,B=v(5,27,B+(p&E|x&~E)+o-165796510)+p,E=v(9,23,E+(B&x|p&~x)+c-1069501632)+B,x=v(14,18,x+(E&p|B&~p)+A+643717713)+E,p=v(20,12,p+(x&B|E&~B)+n-373897302)+x,B=v(5,27,B+(p&E|x&~E)+f-701558691)+p,E=v(9,23,E+(B&x|p&~x)+d+38016083)+B,x=v(14,18,x+(E&p|B&~p)+y-660478335)+E,p=v(20,12,p+(x&B|E&~B)+a-405537848)+x,B=v(5,27,B+(p&E|x&~E)+u+568446438)+p,E=v(9,23,E+(B&x|p&~x)+_-1019803690)+B,x=v(14,18,x+(E&p|B&~p)+i-187363961)+E,p=v(20,12,p+(x&B|E&~B)+h+1163531501)+x,B=v(5,27,B+(p&E|x&~E)+g-1444681467)+p,E=v(9,23,E+(B&x|p&~x)+s-51403784)+B,x=v(14,18,x+(E&p|B&~p)+l+1735328473)+E,p=v(20,12,p+(x&B|E&~B)+m-1926607734)+x,B=v(4,28,B+(p^x^E)+f-378558)+p,E=v(11,21,E+(B^p^x)+h-2022574463)+B,x=v(16,16,x+(E^B^p)+A+1839030562)+E,p=v(23,9,p+(x^E^B)+_-35309556)+x,B=v(4,28,B+(p^x^E)+o-1530992060)+p,E=v(11,21,E+(B^p^x)+a+1272893353)+B,x=v(16,16,x+(E^B^p)+l-155497632)+E,p=v(23,9,p+(x^E^B)+d-1094730640)+x,B=v(4,28,B+(p^x^E)+g+681279174)+p,E=v(11,21,E+(B^p^x)+n-358537222)+B,x=v(16,16,x+(E^B^p)+i-722521979)+E,p=v(23,9,p+(x^E^B)+c+76029189)+x,B=v(4,28,B+(p^x^E)+u-640364487)+p,E=v(11,21,E+(B^p^x)+m-421815835)+B,x=v(16,16,x+(E^B^p)+y+530742520)+E,p=v(23,9,p+(x^E^B)+s-995338651)+x,B=v(6,26,B+(x^(p|~E))+n-198630844)+p,E=v(10,22,E+(p^(B|~x))+l+1126891415)+B,x=v(15,17,x+(B^(E|~p))+_-1416354905)+E,p=v(21,11,p+(E^(x|~B))+f-57434055)+x,B=v(6,26,B+(x^(p|~E))+m+1700485571)+p,E=v(10,22,E+(p^(B|~x))+i-1894986606)+B,x=v(15,17,x+(B^(E|~p))+d-1051523)+E,p=v(21,11,p+(E^(x|~B))+o-2054922799)+x,B=v(6,26,B+(x^(p|~E))+h+1873313359)+p,E=v(10,22,E+(p^(B|~x))+y-30611744)+B,x=v(15,17,x+(B^(E|~p))+c-1560198380)+E,p=v(21,11,p+(E^(x|~B))+g+1309151649)+x,B=v(6,26,B+(x^(p|~E))+a-145523070)+p,E=v(10,22,E+(p^(B|~x))+A-1120210379)+B,x=v(15,17,x+(B^(E|~p))+s+718787259)+E,p=v(21,11,p+(E^(x|~B))+u-343485551)+x,B=B+T>>>0,p=p+b>>>0,x=x+C>>>0,E=E+I>>>0;return re.endian([B,p,x,E]);function v(it,At,Y){return Y<<it|Y>>>At}};return function(e,r){var n=re.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:re.bytesconvertNumberToHex(n);return o}}function Jx(t){var e,r,n,o=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>o++;)n[o]=t.charCodeAt(o);return n}function zx(t){return Buffer.from(t,"base64").toString("binary")}function pu(t){return t}function Qx(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return re.rotl(e,8)&16711935|re.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=re.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,o=0;n<e.length;n++,o+=8)r[o>>>5]|=e[n]<<24-o%32;return r},wordsToBytes:function(e){for(var r=[],n=0;n<e.length*32;n+=8)r.push(e[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(e){for(var r=[],n=0;n<e.length;n++)r.push((e[n]>>>4).toString(16)),r.push((e[n]&15).toString(16));return r.join("")}}}var rr=class extends ps{constructor(e={}){super(),this.name="md5",this.options=e}async hash(e,r){let o=await new Promise((s,i)=>Xa(e).then(s).catch(i));return uu(o,r)}};var Wr=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}concatenate(e){return dn(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var zn=class extends Wr{constructor(e){super(e),this.name="uncompressed",this.extensions=[],this.contentEncodings=[],this.isSupported=!0,this.options=e||{}}compressSync(e){return e}decompressSync(e){return e}async*compressBatches(e){return yield*e}async*decompressBatches(e){return yield*e}};var hr=mr(nd(),1),xe=mr(od(),1);var ur=class extends Wr{constructor(e={}){super(e),this.name="deflate",this.extensions=[],this.contentEncodings=["deflate"],this.isSupported=!0,this._chunks=[],this.options=e}async compress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await _r(xe.default.gzip)(e):await _r(xe.default.deflate)(e);return xr(r)}return this.compressSync(e)}async decompress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await _r(xe.default.gunzip)(e):await _r(xe.default.inflate)(e);return xr(r)}return this.decompressSync(e)}compressSync(e){if(!xt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?xe.default.gzipSync(e):xe.default.deflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?hr.default.deflateRaw:hr.default.deflate)(n,r).buffer}decompressSync(e){if(!xt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?xe.default.gunzipSync(e):xe.default.inflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?hr.default.inflateRaw:hr.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new hr.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new hr.default.Inflate(r);yield*this.transformBatches(n,e)}async*transformBatches(e,r){e.onData=this._onData.bind(this),e.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),o=e.push(n,!0);yield*this._getChunks()}_onData(e){this._chunks.push(e)}_onEnd(e){if(e!==0)throw new Error(this._getError(e)+this._chunks.length)}_getChunks(){let e=this._chunks;return this._chunks=[],e}_getError(e=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[e]}`}};var NE={0:async t=>t,8:async t=>await new ur({raw:!0}).decompress(t)},Ls=class{constructor(e){if(this.fileProvider=null,this.archive=null,typeof e=="string")if(this.fileName=e,!xt)this.fileProvider=new pn(e);else throw new Error("Cannot open file for random access in a WEB browser");else e instanceof dr?(this.fileProvider=e.fileProvider,this.archive=e,this.fileName=e.fileName):Js(e)&&(this.fileProvider=e)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let e=[],r=Yr(this.fileProvider);for await(let n of r)e.push(n.fileName);return e}async stat(e){let r=await this.getCDFileHeader(e);return{...r,size:Number(r.uncompressedSize)}}async fetch(e){let r;if(this.archive)r=await this.archive.getFile(e,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let o=await this.getCDFileHeader(e),s=await er(o.localHeaderOffset,this.fileProvider);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=NE[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:e?`${this.fileName||""}/${e}`:this.fileName||""}),n}async getCDFileHeader(e){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=Yr(this.fileProvider),n=null;for await(let o of r)if(o.fileName===e){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var dr=class{constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new Ls(this.fileProvider).fetch(e)).arrayBuffer()}};function Sc(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),s=UE(t,n,16);r[s]=o}return r}function UE(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Fc(t){let e=Yr(t);return PE(e)}async function PE(t){let e=new rr,r=new TextEncoder,n={};for await(let o of t){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await e.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var HE={0:t=>new zn().decompress(t),8:t=>new ur({raw:!0}).decompress(t)},fn=class extends dr{constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!r)throw new Error(`No such file in the archive: ${e}`);return r}async getFileBytes(e){let r;if(this.hashTable){let n=new TextEncoder().encode(e).buffer,o=await new rr().hash(n,"hex"),s=this.hashTable[o];if(s===void 0)return null;let i=await er(s,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),f=HE[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(e);return r}};var sd=async(t,e)=>{let r=await Hn(t,Jn),n=await kn(r,t),o;if(n?.fileName!=="@3dtilesIndex1@")o=await Fc(t),e?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await er(n.localHeaderOffset,t);if(!s)throw new Error("corrupted 3tz zip archive");let i=s.fileDataOffset,a=await t.slice(i,i+s.compressedSize);o=Sc(a)}return new fn(t,o)};var kE="4.2.0-alpha.4",id={name:"3tz",id:"3tz",module:"3d-tiles",version:kE,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:JE,extensions:["3tz"],options:{}};async function JE(t,e={}){return(await sd(new gn(new DataView(t)))).getFile(e["3d-tiles-archive"]?.path??"")}function Ue(t,e,r){if(!e)return r+12;let{magic:o,version:s=1,byteLength:i=12}=t;return z(Array.isArray(o)&&Number.isFinite(s)&&Number.isFinite(i)),e.setUint8(r+0,o[0]),e.setUint8(r+1,o[1]),e.setUint8(r+2,o[2]),e.setUint8(r+3,o[3]),e.setUint32(r+4,s,!0),e.setUint32(r+8,i,!0),r+=12,r}function Pe(t,e,r){t&&t.setUint32(e+8,r,!0)}function ad(t,e,r,n,o){t={magic:Se.COMPOSITE,tiles:[],...t};let s=r;r+=Ue(t,e,r),e&&e.setUint32(r,t.tiles.length,!0),r+=4;for(let i=0;i<t.tiles.length;++i)r+=o(t.tiles[i],e,r,n);return Pe(e,s,r-s),r}function cd(t,e,r,n){let{featuresLength:o=0,batchTable:s}=t,a=JSON.stringify({BATCH_LENGTH:o}),f=s?JSON.stringify(s):"",c=wt(a.length,8),l=f?wt(f.length,8):0;t={magic:Se.BATCHED_MODEL,...t};let h=r;r=Ue(t,e,r),e&&(e.setUint32(12,c,!0),e.setUint32(16,0,!0),e.setUint32(20,l,!0),e.setUint32(24,0,!0)),r+=16,r=mo(e,r,a,8),s&&(r=mo(e,r,f,8));let u=t.gltfEncoded;return u&&(r=un(e,r,u,u.byteLength)),Pe(e,h,r-h),r}function fd(t,e,r,n){let{featuresLength:o=1,gltfFormat:s=1,gltfUri:i=""}=t,a=i.length,f={INSTANCES_LENGTH:o,POSITION:new Array(o*3).fill(0)},c=JSON.stringify(f),l=c.length;t={magic:Se.INSTANCED_MODEL,...t};let h=r;return r=Ue(t,e,0),e&&(e.setUint32(12,l,!0),e.setUint32(16,0,!0),e.setUint32(20,0,!0),e.setUint32(24,0,!0),e.setUint32(28,s,!0)),r+=20,r+=Br(e,r,c,l),r+=Br(e,r,i,a),Pe(e,h,r-h),r}var zE={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function ld(t,e,r,n){let{featureTableJson:o=zE}=t,s=JSON.stringify(o);s=Us(s,4);let{featureTableJsonByteLength:i=s.length}=t,a=new ArrayBuffer(12),f=a.byteLength;t={magic:Se.POINT_CLOUD,...t};let c=r;return r+=Ue(t,e,0),e&&(e.setUint32(r+0,i,!0),e.setUint32(r+4,f,!0),e.setUint32(r+8,0,!0),e.setUint32(r+12,0,!0)),r+=16,r+=Br(e,r,s,i),r+=un(e,r,a,f),Pe(e,c,r-c),r}function Rc(t,e){let r=Dc(t,null,0,e),n=new ArrayBuffer(r),o=new DataView(n);return Dc(t,o,0,e),n}function Dc(t,e,r,n){switch(z(typeof t.type=="string"),t.type){case Et.COMPOSITE:return ad(t,e,r,n,Dc);case Et.POINT_CLOUD:return ld(t,e,r,n);case Et.BATCHED_3D_MODEL:return cd(t,e,r,n);case Et.INSTANCED_3D_MODEL:return fd(t,e,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var ud={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Fr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(t,e)=>hd(t,e),encodeSync:hd};function hd(t,e){return Rc(t,e)}return xd(io);})();
8
+ /*! Bundled license information:
9
+
10
+ long/index.js:
11
+ (**
12
+ * @license
13
+ * Copyright 2009 The Closure Library Authors
14
+ * Copyright 2020 Daniel Wirtz / The long.js Authors.
15
+ *
16
+ * Licensed under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License.
18
+ * You may obtain a copy of the License at
19
+ *
20
+ * http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software
23
+ * distributed under the License is distributed on an "AS IS" BASIS,
24
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
+ * See the License for the specific language governing permissions and
26
+ * limitations under the License.
27
+ *
28
+ * SPDX-License-Identifier: Apache-2.0
29
+ *)
30
+ */
31
+ return __exports__;
32
+ });