@vctrl/hooks 0.3.1 → 0.3.2
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.
- package/{_commonjsHelpers-DZAafUiT.cjs → _commonjsHelpers-BKV1RZto.cjs} +2 -2
- package/{_commonjsHelpers-CT5_WOk_.js → _commonjsHelpers-BbdAOH3u.js} +18 -18
- package/index.cjs.js +1 -1
- package/index.es.js +2 -2
- package/model-context-BmfXsk0j.cjs +9 -0
- package/{model-context-Bvjdyghq.js → model-context-qjRd1gfd.js} +358 -353
- package/package.json +11 -1
- package/use-export-model.cjs.js +1 -1
- package/use-export-model.es.js +1 -1
- package/use-load-model.cjs.js +1 -1
- package/use-load-model.es.js +1 -1
- package/use-optimize-model-BXIlJ5Yx.cjs +20 -0
- package/use-optimize-model-BpcR9d1L.js +10037 -0
- package/use-optimize-model.cjs.js +1 -1
- package/use-optimize-model.es.js +1 -1
- package/model-context-BBYdA-gO.cjs +0 -9
- package/three.module-7bSgh1t6.js +0 -16071
- package/three.module-C5-FOeun.cjs +0 -3841
- package/use-optimize-model-DMZVYv9U.cjs +0 -20
- package/use-optimize-model-DRrg3MLA.js +0 -9954
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";const Tn=require("react"),xs=require("./_commonjsHelpers-BKV1RZto.cjs");class da{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;return n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t),this}removeEventListener(e,t){if(this._listeners===void 0)return this;const s=this._listeners[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}return this}dispatchEvent(e){if(this._listeners===void 0)return this;const n=this._listeners[e.type];if(n!==void 0){const s=n.slice(0);for(let r=0,i=s.length;r<i;r++)s[r].call(this,e)}return this}dispose(){for(const e in this._listeners)delete this._listeners[e]}}class Ke extends da{constructor(e,t,n,s={}){if(super(),this._name=void 0,this._parent=void 0,this._child=void 0,this._attributes=void 0,this._disposed=!1,this._name=e,this._parent=t,this._child=n,this._attributes=s,!t.isOnGraph(n))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(e){return this._child=e,this}getAttributes(){return this._attributes}dispose(){this._disposed||(this._disposed=!0,this.dispatchEvent({type:"dispose",target:this}),super.dispose())}isDisposed(){return this._disposed}}class En extends da{constructor(...e){super(...e),this._emptySet=new Set,this._edges=new Set,this._parentEdges=new Map,this._childEdges=new Map}listEdges(){return Array.from(this._edges)}listParentEdges(e){return Array.from(this._childEdges.get(e)||this._emptySet)}listParents(e){return this.listParentEdges(e).map(t=>t.getParent())}listChildEdges(e){return Array.from(this._parentEdges.get(e)||this._emptySet)}listChildren(e){return this.listChildEdges(e).map(t=>t.getChild())}disconnectParents(e,t){let n=this.listParentEdges(e);return t&&(n=n.filter(s=>t(s.getParent()))),n.forEach(s=>s.dispose()),this}createEdge(e,t,n,s){return this._registerEdge(new Ke(e,t,n,s))}_registerEdge(e){this._edges.add(e);const t=e.getParent();this._parentEdges.has(t)||this._parentEdges.set(t,new Set),this._parentEdges.get(t).add(e);const n=e.getChild();return this._childEdges.has(n)||this._childEdges.set(n,new Set),this._childEdges.get(n).add(e),e.addEventListener("dispose",()=>this._removeEdge(e)),e}_removeEdge(e){return this._edges.delete(e),this._parentEdges.get(e.getParent()).delete(e),this._childEdges.get(e.getChild()).delete(e),this}}function bt(){return bt=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},bt.apply(this,arguments)}class Be{constructor(e){if(this.list=[],e)for(const t of e)this.list.push(t)}add(e){this.list.push(e)}remove(e){const t=this.list.indexOf(e);t>=0&&this.list.splice(t,1)}removeChild(e){const t=[];for(const n of this.list)n.getChild()===e&&t.push(n);for(const n of t)this.remove(n);return t}listRefsByChild(e){const t=[];for(const n of this.list)n.getChild()===e&&t.push(n);return t}values(){return this.list}}class B{constructor(e){if(this.set=new Set,this.map=new Map,e)for(const t of e)this.add(t)}add(e){const t=e.getChild();this.removeChild(t),this.set.add(e),this.map.set(t,e)}remove(e){this.set.delete(e),this.map.delete(e.getChild())}removeChild(e){const t=this.map.get(e)||null;return t&&this.remove(t),t}getRefByChild(e){return this.map.get(e)||null}values(){return Array.from(this.set)}}class ue{constructor(e){this.map={},e&&Object.assign(this.map,e)}set(e,t){this.map[e]=t}delete(e){delete this.map[e]}get(e){return this.map[e]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}}const P=Symbol("attributes"),We=Symbol("immutableKeys");class ua extends da{constructor(e){super(),this._disposed=!1,this.graph=void 0,this[P]=void 0,this[We]=void 0,this.graph=e,this[We]=new Set,this[P]=this._createAttributes()}getDefaults(){return{}}_createAttributes(){const e=this.getDefaults(),t={};for(const n in e){const s=e[n];if(s instanceof ua){const r=this.graph.createEdge(n,this,s);r.addEventListener("dispose",()=>s.dispose()),this[We].add(n),t[n]=r}else t[n]=s}return t}isOnGraph(e){return this.graph===e.graph}isDisposed(){return this._disposed}dispose(){this._disposed||(this.graph.listChildEdges(this).forEach(e=>e.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"}))}detach(){return this.graph.disconnectParents(this),this}swap(e,t){for(const n in this[P]){const s=this[P][n];if(s instanceof Ke){const r=s;r.getChild()===e&&this.setRef(n,t,r.getAttributes())}else if(s instanceof Be)for(const r of s.listRefsByChild(e)){const i=r.getAttributes();this.removeRef(n,e),this.addRef(n,t,i)}else if(s instanceof B){const r=s.getRefByChild(e);if(r){const i=r.getAttributes();this.removeRef(n,e),this.addRef(n,t,i)}}else if(s instanceof ue)for(const r of s.keys()){const i=s.get(r);i.getChild()===e&&this.setRefMap(n,r,t,i.getAttributes())}}return this}get(e){return this[P][e]}set(e,t){return this[P][e]=t,this.dispatchEvent({type:"change",attribute:e})}getRef(e){const t=this[P][e];return t?t.getChild():null}setRef(e,t,n){if(this[We].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);const s=this[P][e];if(s&&s.dispose(),!t)return this;const r=this.graph.createEdge(e,this,t,n);return r.addEventListener("dispose",()=>{delete this[P][e],this.dispatchEvent({type:"change",attribute:e})}),this[P][e]=r,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this.assertRefList(e).values().map(n=>n.getChild())}addRef(e,t,n){const s=this.graph.createEdge(e,this,t,n),r=this.assertRefList(e);return r.add(s),s.addEventListener("dispose",()=>{r.remove(s),this.dispatchEvent({type:"change",attribute:e})}),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,t){const n=this.assertRefList(e);if(n instanceof Be)for(const s of n.removeChild(t))s.dispose();else{const s=n.removeChild(t);s&&s.dispose()}return this}assertRefList(e){const t=this[P][e];if(t instanceof Be||t instanceof B)return t;throw new Error(`Expected RefList or RefSet for attribute "${e}"`)}listRefMapKeys(e){return this.assertRefMap(e).keys()}listRefMapValues(e){return this.assertRefMap(e).values().map(t=>t.getChild())}getRefMap(e,t){const s=this.assertRefMap(e).get(t);return s?s.getChild():null}setRefMap(e,t,n,s){const r=this.assertRefMap(e),i=r.get(t);if(i&&i.dispose(),!n)return this;s=Object.assign(s||{},{key:t});const o=this.graph.createEdge(e,this,n,bt({},s,{key:t}));return o.addEventListener("dispose",()=>{r.delete(t),this.dispatchEvent({type:"change",attribute:e,key:t})}),r.set(t,o),this.dispatchEvent({type:"change",attribute:e,key:t})}assertRefMap(e){const t=this[P][e];if(t instanceof ue)return t;throw new Error(`Expected RefMap for attribute "${e}"`)}dispatchEvent(e){return super.dispatchEvent(bt({},e,{target:this})),this.graph.dispatchEvent(bt({},e,{target:this,type:`node:${e.type}`})),this}}const Ts="v4.0.8",Ye="@glb.bin";var A;(function(a){a.ACCESSOR="Accessor",a.ANIMATION="Animation",a.ANIMATION_CHANNEL="AnimationChannel",a.ANIMATION_SAMPLER="AnimationSampler",a.BUFFER="Buffer",a.CAMERA="Camera",a.MATERIAL="Material",a.MESH="Mesh",a.PRIMITIVE="Primitive",a.PRIMITIVE_TARGET="PrimitiveTarget",a.NODE="Node",a.ROOT="Root",a.SCENE="Scene",a.SKIN="Skin",a.TEXTURE="Texture",a.TEXTURE_INFO="TextureInfo"})(A||(A={}));var wt;(function(a){a.INTERLEAVED="interleaved",a.SEPARATE="separate"})(wt||(wt={}));var ae;(function(a){a.ARRAY_BUFFER="ARRAY_BUFFER",a.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",a.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",a.OTHER="OTHER",a.SPARSE="SPARSE"})(ae||(ae={}));var oe;(function(a){a[a.R=4096]="R",a[a.G=256]="G",a[a.B=16]="B",a[a.A=1]="A"})(oe||(oe={}));var ze;(function(a){a.GLTF="GLTF",a.GLB="GLB"})(ze||(ze={}));const pt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var Xt=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var a=0,e=arguments.length;e--;)a+=arguments[e]*arguments[e];return Math.sqrt(a)});function In(){var a=new Xt(3);return Xt!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a}function Pt(a){var e=a[0],t=a[1],n=a[2];return Math.hypot(e,t,n)}function An(a,e,t){var n=e[0],s=e[1],r=e[2],i=t[3]*n+t[7]*s+t[11]*r+t[15];return i=i||1,a[0]=(t[0]*n+t[4]*s+t[8]*r+t[12])/i,a[1]=(t[1]*n+t[5]*s+t[9]*r+t[13])/i,a[2]=(t[2]*n+t[6]*s+t[10]*r+t[14])/i,a}(function(){var a=In();return function(e,t,n,s,r,i){var o,c;for(t||(t=3),n||(n=0),s?c=Math.min(s*t+n,e.length):c=e.length,o=n;o<c;o+=t)a[0]=e[o],a[1]=e[o+1],a[2]=e[o+2],r(a,a,i),e[o]=a[0],e[o+1]=a[1],e[o+2]=a[2];return e}})();function wn(a){const e=Es(),t=a.propertyType===A.NODE?[a]:a.listChildren();for(const n of t)n.traverse(s=>{const r=s.getMesh();if(!r)return;const i=Rn(r,s.getWorldMatrix());i.min.every(isFinite)&&i.max.every(isFinite)&&(Jt(i.min,e),Jt(i.max,e))});return e}function Rn(a,e){const t=Es();for(const n of a.listPrimitives()){const s=n.getAttribute("POSITION"),r=n.getIndices();if(!s)continue;let i=[0,0,0],o=[0,0,0];for(let c=0,f=r?r.getCount():s.getCount();c<f;c++){const b=r?r.getScalar(c):c;i=s.getElement(b,i),o=An(o,i,e),Jt(o,t)}}return t}function Jt(a,e){for(let t=0;t<3;t++)e.min[t]=Math.min(a[t],e.min[t]),e.max[t]=Math.max(a[t],e.max[t])}function Es(){return{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}class O{static createBufferFromDataURI(e){if(typeof Buffer>"u"){const t=atob(e.split(",")[1]),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}else{const t=e.split(",")[1],n=e.indexOf("base64")>=0;return Buffer.from(t,n?"base64":"utf8")}}static encodeText(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}static decodeText(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}static concat(e){let t=0;for(const r of e)t+=r.byteLength;const n=new Uint8Array(t);let s=0;for(const r of e)n.set(r,s),s+=r.byteLength;return n}static pad(e,t=0){const n=this.padNumber(e.byteLength);if(n===e.byteLength)return e;const s=new Uint8Array(n);if(s.set(e),t!==0)for(let r=e.byteLength;r<n;r++)s[r]=t;return s}static padNumber(e){return Math.ceil(e/4)*4}static equals(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;let n=e.byteLength;for(;n--;)if(e[n]!==t[n])return!1;return!0}static toView(e,t=0,n=1/0){return new Uint8Array(e.buffer,e.byteOffset+t,Math.min(e.byteLength,n))}static assertView(e){if(e&&!ArrayBuffer.isView(e))throw new Error(`Method requires Uint8Array parameter; received "${typeof e}".`);return e}}class jn{static hexToFactor(e,t){e=Math.floor(e);const n=t;return n[0]=(e>>16&255)/255,n[1]=(e>>8&255)/255,n[2]=(e&255)/255,this.convertSRGBToLinear(t,t)}static factorToHex(e){const t=[...e],[n,s,r]=this.convertLinearToSRGB(e,t);return n*255<<16^s*255<<8^r*255<<0}static convertSRGBToLinear(e,t){const n=e,s=t;for(let r=0;r<3;r++)s[r]=n[r]<.04045?n[r]*.0773993808:Math.pow(n[r]*.9478672986+.0521327014,2.4);return t}static convertLinearToSRGB(e,t){const n=e,s=t;for(let r=0;r<3;r++)s[r]=n[r]<.0031308?n[r]*12.92:1.055*Math.pow(n[r],.41666)-.055;return t}}class vn{match(e){return e.length>=3&&e[0]===255&&e[1]===216&&e[2]===255}getSize(e){let t=new DataView(e.buffer,e.byteOffset+4),n,s;for(;t.byteLength;){if(n=t.getUint16(0,!1),kn(t,n),s=t.getUint8(n+1),s===192||s===193||s===194)return[t.getUint16(n+7,!1),t.getUint16(n+5,!1)];t=new DataView(e.buffer,t.byteOffset+n+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(e){return 3}}class _t{match(e){return e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10}getSize(e){const t=new DataView(e.buffer,e.byteOffset);return O.decodeText(e.slice(12,16))===_t.PNG_FRIED_CHUNK_NAME?[t.getUint32(32,!1),t.getUint32(36,!1)]:[t.getUint32(16,!1),t.getUint32(20,!1)]}getChannels(e){return 4}}_t.PNG_FRIED_CHUNK_NAME="CgBI";class he{static registerFormat(e,t){this.impls[e]=t}static getMimeType(e){for(const t in this.impls)if(this.impls[t].match(e))return t;return null}static getSize(e,t){return this.impls[t]?this.impls[t].getSize(e):null}static getChannels(e,t){return this.impls[t]?this.impls[t].getChannels(e):null}static getVRAMByteLength(e,t){if(!this.impls[t])return null;if(this.impls[t].getVRAMByteLength)return this.impls[t].getVRAMByteLength(e);let n=0;const s=4,r=this.getSize(e,t);if(!r)return null;for(;r[0]>1||r[1]>1;)n+=r[0]*r[1]*s,r[0]=Math.max(Math.floor(r[0]/2),1),r[1]=Math.max(Math.floor(r[1]/2),1);return n+=1*1*s,n}static mimeTypeToExtension(e){return e==="image/jpeg"?"jpg":e.split("/").pop()}static extensionToMimeType(e){return e==="jpg"?"image/jpeg":e?`image/${e}`:""}}he.impls={"image/jpeg":new vn,"image/png":new _t};function kn(a,e){if(e>a.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(a.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return a}class Qe{static basename(e){const t=e.split(/[\\/]/).pop();return t.substring(0,t.lastIndexOf("."))}static extension(e){if(e.startsWith("data:image/")){const t=e.match(/data:(image\/\w+)/)[1];return he.mimeTypeToExtension(t)}else{if(e.startsWith("data:model/gltf+json"))return"gltf";if(e.startsWith("data:model/gltf-binary"))return"glb";if(e.startsWith("data:application/"))return"bin"}return e.split(/[\\/]/).pop().split(/[.]/).pop()}}function _a(a){return Object.prototype.toString.call(a)==="[object Object]"}function Le(a){if(_a(a)===!1)return!1;const e=a.constructor;if(e===void 0)return!0;const t=e.prototype;return!(_a(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}var Yt,Qt;(function(a){a[a.SILENT=4]="SILENT",a[a.ERROR=3]="ERROR",a[a.WARN=2]="WARN",a[a.INFO=1]="INFO",a[a.DEBUG=0]="DEBUG"})(Qt||(Qt={}));class ie{constructor(e){this.verbosity=void 0,this.verbosity=e}debug(e){this.verbosity<=ie.Verbosity.DEBUG&&console.debug(e)}info(e){this.verbosity<=ie.Verbosity.INFO&&console.info(e)}warn(e){this.verbosity<=ie.Verbosity.WARN&&console.warn(e)}error(e){this.verbosity<=ie.Verbosity.ERROR&&console.error(e)}}Yt=ie;ie.Verbosity=Qt;ie.DEFAULT_INSTANCE=new Yt(Yt.Verbosity.INFO);function Nn(a){var e=a[0],t=a[1],n=a[2],s=a[3],r=a[4],i=a[5],o=a[6],c=a[7],f=a[8],b=a[9],u=a[10],d=a[11],g=a[12],l=a[13],m=a[14],p=a[15],h=e*i-t*r,I=e*o-n*r,x=e*c-s*r,T=t*o-n*i,E=t*c-s*i,R=n*c-s*o,y=f*l-b*g,w=f*m-u*g,j=f*p-d*g,v=b*m-u*l,k=b*p-d*l,N=u*p-d*m;return h*N-I*k+x*v+T*j-E*w+R*y}function Mn(a,e,t){var n=e[0],s=e[1],r=e[2],i=e[3],o=e[4],c=e[5],f=e[6],b=e[7],u=e[8],d=e[9],g=e[10],l=e[11],m=e[12],p=e[13],h=e[14],I=e[15],x=t[0],T=t[1],E=t[2],R=t[3];return a[0]=x*n+T*o+E*u+R*m,a[1]=x*s+T*c+E*d+R*p,a[2]=x*r+T*f+E*g+R*h,a[3]=x*i+T*b+E*l+R*I,x=t[4],T=t[5],E=t[6],R=t[7],a[4]=x*n+T*o+E*u+R*m,a[5]=x*s+T*c+E*d+R*p,a[6]=x*r+T*f+E*g+R*h,a[7]=x*i+T*b+E*l+R*I,x=t[8],T=t[9],E=t[10],R=t[11],a[8]=x*n+T*o+E*u+R*m,a[9]=x*s+T*c+E*d+R*p,a[10]=x*r+T*f+E*g+R*h,a[11]=x*i+T*b+E*l+R*I,x=t[12],T=t[13],E=t[14],R=t[15],a[12]=x*n+T*o+E*u+R*m,a[13]=x*s+T*c+E*d+R*p,a[14]=x*r+T*f+E*g+R*h,a[15]=x*i+T*b+E*l+R*I,a}function Sn(a,e){var t=e[0],n=e[1],s=e[2],r=e[4],i=e[5],o=e[6],c=e[8],f=e[9],b=e[10];return a[0]=Math.hypot(t,n,s),a[1]=Math.hypot(r,i,o),a[2]=Math.hypot(c,f,b),a}function Cn(a,e){var t=new Xt(3);Sn(t,e);var n=1/t[0],s=1/t[1],r=1/t[2],i=e[0]*n,o=e[1]*s,c=e[2]*r,f=e[4]*n,b=e[5]*s,u=e[6]*r,d=e[8]*n,g=e[9]*s,l=e[10]*r,m=i+b+l,p=0;return m>0?(p=Math.sqrt(m+1)*2,a[3]=.25*p,a[0]=(u-g)/p,a[1]=(d-c)/p,a[2]=(o-f)/p):i>b&&i>l?(p=Math.sqrt(1+i-b-l)*2,a[3]=(u-g)/p,a[0]=.25*p,a[1]=(o+f)/p,a[2]=(d+c)/p):b>l?(p=Math.sqrt(1+b-i-l)*2,a[3]=(d-c)/p,a[0]=(o+f)/p,a[1]=.25*p,a[2]=(u+g)/p):(p=Math.sqrt(1+l-i-b)*2,a[3]=(o-f)/p,a[0]=(d+c)/p,a[1]=(u+g)/p,a[2]=.25*p),a}class F{static identity(e){return e}static eq(e,t,n=1e-5){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(Math.abs(e[s]-t[s])>n)return!1;return!0}static clamp(e,t,n){return e<t?t:e>n?n:e}static decodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return e/65535;case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5120:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return Math.round(F.clamp(e,0,1)*65535);case 5121:return Math.round(F.clamp(e,0,1)*255);case 5122:return Math.round(F.clamp(e,-1,1)*32767);case 5120:return Math.round(F.clamp(e,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(e,t,n,s){let r=Pt([e[0],e[1],e[2]]);const i=Pt([e[4],e[5],e[6]]),o=Pt([e[8],e[9],e[10]]);Nn(e)<0&&(r=-r),t[0]=e[12],t[1]=e[13],t[2]=e[14];const f=e.slice(),b=1/r,u=1/i,d=1/o;f[0]*=b,f[1]*=b,f[2]*=b,f[4]*=u,f[5]*=u,f[6]*=u,f[8]*=d,f[9]*=d,f[10]*=d,Cn(n,f),s[0]=r,s[1]=i,s[2]=o}static compose(e,t,n,s){const r=s,i=t[0],o=t[1],c=t[2],f=t[3],b=i+i,u=o+o,d=c+c,g=i*b,l=i*u,m=i*d,p=o*u,h=o*d,I=c*d,x=f*b,T=f*u,E=f*d,R=n[0],y=n[1],w=n[2];return r[0]=(1-(p+I))*R,r[1]=(l+E)*R,r[2]=(m-T)*R,r[3]=0,r[4]=(l-E)*y,r[5]=(1-(g+I))*y,r[6]=(h+x)*y,r[7]=0,r[8]=(m+T)*w,r[9]=(h-x)*w,r[10]=(1-(g+p))*w,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}}function On(a,e){if(!!a!=!!e)return!1;const t=a.getChild(),n=e.getChild();return t===n||t.equals(n)}function _n(a,e){if(!!a!=!!e)return!1;const t=a.values(),n=e.values();if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++){const r=t[s],i=n[s];if(r.getChild()!==i.getChild()&&!r.getChild().equals(i.getChild()))return!1}return!0}function Fn(a,e){if(!!a!=!!e)return!1;const t=a.keys(),n=e.keys();if(t.length!==n.length)return!1;for(const s of t){const r=a.get(s),i=e.get(s);if(!!r!=!!i)return!1;const o=r.getChild(),c=i.getChild();if(o!==c&&!o.equals(c))return!1}return!0}function Is(a,e){if(a===e)return!0;if(!!a!=!!e||!a||!e||a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(a[t]!==e[t])return!1;return!0}function As(a,e){if(a===e)return!0;if(!!a!=!!e)return!1;if(!Le(a)||!Le(e))return a===e;const t=a,n=e;let s=0,r=0,i;for(i in t)s++;for(i in n)r++;if(s!==r)return!1;for(i in t){const o=t[i],c=n[i];if(Rt(o)&&Rt(c)){if(!Is(o,c))return!1}else if(Le(o)&&Le(c)){if(!As(o,c))return!1}else if(o!==c)return!1}return!0}function Rt(a){return Array.isArray(a)||ArrayBuffer.isView(a)}const Fa="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",Dn=999,Un=6,Da=new Set,Bn=function(){let e="";for(let t=0;t<Un;t++)e+=Fa.charAt(Math.floor(Math.random()*Fa.length));return e},Ln=function(){for(let e=0;e<Dn;e++){const t=Bn();if(!Da.has(t))return Da.add(t),t}return""},Ua="https://null.example";class dt{static dirname(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substring(0,t+1)}static basename(e){return Qe.basename(new URL(e,Ua).pathname)}static extension(e){return Qe.extension(new URL(e,Ua).pathname)}static resolve(e,t){if(!this.isRelativePath(t))return t;const n=e.split("/"),s=t.split("/");n.pop();for(let r=0;r<s.length;r++)s[r]!=="."&&(s[r]===".."?n.pop():n.push(s[r]));return n.join("/")}static isAbsoluteURL(e){return this.PROTOCOL_REGEXP.test(e)}static isRelativePath(e){return!/^(?:[a-zA-Z]+:)?\//.test(e)}}dt.DEFAULT_INIT={};dt.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;const Ae=a=>a,Gn=new Set;class ha extends ua{constructor(e,t=""){super(e),this[P].name=t,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(e,t){return Array.isArray(t)&&(t=t.slice()),super.set(e,t)}getName(){return this.get("name")}setName(e){return this.set("name",e)}getExtras(){return this.get("extras")}setExtras(e){return this.set("extras",e)}clone(){const e=this.constructor;return new e(this.graph).copy(this,Ae)}copy(e,t=Ae){for(const n in this[P]){const s=this[P][n];if(s instanceof Ke)this[We].has(n)||s.dispose();else if(s instanceof Be||s instanceof B)for(const r of s.values())r.dispose();else if(s instanceof ue)for(const r of s.values())r.dispose()}for(const n in e[P]){const s=this[P][n],r=e[P][n];if(r instanceof Ke)this[We].has(n)?s.getChild().copy(t(r.getChild()),t):this.setRef(n,t(r.getChild()),r.getAttributes());else if(r instanceof B||r instanceof Be)for(const i of r.values())this.addRef(n,t(i.getChild()),i.getAttributes());else if(r instanceof ue)for(const i of r.keys()){const o=r.get(i);this.setRefMap(n,i,t(o.getChild()),o.getAttributes())}else Le(r)?this[P][n]=JSON.parse(JSON.stringify(r)):Array.isArray(r)||r instanceof ArrayBuffer||ArrayBuffer.isView(r)?this[P][n]=r.slice():this[P][n]=r}return this}equals(e,t=Gn){if(this===e)return!0;if(this.propertyType!==e.propertyType)return!1;for(const n in this[P]){if(t.has(n))continue;const s=this[P][n],r=e[P][n];if(s instanceof Ke||r instanceof Ke){if(!On(s,r))return!1}else if(s instanceof B||r instanceof B||s instanceof Be||r instanceof Be){if(!_n(s,r))return!1}else if(s instanceof ue||r instanceof ue){if(!Fn(s,r))return!1}else if(Le(s)||Le(r)){if(!As(s,r))return!1}else if(Rt(s)||Rt(r)){if(!Is(s,r))return!1}else if(s!==r)return!1}return!0}detach(){return this.graph.disconnectParents(this,e=>e.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class te extends ha{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new ue})}getExtension(e){return this.getRefMap("extensions",e)}setExtension(e,t){return t&&t._validateParent(this),this.setRefMap("extensions",e,t)}listExtensions(){return this.listRefMapValues("extensions")}}class S extends te{init(){this.propertyType=A.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:S.Type.SCALAR,componentType:S.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(e){switch(e){case S.Type.SCALAR:return 1;case S.Type.VEC2:return 2;case S.Type.VEC3:return 3;case S.Type.VEC4:return 4;case S.Type.MAT2:return 4;case S.Type.MAT3:return 9;case S.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case S.ComponentType.BYTE:return 1;case S.ComponentType.UNSIGNED_BYTE:return 1;case S.ComponentType.SHORT:return 2;case S.ComponentType.UNSIGNED_SHORT:return 2;case S.ComponentType.UNSIGNED_INT:return 4;case S.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+e)}}getMinNormalized(e){const t=this.getNormalized(),n=this.getElementSize(),s=this.getComponentType();if(this.getMin(e),t)for(let r=0;r<n;r++)e[r]=F.decodeNormalizedInt(e[r],s);return e}getMin(e){const t=this.getArray(),n=this.getCount(),s=this.getElementSize();for(let r=0;r<s;r++)e[r]=1/0;for(let r=0;r<n*s;r+=s)for(let i=0;i<s;i++){const o=t[r+i];Number.isFinite(o)&&(e[i]=Math.min(e[i],o))}return e}getMaxNormalized(e){const t=this.getNormalized(),n=this.getElementSize(),s=this.getComponentType();if(this.getMax(e),t)for(let r=0;r<n;r++)e[r]=F.decodeNormalizedInt(e[r],s);return e}getMax(e){const t=this.get("array"),n=this.getCount(),s=this.getElementSize();for(let r=0;r<s;r++)e[r]=-1/0;for(let r=0;r<n*s;r+=s)for(let i=0;i<s;i++){const o=t[r+i];Number.isFinite(o)&&(e[i]=Math.max(e[i],o))}return e}getCount(){const e=this.get("array");return e?e.length/this.getElementSize():0}getType(){return this.get("type")}setType(e){return this.set("type",e)}getElementSize(){return S.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(e){return this.set("normalized",e)}getScalar(e){const t=this.getElementSize(),n=this.getComponentType(),s=this.getArray();return this.getNormalized()?F.decodeNormalizedInt(s[e*t],n):s[e*t]}setScalar(e,t){const n=this.getElementSize(),s=this.getComponentType(),r=this.getArray();return this.getNormalized()?r[e*n]=F.encodeNormalizedInt(t,s):r[e*n]=t,this}getElement(e,t){const n=this.getNormalized(),s=this.getElementSize(),r=this.getComponentType(),i=this.getArray();for(let o=0;o<s;o++)n?t[o]=F.decodeNormalizedInt(i[e*s+o],r):t[o]=i[e*s+o];return t}setElement(e,t){const n=this.getNormalized(),s=this.getElementSize(),r=this.getComponentType(),i=this.getArray();for(let o=0;o<s;o++)n?i[e*s+o]=F.encodeNormalizedInt(t[o],r):i[e*s+o]=t[o];return this}getSparse(){return this.get("sparse")}setSparse(e){return this.set("sparse",e)}getBuffer(){return this.getRef("buffer")}setBuffer(e){return this.setRef("buffer",e)}getArray(){return this.get("array")}setArray(e){return this.set("componentType",e?zn(e):S.ComponentType.FLOAT),this.set("array",e),this}getByteLength(){const e=this.get("array");return e?e.byteLength:0}}S.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};S.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function zn(a){switch(a.constructor){case Float32Array:return S.ComponentType.FLOAT;case Uint32Array:return S.ComponentType.UNSIGNED_INT;case Uint16Array:return S.ComponentType.UNSIGNED_SHORT;case Uint8Array:return S.ComponentType.UNSIGNED_BYTE;case Int16Array:return S.ComponentType.SHORT;case Int8Array:return S.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class ws extends te{init(){this.propertyType=A.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new B,samplers:new B})}addChannel(e){return this.addRef("channels",e)}removeChannel(e){return this.removeRef("channels",e)}listChannels(){return this.listRefs("channels")}addSampler(e){return this.addRef("samplers",e)}removeSampler(e){return this.removeRef("samplers",e)}listSamplers(){return this.listRefs("samplers")}}class et extends te{init(){this.propertyType=A.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(e){return this.set("targetPath",e)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(e){return this.setRef("targetNode",e)}getSampler(){return this.getRef("sampler")}setSampler(e){return this.setRef("sampler",e)}}et.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class tt extends te{init(){this.propertyType=A.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:tt.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(e){return this.set("interpolation",e)}getInput(){return this.getRef("input")}setInput(e){return this.setRef("input",e,{usage:ae.OTHER})}getOutput(){return this.getRef("output")}setOutput(e){return this.setRef("output",e,{usage:ae.OTHER})}}tt.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class Rs extends te{init(){this.propertyType=A.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(e){return this.set("uri",e)}}class Ve extends te{init(){this.propertyType=A.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:Ve.Type.PERSPECTIVE,znear:.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(e){return this.set("type",e)}getZNear(){return this.get("znear")}setZNear(e){return this.set("znear",e)}getZFar(){return this.get("zfar")}setZFar(e){return this.set("zfar",e)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(e){return this.set("aspectRatio",e)}getYFov(){return this.get("yfov")}setYFov(e){return this.set("yfov",e)}getXMag(){return this.get("xmag")}setXMag(e){return this.set("xmag",e)}getYMag(){return this.get("ymag")}setYMag(e){return this.set("ymag",e)}}Ve.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class V extends ha{_validateParent(e){if(!this.parentTypes.includes(e.propertyType))throw new Error(`Parent "${e.propertyType}" invalid for child "${this.propertyType}".`)}}V.EXTENSION_NAME=void 0;class U extends te{init(){this.propertyType=A.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:U.WrapMode.REPEAT,wrapT:U.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}getMagFilter(){return this.get("magFilter")}setMagFilter(e){return this.set("magFilter",e)}getMinFilter(){return this.get("minFilter")}setMinFilter(e){return this.set("minFilter",e)}getWrapS(){return this.get("wrapS")}setWrapS(e){return this.set("wrapS",e)}getWrapT(){return this.get("wrapT")}setWrapT(e){return this.set("wrapT",e)}}U.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};U.MagFilter={NEAREST:9728,LINEAR:9729};U.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};const{R:mt,G:yt,B:xt,A:Pn}=oe;class ye extends te{init(){this.propertyType=A.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:ye.AlphaMode.OPAQUE,alphaCutoff:.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new U(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new U(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new U(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new U(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new U(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(e){return this.set("doubleSided",e)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(e){const t=this.get("baseColorFactor").slice();return t[3]=e,this.set("baseColorFactor",t)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(e){return this.set("alphaMode",e)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(e){return this.set("alphaCutoff",e)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(e){return this.set("baseColorFactor",e)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(e){return this.setRef("baseColorTexture",e,{channels:mt|yt|xt|Pn,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(e){return this.set("emissiveFactor",e)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(e){return this.setRef("emissiveTexture",e,{channels:mt|yt|xt,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(e){return this.set("normalScale",e)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(e){return this.setRef("normalTexture",e,{channels:mt|yt|xt})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(e){return this.set("occlusionStrength",e)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(e){return this.setRef("occlusionTexture",e,{channels:mt})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(e){return this.set("roughnessFactor",e)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(e){return this.set("metallicFactor",e)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(e){return this.setRef("metallicRoughnessTexture",e,{channels:yt|xt})}}ye.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class js extends te{init(){this.propertyType=A.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new B})}addPrimitive(e){return this.addRef("primitives",e)}removePrimitive(e){return this.removeRef("primitives",e)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}}class la extends te{init(){this.propertyType=A.NODE}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new B})}copy(e,t=Ae){if(t===Ae)throw new Error("Node cannot be copied.");return super.copy(e,t)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(e){return this.set("translation",e)}setRotation(e){return this.set("rotation",e)}setScale(e){return this.set("scale",e)}getMatrix(){return F.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(e){const t=this.get("translation").slice(),n=this.get("rotation").slice(),s=this.get("scale").slice();return F.decompose(e,t,n,s),this.set("translation",t).set("rotation",n).set("scale",s)}getWorldTranslation(){const e=[0,0,0];return F.decompose(this.getWorldMatrix(),e,[0,0,0,1],[1,1,1]),e}getWorldRotation(){const e=[0,0,0,1];return F.decompose(this.getWorldMatrix(),[0,0,0],e,[1,1,1]),e}getWorldScale(){const e=[1,1,1];return F.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],e),e}getWorldMatrix(){const e=[];for(let s=this;s!=null;s=s.getParentNode())e.push(s);let t;const n=e.pop().getMatrix();for(;t=e.pop();)Mn(n,n,t.getMatrix());return n}addChild(e){const t=e.getParentNode();t&&t.removeChild(e);for(const n of e.listParents())n.propertyType===A.SCENE&&n.removeChild(e);return this.addRef("children",e)}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}getParentNode(){for(const e of this.listParents())if(e.propertyType===A.NODE)return e;return null}getMesh(){return this.getRef("mesh")}setMesh(e){return this.setRef("mesh",e)}getCamera(){return this.getRef("camera")}setCamera(e){return this.setRef("camera",e)}getSkin(){return this.getRef("skin")}setSkin(e){return this.setRef("skin",e)}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}traverse(e){e(this);for(const t of this.listChildren())t.traverse(e);return this}}class H extends te{init(){this.propertyType=A.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:H.Mode.TRIANGLES,material:null,indices:null,attributes:new ue,targets:new B})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:ae.ELEMENT_ARRAY_BUFFER})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:ae.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}getMode(){return this.get("mode")}setMode(e){return this.set("mode",e)}listTargets(){return this.listRefs("targets")}addTarget(e){return this.addRef("targets",e)}removeTarget(e){return this.removeRef("targets",e)}}H.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class vs extends ha{init(){this.propertyType=A.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new ue})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:ae.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function ee(){return ee=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},ee.apply(this,arguments)}class Ft extends te{init(){this.propertyType=A.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new B})}copy(e,t=Ae){if(t===Ae)throw new Error("Scene cannot be copied.");return super.copy(e,t)}addChild(e){const t=e.getParentNode();return t&&t.removeChild(e),this.addRef("children",e)}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}traverse(e){for(const t of this.listChildren())t.traverse(e);return this}}class ks extends te{init(){this.propertyType=A.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new B})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(e){return this.setRef("skeleton",e)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(e){return this.setRef("inverseBindMatrices",e,{usage:ae.INVERSE_BIND_MATRICES})}addJoint(e){return this.addRef("joints",e)}removeJoint(e){return this.removeRef("joints",e)}listJoints(){return this.listRefs("joints")}}class ut extends te{init(){this.propertyType=A.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||he.extensionToMimeType(Qe.extension(this.get("uri")))}setMimeType(e){return this.set("mimeType",e)}getURI(){return this.get("uri")}setURI(e){this.set("uri",e);const t=he.extensionToMimeType(Qe.extension(e));return t&&this.set("mimeType",t),this}getImage(){return this.get("image")}setImage(e){return this.set("image",O.assertView(e))}getSize(){const e=this.get("image");return e?he.getSize(e,this.getMimeType()):null}}class at extends te{init(){this.propertyType=A.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${Ts}`,version:"2.0"},defaultScene:null,accessors:new B,animations:new B,buffers:new B,cameras:new B,materials:new B,meshes:new B,nodes:new B,scenes:new B,skins:new B,textures:new B})}constructor(e){super(e),this._extensions=new Set,e.addEventListener("node:create",t=>{this._addChildOfRoot(t.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(e,t=Ae){if(t===Ae)throw new Error("Root cannot be copied.");this.set("asset",ee({},e.get("asset"))),this.setName(e.getName()),this.setExtras(ee({},e.getExtras())),this.setDefaultScene(e.getDefaultScene()?t(e.getDefaultScene()):null);for(const n of e.listRefMapKeys("extensions")){const s=e.getExtension(n);this.setExtension(n,t(s))}return this}_addChildOfRoot(e){return e instanceof Ft?this.addRef("scenes",e):e instanceof la?this.addRef("nodes",e):e instanceof Ve?this.addRef("cameras",e):e instanceof ks?this.addRef("skins",e):e instanceof js?this.addRef("meshes",e):e instanceof ye?this.addRef("materials",e):e instanceof ut?this.addRef("textures",e):e instanceof ws?this.addRef("animations",e):e instanceof S?this.addRef("accessors",e):e instanceof Rs&&this.addRef("buffers",e),this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter(e=>e.isRequired())}_enableExtension(e){return this._extensions.add(e),this}_disableExtension(e){return this._extensions.delete(e),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(e){return this.setRef("defaultScene",e)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}}class fe{static fromGraph(e){return fe._GRAPH_DOCUMENTS.get(e)||null}constructor(){this._graph=new En,this._root=new at(this._graph),this._logger=ie.DEFAULT_INSTANCE,fe._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(e){return this._logger=e,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(e){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...e){const t=e.map(n=>n.name);for(const n of e)await n(this,{stack:t});return this}createExtension(e){const t=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(s=>s.extensionName===t)||new e(this)}createScene(e=""){return new Ft(this._graph,e)}createNode(e=""){return new la(this._graph,e)}createCamera(e=""){return new Ve(this._graph,e)}createSkin(e=""){return new ks(this._graph,e)}createMesh(e=""){return new js(this._graph,e)}createPrimitive(){return new H(this._graph)}createPrimitiveTarget(e=""){return new vs(this._graph,e)}createMaterial(e=""){return new ye(this._graph,e)}createTexture(e=""){return new ut(this._graph,e)}createAnimation(e=""){return new ws(this._graph,e)}createAnimationChannel(e=""){return new et(this._graph,e)}createAnimationSampler(e=""){return new tt(this._graph,e)}createAccessor(e="",t=null){return t||(t=this.getRoot().listBuffers()[0]),new S(this._graph,e).setBuffer(t)}createBuffer(e=""){return new Rs(this._graph,e)}}fe._GRAPH_DOCUMENTS=new WeakMap;class L{constructor(e){this.extensionName="",this.prereadTypes=[],this.prewriteTypes=[],this.readDependencies=[],this.writeDependencies=[],this.document=void 0,this.required=!1,this.properties=new Set,this._listener=void 0,this.document=e,e.getRoot()._enableExtension(this),this._listener=n=>{const s=n,r=s.target;r instanceof V&&r.extensionName===this.extensionName&&(s.type==="node:create"&&this._addExtensionProperty(r),s.type==="node:dispose"&&this._removeExtensionProperty(r))};const t=e.getGraph();t.addEventListener("node:create",this._listener),t.addEventListener("node:dispose",this._listener)}dispose(){this.document.getRoot()._disableExtension(this);const e=this.document.getGraph();e.removeEventListener("node:create",this._listener),e.removeEventListener("node:dispose",this._listener);for(const t of this.properties)t.dispose()}static register(){}isRequired(){return this.required}setRequired(e){return this.required=e,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(e){return this.properties.add(e),this}_removeExtensionProperty(e){return this.properties.delete(e),this}install(e,t){return this}preread(e,t){return this}prewrite(e,t){return this}}L.EXTENSION_NAME=void 0;class Vn{constructor(e){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=e}setTextureInfo(e,t){this.textureInfos.set(e,t),t.texCoord!==void 0&&e.setTexCoord(t.texCoord),t.extras!==void 0&&e.setExtras(t.extras);const n=this.jsonDoc.json.textures[t.index];if(n.sampler===void 0)return;const s=this.jsonDoc.json.samplers[n.sampler];s.magFilter!==void 0&&e.setMagFilter(s.magFilter),s.minFilter!==void 0&&e.setMinFilter(s.minFilter),s.wrapS!==void 0&&e.setWrapS(s.wrapS),s.wrapT!==void 0&&e.setWrapT(s.wrapT)}}const Ba={logger:ie.DEFAULT_INSTANCE,extensions:[],dependencies:{}},Hn=new Set([A.BUFFER,A.TEXTURE,A.MATERIAL,A.MESH,A.PRIMITIVE,A.NODE,A.SCENE]);class qn{static read(e,t=Ba){const n=ee({},Ba,t),{json:s}=e,r=new fe().setLogger(n.logger);this.validate(e,n);const i=new Vn(e),o=s.asset,c=r.getRoot().getAsset();o.copyright&&(c.copyright=o.copyright),o.extras&&(c.extras=o.extras),s.extras!==void 0&&r.getRoot().setExtras(ee({},s.extras));const f=s.extensionsUsed||[],b=s.extensionsRequired||[];n.extensions.sort((y,w)=>y.EXTENSION_NAME>w.EXTENSION_NAME?1:-1);for(const y of n.extensions)if(f.includes(y.EXTENSION_NAME)){const w=r.createExtension(y).setRequired(b.includes(y.EXTENSION_NAME)),j=w.prereadTypes.filter(v=>!Hn.has(v));j.length&&n.logger.warn(`Preread hooks for some types (${j.join()}), requested by extension ${w.extensionName}, are unsupported. Please file an issue or a PR.`);for(const v of w.readDependencies)w.install(v,n.dependencies[v])}const u=s.buffers||[];r.getRoot().listExtensionsUsed().filter(y=>y.prereadTypes.includes(A.BUFFER)).forEach(y=>y.preread(i,A.BUFFER)),i.buffers=u.map(y=>{const w=r.createBuffer(y.name);return y.extras&&w.setExtras(y.extras),y.uri&&y.uri.indexOf("__")!==0&&w.setURI(y.uri),w});const d=s.bufferViews||[];i.bufferViewBuffers=d.map((y,w)=>{if(!i.bufferViews[w]){const j=e.json.buffers[y.buffer],v=j.uri?e.resources[j.uri]:e.resources[Ye],k=y.byteOffset||0;i.bufferViews[w]=O.toView(v,k,y.byteLength)}return i.buffers[y.buffer]});const g=s.accessors||[];i.accessors=g.map(y=>{const w=i.bufferViewBuffers[y.bufferView],j=r.createAccessor(y.name,w).setType(y.type);return y.extras&&j.setExtras(y.extras),y.normalized!==void 0&&j.setNormalized(y.normalized),y.bufferView===void 0||j.setArray(It(y,i)),j});const l=s.images||[],m=s.textures||[];r.getRoot().listExtensionsUsed().filter(y=>y.prereadTypes.includes(A.TEXTURE)).forEach(y=>y.preread(i,A.TEXTURE)),i.textures=l.map(y=>{const w=r.createTexture(y.name);if(y.extras&&w.setExtras(y.extras),y.bufferView!==void 0){const j=s.bufferViews[y.bufferView],v=e.json.buffers[j.buffer],k=v.uri?e.resources[v.uri]:e.resources[Ye],N=j.byteOffset||0,M=j.byteLength,C=k.slice(N,N+M);w.setImage(C)}else y.uri!==void 0&&(w.setImage(e.resources[y.uri]),y.uri.indexOf("__")!==0&&w.setURI(y.uri));if(y.mimeType!==void 0)w.setMimeType(y.mimeType);else if(y.uri){const j=Qe.extension(y.uri);w.setMimeType(he.extensionToMimeType(j))}return w}),r.getRoot().listExtensionsUsed().filter(y=>y.prereadTypes.includes(A.MATERIAL)).forEach(y=>y.preread(i,A.MATERIAL));const p=s.materials||[];i.materials=p.map(y=>{const w=r.createMaterial(y.name);y.extras&&w.setExtras(y.extras),y.alphaMode!==void 0&&w.setAlphaMode(y.alphaMode),y.alphaCutoff!==void 0&&w.setAlphaCutoff(y.alphaCutoff),y.doubleSided!==void 0&&w.setDoubleSided(y.doubleSided);const j=y.pbrMetallicRoughness||{};if(j.baseColorFactor!==void 0&&w.setBaseColorFactor(j.baseColorFactor),y.emissiveFactor!==void 0&&w.setEmissiveFactor(y.emissiveFactor),j.metallicFactor!==void 0&&w.setMetallicFactor(j.metallicFactor),j.roughnessFactor!==void 0&&w.setRoughnessFactor(j.roughnessFactor),j.baseColorTexture!==void 0){const v=j.baseColorTexture,k=i.textures[m[v.index].source];w.setBaseColorTexture(k),i.setTextureInfo(w.getBaseColorTextureInfo(),v)}if(y.emissiveTexture!==void 0){const v=y.emissiveTexture,k=i.textures[m[v.index].source];w.setEmissiveTexture(k),i.setTextureInfo(w.getEmissiveTextureInfo(),v)}if(y.normalTexture!==void 0){const v=y.normalTexture,k=i.textures[m[v.index].source];w.setNormalTexture(k),i.setTextureInfo(w.getNormalTextureInfo(),v),y.normalTexture.scale!==void 0&&w.setNormalScale(y.normalTexture.scale)}if(y.occlusionTexture!==void 0){const v=y.occlusionTexture,k=i.textures[m[v.index].source];w.setOcclusionTexture(k),i.setTextureInfo(w.getOcclusionTextureInfo(),v),y.occlusionTexture.strength!==void 0&&w.setOcclusionStrength(y.occlusionTexture.strength)}if(j.metallicRoughnessTexture!==void 0){const v=j.metallicRoughnessTexture,k=i.textures[m[v.index].source];w.setMetallicRoughnessTexture(k),i.setTextureInfo(w.getMetallicRoughnessTextureInfo(),v)}return w}),r.getRoot().listExtensionsUsed().filter(y=>y.prereadTypes.includes(A.MESH)).forEach(y=>y.preread(i,A.MESH));const h=s.meshes||[];r.getRoot().listExtensionsUsed().filter(y=>y.prereadTypes.includes(A.PRIMITIVE)).forEach(y=>y.preread(i,A.PRIMITIVE)),i.meshes=h.map(y=>{const w=r.createMesh(y.name);return y.extras&&w.setExtras(y.extras),y.weights!==void 0&&w.setWeights(y.weights),(y.primitives||[]).forEach(v=>{const k=r.createPrimitive();v.extras&&k.setExtras(v.extras),v.material!==void 0&&k.setMaterial(i.materials[v.material]),v.mode!==void 0&&k.setMode(v.mode);for(const[C,_]of Object.entries(v.attributes||{}))k.setAttribute(C,i.accessors[_]);v.indices!==void 0&&k.setIndices(i.accessors[v.indices]);const N=y.extras&&y.extras.targetNames||[];(v.targets||[]).forEach((C,_)=>{const D=N[_]||_.toString(),G=r.createPrimitiveTarget(D);for(const[Y,z]of Object.entries(C))G.setAttribute(Y,i.accessors[z]);k.addTarget(G)}),w.addPrimitive(k)}),w});const I=s.cameras||[];i.cameras=I.map(y=>{const w=r.createCamera(y.name).setType(y.type);if(y.extras&&w.setExtras(y.extras),y.type===Ve.Type.PERSPECTIVE){const j=y.perspective;w.setYFov(j.yfov),w.setZNear(j.znear),j.zfar!==void 0&&w.setZFar(j.zfar),j.aspectRatio!==void 0&&w.setAspectRatio(j.aspectRatio)}else{const j=y.orthographic;w.setZNear(j.znear).setZFar(j.zfar).setXMag(j.xmag).setYMag(j.ymag)}return w});const x=s.nodes||[];r.getRoot().listExtensionsUsed().filter(y=>y.prereadTypes.includes(A.NODE)).forEach(y=>y.preread(i,A.NODE)),i.nodes=x.map(y=>{const w=r.createNode(y.name);if(y.extras&&w.setExtras(y.extras),y.translation!==void 0&&w.setTranslation(y.translation),y.rotation!==void 0&&w.setRotation(y.rotation),y.scale!==void 0&&w.setScale(y.scale),y.matrix!==void 0){const j=[0,0,0],v=[0,0,0,1],k=[1,1,1];F.decompose(y.matrix,j,v,k),w.setTranslation(j),w.setRotation(v),w.setScale(k)}return y.weights!==void 0&&w.setWeights(y.weights),w});const T=s.skins||[];i.skins=T.map(y=>{const w=r.createSkin(y.name);y.extras&&w.setExtras(y.extras),y.inverseBindMatrices!==void 0&&w.setInverseBindMatrices(i.accessors[y.inverseBindMatrices]),y.skeleton!==void 0&&w.setSkeleton(i.nodes[y.skeleton]);for(const j of y.joints)w.addJoint(i.nodes[j]);return w}),x.map((y,w)=>{const j=i.nodes[w];(y.children||[]).forEach(k=>j.addChild(i.nodes[k])),y.mesh!==void 0&&j.setMesh(i.meshes[y.mesh]),y.camera!==void 0&&j.setCamera(i.cameras[y.camera]),y.skin!==void 0&&j.setSkin(i.skins[y.skin])});const E=s.animations||[];i.animations=E.map(y=>{const w=r.createAnimation(y.name);y.extras&&w.setExtras(y.extras);const v=(y.samplers||[]).map(N=>{const M=r.createAnimationSampler().setInput(i.accessors[N.input]).setOutput(i.accessors[N.output]).setInterpolation(N.interpolation||tt.Interpolation.LINEAR);return N.extras&&M.setExtras(N.extras),w.addSampler(M),M});return(y.channels||[]).forEach(N=>{const M=r.createAnimationChannel().setSampler(v[N.sampler]).setTargetPath(N.target.path);N.target.node!==void 0&&M.setTargetNode(i.nodes[N.target.node]),N.extras&&M.setExtras(N.extras),w.addChannel(M)}),w});const R=s.scenes||[];return r.getRoot().listExtensionsUsed().filter(y=>y.prereadTypes.includes(A.SCENE)).forEach(y=>y.preread(i,A.SCENE)),i.scenes=R.map(y=>{const w=r.createScene(y.name);return y.extras&&w.setExtras(y.extras),(y.nodes||[]).map(v=>i.nodes[v]).forEach(v=>w.addChild(v)),w}),s.scene!==void 0&&r.getRoot().setDefaultScene(i.scenes[s.scene]),r.getRoot().listExtensionsUsed().forEach(y=>y.read(i)),g.forEach((y,w)=>{const j=i.accessors[w],v=!!y.sparse,k=!y.bufferView&&!j.getArray();(v||k)&&j.setSparse(!0).setArray(Wn(y,i))}),r}static validate(e,t){const n=e.json;if(n.asset.version!=="2.0")throw new Error(`Unsupported glTF version, "${n.asset.version}".`);if(n.extensionsRequired){for(const s of n.extensionsRequired)if(!t.extensions.find(r=>r.EXTENSION_NAME===s))throw new Error(`Missing required extension, "${s}".`)}if(n.extensionsUsed)for(const s of n.extensionsUsed)t.extensions.find(r=>r.EXTENSION_NAME===s)||t.logger.warn(`Missing optional extension, "${s}".`)}}function Kn(a,e){const t=e.jsonDoc,n=e.bufferViews[a.bufferView],s=t.json.bufferViews[a.bufferView],r=pt[a.componentType],i=S.getElementSize(a.type),o=r.BYTES_PER_ELEMENT,c=a.byteOffset||0,f=new r(a.count*i),b=new DataView(n.buffer,n.byteOffset,n.byteLength),u=s.byteStride;for(let d=0;d<a.count;d++)for(let g=0;g<i;g++){const l=c+d*u+g*o;let m;switch(a.componentType){case S.ComponentType.FLOAT:m=b.getFloat32(l,!0);break;case S.ComponentType.UNSIGNED_INT:m=b.getUint32(l,!0);break;case S.ComponentType.UNSIGNED_SHORT:m=b.getUint16(l,!0);break;case S.ComponentType.UNSIGNED_BYTE:m=b.getUint8(l);break;case S.ComponentType.SHORT:m=b.getInt16(l,!0);break;case S.ComponentType.BYTE:m=b.getInt8(l);break;default:throw new Error(`Unexpected componentType "${a.componentType}".`)}f[d*i+g]=m}return f}function It(a,e){const t=e.jsonDoc,n=e.bufferViews[a.bufferView],s=t.json.bufferViews[a.bufferView],r=pt[a.componentType],i=S.getElementSize(a.type),o=r.BYTES_PER_ELEMENT,c=i*o;if(s.byteStride!==void 0&&s.byteStride!==c)return Kn(a,e);const f=n.byteOffset+(a.byteOffset||0),b=a.count*i*o;return new r(n.buffer.slice(f,f+b))}function Wn(a,e){const t=pt[a.componentType],n=S.getElementSize(a.type);let s;a.bufferView!==void 0?s=It(a,e):s=new t(a.count*n);const r=a.sparse;if(!r)return s;const i=r.count,o=ee({},a,r.indices,{count:i,type:"SCALAR"}),c=ee({},a,r.values,{count:i}),f=It(o,e),b=It(c,e);for(let u=0;u<o.count;u++)for(let d=0;d<n;d++)s[f[u]*n+d]=b[u*n+d];return s}var ht;(function(a){a[a.ARRAY_BUFFER=34962]="ARRAY_BUFFER",a[a.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(ht||(ht={}));class le{constructor(e,t,n){this._doc=void 0,this.jsonDoc=void 0,this.options=void 0,this.accessorIndexMap=new Map,this.animationIndexMap=new Map,this.bufferIndexMap=new Map,this.cameraIndexMap=new Map,this.skinIndexMap=new Map,this.materialIndexMap=new Map,this.meshIndexMap=new Map,this.nodeIndexMap=new Map,this.imageIndexMap=new Map,this.textureDefIndexMap=new Map,this.textureInfoDefMap=new Map,this.samplerDefIndexMap=new Map,this.sceneIndexMap=new Map,this.imageBufferViews=[],this.otherBufferViews=new Map,this.otherBufferViewsIndexMap=new Map,this.extensionData={},this.bufferURIGenerator=void 0,this.imageURIGenerator=void 0,this.logger=void 0,this._accessorUsageMap=new Map,this.accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]),this.accessorParents=new Map,this._doc=e,this.jsonDoc=t,this.options=n;const s=e.getRoot(),r=s.listBuffers().length,i=s.listTextures().length;this.bufferURIGenerator=new La(r>1,()=>n.basename||"buffer"),this.imageURIGenerator=new La(i>1,o=>Xn(e,o)||n.basename||"texture"),this.logger=e.getLogger()}createTextureInfoDef(e,t){const n={magFilter:t.getMagFilter()||void 0,minFilter:t.getMinFilter()||void 0,wrapS:t.getWrapS(),wrapT:t.getWrapT()},s=JSON.stringify(n);this.samplerDefIndexMap.has(s)||(this.samplerDefIndexMap.set(s,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(n));const r={source:this.imageIndexMap.get(e),sampler:this.samplerDefIndexMap.get(s)},i=JSON.stringify(r);this.textureDefIndexMap.has(i)||(this.textureDefIndexMap.set(i,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(r));const o={index:this.textureDefIndexMap.get(i)};return t.getTexCoord()!==0&&(o.texCoord=t.getTexCoord()),Object.keys(t.getExtras()).length>0&&(o.extras=t.getExtras()),this.textureInfoDefMap.set(t,o),o}createPropertyDef(e){const t={};return e.getName()&&(t.name=e.getName()),Object.keys(e.getExtras()).length>0&&(t.extras=e.getExtras()),t}createAccessorDef(e){const t=this.createPropertyDef(e);return t.type=e.getType(),t.componentType=e.getComponentType(),t.count=e.getCount(),this._doc.getGraph().listParentEdges(e).some(s=>s.getName()==="attributes"&&s.getAttributes().key==="POSITION"||s.getName()==="input")&&(t.max=e.getMax([]).map(Math.fround),t.min=e.getMin([]).map(Math.fround)),e.getNormalized()&&(t.normalized=e.getNormalized()),t}createImageData(e,t,n){if(this.options.format===ze.GLB)this.imageBufferViews.push(t),e.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:t.byteLength});else{const s=he.mimeTypeToExtension(n.getMimeType());e.uri=this.imageURIGenerator.createURI(n,s),this.jsonDoc.resources[e.uri]=t}}getAccessorUsage(e){const t=this._accessorUsageMap.get(e);if(t)return t;if(e.getSparse())return ae.SPARSE;for(const n of this._doc.getGraph().listParentEdges(e)){const{usage:s}=n.getAttributes();if(s)return s;n.getParent().propertyType!==A.ROOT&&this.logger.warn(`Missing attribute ".usage" on edge, "${n.getName()}".`)}return ae.OTHER}addAccessorToUsageGroup(e,t){const n=this._accessorUsageMap.get(e);if(n&&n!==t)throw new Error(`Accessor with usage "${n}" cannot be reused as "${t}".`);return this._accessorUsageMap.set(e,t),this}}le.BufferViewTarget=ht;le.BufferViewUsage=ae;le.USAGE_TO_TARGET={[ae.ARRAY_BUFFER]:ht.ARRAY_BUFFER,[ae.ELEMENT_ARRAY_BUFFER]:ht.ELEMENT_ARRAY_BUFFER};class La{constructor(e,t){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=e,this.basename=t}createURI(e,t){if(e.getURI())return e.getURI();if(this.multiple){const n=this.basename(e);return this.counter[n]=this.counter[n]||1,`${n}_${this.counter[n]++}.${t}`}else return`${this.basename(e)}.${t}`}}function Xn(a,e){const t=a.getGraph().listParentEdges(e).find(n=>n.getParent()!==a.getRoot());return t?t.getName().replace(/texture$/i,""):""}const{BufferViewUsage:Tt}=le,{UNSIGNED_INT:Jn,UNSIGNED_SHORT:Yn,UNSIGNED_BYTE:Qn}=S.ComponentType,$n=new Set([A.ACCESSOR,A.BUFFER,A.MATERIAL,A.MESH]);class Zn{static write(e,t){const n=e.getGraph(),s=e.getRoot(),r={asset:ee({generator:`glTF-Transform ${Ts}`},s.getAsset()),extras:ee({},s.getExtras())},i={json:r,resources:{}},o=new le(e,i,t),c=t.logger||ie.DEFAULT_INSTANCE,f=new Set(t.extensions.map(h=>h.EXTENSION_NAME)),b=e.getRoot().listExtensionsUsed().filter(h=>f.has(h.extensionName)).sort((h,I)=>h.extensionName>I.extensionName?1:-1),u=e.getRoot().listExtensionsRequired().filter(h=>f.has(h.extensionName)).sort((h,I)=>h.extensionName>I.extensionName?1:-1);b.length<e.getRoot().listExtensionsUsed().length&&c.warn("Some extensions were not registered for I/O, and will not be written.");for(const h of b){const I=h.prewriteTypes.filter(x=>!$n.has(x));I.length&&c.warn(`Prewrite hooks for some types (${I.join()}), requested by extension ${h.extensionName}, are unsupported. Please file an issue or a PR.`);for(const x of h.writeDependencies)h.install(x,t.dependencies[x])}function d(h,I,x,T){const E=[];let R=0;for(const j of h){const v=o.createAccessorDef(j);v.bufferView=r.bufferViews.length;const k=j.getArray(),N=O.pad(O.toView(k));v.byteOffset=R,R+=N.byteLength,E.push(N),o.accessorIndexMap.set(j,r.accessors.length),r.accessors.push(v)}const y=O.concat(E),w={buffer:I,byteOffset:x,byteLength:y.byteLength};return T&&(w.target=T),r.bufferViews.push(w),{buffers:E,byteLength:R}}function g(h,I,x){const T=h[0].getCount();let E=0;for(const v of h){const k=o.createAccessorDef(v);k.bufferView=r.bufferViews.length,k.byteOffset=E;const N=v.getElementSize(),M=v.getComponentSize();E+=O.padNumber(N*M),o.accessorIndexMap.set(v,r.accessors.length),r.accessors.push(k)}const R=T*E,y=new ArrayBuffer(R),w=new DataView(y);for(let v=0;v<T;v++){let k=0;for(const N of h){const M=N.getElementSize(),C=N.getComponentSize(),_=N.getComponentType(),D=N.getArray();for(let G=0;G<M;G++){const Y=v*E+k+G*C,z=D[v*M+G];switch(_){case S.ComponentType.FLOAT:w.setFloat32(Y,z,!0);break;case S.ComponentType.BYTE:w.setInt8(Y,z);break;case S.ComponentType.SHORT:w.setInt16(Y,z,!0);break;case S.ComponentType.UNSIGNED_BYTE:w.setUint8(Y,z);break;case S.ComponentType.UNSIGNED_SHORT:w.setUint16(Y,z,!0);break;case S.ComponentType.UNSIGNED_INT:w.setUint32(Y,z,!0);break;default:throw new Error("Unexpected component type: "+_)}}k+=O.padNumber(M*C)}}const j={buffer:I,byteOffset:x,byteLength:R,byteStride:E,target:le.BufferViewTarget.ARRAY_BUFFER};return r.bufferViews.push(j),{byteLength:R,buffers:[new Uint8Array(y)]}}function l(h,I,x){const T=[];let E=0;const R=new Map;let y=-1/0,w=!1;for(const _ of h){const D=o.createAccessorDef(_);r.accessors.push(D),o.accessorIndexMap.set(_,r.accessors.length-1);const G=[],Y=[],z=[],W=new Array(_.getElementSize()).fill(0);for(let xe=0,xn=_.getCount();xe<xn;xe++)if(_.getElement(xe,z),!F.eq(z,W,0)){y=Math.max(xe,y),G.push(xe);for(let zt=0;zt<z.length;zt++)Y.push(z[zt])}const Q=G.length,ce={accessorDef:D,count:Q};if(R.set(_,ce),Q===0)continue;Q>_.getCount()/2&&(w=!0);const Gt=pt[_.getComponentType()];ce.indices=G,ce.values=new Gt(Y)}if(!Number.isFinite(y))return{buffers:T,byteLength:E};w&&c.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");const j=y<255?Uint8Array:y<65535?Uint16Array:Uint32Array,v=y<255?Qn:y<65535?Yn:Jn,k={buffer:I,byteOffset:x+E,byteLength:0};for(const _ of h){const D=R.get(_);if(D.count===0)continue;D.indicesByteOffset=k.byteLength;const G=O.pad(O.toView(new j(D.indices)));T.push(G),E+=G.byteLength,k.byteLength+=G.byteLength}r.bufferViews.push(k);const N=r.bufferViews.length-1,M={buffer:I,byteOffset:x+E,byteLength:0};for(const _ of h){const D=R.get(_);if(D.count===0)continue;D.valuesByteOffset=M.byteLength;const G=O.pad(O.toView(D.values));T.push(G),E+=G.byteLength,M.byteLength+=G.byteLength}r.bufferViews.push(M);const C=r.bufferViews.length-1;for(const _ of h){const D=R.get(_);D.count!==0&&(D.accessorDef.sparse={count:D.count,indices:{bufferView:N,byteOffset:D.indicesByteOffset,componentType:v},values:{bufferView:C,byteOffset:D.valuesByteOffset}})}return{buffers:T,byteLength:E}}if(r.accessors=[],r.bufferViews=[],r.samplers=[],r.textures=[],r.images=s.listTextures().map((h,I)=>{const x=o.createPropertyDef(h);h.getMimeType()&&(x.mimeType=h.getMimeType());const T=h.getImage();return T&&o.createImageData(x,T,h),o.imageIndexMap.set(h,I),x}),b.filter(h=>h.prewriteTypes.includes(A.ACCESSOR)).forEach(h=>h.prewrite(o,A.ACCESSOR)),s.listAccessors().forEach(h=>{const I=o.accessorUsageGroupedByParent,x=o.accessorParents;if(o.accessorIndexMap.has(h))return;const T=o.getAccessorUsage(h);if(o.addAccessorToUsageGroup(h,T),I.has(T)){const E=n.listParents(h).find(R=>R.propertyType!==A.ROOT);x.set(h,E)}}),b.filter(h=>h.prewriteTypes.includes(A.BUFFER)).forEach(h=>h.prewrite(o,A.BUFFER)),(s.listAccessors().length>0||s.listTextures().length>0||o.otherBufferViews.size>0)&&s.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");r.buffers=[],s.listBuffers().forEach((h,I)=>{const x=o.createPropertyDef(h),T=o.accessorUsageGroupedByParent,E=h.listParents().filter(M=>M instanceof S),R=new Set(E.map(M=>o.accessorParents.get(M))),y=new Map(Array.from(R).map((M,C)=>[M,C])),w={};for(const M of E){var j;if(o.accessorIndexMap.has(M))continue;const C=o.getAccessorUsage(M);let _=C;if(T.has(C)){const D=o.accessorParents.get(M);_+=`:${y.get(D)}`}w[j=_]||(w[j]={usage:C,accessors:[]}),w[_].accessors.push(M)}const v=[],k=r.buffers.length;let N=0;for(const{usage:M,accessors:C}of Object.values(w))if(M===Tt.ARRAY_BUFFER&&t.vertexLayout===wt.INTERLEAVED){const _=g(C,k,N);N+=_.byteLength,v.push(..._.buffers)}else if(M===Tt.ARRAY_BUFFER)for(const _ of C){const D=g([_],k,N);N+=D.byteLength,v.push(...D.buffers)}else if(M===Tt.SPARSE){const _=l(C,k,N);N+=_.byteLength,v.push(..._.buffers)}else if(M===Tt.ELEMENT_ARRAY_BUFFER){const _=le.BufferViewTarget.ELEMENT_ARRAY_BUFFER,D=d(C,k,N,_);N+=D.byteLength,v.push(...D.buffers)}else{const _=d(C,k,N);N+=_.byteLength,v.push(..._.buffers)}if(o.imageBufferViews.length&&I===0){for(let M=0;M<o.imageBufferViews.length;M++)if(r.bufferViews[r.images[M].bufferView].byteOffset=N,N+=o.imageBufferViews[M].byteLength,v.push(o.imageBufferViews[M]),N%8){const C=8-N%8;N+=C,v.push(new Uint8Array(C))}}if(o.otherBufferViews.has(h))for(const M of o.otherBufferViews.get(h))r.bufferViews.push({buffer:k,byteOffset:N,byteLength:M.byteLength}),o.otherBufferViewsIndexMap.set(M,r.bufferViews.length-1),N+=M.byteLength,v.push(M);if(N){let M;t.format===ze.GLB?M=Ye:(M=o.bufferURIGenerator.createURI(h,"bin"),x.uri=M),x.byteLength=N,i.resources[M]=O.concat(v)}r.buffers.push(x),o.bufferIndexMap.set(h,I)}),s.listAccessors().find(h=>!h.getBuffer())&&c.warn("Skipped writing one or more Accessors: no Buffer assigned."),b.filter(h=>h.prewriteTypes.includes(A.MATERIAL)).forEach(h=>h.prewrite(o,A.MATERIAL)),r.materials=s.listMaterials().map((h,I)=>{const x=o.createPropertyDef(h);if(h.getAlphaMode()!==ye.AlphaMode.OPAQUE&&(x.alphaMode=h.getAlphaMode()),h.getAlphaMode()===ye.AlphaMode.MASK&&(x.alphaCutoff=h.getAlphaCutoff()),h.getDoubleSided()&&(x.doubleSided=!0),x.pbrMetallicRoughness={},F.eq(h.getBaseColorFactor(),[1,1,1,1])||(x.pbrMetallicRoughness.baseColorFactor=h.getBaseColorFactor()),F.eq(h.getEmissiveFactor(),[0,0,0])||(x.emissiveFactor=h.getEmissiveFactor()),h.getRoughnessFactor()!==1&&(x.pbrMetallicRoughness.roughnessFactor=h.getRoughnessFactor()),h.getMetallicFactor()!==1&&(x.pbrMetallicRoughness.metallicFactor=h.getMetallicFactor()),h.getBaseColorTexture()){const T=h.getBaseColorTexture(),E=h.getBaseColorTextureInfo();x.pbrMetallicRoughness.baseColorTexture=o.createTextureInfoDef(T,E)}if(h.getEmissiveTexture()){const T=h.getEmissiveTexture(),E=h.getEmissiveTextureInfo();x.emissiveTexture=o.createTextureInfoDef(T,E)}if(h.getNormalTexture()){const T=h.getNormalTexture(),E=h.getNormalTextureInfo(),R=o.createTextureInfoDef(T,E);h.getNormalScale()!==1&&(R.scale=h.getNormalScale()),x.normalTexture=R}if(h.getOcclusionTexture()){const T=h.getOcclusionTexture(),E=h.getOcclusionTextureInfo(),R=o.createTextureInfoDef(T,E);h.getOcclusionStrength()!==1&&(R.strength=h.getOcclusionStrength()),x.occlusionTexture=R}if(h.getMetallicRoughnessTexture()){const T=h.getMetallicRoughnessTexture(),E=h.getMetallicRoughnessTextureInfo();x.pbrMetallicRoughness.metallicRoughnessTexture=o.createTextureInfoDef(T,E)}return o.materialIndexMap.set(h,I),x}),b.filter(h=>h.prewriteTypes.includes(A.MESH)).forEach(h=>h.prewrite(o,A.MESH)),r.meshes=s.listMeshes().map((h,I)=>{const x=o.createPropertyDef(h);let T=null;return x.primitives=h.listPrimitives().map(E=>{const R={attributes:{}};R.mode=E.getMode();const y=E.getMaterial();y&&(R.material=o.materialIndexMap.get(y)),Object.keys(E.getExtras()).length&&(R.extras=E.getExtras());const w=E.getIndices();w&&(R.indices=o.accessorIndexMap.get(w));for(const j of E.listSemantics())R.attributes[j]=o.accessorIndexMap.get(E.getAttribute(j));for(const j of E.listTargets()){const v={};for(const k of j.listSemantics())v[k]=o.accessorIndexMap.get(j.getAttribute(k));R.targets=R.targets||[],R.targets.push(v)}return E.listTargets().length&&!T&&(T=E.listTargets().map(j=>j.getName())),R}),h.getWeights().length&&(x.weights=h.getWeights()),T&&(x.extras=x.extras||{},x.extras.targetNames=T),o.meshIndexMap.set(h,I),x}),r.cameras=s.listCameras().map((h,I)=>{const x=o.createPropertyDef(h);if(x.type=h.getType(),x.type===Ve.Type.PERSPECTIVE){x.perspective={znear:h.getZNear(),zfar:h.getZFar(),yfov:h.getYFov()};const T=h.getAspectRatio();T!==null&&(x.perspective.aspectRatio=T)}else x.orthographic={znear:h.getZNear(),zfar:h.getZFar(),xmag:h.getXMag(),ymag:h.getYMag()};return o.cameraIndexMap.set(h,I),x}),r.nodes=s.listNodes().map((h,I)=>{const x=o.createPropertyDef(h);return F.eq(h.getTranslation(),[0,0,0])||(x.translation=h.getTranslation()),F.eq(h.getRotation(),[0,0,0,1])||(x.rotation=h.getRotation()),F.eq(h.getScale(),[1,1,1])||(x.scale=h.getScale()),h.getWeights().length&&(x.weights=h.getWeights()),o.nodeIndexMap.set(h,I),x}),r.skins=s.listSkins().map((h,I)=>{const x=o.createPropertyDef(h),T=h.getInverseBindMatrices();T&&(x.inverseBindMatrices=o.accessorIndexMap.get(T));const E=h.getSkeleton();return E&&(x.skeleton=o.nodeIndexMap.get(E)),x.joints=h.listJoints().map(R=>o.nodeIndexMap.get(R)),o.skinIndexMap.set(h,I),x}),s.listNodes().forEach((h,I)=>{const x=r.nodes[I],T=h.getMesh();T&&(x.mesh=o.meshIndexMap.get(T));const E=h.getCamera();E&&(x.camera=o.cameraIndexMap.get(E));const R=h.getSkin();R&&(x.skin=o.skinIndexMap.get(R)),h.listChildren().length>0&&(x.children=h.listChildren().map(y=>o.nodeIndexMap.get(y)))}),r.animations=s.listAnimations().map((h,I)=>{const x=o.createPropertyDef(h),T=new Map;return x.samplers=h.listSamplers().map((E,R)=>{const y=o.createPropertyDef(E);return y.input=o.accessorIndexMap.get(E.getInput()),y.output=o.accessorIndexMap.get(E.getOutput()),y.interpolation=E.getInterpolation(),T.set(E,R),y}),x.channels=h.listChannels().map(E=>{const R=o.createPropertyDef(E);return R.sampler=T.get(E.getSampler()),R.target={node:o.nodeIndexMap.get(E.getTargetNode()),path:E.getTargetPath()},R}),o.animationIndexMap.set(h,I),x}),r.scenes=s.listScenes().map((h,I)=>{const x=o.createPropertyDef(h);return x.nodes=h.listChildren().map(T=>o.nodeIndexMap.get(T)),o.sceneIndexMap.set(h,I),x});const p=s.getDefaultScene();return p&&(r.scene=s.listScenes().indexOf(p)),r.extensionsUsed=b.map(h=>h.extensionName),r.extensionsRequired=u.map(h=>h.extensionName),b.forEach(h=>h.write(o)),er(r),i}}function er(a){const e=[];for(const t in a){const n=a[t];(Array.isArray(n)&&n.length===0||n===null||n===""||n&&typeof n=="object"&&Object.keys(n).length===0)&&e.push(t)}for(const t of e)delete a[t]}var jt;(function(a){a[a.JSON=1313821514]="JSON",a[a.BIN=5130562]="BIN"})(jt||(jt={}));class tr{constructor(){this._logger=ie.DEFAULT_INSTANCE,this._extensions=new Set,this._dependencies={},this._vertexLayout=wt.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(e){return this._logger=e,this}registerExtensions(e){for(const t of e)this._extensions.add(t),t.register();return this}registerDependencies(e){return Object.assign(this._dependencies,e),this}setVertexLayout(e){return this._vertexLayout=e,this}async read(e){return await this.readJSON(await this.readAsJSON(e))}async readAsJSON(e){const t=await this.readURI(e,"view");this.lastReadBytes=t.byteLength;const n=Ga(t)?this._binaryToJSON(t):{json:JSON.parse(O.decodeText(t)),resources:{}};return await this._readResourcesExternal(n,this.dirname(e)),this._readResourcesInternal(n),n}async readJSON(e){return e=this._copyJSON(e),this._readResourcesInternal(e),qn.read(e,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(e){const t=this._binaryToJSON(O.assertView(e));this._readResourcesInternal(t);const n=t.json;if(n.buffers&&n.buffers.some(s=>ar(t,s)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(n.images&&n.images.some(s=>sr(t,s)))throw new Error("Cannot resolve external images with binaryToJSON().");return t}async readBinary(e){return this.readJSON(await this.binaryToJSON(O.assertView(e)))}async writeJSON(e,t={}){if(t.format===ze.GLB&&e.getRoot().listBuffers().length>1)throw new Error("GLB must have 0–1 buffers.");return Zn.write(e,{format:t.format||ze.GLTF,basename:t.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:ee({},this._dependencies),extensions:Array.from(this._extensions)})}async writeBinary(e){const{json:t,resources:n}=await this.writeJSON(e,{format:ze.GLB}),s=new Uint32Array([1179937895,2,12]),r=JSON.stringify(t),i=O.pad(O.encodeText(r),32),o=O.toView(new Uint32Array([i.byteLength,1313821514])),c=O.concat([o,i]);s[s.length-1]+=c.byteLength;const f=Object.values(n)[0];if(!f||!f.byteLength)return O.concat([O.toView(s),c]);const b=O.pad(f,0),u=O.toView(new Uint32Array([b.byteLength,5130562])),d=O.concat([u,b]);return s[s.length-1]+=d.byteLength,O.concat([O.toView(s),c,d])}async _readResourcesExternal(e,t){var n=this;const s=e.json.images||[],r=e.json.buffers||[],i=[...s,...r].map(async function(o){const c=o.uri;if(!c||c.match(/data:/))return Promise.resolve();e.resources[c]=await n.readURI(n.resolve(t,c),"view"),n.lastReadBytes+=e.resources[c].byteLength});await Promise.all(i)}_readResourcesInternal(e){function t(r){if(r.uri){if(r.uri in e.resources){O.assertView(e.resources[r.uri]);return}if(r.uri.match(/data:/)){const i=`__${Ln()}.${Qe.extension(r.uri)}`;e.resources[i]=O.createBufferFromDataURI(r.uri),r.uri=i}}}(e.json.images||[]).forEach(r=>{if(r.bufferView===void 0&&r.uri===void 0)throw new Error("Missing resource URI or buffer view.");t(r)}),(e.json.buffers||[]).forEach(t)}_copyJSON(e){const{images:t,buffers:n}=e.json;return e={json:ee({},e.json),resources:ee({},e.resources)},t&&(e.json.images=t.map(s=>ee({},s))),n&&(e.json.buffers=n.map(s=>ee({},s))),e}_binaryToJSON(e){if(!Ga(e))throw new Error("Invalid glTF 2.0 binary.");const t=new Uint32Array(e.buffer,e.byteOffset+12,2);if(t[1]!==jt.JSON)throw new Error("Missing required GLB JSON chunk.");const n=20,s=t[0],r=O.decodeText(O.toView(e,n,s)),i=JSON.parse(r),o=n+s;if(e.byteLength<=o)return{json:i,resources:{}};const c=new Uint32Array(e.buffer,e.byteOffset+o,2);if(c[1]!==jt.BIN)return{json:i,resources:{}};const f=c[0],b=O.toView(e,o+8,f);return{json:i,resources:{[Ye]:b}}}}function ar(a,e){return e.uri!==void 0&&!(e.uri in a.resources)}function sr(a,e){return e.uri!==void 0&&!(e.uri in a.resources)&&e.bufferView===void 0}function Ga(a){if(a.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(a.buffer,a.byteOffset,3);return e[0]===1179937895&&e[1]===2}class nr extends tr{constructor(e=dt.DEFAULT_INIT){super(),this._fetchConfig=void 0,this._fetchConfig=e}async readURI(e,t){const n=await fetch(e,this._fetchConfig);switch(t){case"view":return new Uint8Array(await n.arrayBuffer());case"text":return n.text()}}resolve(e,t){return dt.resolve(e,t)}dirname(e){return dt.dirname(e)}}function rr(a){for(var e=new Array(a),t=0;t<a;++t)e[t]=t;return e}var ir=rr;/*!
|
|
2
|
+
* Determine if an object is a Buffer
|
|
3
|
+
*
|
|
4
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/var or=function(a){return a!=null&&(Ns(a)||cr(a)||!!a._isBuffer)};function Ns(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function cr(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&Ns(a.slice(0,0))}var fr=ir,br=or,dr=typeof Float64Array<"u";function ur(a,e){return a[0]-e[0]}function hr(){var a=this.stride,e=new Array(a.length),t;for(t=0;t<e.length;++t)e[t]=[Math.abs(a[t]),t];e.sort(ur);var n=new Array(e.length);for(t=0;t<n.length;++t)n[t]=e[t][1];return n}function lr(a,e){var t=["View",e,"d",a].join("");e<0&&(t="View_Nil"+a);var n=a==="generic";if(e===-1){var s="function "+t+"(a){this.data=a;};var proto="+t+".prototype;proto.dtype='"+a+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+t+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+t+"(a){return new "+t+"(a);}",m=new Function(s);return m()}else if(e===0){var s="function "+t+"(a,d) {this.data = a;this.offset = d};var proto="+t+".prototype;proto.dtype='"+a+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+t+"_copy() {return new "+t+"(this.data,this.offset)};proto.pick=function "+t+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+t+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+t+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+t+"(a,b,c,d){return new "+t+"(a,d)}",m=new Function("TrivialArray",s);return m(vt[a][0])}var s=["'use strict'"],r=fr(e),i=r.map(function(p){return"i"+p}),o="this.offset+"+r.map(function(p){return"this.stride["+p+"]*i"+p}).join("+"),c=r.map(function(p){return"b"+p}).join(","),f=r.map(function(p){return"c"+p}).join(",");s.push("function "+t+"(a,"+c+","+f+",d){this.data=a","this.shape=["+c+"]","this.stride=["+f+"]","this.offset=d|0}","var proto="+t+".prototype","proto.dtype='"+a+"'","proto.dimension="+e),s.push("Object.defineProperty(proto,'size',{get:function "+t+"_size(){return "+r.map(function(p){return"this.shape["+p+"]"}).join("*"),"}})"),e===1?s.push("proto.order=[0]"):(s.push("Object.defineProperty(proto,'order',{get:"),e<4?(s.push("function "+t+"_order(){"),e===2?s.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):e===3&&s.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):s.push("ORDER})")),s.push("proto.set=function "+t+"_set("+i.join(",")+",v){"),n?s.push("return this.data.set("+o+",v)}"):s.push("return this.data["+o+"]=v}"),s.push("proto.get=function "+t+"_get("+i.join(",")+"){"),n?s.push("return this.data.get("+o+")}"):s.push("return this.data["+o+"]}"),s.push("proto.index=function "+t+"_index(",i.join(),"){return "+o+"}"),s.push("proto.hi=function "+t+"_hi("+i.join(",")+"){return new "+t+"(this.data,"+r.map(function(p){return["(typeof i",p,"!=='number'||i",p,"<0)?this.shape[",p,"]:i",p,"|0"].join("")}).join(",")+","+r.map(function(p){return"this.stride["+p+"]"}).join(",")+",this.offset)}");var b=r.map(function(p){return"a"+p+"=this.shape["+p+"]"}),u=r.map(function(p){return"c"+p+"=this.stride["+p+"]"});s.push("proto.lo=function "+t+"_lo("+i.join(",")+"){var b=this.offset,d=0,"+b.join(",")+","+u.join(","));for(var d=0;d<e;++d)s.push("if(typeof i"+d+"==='number'&&i"+d+">=0){d=i"+d+"|0;b+=c"+d+"*d;a"+d+"-=d}");s.push("return new "+t+"(this.data,"+r.map(function(p){return"a"+p}).join(",")+","+r.map(function(p){return"c"+p}).join(",")+",b)}"),s.push("proto.step=function "+t+"_step("+i.join(",")+"){var "+r.map(function(p){return"a"+p+"=this.shape["+p+"]"}).join(",")+","+r.map(function(p){return"b"+p+"=this.stride["+p+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var d=0;d<e;++d)s.push("if(typeof i"+d+"==='number'){d=i"+d+"|0;if(d<0){c+=b"+d+"*(a"+d+"-1);a"+d+"=ceil(-a"+d+"/d)}else{a"+d+"=ceil(a"+d+"/d)}b"+d+"*=d}");s.push("return new "+t+"(this.data,"+r.map(function(p){return"a"+p}).join(",")+","+r.map(function(p){return"b"+p}).join(",")+",c)}");for(var g=new Array(e),l=new Array(e),d=0;d<e;++d)g[d]="a[i"+d+"]",l[d]="b[i"+d+"]";s.push("proto.transpose=function "+t+"_transpose("+i+"){"+i.map(function(p,h){return p+"=("+p+"===undefined?"+h+":"+p+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+t+"(this.data,"+g.join(",")+","+l.join(",")+",this.offset)}"),s.push("proto.pick=function "+t+"_pick("+i+"){var a=[],b=[],c=this.offset");for(var d=0;d<e;++d)s.push("if(typeof i"+d+"==='number'&&i"+d+">=0){c=(c+this.stride["+d+"]*i"+d+")|0}else{a.push(this.shape["+d+"]);b.push(this.stride["+d+"])}");s.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),s.push("return function construct_"+t+"(data,shape,stride,offset){return new "+t+"(data,"+r.map(function(p){return"shape["+p+"]"}).join(",")+","+r.map(function(p){return"stride["+p+"]"}).join(",")+",offset)}");var m=new Function("CTOR_LIST","ORDER",s.join(`
|
|
7
|
+
`));return m(vt[a],hr)}function gr(a){if(br(a))return"buffer";if(dr)switch(Object.prototype.toString.call(a)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(a)?"array":"generic"}var vt={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function pr(a,e,t,n){if(a===void 0){var f=vt.array[0];return f([])}else typeof a=="number"&&(a=[a]);e===void 0&&(e=[a.length]);var s=e.length;if(t===void 0){t=new Array(s);for(var r=s-1,i=1;r>=0;--r)t[r]=i,i*=e[r]}if(n===void 0){n=0;for(var r=0;r<s;++r)t[r]<0&&(n-=(e[r]-1)*t[r])}for(var o=gr(a),c=vt[o];c.length<=s+1;)c.push(lr(o,c.length-1));var f=c[s+1];return f(a,e,t,n)}var mr=pr;const yr=xs.getDefaultExportFromCjs(mr);var xr={};function Tr(a,e){for(var t=1,n=a.length,s=a[0],r=a[0],i=1;i<n;++i)if(r=s,s=a[i],e(s,r)){if(i===t){t++;continue}a[t++]=s}return a.length=t,a}function Er(a){for(var e=1,t=a.length,n=a[0],s=a[0],r=1;r<t;++r,s=n)if(s=n,n=a[r],n!==s){if(r===e){e++;continue}a[e++]=n}return a.length=e,a}function Ir(a,e,t){return a.length===0?a:e?(t||a.sort(e),Tr(a,e)):(t||a.sort(),Er(a))}var Ar=Ir,wr=Ar;function Ms(a,e,t){var n=a.length,s=e.arrayArgs.length,r=e.indexArgs.length>0,i=[],o=[],c=0,f=0,b,u;for(b=0;b<n;++b)o.push(["i",b,"=0"].join(""));for(u=0;u<s;++u)for(b=0;b<n;++b)f=c,c=a[b],b===0?o.push(["d",u,"s",b,"=t",u,"p",c].join("")):o.push(["d",u,"s",b,"=(t",u,"p",c,"-s",f,"*t",u,"p",f,")"].join(""));for(o.length>0&&i.push("var "+o.join(",")),b=n-1;b>=0;--b)c=a[b],i.push(["for(i",b,"=0;i",b,"<s",c,";++i",b,"){"].join(""));for(i.push(t),b=0;b<n;++b){for(f=c,c=a[b],u=0;u<s;++u)i.push(["p",u,"+=d",u,"s",b].join(""));r&&(b>0&&i.push(["index[",f,"]-=s",f].join("")),i.push(["++index[",c,"]"].join(""))),i.push("}")}return i.join(`
|
|
8
|
+
`)}function Rr(a,e,t,n){for(var s=e.length,r=t.arrayArgs.length,i=t.blockSize,o=t.indexArgs.length>0,c=[],f=0;f<r;++f)c.push(["var offset",f,"=p",f].join(""));for(var f=a;f<s;++f)c.push(["for(var j"+f+"=SS[",e[f],"]|0;j",f,">0;){"].join("")),c.push(["if(j",f,"<",i,"){"].join("")),c.push(["s",e[f],"=j",f].join("")),c.push(["j",f,"=0"].join("")),c.push(["}else{s",e[f],"=",i].join("")),c.push(["j",f,"-=",i,"}"].join("")),o&&c.push(["index[",e[f],"]=j",f].join(""));for(var f=0;f<r;++f){for(var b=["offset"+f],u=a;u<s;++u)b.push(["j",u,"*t",f,"p",e[u]].join(""));c.push(["p",f,"=(",b.join("+"),")"].join(""))}c.push(Ms(e,t,n));for(var f=a;f<s;++f)c.push("}");return c.join(`
|
|
9
|
+
`)}function jr(a){for(var e=0,t=a[0].length;e<t;){for(var n=1;n<a.length;++n)if(a[n][e]!==a[0][e])return e;++e}return e}function Vt(a,e,t){for(var n=a.body,s=[],r=[],i=0;i<a.args.length;++i){var o=a.args[i];if(!(o.count<=0)){var c=new RegExp(o.name,"g"),f="",b=e.arrayArgs.indexOf(i);switch(e.argTypes[i]){case"offset":var u=e.offsetArgIndex.indexOf(i),d=e.offsetArgs[u];b=d.array,f="+q"+u;case"array":f="p"+b+f;var g="l"+i,l="a"+b;if(e.arrayBlockIndices[b]===0)o.count===1?t[b]==="generic"?o.lvalue?(s.push(["var ",g,"=",l,".get(",f,")"].join("")),n=n.replace(c,g),r.push([l,".set(",f,",",g,")"].join(""))):n=n.replace(c,[l,".get(",f,")"].join("")):n=n.replace(c,[l,"[",f,"]"].join("")):t[b]==="generic"?(s.push(["var ",g,"=",l,".get(",f,")"].join("")),n=n.replace(c,g),o.lvalue&&r.push([l,".set(",f,",",g,")"].join(""))):(s.push(["var ",g,"=",l,"[",f,"]"].join("")),n=n.replace(c,g),o.lvalue&&r.push([l,"[",f,"]=",g].join("")));else{for(var m=[o.name],p=[f],h=0;h<Math.abs(e.arrayBlockIndices[b]);h++)m.push("\\s*\\[([^\\]]+)\\]"),p.push("$"+(h+1)+"*t"+b+"b"+h);if(c=new RegExp(m.join(""),"g"),f=p.join("+"),t[b]==="generic")throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(c,[l,"[",f,"]"].join(""))}break;case"scalar":n=n.replace(c,"Y"+e.scalarArgs.indexOf(i));break;case"index":n=n.replace(c,"index");break;case"shape":n=n.replace(c,"shape");break}}}return[s.join(`
|
|
10
|
+
`),n,r.join(`
|
|
11
|
+
`)].join(`
|
|
12
|
+
`).trim()}function vr(a){for(var e=new Array(a.length),t=!0,n=0;n<a.length;++n){var s=a[n],r=s.match(/\d+/);r?r=r[0]:r="",s.charAt(0)===0?e[n]="u"+s.charAt(1)+r:e[n]=s.charAt(0)+r,n>0&&(t=t&&e[n]===e[n-1])}return t?e[0]:e.join("")}function kr(a,e){for(var t=e[1].length-Math.abs(a.arrayBlockIndices[0])|0,n=new Array(a.arrayArgs.length),s=new Array(a.arrayArgs.length),r=0;r<a.arrayArgs.length;++r)s[r]=e[2*r],n[r]=e[2*r+1];for(var i=[],o=[],c=[],f=[],b=[],r=0;r<a.arrayArgs.length;++r){a.arrayBlockIndices[r]<0?(c.push(0),f.push(t),i.push(t),o.push(t+a.arrayBlockIndices[r])):(c.push(a.arrayBlockIndices[r]),f.push(a.arrayBlockIndices[r]+t),i.push(0),o.push(a.arrayBlockIndices[r]));for(var u=[],d=0;d<n[r].length;d++)c[r]<=n[r][d]&&n[r][d]<f[r]&&u.push(n[r][d]-c[r]);b.push(u)}for(var g=["SS"],l=["'use strict'"],m=[],d=0;d<t;++d)m.push(["s",d,"=SS[",d,"]"].join(""));for(var r=0;r<a.arrayArgs.length;++r){g.push("a"+r),g.push("t"+r),g.push("p"+r);for(var d=0;d<t;++d)m.push(["t",r,"p",d,"=t",r,"[",c[r]+d,"]"].join(""));for(var d=0;d<Math.abs(a.arrayBlockIndices[r]);++d)m.push(["t",r,"b",d,"=t",r,"[",i[r]+d,"]"].join(""))}for(var r=0;r<a.scalarArgs.length;++r)g.push("Y"+r);if(a.shapeArgs.length>0&&m.push("shape=SS.slice(0)"),a.indexArgs.length>0){for(var p=new Array(t),r=0;r<t;++r)p[r]="0";m.push(["index=[",p.join(","),"]"].join(""))}for(var r=0;r<a.offsetArgs.length;++r){for(var h=a.offsetArgs[r],I=[],d=0;d<h.offset.length;++d)h.offset[d]!==0&&(h.offset[d]===1?I.push(["t",h.array,"p",d].join("")):I.push([h.offset[d],"*t",h.array,"p",d].join("")));I.length===0?m.push("q"+r+"=0"):m.push(["q",r,"=",I.join("+")].join(""))}var x=wr([].concat(a.pre.thisVars).concat(a.body.thisVars).concat(a.post.thisVars));m=m.concat(x),m.length>0&&l.push("var "+m.join(","));for(var r=0;r<a.arrayArgs.length;++r)l.push("p"+r+"|=0");a.pre.body.length>3&&l.push(Vt(a.pre,a,s));var T=Vt(a.body,a,s),E=jr(b);E<t?l.push(Rr(E,b[0],a,T)):l.push(Ms(b[0],a,T)),a.post.body.length>3&&l.push(Vt(a.post,a,s)),a.debug&&console.log("-----Generated cwise routine for ",e,`:
|
|
13
|
+
`+l.join(`
|
|
14
|
+
`)+`
|
|
15
|
+
----------`);var R=[a.funcName||"unnamed","_cwise_loop_",n[0].join("s"),"m",E,vr(s)].join(""),y=new Function(["function ",R,"(",g.join(","),"){",l.join(`
|
|
16
|
+
`),"} return ",R].join(""));return y()}var Nr=kr,Mr=Nr;function Sr(a){var e=["'use strict'","var CACHED={}"],t=[],n=a.funcName+"_cwise_thunk";e.push(["return function ",n,"(",a.shimArgs.join(","),"){"].join(""));for(var s=[],r=[],i=[["array",a.arrayArgs[0],".shape.slice(",Math.max(0,a.arrayBlockIndices[0]),a.arrayBlockIndices[0]<0?","+a.arrayBlockIndices[0]+")":")"].join("")],o=[],c=[],f=0;f<a.arrayArgs.length;++f){var b=a.arrayArgs[f];t.push(["t",b,"=array",b,".dtype,","r",b,"=array",b,".order"].join("")),s.push("t"+b),s.push("r"+b),r.push("t"+b),r.push("r"+b+".join()"),i.push("array"+b+".data"),i.push("array"+b+".stride"),i.push("array"+b+".offset|0"),f>0&&(o.push("array"+a.arrayArgs[0]+".shape.length===array"+b+".shape.length+"+(Math.abs(a.arrayBlockIndices[0])-Math.abs(a.arrayBlockIndices[f]))),c.push("array"+a.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,a.arrayBlockIndices[0])+"]===array"+b+".shape[shapeIndex+"+Math.max(0,a.arrayBlockIndices[f])+"]"))}a.arrayArgs.length>1&&(e.push("if (!("+o.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+a.arrayArgs[0]+".shape.length-"+Math.abs(a.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var f=0;f<a.scalarArgs.length;++f)i.push("scalar"+a.scalarArgs[f]);t.push(["type=[",r.join(","),"].join()"].join("")),t.push("proc=CACHED[type]"),e.push("var "+t.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",s.join(","),"])}","return proc(",i.join(","),")}"].join("")),a.debug&&console.log(`-----Generated thunk:
|
|
17
|
+
`+e.join(`
|
|
18
|
+
`)+`
|
|
19
|
+
----------`);var u=new Function("compile",e.join(`
|
|
20
|
+
`));return u(Mr.bind(void 0,a))}var Cr=Sr,Or=Cr;function _r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function Fr(a){var e=new _r;e.pre=a.pre,e.body=a.body,e.post=a.post;var t=a.args.slice(0);e.argTypes=t;for(var n=0;n<t.length;++n){var s=t[n];if(s==="array"||typeof s=="object"&&s.blockIndices){if(e.argTypes[n]="array",e.arrayArgs.push(n),e.arrayBlockIndices.push(s.blockIndices?s.blockIndices:0),e.shimArgs.push("array"+n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array args");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array args")}else if(s==="scalar")e.scalarArgs.push(n),e.shimArgs.push("scalar"+n);else if(s==="index"){if(e.indexArgs.push(n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array index");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array index");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array index")}else if(s==="shape"){if(e.shapeArgs.push(n),n<e.pre.args.length&&e.pre.args[n].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array shape");if(n<e.post.args.length&&e.post.args[n].lvalue)throw new Error("cwise: post() block may not write to array shape")}else if(typeof s=="object"&&s.offset)e.argTypes[n]="offset",e.offsetArgs.push({array:s.array,offset:s.offset}),e.offsetArgIndex.push(n);else throw new Error("cwise: Unknown argument type "+t[n])}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>t.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>t.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>t.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!a.printCode||!!a.debug,e.funcName=a.funcName||"cwise",e.blockSize=a.blockSize||64,Or(e)}var Dr=Fr;(function(a){var e=Dr,t={body:"",args:[],thisVars:[],localVars:[]};function n(d){if(!d)return t;for(var g=0;g<d.args.length;++g){var l=d.args[g];g===0?d.args[g]={name:l,lvalue:!0,rvalue:!!d.rvalue,count:d.count||1}:d.args[g]={name:l,lvalue:!1,rvalue:!0,count:1}}return d.thisVars||(d.thisVars=[]),d.localVars||(d.localVars=[]),d}function s(d){return e({args:d.args,pre:n(d.pre),body:n(d.body),post:n(d.proc),funcName:d.funcName})}function r(d){for(var g=[],l=0;l<d.args.length;++l)g.push("a"+l);var m=new Function("P",["return function ",d.funcName,"_ndarrayops(",g.join(","),") {P(",g.join(","),");return a0}"].join(""));return m(s(d))}var i={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};(function(){for(var d in i){var g=i[d];a[d]=r({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+g+"c"},funcName:d}),a[d+"eq"]=r({args:["array","array"],body:{args:["a","b"],body:"a"+g+"=b"},rvalue:!0,funcName:d+"eq"}),a[d+"s"]=r({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+g+"s"},funcName:d+"s"}),a[d+"seq"]=r({args:["array","scalar"],body:{args:["a","s"],body:"a"+g+"=s"},rvalue:!0,funcName:d+"seq"})}})();var o={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var d in o){var g=o[d];a[d]=r({args:["array","array"],body:{args:["a","b"],body:"a="+g+"b"},funcName:d}),a[d+"eq"]=r({args:["array"],body:{args:["a"],body:"a="+g+"a"},rvalue:!0,count:2,funcName:d+"eq"})}})();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var d in c){var g=c[d];a[d]=r({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+g+"c"},funcName:d}),a[d+"s"]=r({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+g+"s"},funcName:d+"s"}),a[d+"eq"]=r({args:["array","array"],body:{args:["a","b"],body:"a=a"+g+"b"},rvalue:!0,count:2,funcName:d+"eq"}),a[d+"seq"]=r({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+g+"s"},rvalue:!0,count:2,funcName:d+"seq"})}})();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var d=0;d<f.length;++d){var g=f[d];a[g]=r({args:["array","array"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:g}),a[g+"eq"]=r({args:["array"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:g+"eq"})}})();var b=["max","min","atan2","pow"];(function(){for(var d=0;d<b.length;++d){var g=b[d];a[g]=r({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:g}),a[g+"s"]=r({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:g+"s"}),a[g+"eq"]=r({args:["array","array"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:g+"eq"}),a[g+"seq"]=r({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:g+"seq"})}})();var u=["atan2","pow"];(function(){for(var d=0;d<u.length;++d){var g=u[d];a[g+"op"]=r({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:g+"op"}),a[g+"ops"]=r({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:g+"ops"}),a[g+"opeq"]=r({args:["array","array"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:g+"opeq"}),a[g+"opseq"]=r({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+g,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:g+"opseq"})}})(),a.any=e({args:["array"],pre:t,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),a.all=e({args:["array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),a.sum=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),a.prod=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),a.norm2squared=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),a.norm2=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),a.norminf=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),a.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),a.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),a.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),a.argmin=e({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),a.argmax=e({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),a.random=r({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),a.assign=r({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),a.assigns=r({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),a.equals=e({args:["array","array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(xr);function Ur(a,e){if(!(a instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");const t=new Blob([a],{type:e}),n=URL.createObjectURL(t);return new Promise((s,r)=>{const i=new Image;i.crossOrigin="anonymous",i.onload=function(){URL.revokeObjectURL(n);const c=new OffscreenCanvas(i.width,i.height).getContext("2d");c.drawImage(i,0,0);const f=c.getImageData(0,0,i.width,i.height);s(yr(new Uint8Array(f.data),[i.width,i.height,4],[4,4*i.width,1],0))},i.onerror=o=>{URL.revokeObjectURL(n),r(o)},i.src=n})}async function Br(a,e){return Ur(a,e)}const Lr=0,Gr=0,zr=0,Pr=2,Vr=0,Hr=163,qr=166,Kr=0,Wr=2,Xr=1,Jr=64,Yr=0;class Qr{constructor(){this.vkFormat=Yr,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=Lr,this.levels=[],this.dataFormatDescriptor=[{vendorId:zr,descriptorType:Gr,descriptorBlockSize:0,versionNumber:Pr,colorModel:Vr,colorPrimaries:Xr,transferFunction:Wr,flags:Kr,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class rt{constructor(e,t,n,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=s,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian),t=this._dataView.getUint32(this._offset+4,this._littleEndian),n=e+2**32*t;return this._offset+=8,n}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,s)}}const $=[171,75,84,88,32,50,48,187,13,10,26,10];function za(a){return new TextDecoder().decode(a)}function Ht(a){const e=new Uint8Array(a.buffer,a.byteOffset,$.length);if(e[0]!==$[0]||e[1]!==$[1]||e[2]!==$[2]||e[3]!==$[3]||e[4]!==$[4]||e[5]!==$[5]||e[6]!==$[6]||e[7]!==$[7]||e[8]!==$[8]||e[9]!==$[9]||e[10]!==$[10]||e[11]!==$[11])throw new Error("Missing KTX 2.0 identifier.");const t=new Qr,n=17*Uint32Array.BYTES_PER_ELEMENT,s=new rt(a,$.length,n,!0);t.vkFormat=s._nextUint32(),t.typeSize=s._nextUint32(),t.pixelWidth=s._nextUint32(),t.pixelHeight=s._nextUint32(),t.pixelDepth=s._nextUint32(),t.layerCount=s._nextUint32(),t.faceCount=s._nextUint32();const r=s._nextUint32();t.supercompressionScheme=s._nextUint32();const i=s._nextUint32(),o=s._nextUint32(),c=s._nextUint32(),f=s._nextUint32(),b=s._nextUint64(),u=s._nextUint64(),d=r*3*8,g=new rt(a,$.length+n,d,!0);for(let W=0;W<r;W++)t.levels.push({levelData:new Uint8Array(a.buffer,a.byteOffset+g._nextUint64(),g._nextUint64()),uncompressedByteLength:g._nextUint64()});const l=new rt(a,i,o,!0),m={vendorId:l._skip(4)._nextUint16(),descriptorType:l._nextUint16(),versionNumber:l._nextUint16(),descriptorBlockSize:l._nextUint16(),colorModel:l._nextUint8(),colorPrimaries:l._nextUint8(),transferFunction:l._nextUint8(),flags:l._nextUint8(),texelBlockDimension:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],bytesPlane:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],samples:[]},I=(m.descriptorBlockSize/4-6)/4;for(let W=0;W<I;W++){const Q={bitOffset:l._nextUint16(),bitLength:l._nextUint8(),channelType:l._nextUint8(),samplePosition:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};Q.channelType&Jr?(Q.sampleLower=l._nextInt32(),Q.sampleUpper=l._nextInt32()):(Q.sampleLower=l._nextUint32(),Q.sampleUpper=l._nextUint32()),m.samples[W]=Q}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(m);const x=new rt(a,c,f,!0);for(;x._offset<f;){const W=x._nextUint32(),Q=x._scan(W),ce=za(Q);if(t.keyValue[ce]=x._nextUint8Array(W-Q.byteLength-1),ce.match(/^ktx/i)){const xe=za(t.keyValue[ce]);t.keyValue[ce]=xe.substring(0,xe.lastIndexOf("\0"))}const Gt=W%4?4-W%4:0;x._skip(Gt)}if(u<=0)return t;const T=new rt(a,b,u,!0),E=T._nextUint16(),R=T._nextUint16(),y=T._nextUint32(),w=T._nextUint32(),j=T._nextUint32(),v=T._nextUint32(),k=[];for(let W=0;W<r;W++)k.push({imageFlags:T._nextUint32(),rgbSliceByteOffset:T._nextUint32(),rgbSliceByteLength:T._nextUint32(),alphaSliceByteOffset:T._nextUint32(),alphaSliceByteLength:T._nextUint32()});const N=b+T._offset,M=N+y,C=M+w,_=C+j,D=new Uint8Array(a.buffer,a.byteOffset+N,y),G=new Uint8Array(a.buffer,a.byteOffset+M,w),Y=new Uint8Array(a.buffer,a.byteOffset+C,j),z=new Uint8Array(a.buffer,a.byteOffset+_,v);return t.globalData={endpointCount:E,selectorCount:R,imageDescs:k,endpointsData:D,selectorsData:G,tablesData:Y,extendedData:z},t}const ga="EXT_mesh_gpu_instancing",$t="EXT_meshopt_compression",$r="EXT_texture_webp",Zr="EXT_texture_avif",Ss="KHR_draco_mesh_compression",pa="KHR_lights_punctual",ma="KHR_materials_anisotropy",ya="KHR_materials_clearcoat",xa="KHR_materials_diffuse_transmission",Ta="KHR_materials_dispersion",Ea="KHR_materials_emissive_strength",Ia="KHR_materials_ior",Aa="KHR_materials_iridescence",wa="KHR_materials_pbrSpecularGlossiness",Ra="KHR_materials_sheen",ja="KHR_materials_specular",va="KHR_materials_transmission",ka="KHR_materials_unlit",Na="KHR_materials_volume",He="KHR_materials_variants",ei="KHR_mesh_quantization",ti="KHR_texture_basisu",Ma="KHR_texture_transform",kt="KHR_xmp_json_ld",Zt="INSTANCE_ATTRIBUTE";class Cs extends V{init(){this.extensionName=ga,this.propertyType="InstancedMesh",this.parentTypes=[A.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new ue})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:Zt})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}Cs.EXTENSION_NAME=ga;const we=ga;class ai extends L{constructor(...e){super(...e),this.extensionName=we,this.provideTypes=[A.NODE],this.prewriteTypes=[A.ACCESSOR]}createInstancedMesh(){return new Cs(this.document.getGraph())}read(e){return(e.jsonDoc.json.nodes||[]).forEach((s,r)=>{if(!s.extensions||!s.extensions[we])return;const i=s.extensions[we],o=this.createInstancedMesh();for(const c in i.attributes)o.setAttribute(c,e.accessors[i.attributes[c]]);e.nodes[r].setExtension(we,o)}),this}prewrite(e){e.accessorUsageGroupedByParent.add(Zt);for(const t of this.properties)for(const n of t.listAttributes())e.addAccessorToUsageGroup(n,Zt);return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listNodes().forEach(n=>{const s=n.getExtension(we);if(s){const r=e.nodeIndexMap.get(n),i=t.json.nodes[r],o={attributes:{}};s.listSemantics().forEach(c=>{const f=s.getAttribute(c);o.attributes[c]=e.accessorIndexMap.get(f)}),i.extensions=i.extensions||{},i.extensions[we]=o}}),this}}ai.EXTENSION_NAME=we;function me(){return me=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},me.apply(this,arguments)}var lt;(function(a){a.QUANTIZE="quantize",a.FILTER="filter"})(lt||(lt={}));var Je;(function(a){a.ATTRIBUTES="ATTRIBUTES",a.TRIANGLES="TRIANGLES",a.INDICES="INDICES"})(Je||(Je={}));var q;(function(a){a.NONE="NONE",a.OCTAHEDRAL="OCTAHEDRAL",a.QUATERNION="QUATERNION",a.EXPONENTIAL="EXPONENTIAL"})(q||(q={}));const{BYTE:si,SHORT:Pa,FLOAT:ni}=S.ComponentType,{encodeNormalizedInt:Va,decodeNormalizedInt:ea}=F;function ri(a,e,t,n){const{filter:s,bits:r}=n,i={array:a.getArray(),byteStride:a.getElementSize()*a.getComponentSize(),componentType:a.getComponentType(),normalized:a.getNormalized()};if(t!==Je.ATTRIBUTES)return i;if(s!==q.NONE){let o=a.getNormalized()?ii(a):new Float32Array(i.array);switch(s){case q.EXPONENTIAL:i.byteStride=a.getElementSize()*4,i.componentType=ni,i.normalized=!1,i.array=e.encodeFilterExp(o,a.getCount(),i.byteStride,r);break;case q.OCTAHEDRAL:i.byteStride=r>8?8:4,i.componentType=r>8?Pa:si,i.normalized=!0,o=a.getElementSize()===3?ci(o):o,i.array=e.encodeFilterOct(o,a.getCount(),i.byteStride,r);break;case q.QUATERNION:i.byteStride=8,i.componentType=Pa,i.normalized=!0,i.array=e.encodeFilterQuat(o,a.getCount(),i.byteStride,r);break;default:throw new Error("Invalid filter.")}i.min=a.getMin([]),i.max=a.getMax([]),a.getNormalized()&&(i.min=i.min.map(c=>ea(c,a.getComponentType())),i.max=i.max.map(c=>ea(c,a.getComponentType()))),i.normalized&&(i.min=i.min.map(c=>Va(c,i.componentType)),i.max=i.max.map(c=>Va(c,i.componentType)))}else i.byteStride%4&&(i.array=oi(i.array,a.getElementSize()),i.byteStride=i.array.byteLength/a.getCount());return i}function ii(a){const e=a.getComponentType(),t=a.getArray(),n=new Float32Array(t.length);for(let s=0;s<t.length;s++)n[s]=ea(t[s],e);return n}function oi(a,e){const n=O.padNumber(a.BYTES_PER_ELEMENT*e)/a.BYTES_PER_ELEMENT,s=a.length/e,r=new a.constructor(s*n);for(let i=0;i*e<a.length;i++)for(let o=0;o<e;o++)r[i*n+o]=a[i*e+o];return r}function ci(a){const e=new Float32Array(a.length*4/3);for(let t=0,n=a.length/3;t<n;t++)e[t*4]=a[t*3],e[t*4+1]=a[t*3+1],e[t*4+2]=a[t*3+2];return e}function fi(a,e){return e===le.BufferViewUsage.ELEMENT_ARRAY_BUFFER?a.listParents().some(n=>n instanceof H&&n.getMode()===H.Mode.TRIANGLES)?Je.TRIANGLES:Je.INDICES:Je.ATTRIBUTES}function bi(a,e){const t=e.getGraph().listParentEdges(a).filter(n=>!(n.getParent()instanceof at));for(const n of t){const s=n.getName(),r=n.getAttributes().key||"",i=n.getParent().propertyType===A.PRIMITIVE_TARGET;if(s==="indices")return{filter:q.NONE};if(s==="attributes"){if(r==="POSITION")return{filter:q.NONE};if(r==="TEXCOORD_0")return{filter:q.NONE};if(r.startsWith("JOINTS_"))return{filter:q.NONE};if(r.startsWith("WEIGHTS_"))return{filter:q.NONE};if(r==="NORMAL"||r==="TANGENT")return i?{filter:q.NONE}:{filter:q.OCTAHEDRAL,bits:8}}if(s==="output"){const o=Os(a);return o==="rotation"?{filter:q.QUATERNION,bits:16}:o==="translation"?{filter:q.EXPONENTIAL,bits:12}:o==="scale"?{filter:q.EXPONENTIAL,bits:12}:{filter:q.NONE}}if(s==="input")return{filter:q.NONE};if(s==="inverseBindMatrices")return{filter:q.NONE}}return{filter:q.NONE}}function Os(a){for(const e of a.listParents())if(e instanceof tt){for(const t of e.listParents())if(t instanceof et)return t.getTargetPath()}return null}function di(a){return!a.extensions||!a.extensions[$t]?!1:!!a.extensions[$t].fallback}const Z=$t,Ha={method:lt.QUANTIZE};class _s extends L{constructor(...e){super(...e),this.extensionName=Z,this.prereadTypes=[A.BUFFER,A.PRIMITIVE],this.prewriteTypes=[A.BUFFER,A.ACCESSOR],this.readDependencies=["meshopt.decoder"],this.writeDependencies=["meshopt.encoder"],this._decoder=null,this._decoderFallbackBufferMap=new Map,this._encoder=null,this._encoderOptions=Ha,this._encoderFallbackBuffer=null,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={}}install(e,t){return e==="meshopt.decoder"&&(this._decoder=t),e==="meshopt.encoder"&&(this._encoder=t),this}setEncoderOptions(e){return this._encoderOptions=me({},Ha,e),this}preread(e,t){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${Z}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${Z}]: Missing WASM support.`)}return t===A.BUFFER?this._prereadBuffers(e):t===A.PRIMITIVE&&this._prereadPrimitives(e),this}_prereadBuffers(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach((s,r)=>{if(!s.extensions||!s.extensions[Z])return;const i=s.extensions[Z],o=i.byteOffset||0,c=i.byteLength||0,f=i.count,b=i.byteStride,u=new Uint8Array(f*b),d=t.json.buffers[i.buffer],g=d.uri?t.resources[d.uri]:t.resources[Ye],l=O.toView(g,o,c);this._decoder.decodeGltfBuffer(u,f,b,l,i.mode,i.filter),e.bufferViews[r]=u})}_prereadPrimitives(e){const t=e.jsonDoc;(t.json.bufferViews||[]).forEach(s=>{if(!s.extensions||!s.extensions[Z])return;const r=s.extensions[Z],i=e.buffers[r.buffer],o=e.buffers[s.buffer],c=t.json.buffers[s.buffer];di(c)&&this._decoderFallbackBufferMap.set(o,i)})}read(e){if(!this.isRequired())return this;for(const[t,n]of this._decoderFallbackBufferMap){for(const s of t.listParents())s instanceof S&&s.swap(t,n);t.dispose()}return this}prewrite(e,t){return t===A.ACCESSOR?this._prewriteAccessors(e):t===A.BUFFER&&this._prewriteBuffers(e),this}_prewriteAccessors(e){const t=e.jsonDoc.json,n=this._encoder,s=this._encoderOptions,r=this.document.getGraph(),i=this.document.createBuffer(),o=this.document.getRoot().listBuffers().indexOf(i);let c=1;const f=new Map,b=u=>{for(const d of r.listParents(u)){if(d.propertyType===A.ROOT)continue;let g=f.get(u);return g===void 0&&f.set(u,g=c++),g}return-1};this._encoderFallbackBuffer=i,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(const u of this.document.getRoot().listAccessors()){if(Os(u)==="weights"||u.getSparse())continue;const d=e.getAccessorUsage(u),g=e.accessorUsageGroupedByParent.has(d)?b(u):null,l=fi(u,d),m=s.method===lt.FILTER?bi(u,this.document):{filter:q.NONE},p=ri(u,n,l,m),{array:h,byteStride:I}=p,x=u.getBuffer();if(!x)throw new Error(`${Z}: Missing buffer for accessor.`);const T=this.document.getRoot().listBuffers().indexOf(x),E=[d,g,l,m.filter,I,T].join(":");let R=this._encoderBufferViews[E],y=this._encoderBufferViewData[E],w=this._encoderBufferViewAccessors[E];(!R||!y)&&(w=this._encoderBufferViewAccessors[E]=[],y=this._encoderBufferViewData[E]=[],R=this._encoderBufferViews[E]={buffer:o,target:le.USAGE_TO_TARGET[d],byteOffset:0,byteLength:0,byteStride:d===le.BufferViewUsage.ARRAY_BUFFER?I:void 0,extensions:{[Z]:{buffer:T,byteOffset:0,byteLength:0,mode:l,filter:m.filter!==q.NONE?m.filter:void 0,byteStride:I,count:0}}});const j=e.createAccessorDef(u);j.componentType=p.componentType,j.normalized=p.normalized,j.byteOffset=R.byteLength,j.min&&p.min&&(j.min=p.min),j.max&&p.max&&(j.max=p.max),e.accessorIndexMap.set(u,t.accessors.length),t.accessors.push(j),w.push(j),y.push(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),R.byteLength+=h.byteLength,R.extensions.EXT_meshopt_compression.count+=u.getCount()}}_prewriteBuffers(e){const t=this._encoder;for(const n in this._encoderBufferViews){const s=this._encoderBufferViews[n],r=this._encoderBufferViewData[n],i=this.document.getRoot().listBuffers()[s.extensions[Z].buffer],o=e.otherBufferViews.get(i)||[],{count:c,byteStride:f,mode:b}=s.extensions[Z],u=O.concat(r),d=t.encodeGltfBuffer(u,c,f,b),g=O.pad(d);s.extensions[Z].byteLength=d.byteLength,r.length=0,r.push(g),o.push(g),e.otherBufferViews.set(i,o)}}write(e){let t=0;for(const i in this._encoderBufferViews){const o=this._encoderBufferViews[i],c=this._encoderBufferViewData[i][0],f=e.otherBufferViewsIndexMap.get(c),b=this._encoderBufferViewAccessors[i];for(const l of b)l.bufferView=f;const u=e.jsonDoc.json.bufferViews[f],d=u.byteOffset||0;Object.assign(u,o),u.byteOffset=t;const g=u.extensions[Z];g.byteOffset=d,t+=O.padNumber(o.byteLength)}const n=this._encoderFallbackBuffer,s=e.bufferIndexMap.get(n),r=e.jsonDoc.json.buffers[s];return r.byteLength=t,r.extensions={[Z]:{fallback:!0}},n.dispose(),this}}_s.EXTENSION_NAME=Z;_s.EncoderMethod=lt;const ot=Zr;class ui{match(e){return e.length>=12&&O.decodeText(e.slice(4,12))==="ftypavif"}getSize(e){if(!this.match(e))return null;const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let n=qa(t,0);if(!n)return null;let s=n.end;for(;n=qa(t,s);)if(n.type==="meta")s=n.start+4;else if(n.type==="iprp"||n.type==="ipco")s=n.start;else{if(n.type==="ispe")return[t.getUint32(n.start+4),t.getUint32(n.start+8)];if(n.type==="mdat")break;s=n.end}return null}getChannels(e){return 4}}class hi extends L{constructor(...e){super(...e),this.extensionName=ot,this.prereadTypes=[A.TEXTURE]}static register(){he.registerFormat("image/avif",new ui)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(n=>{n.extensions&&n.extensions[ot]&&(n.source=n.extensions[ot].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/avif"){const s=e.imageIndexMap.get(n);(t.json.textures||[]).forEach(i=>{i.source===s&&(i.extensions=i.extensions||{},i.extensions[ot]={source:i.source},delete i.source)})}}),this}}hi.EXTENSION_NAME=ot;function qa(a,e){if(a.byteLength<4+e)return null;const t=a.getUint32(e);return a.byteLength<t+e||t<8?null:{type:O.decodeText(new Uint8Array(a.buffer,a.byteOffset+e+4,4)),start:e+8,end:e+t}}const ct=$r;class li{match(e){return e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80}getSize(e){const t=O.decodeText(e.slice(0,4)),n=O.decodeText(e.slice(8,12));if(t!=="RIFF"||n!=="WEBP")return null;const s=new DataView(e.buffer,e.byteOffset);let r=12;for(;r<s.byteLength;){const i=O.decodeText(new Uint8Array([s.getUint8(r),s.getUint8(r+1),s.getUint8(r+2),s.getUint8(r+3)])),o=s.getUint32(r+4,!0);if(i==="VP8 "){const c=s.getInt16(r+14,!0)&16383,f=s.getInt16(r+16,!0)&16383;return[c,f]}else if(i==="VP8L"){const c=s.getUint8(r+9),f=s.getUint8(r+10),b=s.getUint8(r+11),u=s.getUint8(r+12),d=1+((f&63)<<8|c),g=1+((u&15)<<10|b<<2|(f&192)>>6);return[d,g]}r+=8+o+o%2}return null}getChannels(e){return 4}}class gi extends L{constructor(...e){super(...e),this.extensionName=ct,this.prereadTypes=[A.TEXTURE]}static register(){he.registerFormat("image/webp",new li)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(n=>{n.extensions&&n.extensions[ct]&&(n.source=n.extensions[ct].source)}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/webp"){const s=e.imageIndexMap.get(n);(t.json.textures||[]).forEach(i=>{i.source===s&&(i.extensions=i.extensions||{},i.extensions[ct]={source:i.source},delete i.source)})}}),this}}gi.EXTENSION_NAME=ct;const Ka=Ss;let X,Fs,Ds;function pi(a,e){const t=new X.DecoderBuffer;try{if(t.Init(e,e.length),a.GetEncodedGeometryType(t)!==X.TRIANGULAR_MESH)throw new Error(`[${Ka}] Unknown geometry type.`);const s=new X.Mesh;if(!a.DecodeBufferToMesh(t,s).ok()||s.ptr===0)throw new Error(`[${Ka}] Decoding failure.`);return s}finally{X.destroy(t)}}function mi(a,e){const n=e.num_faces()*3;let s,r;if(e.num_points()<=65534){const i=n*Uint16Array.BYTES_PER_ELEMENT;s=X._malloc(i),a.GetTrianglesUInt16Array(e,i,s),r=new Uint16Array(X.HEAPU16.buffer,s,n).slice()}else{const i=n*Uint32Array.BYTES_PER_ELEMENT;s=X._malloc(i),a.GetTrianglesUInt32Array(e,i,s),r=new Uint32Array(X.HEAPU32.buffer,s,n).slice()}return X._free(s),r}function yi(a,e,t,n){const s=Ds[n.componentType],r=Fs[n.componentType],i=t.num_components(),c=e.num_points()*i,f=c*r.BYTES_PER_ELEMENT,b=X._malloc(f);a.GetAttributeDataArrayForAllPoints(e,t,s,f,b);const u=new r(X.HEAPF32.buffer,b,c).slice();return X._free(b),u}function xi(a){X=a,Fs={[S.ComponentType.FLOAT]:Float32Array,[S.ComponentType.UNSIGNED_INT]:Uint32Array,[S.ComponentType.UNSIGNED_SHORT]:Uint16Array,[S.ComponentType.UNSIGNED_BYTE]:Uint8Array,[S.ComponentType.SHORT]:Int16Array,[S.ComponentType.BYTE]:Int8Array},Ds={[S.ComponentType.FLOAT]:X.DT_FLOAT32,[S.ComponentType.UNSIGNED_INT]:X.DT_UINT32,[S.ComponentType.UNSIGNED_SHORT]:X.DT_UINT16,[S.ComponentType.UNSIGNED_BYTE]:X.DT_UINT8,[S.ComponentType.SHORT]:X.DT_INT16,[S.ComponentType.BYTE]:X.DT_INT8}}let se;var gt;(function(a){a[a.EDGEBREAKER=1]="EDGEBREAKER",a[a.SEQUENTIAL=0]="SEQUENTIAL"})(gt||(gt={}));var re;(function(a){a.POSITION="POSITION",a.NORMAL="NORMAL",a.COLOR="COLOR",a.TEX_COORD="TEX_COORD",a.GENERIC="GENERIC"})(re||(re={}));const Us={[re.POSITION]:14,[re.NORMAL]:10,[re.COLOR]:8,[re.TEX_COORD]:12,[re.GENERIC]:12},Wa={decodeSpeed:5,encodeSpeed:5,method:gt.EDGEBREAKER,quantizationBits:Us,quantizationVolume:"mesh"};function Ti(a){se=a}function Ei(a,e=Wa){const t=me({},Wa,e);t.quantizationBits=me({},Us,e.quantizationBits);const n=new se.MeshBuilder,s=new se.Mesh,r=new se.ExpertEncoder(s),i={},o=new se.DracoInt8Array,c=a.listTargets().length>0;let f=!1;for(const m of a.listSemantics()){const p=a.getAttribute(m);if(p.getSparse()){f=!0;continue}const h=Ii(m),I=Ai(n,p.getComponentType(),s,se[h],p.getCount(),p.getElementSize(),p.getArray());if(I===-1)throw new Error(`Error compressing "${m}" attribute.`);if(i[m]=I,t.quantizationVolume==="mesh"||m!=="POSITION")r.SetAttributeQuantization(I,t.quantizationBits[h]);else if(typeof t.quantizationVolume=="object"){const{quantizationVolume:x}=t,T=Math.max(x.max[0]-x.min[0],x.max[1]-x.min[1],x.max[2]-x.min[2]);r.SetAttributeExplicitQuantization(I,t.quantizationBits[h],p.getElementSize(),x.min,T)}else throw new Error("Invalid quantization volume state.")}const b=a.getIndices();if(!b)throw new ta("Primitive must have indices.");n.AddFacesToMesh(s,b.getCount()/3,b.getArray()),r.SetSpeedOptions(t.encodeSpeed,t.decodeSpeed),r.SetTrackEncodedProperties(!0),t.method===gt.SEQUENTIAL||c||f?r.SetEncodingMethod(se.MESH_SEQUENTIAL_ENCODING):r.SetEncodingMethod(se.MESH_EDGEBREAKER_ENCODING);const u=r.EncodeToDracoBuffer(!(c||f),o);if(u<=0)throw new ta("Error applying Draco compression.");const d=new Uint8Array(u);for(let m=0;m<u;++m)d[m]=o.GetValue(m);const g=r.GetNumberOfEncodedPoints(),l=r.GetNumberOfEncodedFaces()*3;return se.destroy(o),se.destroy(s),se.destroy(n),se.destroy(r),{numVertices:g,numIndices:l,data:d,attributeIDs:i}}function Ii(a){return a==="POSITION"?re.POSITION:a==="NORMAL"?re.NORMAL:a.startsWith("COLOR_")?re.COLOR:a.startsWith("TEXCOORD_")?re.TEX_COORD:re.GENERIC}function Ai(a,e,t,n,s,r,i){switch(e){case S.ComponentType.UNSIGNED_BYTE:return a.AddUInt8Attribute(t,n,s,r,i);case S.ComponentType.BYTE:return a.AddInt8Attribute(t,n,s,r,i);case S.ComponentType.UNSIGNED_SHORT:return a.AddUInt16Attribute(t,n,s,r,i);case S.ComponentType.SHORT:return a.AddInt16Attribute(t,n,s,r,i);case S.ComponentType.UNSIGNED_INT:return a.AddUInt32Attribute(t,n,s,r,i);case S.ComponentType.FLOAT:return a.AddFloatAttribute(t,n,s,r,i);default:throw new Error(`Unexpected component type, "${e}".`)}}class ta extends Error{}const K=Ss;class Bs extends L{constructor(...e){super(...e),this.extensionName=K,this.prereadTypes=[A.PRIMITIVE],this.prewriteTypes=[A.ACCESSOR],this.readDependencies=["draco3d.decoder"],this.writeDependencies=["draco3d.encoder"],this._decoderModule=null,this._encoderModule=null,this._encoderOptions={}}install(e,t){return e==="draco3d.decoder"&&(this._decoderModule=t,xi(this._decoderModule)),e==="draco3d.encoder"&&(this._encoderModule=t,Ti(this._encoderModule)),this}setEncoderOptions(e){return this._encoderOptions=e,this}preread(e){if(!this._decoderModule)throw new Error(`[${K}] Please install extension dependency, "draco3d.decoder".`);const t=this.document.getLogger(),n=e.jsonDoc,s=new Map;try{const r=n.json.meshes||[];for(const i of r)for(const o of i.primitives){if(!o.extensions||!o.extensions[K])continue;const c=o.extensions[K];let[f,b]=s.get(c.bufferView)||[];if(!b||!f){const u=n.json.bufferViews[c.bufferView],d=n.json.buffers[u.buffer],g=d.uri?n.resources[d.uri]:n.resources[Ye],l=u.byteOffset||0,m=u.byteLength,p=O.toView(g,l,m);f=new this._decoderModule.Decoder,b=pi(f,p),s.set(c.bufferView,[f,b]),t.debug(`[${K}] Decompressed ${p.byteLength} bytes.`)}for(const u in o.attributes){const d=e.jsonDoc.json.accessors[o.attributes[u]],g=f.GetAttributeByUniqueId(b,c.attributes[u]),l=yi(f,b,g,d);e.accessors[o.attributes[u]].setArray(l)}o.indices!==void 0&&e.accessors[o.indices].setArray(mi(f,b))}}finally{for(const[r,i]of Array.from(s.values()))this._decoderModule.destroy(r),this._decoderModule.destroy(i)}return this}read(e){return this}prewrite(e,t){if(!this._encoderModule)throw new Error(`[${K}] Please install extension dependency, "draco3d.encoder".`);const n=this.document.getLogger();n.debug(`[${K}] Compression options: ${JSON.stringify(this._encoderOptions)}`);const s=wi(this.document),r=new Map;let i="mesh";this._encoderOptions.quantizationVolume==="scene"&&(this.document.getRoot().listScenes().length!==1?n.warn(`[${K}]: quantizationVolume=scene requires exactly 1 scene.`):i=wn(this.document.getRoot().listScenes().pop()));for(const o of Array.from(s.keys())){const c=s.get(o);if(!c)throw new Error("Unexpected primitive.");if(r.has(c)){r.set(c,r.get(c));continue}const f=o.getIndices(),b=e.jsonDoc.json.accessors;let u;try{u=Ei(o,me({},this._encoderOptions,{quantizationVolume:i}))}catch(l){if(l instanceof ta){n.warn(`[${K}]: ${l.message} Skipping primitive compression.`);continue}throw l}r.set(c,u);const d=e.createAccessorDef(f);d.count=u.numIndices,e.accessorIndexMap.set(f,b.length),b.push(d),u.numVertices>65534&&d.componentType!==S.ComponentType.UNSIGNED_INT&&(d.componentType=S.ComponentType.UNSIGNED_INT);for(const l of o.listSemantics()){const m=o.getAttribute(l);if(u.attributeIDs[l]===void 0)continue;const p=e.createAccessorDef(m);p.count=u.numVertices,e.accessorIndexMap.set(m,b.length),b.push(p)}const g=o.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];e.otherBufferViews.has(g)||e.otherBufferViews.set(g,[]),e.otherBufferViews.get(g).push(u.data)}return n.debug(`[${K}] Compressed ${s.size} primitives.`),e.extensionData[K]={primitiveHashMap:s,primitiveEncodingMap:r},this}write(e){const t=e.extensionData[K];for(const n of this.document.getRoot().listMeshes()){const s=e.jsonDoc.json.meshes[e.meshIndexMap.get(n)];for(let r=0;r<n.listPrimitives().length;r++){const i=n.listPrimitives()[r],o=s.primitives[r],c=t.primitiveHashMap.get(i);if(!c)continue;const f=t.primitiveEncodingMap.get(c);f&&(o.extensions=o.extensions||{},o.extensions[K]={bufferView:e.otherBufferViewsIndexMap.get(f.data),attributes:f.attributeIDs})}}if(!t.primitiveHashMap.size){const n=e.jsonDoc.json;n.extensionsUsed=(n.extensionsUsed||[]).filter(s=>s!==K),n.extensionsRequired=(n.extensionsRequired||[]).filter(s=>s!==K)}return this}}Bs.EXTENSION_NAME=K;Bs.EncoderMethod=gt;function wi(a){const e=a.getLogger(),t=new Set,n=new Set;let s=0,r=0;for(const u of a.getRoot().listMeshes())for(const d of u.listPrimitives())d.getIndices()?d.getMode()!==H.Mode.TRIANGLES?(n.add(d),r++):t.add(d):(n.add(d),s++);s>0&&e.warn(`[${K}] Skipping Draco compression of ${s} non-indexed primitives.`),r>0&&e.warn(`[${K}] Skipping Draco compression of ${r} non-TRIANGLES primitives.`);const i=a.getRoot().listAccessors(),o=new Map;for(let u=0;u<i.length;u++)o.set(i[u],u);const c=new Map,f=new Set,b=new Map;for(const u of Array.from(t)){let d=Xa(u,o);if(f.has(d)){b.set(u,d);continue}if(c.has(u.getIndices())){const g=u.getIndices(),l=g.clone();o.set(l,a.getRoot().listAccessors().length-1),u.swap(g,l)}for(const g of u.listAttributes())if(c.has(g)){const l=g.clone();o.set(l,a.getRoot().listAccessors().length-1),u.swap(g,l)}d=Xa(u,o),f.add(d),b.set(u,d),c.set(u.getIndices(),d);for(const g of u.listAttributes())c.set(g,d)}for(const u of Array.from(c.keys())){const d=new Set(u.listParents().map(g=>g.propertyType));if(d.size!==2||!d.has(A.PRIMITIVE)||!d.has(A.ROOT))throw new Error(`[${K}] Compressed accessors must only be used as indices or vertex attributes.`)}for(const u of Array.from(t)){const d=b.get(u),g=u.getIndices();if(c.get(g)!==d||u.listAttributes().some(l=>c.get(l)!==d))throw new Error(`[${K}] Draco primitives must share all, or no, accessors.`)}for(const u of Array.from(n)){const d=u.getIndices();if(c.has(d)||u.listAttributes().some(g=>c.has(g)))throw new Error(`[${K}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return b}function Xa(a,e){const t=[],n=a.getIndices();t.push(e.get(n));for(const s of a.listAttributes())t.push(e.get(s));return t.sort().join("|")}class $e extends V{init(){this.extensionName=pa,this.propertyType="Light",this.parentTypes=[A.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:$e.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(e){return this.set("color",e)}getIntensity(){return this.get("intensity")}setIntensity(e){return this.set("intensity",e)}getType(){return this.get("type")}setType(e){return this.set("type",e)}getRange(){return this.get("range")}setRange(e){return this.set("range",e)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(e){return this.set("innerConeAngle",e)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(e){return this.set("outerConeAngle",e)}}$e.EXTENSION_NAME=pa;$e.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};const be=pa;class Ri extends L{constructor(...e){super(...e),this.extensionName=be}createLight(e=""){return new $e(this.document.getGraph(),e)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[be])return this;const r=(t.json.extensions[be].lights||[]).map(i=>{var o,c;const f=this.createLight().setName(i.name||"").setType(i.type);return i.color!==void 0&&f.setColor(i.color),i.intensity!==void 0&&f.setIntensity(i.intensity),i.range!==void 0&&f.setRange(i.range),((o=i.spot)==null?void 0:o.innerConeAngle)!==void 0&&f.setInnerConeAngle(i.spot.innerConeAngle),((c=i.spot)==null?void 0:c.outerConeAngle)!==void 0&&f.setOuterConeAngle(i.spot.outerConeAngle),f});return t.json.nodes.forEach((i,o)=>{if(!i.extensions||!i.extensions[be])return;const c=i.extensions[be];e.nodes[o].setExtension(be,r[c.light])}),this}write(e){const t=e.jsonDoc;if(this.properties.size===0)return this;const n=[],s=new Map;for(const r of this.properties){const i=r,o={type:i.getType()};F.eq(i.getColor(),[1,1,1])||(o.color=i.getColor()),i.getIntensity()!==1&&(o.intensity=i.getIntensity()),i.getRange()!=null&&(o.range=i.getRange()),i.getName()&&(o.name=i.getName()),i.getType()===$e.Type.SPOT&&(o.spot={innerConeAngle:i.getInnerConeAngle(),outerConeAngle:i.getOuterConeAngle()}),n.push(o),s.set(i,n.length-1)}return this.document.getRoot().listNodes().forEach(r=>{const i=r.getExtension(be);if(i){const o=e.nodeIndexMap.get(r),c=t.json.nodes[o];c.extensions=c.extensions||{},c.extensions[be]={light:s.get(i)}}}),t.json.extensions=t.json.extensions||{},t.json.extensions[be]={lights:n},this}}Ri.EXTENSION_NAME=be;const{R:ji,G:vi,B:ki}=oe;class Ls extends V{init(){this.extensionName=ma,this.propertyType="Anisotropy",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new U(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(e){return this.set("anisotropyStrength",e)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(e){return this.set("anisotropyRotation",e)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(e){return this.setRef("anisotropyTexture",e,{channels:ji|vi|ki})}}Ls.EXTENSION_NAME=ma;const Re=ma;class Ni extends L{constructor(...e){super(...e),this.extensionName=Re,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createAnisotropy(){return new Ls(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[Re]){const o=this.createAnisotropy();e.materials[i].setExtension(Re,o);const c=r.extensions[Re];if(c.anisotropyStrength!==void 0&&o.setAnisotropyStrength(c.anisotropyStrength),c.anisotropyRotation!==void 0&&o.setAnisotropyRotation(c.anisotropyRotation),c.anisotropyTexture!==void 0){const f=c.anisotropyTexture,b=e.textures[s[f.index].source];o.setAnisotropyTexture(b),e.setTextureInfo(o.getAnisotropyTextureInfo(),f)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Re);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[Re]={};if(s.getAnisotropyStrength()>0&&(o.anisotropyStrength=s.getAnisotropyStrength()),s.getAnisotropyRotation()!==0&&(o.anisotropyRotation=s.getAnisotropyRotation()),s.getAnisotropyTexture()){const c=s.getAnisotropyTexture(),f=s.getAnisotropyTextureInfo();o.anisotropyTexture=e.createTextureInfoDef(c,f)}}}),this}}Ni.EXTENSION_NAME=Re;const{R:Ja,G:Ya,B:Mi}=oe;class Gs extends V{init(){this.extensionName=ya,this.propertyType="Clearcoat",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new U(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new U(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new U(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(e){return this.set("clearcoatFactor",e)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(e){return this.setRef("clearcoatTexture",e,{channels:Ja})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(e){return this.set("clearcoatRoughnessFactor",e)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(e){return this.setRef("clearcoatRoughnessTexture",e,{channels:Ya})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(e){return this.set("clearcoatNormalScale",e)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(e){return this.setRef("clearcoatNormalTexture",e,{channels:Ja|Ya|Mi})}}Gs.EXTENSION_NAME=ya;const je=ya;class Si extends L{constructor(...e){super(...e),this.extensionName=je,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createClearcoat(){return new Gs(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[je]){const o=this.createClearcoat();e.materials[i].setExtension(je,o);const c=r.extensions[je];if(c.clearcoatFactor!==void 0&&o.setClearcoatFactor(c.clearcoatFactor),c.clearcoatRoughnessFactor!==void 0&&o.setClearcoatRoughnessFactor(c.clearcoatRoughnessFactor),c.clearcoatTexture!==void 0){const f=c.clearcoatTexture,b=e.textures[s[f.index].source];o.setClearcoatTexture(b),e.setTextureInfo(o.getClearcoatTextureInfo(),f)}if(c.clearcoatRoughnessTexture!==void 0){const f=c.clearcoatRoughnessTexture,b=e.textures[s[f.index].source];o.setClearcoatRoughnessTexture(b),e.setTextureInfo(o.getClearcoatRoughnessTextureInfo(),f)}if(c.clearcoatNormalTexture!==void 0){const f=c.clearcoatNormalTexture,b=e.textures[s[f.index].source];o.setClearcoatNormalTexture(b),e.setTextureInfo(o.getClearcoatNormalTextureInfo(),f),f.scale!==void 0&&o.setClearcoatNormalScale(f.scale)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(je);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[je]={clearcoatFactor:s.getClearcoatFactor(),clearcoatRoughnessFactor:s.getClearcoatRoughnessFactor()};if(s.getClearcoatTexture()){const c=s.getClearcoatTexture(),f=s.getClearcoatTextureInfo();o.clearcoatTexture=e.createTextureInfoDef(c,f)}if(s.getClearcoatRoughnessTexture()){const c=s.getClearcoatRoughnessTexture(),f=s.getClearcoatRoughnessTextureInfo();o.clearcoatRoughnessTexture=e.createTextureInfoDef(c,f)}if(s.getClearcoatNormalTexture()){const c=s.getClearcoatNormalTexture(),f=s.getClearcoatNormalTextureInfo();o.clearcoatNormalTexture=e.createTextureInfoDef(c,f),s.getClearcoatNormalScale()!==1&&(o.clearcoatNormalTexture.scale=s.getClearcoatNormalScale())}}}),this}}Si.EXTENSION_NAME=je;const{R:Ci,G:Oi,B:_i,A:Fi}=oe;class zs extends V{init(){this.extensionName=xa,this.propertyType="DiffuseTransmission",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseTransmissionFactor:0,diffuseTransmissionTexture:null,diffuseTransmissionTextureInfo:new U(this.graph,"diffuseTransmissionTextureInfo"),diffuseTransmissionColorFactor:[1,1,1],diffuseTransmissionColorTexture:null,diffuseTransmissionColorTextureInfo:new U(this.graph,"diffuseTransmissionColorTextureInfo")})}getDiffuseTransmissionFactor(){return this.get("diffuseTransmissionFactor")}setDiffuseTransmissionFactor(e){return this.set("diffuseTransmissionFactor",e)}getDiffuseTransmissionTexture(){return this.getRef("diffuseTransmissionTexture")}getDiffuseTransmissionTextureInfo(){return this.getRef("diffuseTransmissionTexture")?this.getRef("diffuseTransmissionTextureInfo"):null}setDiffuseTransmissionTexture(e){return this.setRef("diffuseTransmissionTexture",e,{channels:Fi})}getDiffuseTransmissionColorFactor(){return this.get("diffuseTransmissionColorFactor")}setDiffuseTransmissionColorFactor(e){return this.set("diffuseTransmissionColorFactor",e)}getDiffuseTransmissionColorTexture(){return this.getRef("diffuseTransmissionColorTexture")}getDiffuseTransmissionColorTextureInfo(){return this.getRef("diffuseTransmissionColorTexture")?this.getRef("diffuseTransmissionColorTextureInfo"):null}setDiffuseTransmissionColorTexture(e){return this.setRef("diffuseTransmissionColorTexture",e,{channels:Ci|Oi|_i})}}zs.EXTENSION_NAME=xa;const ve=xa;class Di extends L{constructor(...e){super(...e),this.extensionName=ve}createDiffuseTransmission(){return new zs(this.document.getGraph())}read(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[ve]){const o=this.createDiffuseTransmission();e.materials[i].setExtension(ve,o);const c=r.extensions[ve];if(c.diffuseTransmissionFactor!==void 0&&o.setDiffuseTransmissionFactor(c.diffuseTransmissionFactor),c.diffuseTransmissionColorFactor!==void 0&&o.setDiffuseTransmissionColorFactor(c.diffuseTransmissionColorFactor),c.diffuseTransmissionTexture!==void 0){const f=c.diffuseTransmissionTexture,b=e.textures[s[f.index].source];o.setDiffuseTransmissionTexture(b),e.setTextureInfo(o.getDiffuseTransmissionTextureInfo(),f)}if(c.diffuseTransmissionColorTexture!==void 0){const f=c.diffuseTransmissionColorTexture,b=e.textures[s[f.index].source];o.setDiffuseTransmissionColorTexture(b),e.setTextureInfo(o.getDiffuseTransmissionColorTextureInfo(),f)}}}),this}write(e){const t=e.jsonDoc;for(const n of this.document.getRoot().listMaterials()){const s=n.getExtension(ve);if(!s)continue;const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[ve]={diffuseTransmissionFactor:s.getDiffuseTransmissionFactor(),diffuseTransmissionColorFactor:s.getDiffuseTransmissionColorFactor()};if(s.getDiffuseTransmissionTexture()){const c=s.getDiffuseTransmissionTexture(),f=s.getDiffuseTransmissionTextureInfo();o.diffuseTransmissionTexture=e.createTextureInfoDef(c,f)}if(s.getDiffuseTransmissionColorTexture()){const c=s.getDiffuseTransmissionColorTexture(),f=s.getDiffuseTransmissionColorTextureInfo();o.diffuseTransmissionColorTexture=e.createTextureInfoDef(c,f)}}return this}}Di.EXTENSION_NAME=ve;class Ps extends V{init(){this.extensionName=Ta,this.propertyType="Dispersion",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{dispersion:0})}getDispersion(){return this.get("dispersion")}setDispersion(e){return this.set("dispersion",e)}}Ps.EXTENSION_NAME=Ta;const ke=Ta;class Ui extends L{constructor(...e){super(...e),this.extensionName=ke,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createDispersion(){return new Ps(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){return(e.jsonDoc.json.materials||[]).forEach((s,r)=>{if(s.extensions&&s.extensions[ke]){const i=this.createDispersion();e.materials[r].setExtension(ke,i);const o=s.extensions[ke];o.dispersion!==void 0&&i.setDispersion(o.dispersion)}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(ke);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{},i.extensions[ke]={dispersion:s.getDispersion()}}}),this}}Ui.EXTENSION_NAME=ke;class Vs extends V{init(){this.extensionName=Ea,this.propertyType="EmissiveStrength",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(e){return this.set("emissiveStrength",e)}}Vs.EXTENSION_NAME=Ea;const Ne=Ea;class Bi extends L{constructor(...e){super(...e),this.extensionName=Ne,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createEmissiveStrength(){return new Vs(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){return(e.jsonDoc.json.materials||[]).forEach((s,r)=>{if(s.extensions&&s.extensions[Ne]){const i=this.createEmissiveStrength();e.materials[r].setExtension(Ne,i);const o=s.extensions[Ne];o.emissiveStrength!==void 0&&i.setEmissiveStrength(o.emissiveStrength)}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Ne);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{},i.extensions[Ne]={emissiveStrength:s.getEmissiveStrength()}}}),this}}Bi.EXTENSION_NAME=Ne;class Hs extends V{init(){this.extensionName=Ia,this.propertyType="IOR",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(e){return this.set("ior",e)}}Hs.EXTENSION_NAME=Ia;const Me=Ia;class Li extends L{constructor(...e){super(...e),this.extensionName=Me,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createIOR(){return new Hs(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){return(e.jsonDoc.json.materials||[]).forEach((s,r)=>{if(s.extensions&&s.extensions[Me]){const i=this.createIOR();e.materials[r].setExtension(Me,i);const o=s.extensions[Me];o.ior!==void 0&&i.setIOR(o.ior)}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Me);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{},i.extensions[Me]={ior:s.getIOR()}}}),this}}Li.EXTENSION_NAME=Me;const{R:Gi,G:zi}=oe;class qs extends V{init(){this.extensionName=Aa,this.propertyType="Iridescence",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new U(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new U(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(e){return this.set("iridescenceFactor",e)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(e){return this.setRef("iridescenceTexture",e,{channels:Gi})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(e){return this.set("iridescenceIOR",e)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(e){return this.set("iridescenceThicknessMinimum",e)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(e){return this.set("iridescenceThicknessMaximum",e)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(e){return this.setRef("iridescenceThicknessTexture",e,{channels:zi})}}qs.EXTENSION_NAME=Aa;const Se=Aa;class Pi extends L{constructor(...e){super(...e),this.extensionName=Se,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createIridescence(){return new qs(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[Se]){const o=this.createIridescence();e.materials[i].setExtension(Se,o);const c=r.extensions[Se];if(c.iridescenceFactor!==void 0&&o.setIridescenceFactor(c.iridescenceFactor),c.iridescenceIor!==void 0&&o.setIridescenceIOR(c.iridescenceIor),c.iridescenceThicknessMinimum!==void 0&&o.setIridescenceThicknessMinimum(c.iridescenceThicknessMinimum),c.iridescenceThicknessMaximum!==void 0&&o.setIridescenceThicknessMaximum(c.iridescenceThicknessMaximum),c.iridescenceTexture!==void 0){const f=c.iridescenceTexture,b=e.textures[s[f.index].source];o.setIridescenceTexture(b),e.setTextureInfo(o.getIridescenceTextureInfo(),f)}if(c.iridescenceThicknessTexture!==void 0){const f=c.iridescenceThicknessTexture,b=e.textures[s[f.index].source];o.setIridescenceThicknessTexture(b),e.setTextureInfo(o.getIridescenceThicknessTextureInfo(),f)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Se);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[Se]={};if(s.getIridescenceFactor()>0&&(o.iridescenceFactor=s.getIridescenceFactor()),s.getIridescenceIOR()!==1.3&&(o.iridescenceIor=s.getIridescenceIOR()),s.getIridescenceThicknessMinimum()!==100&&(o.iridescenceThicknessMinimum=s.getIridescenceThicknessMinimum()),s.getIridescenceThicknessMaximum()!==400&&(o.iridescenceThicknessMaximum=s.getIridescenceThicknessMaximum()),s.getIridescenceTexture()){const c=s.getIridescenceTexture(),f=s.getIridescenceTextureInfo();o.iridescenceTexture=e.createTextureInfoDef(c,f)}if(s.getIridescenceThicknessTexture()){const c=s.getIridescenceThicknessTexture(),f=s.getIridescenceThicknessTextureInfo();o.iridescenceThicknessTexture=e.createTextureInfoDef(c,f)}}}),this}}Pi.EXTENSION_NAME=Se;const{R:Qa,G:$a,B:Za,A:es}=oe;class Ks extends V{init(){this.extensionName=wa,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new U(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new U(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(e){return this.set("diffuseFactor",e)}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(e){return this.setRef("diffuseTexture",e,{channels:Qa|$a|Za|es,isColor:!0})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(e){return this.set("specularFactor",e)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(e){return this.set("glossinessFactor",e)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(e){return this.setRef("specularGlossinessTexture",e,{channels:Qa|$a|Za|es})}}Ks.EXTENSION_NAME=wa;const Ce=wa;class Vi extends L{constructor(...e){super(...e),this.extensionName=Ce,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createPBRSpecularGlossiness(){return new Ks(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[Ce]){const o=this.createPBRSpecularGlossiness();e.materials[i].setExtension(Ce,o);const c=r.extensions[Ce];if(c.diffuseFactor!==void 0&&o.setDiffuseFactor(c.diffuseFactor),c.specularFactor!==void 0&&o.setSpecularFactor(c.specularFactor),c.glossinessFactor!==void 0&&o.setGlossinessFactor(c.glossinessFactor),c.diffuseTexture!==void 0){const f=c.diffuseTexture,b=e.textures[s[f.index].source];o.setDiffuseTexture(b),e.setTextureInfo(o.getDiffuseTextureInfo(),f)}if(c.specularGlossinessTexture!==void 0){const f=c.specularGlossinessTexture,b=e.textures[s[f.index].source];o.setSpecularGlossinessTexture(b),e.setTextureInfo(o.getSpecularGlossinessTextureInfo(),f)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Ce);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[Ce]={diffuseFactor:s.getDiffuseFactor(),specularFactor:s.getSpecularFactor(),glossinessFactor:s.getGlossinessFactor()};if(s.getDiffuseTexture()){const c=s.getDiffuseTexture(),f=s.getDiffuseTextureInfo();o.diffuseTexture=e.createTextureInfoDef(c,f)}if(s.getSpecularGlossinessTexture()){const c=s.getSpecularGlossinessTexture(),f=s.getSpecularGlossinessTextureInfo();o.specularGlossinessTexture=e.createTextureInfoDef(c,f)}}}),this}}Vi.EXTENSION_NAME=Ce;const{R:Hi,G:qi,B:Ki,A:Wi}=oe;class Ws extends V{init(){this.extensionName=Ra,this.propertyType="Sheen",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new U(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new U(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}setSheenColorFactor(e){return this.set("sheenColorFactor",e)}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(e){return this.setRef("sheenColorTexture",e,{channels:Hi|qi|Ki,isColor:!0})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(e){return this.set("sheenRoughnessFactor",e)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(e){return this.setRef("sheenRoughnessTexture",e,{channels:Wi})}}Ws.EXTENSION_NAME=Ra;const Oe=Ra;class Xi extends L{constructor(...e){super(...e),this.extensionName=Oe,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createSheen(){return new Ws(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[Oe]){const o=this.createSheen();e.materials[i].setExtension(Oe,o);const c=r.extensions[Oe];if(c.sheenColorFactor!==void 0&&o.setSheenColorFactor(c.sheenColorFactor),c.sheenRoughnessFactor!==void 0&&o.setSheenRoughnessFactor(c.sheenRoughnessFactor),c.sheenColorTexture!==void 0){const f=c.sheenColorTexture,b=e.textures[s[f.index].source];o.setSheenColorTexture(b),e.setTextureInfo(o.getSheenColorTextureInfo(),f)}if(c.sheenRoughnessTexture!==void 0){const f=c.sheenRoughnessTexture,b=e.textures[s[f.index].source];o.setSheenRoughnessTexture(b),e.setTextureInfo(o.getSheenRoughnessTextureInfo(),f)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Oe);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[Oe]={sheenColorFactor:s.getSheenColorFactor(),sheenRoughnessFactor:s.getSheenRoughnessFactor()};if(s.getSheenColorTexture()){const c=s.getSheenColorTexture(),f=s.getSheenColorTextureInfo();o.sheenColorTexture=e.createTextureInfoDef(c,f)}if(s.getSheenRoughnessTexture()){const c=s.getSheenRoughnessTexture(),f=s.getSheenRoughnessTextureInfo();o.sheenRoughnessTexture=e.createTextureInfoDef(c,f)}}}),this}}Xi.EXTENSION_NAME=Oe;const{R:Ji,G:Yi,B:Qi,A:$i}=oe;class Xs extends V{init(){this.extensionName=ja,this.propertyType="Specular",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new U(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new U(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(e){return this.set("specularFactor",e)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(e){return this.set("specularColorFactor",e)}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(e){return this.setRef("specularTexture",e,{channels:$i})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(e){return this.setRef("specularColorTexture",e,{channels:Ji|Yi|Qi,isColor:!0})}}Xs.EXTENSION_NAME=ja;const _e=ja;class Zi extends L{constructor(...e){super(...e),this.extensionName=_e,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createSpecular(){return new Xs(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[_e]){const o=this.createSpecular();e.materials[i].setExtension(_e,o);const c=r.extensions[_e];if(c.specularFactor!==void 0&&o.setSpecularFactor(c.specularFactor),c.specularColorFactor!==void 0&&o.setSpecularColorFactor(c.specularColorFactor),c.specularTexture!==void 0){const f=c.specularTexture,b=e.textures[s[f.index].source];o.setSpecularTexture(b),e.setTextureInfo(o.getSpecularTextureInfo(),f)}if(c.specularColorTexture!==void 0){const f=c.specularColorTexture,b=e.textures[s[f.index].source];o.setSpecularColorTexture(b),e.setTextureInfo(o.getSpecularColorTextureInfo(),f)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(_e);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[_e]={};if(s.getSpecularFactor()!==1&&(o.specularFactor=s.getSpecularFactor()),F.eq(s.getSpecularColorFactor(),[1,1,1])||(o.specularColorFactor=s.getSpecularColorFactor()),s.getSpecularTexture()){const c=s.getSpecularTexture(),f=s.getSpecularTextureInfo();o.specularTexture=e.createTextureInfoDef(c,f)}if(s.getSpecularColorTexture()){const c=s.getSpecularColorTexture(),f=s.getSpecularColorTextureInfo();o.specularColorTexture=e.createTextureInfoDef(c,f)}}}),this}}Zi.EXTENSION_NAME=_e;const{R:eo}=oe;class Js extends V{init(){this.extensionName=va,this.propertyType="Transmission",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new U(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(e){return this.set("transmissionFactor",e)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(e){return this.setRef("transmissionTexture",e,{channels:eo})}}Js.EXTENSION_NAME=va;const Fe=va;class to extends L{constructor(...e){super(...e),this.extensionName=Fe,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createTransmission(){return new Js(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[Fe]){const o=this.createTransmission();e.materials[i].setExtension(Fe,o);const c=r.extensions[Fe];if(c.transmissionFactor!==void 0&&o.setTransmissionFactor(c.transmissionFactor),c.transmissionTexture!==void 0){const f=c.transmissionTexture,b=e.textures[s[f.index].source];o.setTransmissionTexture(b),e.setTextureInfo(o.getTransmissionTextureInfo(),f)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(Fe);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[Fe]={transmissionFactor:s.getTransmissionFactor()};if(s.getTransmissionTexture()){const c=s.getTransmissionTexture(),f=s.getTransmissionTextureInfo();o.transmissionTexture=e.createTextureInfoDef(c,f)}}}),this}}to.EXTENSION_NAME=Fe;class Ys extends V{init(){this.extensionName=ka,this.propertyType="Unlit",this.parentTypes=[A.MATERIAL]}}Ys.EXTENSION_NAME=ka;const qe=ka;class ao extends L{constructor(...e){super(...e),this.extensionName=qe,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createUnlit(){return new Ys(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){return(e.jsonDoc.json.materials||[]).forEach((n,s)=>{n.extensions&&n.extensions[qe]&&e.materials[s].setExtension(qe,this.createUnlit())}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{if(n.getExtension(qe)){const s=e.materialIndexMap.get(n),r=t.json.materials[s];r.extensions=r.extensions||{},r.extensions[qe]={}}}),this}}ao.EXTENSION_NAME=qe;class Qs extends V{init(){this.extensionName=He,this.propertyType="Mapping",this.parentTypes=["MappingList"]}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:new B})}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}addVariant(e){return this.addRef("variants",e)}removeVariant(e){return this.removeRef("variants",e)}listVariants(){return this.listRefs("variants")}}Qs.EXTENSION_NAME=He;class $s extends V{init(){this.extensionName=He,this.propertyType="MappingList",this.parentTypes=[A.PRIMITIVE]}getDefaults(){return Object.assign(super.getDefaults(),{mappings:new B})}addMapping(e){return this.addRef("mappings",e)}removeMapping(e){return this.removeRef("mappings",e)}listMappings(){return this.listRefs("mappings")}}$s.EXTENSION_NAME=He;class aa extends V{init(){this.extensionName=He,this.propertyType="Variant",this.parentTypes=["MappingList"]}}aa.EXTENSION_NAME=He;const de=He;class so extends L{constructor(...e){super(...e),this.extensionName=de}createMappingList(){return new $s(this.document.getGraph())}createVariant(e=""){return new aa(this.document.getGraph(),e)}createMapping(){return new Qs(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(e=>e instanceof aa)}read(e){const t=e.jsonDoc;if(!t.json.extensions||!t.json.extensions[de])return this;const r=(t.json.extensions[de].variants||[]).map(o=>this.createVariant().setName(o.name||""));return(t.json.meshes||[]).forEach((o,c)=>{const f=e.meshes[c];(o.primitives||[]).forEach((u,d)=>{if(!u.extensions||!u.extensions[de])return;const g=this.createMappingList(),l=u.extensions[de];for(const m of l.mappings){const p=this.createMapping();m.material!==void 0&&p.setMaterial(e.materials[m.material]);for(const h of m.variants||[])p.addVariant(r[h]);g.addMapping(p)}f.listPrimitives()[d].setExtension(de,g)})}),this}write(e){const t=e.jsonDoc,n=this.listVariants();if(!n.length)return this;const s=[],r=new Map;for(const i of n)r.set(i,s.length),s.push(e.createPropertyDef(i));for(const i of this.document.getRoot().listMeshes()){const o=e.meshIndexMap.get(i);i.listPrimitives().forEach((c,f)=>{const b=c.getExtension(de);if(!b)return;const u=e.jsonDoc.json.meshes[o].primitives[f],d=b.listMappings().map(g=>{const l=e.createPropertyDef(g),m=g.getMaterial();return m&&(l.material=e.materialIndexMap.get(m)),l.variants=g.listVariants().map(p=>r.get(p)),l});u.extensions=u.extensions||{},u.extensions[de]={mappings:d}})}return t.json.extensions=t.json.extensions||{},t.json.extensions[de]={variants:s},this}}so.EXTENSION_NAME=de;const{G:no}=oe;class Zs extends V{init(){this.extensionName=Na,this.propertyType="Volume",this.parentTypes=[A.MATERIAL]}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new U(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(e){return this.set("thicknessFactor",e)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(e){return this.setRef("thicknessTexture",e,{channels:no})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(e){return this.set("attenuationDistance",e)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(e){return this.set("attenuationColor",e)}}Zs.EXTENSION_NAME=Na;const De=Na;class ro extends L{constructor(...e){super(...e),this.extensionName=De,this.prereadTypes=[A.MESH],this.prewriteTypes=[A.MESH]}createVolume(){return new Zs(this.document.getGraph())}read(e){return this}write(e){return this}preread(e){const t=e.jsonDoc,n=t.json.materials||[],s=t.json.textures||[];return n.forEach((r,i)=>{if(r.extensions&&r.extensions[De]){const o=this.createVolume();e.materials[i].setExtension(De,o);const c=r.extensions[De];if(c.thicknessFactor!==void 0&&o.setThicknessFactor(c.thicknessFactor),c.attenuationDistance!==void 0&&o.setAttenuationDistance(c.attenuationDistance),c.attenuationColor!==void 0&&o.setAttenuationColor(c.attenuationColor),c.thicknessTexture!==void 0){const f=c.thicknessTexture,b=e.textures[s[f.index].source];o.setThicknessTexture(b),e.setTextureInfo(o.getThicknessTextureInfo(),f)}}}),this}prewrite(e){const t=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{const s=n.getExtension(De);if(s){const r=e.materialIndexMap.get(n),i=t.json.materials[r];i.extensions=i.extensions||{};const o=i.extensions[De]={};if(s.getThicknessFactor()>0&&(o.thicknessFactor=s.getThicknessFactor()),Number.isFinite(s.getAttenuationDistance())&&(o.attenuationDistance=s.getAttenuationDistance()),F.eq(s.getAttenuationColor(),[1,1,1])||(o.attenuationColor=s.getAttenuationColor()),s.getThicknessTexture()){const c=s.getThicknessTexture(),f=s.getThicknessTextureInfo();o.thicknessTexture=e.createTextureInfoDef(c,f)}}}),this}}ro.EXTENSION_NAME=De;const en=ei;class Sa extends L{constructor(...e){super(...e),this.extensionName=en}read(e){return this}write(e){return this}}Sa.EXTENSION_NAME=en;const ft=ti;class io{match(e){return e[0]===171&&e[1]===75&&e[2]===84&&e[3]===88&&e[4]===32&&e[5]===50&&e[6]===48&&e[7]===187&&e[8]===13&&e[9]===10&&e[10]===26&&e[11]===10}getSize(e){const t=Ht(e);return[t.pixelWidth,t.pixelHeight]}getChannels(e){const n=Ht(e).dataFormatDescriptor[0];if(n.colorModel===Hr)return n.samples.length===2&&(n.samples[1].channelType&15)===15?4:3;if(n.colorModel===qr)return(n.samples[0].channelType&15)===3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${n.colorModel}".`)}getVRAMByteLength(e){const t=Ht(e),n=this.getChannels(e)>3;let s=0;for(let r=0;r<t.levels.length;r++){const i=t.levels[r];if(i.uncompressedByteLength)s+=i.uncompressedByteLength;else{const o=Math.max(1,Math.floor(t.pixelWidth/Math.pow(2,r))),c=Math.max(1,Math.floor(t.pixelHeight/Math.pow(2,r))),f=n?16:8;s+=o/4*(c/4)*f}}return s}}class oo extends L{constructor(...e){super(...e),this.extensionName=ft,this.prereadTypes=[A.TEXTURE]}static register(){he.registerFormat("image/ktx2",new io)}preread(e){return e.jsonDoc.json.textures.forEach(t=>{if(t.extensions&&t.extensions[ft]){const n=t.extensions[ft];t.source=n.source}}),this}read(e){return this}write(e){const t=e.jsonDoc;return this.document.getRoot().listTextures().forEach(n=>{if(n.getMimeType()==="image/ktx2"){const s=e.imageIndexMap.get(n);t.json.textures.forEach(r=>{r.source===s&&(r.extensions=r.extensions||{},r.extensions[ft]={source:r.source},delete r.source)})}}),this}}oo.EXTENSION_NAME=ft;class tn extends V{init(){this.extensionName=Ma,this.propertyType="Transform",this.parentTypes=[A.TEXTURE_INFO]}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(e){return this.set("offset",e)}getRotation(){return this.get("rotation")}setRotation(e){return this.set("rotation",e)}getScale(){return this.get("scale")}setScale(e){return this.set("scale",e)}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}}tn.EXTENSION_NAME=Ma;const Ue=Ma;class co extends L{constructor(...e){super(...e),this.extensionName=Ue}createTransform(){return new tn(this.document.getGraph())}read(e){for(const[t,n]of Array.from(e.textureInfos.entries())){if(!n.extensions||!n.extensions[Ue])continue;const s=this.createTransform(),r=n.extensions[Ue];r.offset!==void 0&&s.setOffset(r.offset),r.rotation!==void 0&&s.setRotation(r.rotation),r.scale!==void 0&&s.setScale(r.scale),r.texCoord!==void 0&&s.setTexCoord(r.texCoord),t.setExtension(Ue,s)}return this}write(e){const t=Array.from(e.textureInfoDefMap.entries());for(const[n,s]of t){const r=n.getExtension(Ue);if(!r)continue;s.extensions=s.extensions||{};const i={},o=F.eq;o(r.getOffset(),[0,0])||(i.offset=r.getOffset()),r.getRotation()!==0&&(i.rotation=r.getRotation()),o(r.getScale(),[1,1])||(i.scale=r.getScale()),r.getTexCoord()!=null&&(i.texCoord=r.getTexCoord()),s.extensions[Ue]=i}return this}}co.EXTENSION_NAME=Ue;const fo=[A.ROOT,A.SCENE,A.NODE,A.MESH,A.MATERIAL,A.TEXTURE,A.ANIMATION];class an extends V{init(){this.extensionName=kt,this.propertyType="Packet",this.parentTypes=fo}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(e){return this.set("context",me({},e))}listProperties(){return Object.keys(this.get("properties"))}getProperty(e){const t=this.get("properties");return e in t?t[e]:null}setProperty(e,t){this._assertContext(e);const n=me({},this.get("properties"));return t?n[e]=t:delete n[e],this.set("properties",n)}toJSONLD(){const e=qt(this.get("context")),t=qt(this.get("properties"));return me({"@context":e},t)}fromJSONLD(e){e=qt(e);const t=e["@context"];return t&&this.set("context",t),delete e["@context"],this.set("properties",e)}_assertContext(e){if(!(e.split(":")[0]in this.get("context")))throw new Error(`${kt}: Missing context for term, "${e}".`)}}an.EXTENSION_NAME=kt;function qt(a){return JSON.parse(JSON.stringify(a))}const pe=kt;class bo extends L{constructor(...e){super(...e),this.extensionName=pe}createPacket(){return new an(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(e){var t;const n=(t=e.jsonDoc.json.extensions)==null?void 0:t[pe];if(!n||!n.packets)return this;const s=e.jsonDoc.json,r=this.document.getRoot(),i=n.packets.map(f=>this.createPacket().fromJSONLD(f)),o=[[s.asset],s.scenes,s.nodes,s.meshes,s.materials,s.images,s.animations],c=[[r],r.listScenes(),r.listNodes(),r.listMeshes(),r.listMaterials(),r.listTextures(),r.listAnimations()];for(let f=0;f<o.length;f++){const b=o[f]||[];for(let u=0;u<b.length;u++){const d=b[u];if(d.extensions&&d.extensions[pe]){const g=d.extensions[pe];c[f][u].setExtension(pe,i[g.packet])}}}return this}write(e){const{json:t}=e.jsonDoc,n=[];for(const s of this.properties){n.push(s.toJSONLD());for(const r of s.listParents()){let i;switch(r.propertyType){case A.ROOT:i=t.asset;break;case A.SCENE:i=t.scenes[e.sceneIndexMap.get(r)];break;case A.NODE:i=t.nodes[e.nodeIndexMap.get(r)];break;case A.MESH:i=t.meshes[e.meshIndexMap.get(r)];break;case A.MATERIAL:i=t.materials[e.materialIndexMap.get(r)];break;case A.TEXTURE:i=t.images[e.imageIndexMap.get(r)];break;case A.ANIMATION:i=t.animations[e.animationIndexMap.get(r)];break;default:i=null,this.document.getLogger().warn(`[${pe}]: Unsupported parent property, "${r.propertyType}"`);break}i&&(i.extensions=i.extensions||{},i.extensions[pe]={packet:n.length-1})}}return n.length>0&&(t.extensions=t.extensions||{},t.extensions[pe]={packets:n}),this}}bo.EXTENSION_NAME=pe;function Pe(){return Pe=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},Pe.apply(this,arguments)}H.Mode;function st(a,e){return Object.defineProperty(e,"name",{value:a}),e}function nt(a,e){const t=Pe({},a);for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function uo(a){const e=a.getIndices(),t=a.getAttribute("POSITION");switch(a.getMode()){case H.Mode.POINTS:return e?e.getCount():t.getCount();case H.Mode.LINES:return e?e.getCount()/2:t.getCount()/2;case H.Mode.LINE_LOOP:return e?e.getCount():t.getCount();case H.Mode.LINE_STRIP:return e?e.getCount()-1:t.getCount()-1;case H.Mode.TRIANGLES:return e?e.getCount()/3:t.getCount()/3;case H.Mode.TRIANGLE_STRIP:case H.Mode.TRIANGLE_FAN:return e?e.getCount()-2:t.getCount()-2;default:throw new Error("Unexpected mode: "+a.getMode())}}function ts(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function ho(a,e,t=2){return(a>e?"–":"+")+(Math.abs(a-e)/a*100).toFixed(t)+"%"}function Dt(a,e){return`${ts(a)} → ${ts(e)} (${ho(a,e)})`}function Ca(a){const e=[];for(const t of a.listAttributes())e.push(t);for(const t of a.listTargets())for(const n of t.listAttributes())e.push(n);return Array.from(new Set(e))}function lo(a,e,t){a.swap(e,t);for(const n of a.listTargets())n.swap(e,t)}function go(a,e){if(a==null&&e==null)return!0;if(a==null||e==null||a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(a[t]!==e[t])return!1;return!0}function Ze(a,e){return a.createAccessor(e.getName()).setArray(e.getArray()).setType(e.getType()).setBuffer(e.getBuffer()).setNormalized(e.getNormalized()).setSparse(e.getSparse())}function po(a,e=a){const t=sn(a,e);for(let n=0;n<t.length;n++)t[n]=n;return t}function sn(a,e=a){return e<=65534?new Uint16Array(a):new Uint32Array(a)}function nn(a){for(const e in a)return!1;return!0}function mo(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))}function yo(a){const e=new Set;let t=a,n;for(;n=t.getParentNode();){if(e.has(n))throw new Error("Circular dependency in scene graph.");e.add(n),t=n}return t.listParents().filter(s=>s instanceof Ft)}function xo(a){const e=yo(a),t=a.getParentNode();if(!t)return a;a.setMatrix(a.getWorldMatrix()),t.removeChild(a);for(const n of e)n.addChild(a);return a}var Nt=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var a=0,e=arguments.length;e--;)a+=arguments[e]*arguments[e];return Math.sqrt(a)});function To(a,e){var t=e[0],n=e[1],s=e[2],r=e[3],i=e[4],o=e[5],c=e[6],f=e[7],b=e[8],u=e[9],d=e[10],g=e[11],l=e[12],m=e[13],p=e[14],h=e[15],I=t*o-n*i,x=t*c-s*i,T=t*f-r*i,E=n*c-s*o,R=n*f-r*o,y=s*f-r*c,w=b*m-u*l,j=b*p-d*l,v=b*h-g*l,k=u*p-d*m,N=u*h-g*m,M=d*h-g*p,C=I*M-x*N+T*k+E*v-R*j+y*w;return C?(C=1/C,a[0]=(o*M-c*N+f*k)*C,a[1]=(s*N-n*M-r*k)*C,a[2]=(m*y-p*R+h*E)*C,a[3]=(d*R-u*y-g*E)*C,a[4]=(c*v-i*M-f*j)*C,a[5]=(t*M-s*v+r*j)*C,a[6]=(p*T-l*y-h*x)*C,a[7]=(b*y-d*T+g*x)*C,a[8]=(i*N-o*v+f*w)*C,a[9]=(n*v-t*N-r*w)*C,a[10]=(l*R-m*T+h*I)*C,a[11]=(u*T-b*R-g*I)*C,a[12]=(o*j-i*k-c*w)*C,a[13]=(t*k-n*j+s*w)*C,a[14]=(m*x-l*E-p*I)*C,a[15]=(b*E-u*x+d*I)*C,a):null}function Oa(a,e,t){var n=e[0],s=e[1],r=e[2],i=e[3],o=e[4],c=e[5],f=e[6],b=e[7],u=e[8],d=e[9],g=e[10],l=e[11],m=e[12],p=e[13],h=e[14],I=e[15],x=t[0],T=t[1],E=t[2],R=t[3];return a[0]=x*n+T*o+E*u+R*m,a[1]=x*s+T*c+E*d+R*p,a[2]=x*r+T*f+E*g+R*h,a[3]=x*i+T*b+E*l+R*I,x=t[4],T=t[5],E=t[6],R=t[7],a[4]=x*n+T*o+E*u+R*m,a[5]=x*s+T*c+E*d+R*p,a[6]=x*r+T*f+E*g+R*h,a[7]=x*i+T*b+E*l+R*I,x=t[8],T=t[9],E=t[10],R=t[11],a[8]=x*n+T*o+E*u+R*m,a[9]=x*s+T*c+E*d+R*p,a[10]=x*r+T*f+E*g+R*h,a[11]=x*i+T*b+E*l+R*I,x=t[12],T=t[13],E=t[14],R=t[15],a[12]=x*n+T*o+E*u+R*m,a[13]=x*s+T*c+E*d+R*p,a[14]=x*r+T*f+E*g+R*h,a[15]=x*i+T*b+E*l+R*I,a}function Eo(a,e){return a[0]=e[0],a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=e[1],a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=e[2],a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function Io(a,e,t,n){var s=e[0],r=e[1],i=e[2],o=e[3],c=s+s,f=r+r,b=i+i,u=s*c,d=s*f,g=s*b,l=r*f,m=r*b,p=i*b,h=o*c,I=o*f,x=o*b,T=n[0],E=n[1],R=n[2];return a[0]=(1-(l+p))*T,a[1]=(d+x)*T,a[2]=(g-I)*T,a[3]=0,a[4]=(d-x)*E,a[5]=(1-(u+p))*E,a[6]=(m+h)*E,a[7]=0,a[8]=(g+I)*R,a[9]=(m-h)*R,a[10]=(1-(u+l))*R,a[11]=0,a[12]=t[0],a[13]=t[1],a[14]=t[2],a[15]=1,a}function Ao(){var a=new Nt(3);return Nt!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a}function wo(a,e,t){return a[0]=e[0]*t[0],a[1]=e[1]*t[1],a[2]=e[2]*t[2],a}function sa(a,e,t){return a[0]=Math.min(e[0],t[0]),a[1]=Math.min(e[1],t[1]),a[2]=Math.min(e[2],t[2]),a}function na(a,e,t){return a[0]=Math.max(e[0],t[0]),a[1]=Math.max(e[1],t[1]),a[2]=Math.max(e[2],t[2]),a}function as(a,e,t){return a[0]=e[0]*t,a[1]=e[1]*t,a[2]=e[2]*t,a}function Ro(a,e,t){var n=e[0],s=e[1],r=e[2],i=t[3]*n+t[7]*s+t[11]*r+t[15];return i=i||1,a[0]=(t[0]*n+t[4]*s+t[8]*r+t[12])/i,a[1]=(t[1]*n+t[5]*s+t[9]*r+t[13])/i,a[2]=(t[2]*n+t[6]*s+t[10]*r+t[14])/i,a}var jo=wo;(function(){var a=Ao();return function(e,t,n,s,r,i){var o,c;for(t||(t=3),n||(n=0),s?c=Math.min(s*t+n,e.length):c=e.length,o=n;o<c;o+=t)a[0]=e[o],a[1]=e[o+1],a[2]=e[o+2],r(a,a,i),e[o]=a[0],e[o+1]=a[1],e[o+2]=a[2];return e}})();const Ie="dedup",Kt={keepUniqueNames:!1,propertyTypes:[A.ACCESSOR,A.MESH,A.TEXTURE,A.MATERIAL,A.SKIN]};function Ut(a=Kt){const e=nt(Kt,a),t=new Set(e.propertyTypes);for(const n of e.propertyTypes)if(!Kt.propertyTypes.includes(n))throw new Error(`${Ie}: Unsupported deduplication on type "${n}".`);return st(Ie,n=>{const s=n.getLogger();t.has(A.ACCESSOR)&&vo(n),t.has(A.TEXTURE)&&No(n,e),t.has(A.MATERIAL)&&Mo(n,e),t.has(A.MESH)&&ko(n,e),t.has(A.SKIN)&&So(n,e),s.debug(`${Ie}: Complete.`)})}function vo(a){const e=a.getLogger(),t=new Map,n=new Map,s=new Map,r=new Map,i=a.getRoot().listMeshes();i.forEach(u=>{u.listPrimitives().forEach(d=>{d.listAttributes().forEach(g=>o(g,n)),o(d.getIndices(),t)})});for(const u of a.getRoot().listAnimations())for(const d of u.listSamplers())o(d.getInput(),s),o(d.getOutput(),r);function o(u,d){if(!u)return;const g=[u.getCount(),u.getType(),u.getComponentType(),u.getNormalized(),u.getSparse()].join(":");let l=d.get(g);l||d.set(g,l=new Set),l.add(u)}function c(u,d){for(let g=0;g<u.length;g++){const l=u[g],m=O.toView(l.getArray());if(!d.has(l))for(let p=g+1;p<u.length;p++){const h=u[p];d.has(h)||O.equals(m,O.toView(h.getArray()))&&d.set(h,l)}}}let f=0;const b=new Map;for(const u of[n,t,s,r])for(const d of u.values())f+=d.size,c(Array.from(d),b);e.debug(`${Ie}: Merged ${b.size} of ${f} accessors.`),i.forEach(u=>{u.listPrimitives().forEach(d=>{d.listAttributes().forEach(l=>{b.has(l)&&d.swap(l,b.get(l))});const g=d.getIndices();g&&b.has(g)&&d.swap(g,b.get(g))})});for(const u of a.getRoot().listAnimations())for(const d of u.listSamplers()){const g=d.getInput(),l=d.getOutput();g&&b.has(g)&&d.swap(g,b.get(g)),l&&b.has(l)&&d.swap(l,b.get(l))}Array.from(b.keys()).forEach(u=>u.dispose())}function ko(a,e){const t=a.getLogger(),n=a.getRoot(),s=new Map;n.listAccessors().forEach((o,c)=>s.set(o,c)),n.listMaterials().forEach((o,c)=>s.set(o,c));const r=n.listMeshes().length,i=new Map;for(const o of n.listMeshes()){const c=[];for(const b of o.listPrimitives())c.push(rn(b,s));let f="";if(e.keepUniqueNames&&(f+=o.getName()+";"),f+=c.join(";"),i.has(f)){const b=i.get(f);o.listParents().forEach(u=>{u.propertyType!==A.ROOT&&u.swap(o,b)}),o.dispose()}else i.set(f,o)}t.debug(`${Ie}: Merged ${r-i.size} of ${r} meshes.`)}function No(a,e){const t=a.getLogger(),n=a.getRoot(),s=n.listTextures(),r=new Map;for(let i=0;i<s.length;i++){const o=s[i],c=o.getImage();if(!r.has(o))for(let f=i+1;f<s.length;f++){const b=s[f],u=b.getImage();if(r.has(b)||o.getMimeType()!==b.getMimeType()||e.keepUniqueNames&&o.getName()!==b.getName())continue;const d=o.getSize(),g=b.getSize();!d||!g||d[0]===g[0]&&d[1]===g[1]&&(!c||!u||O.equals(c,u)&&r.set(b,o))}}t.debug(`${Ie}: Merged ${r.size} of ${n.listTextures().length} textures.`),Array.from(r.entries()).forEach(([i,o])=>{i.listParents().forEach(c=>{c instanceof at||c.swap(i,o)}),i.dispose()})}function Mo(a,e){const t=a.getLogger(),s=a.getRoot().listMaterials(),r=new Map,i=new Map,o=new Set;e.keepUniqueNames||o.add("name");for(let c=0;c<s.length;c++){const f=s[c];if(!r.has(f)&&!ss(f,i))for(let b=c+1;b<s.length;b++){const u=s[b];r.has(u)||ss(u,i)||f.equals(u,o)&&r.set(u,f)}}t.debug(`${Ie}: Merged ${r.size} of ${s.length} materials.`),Array.from(r.entries()).forEach(([c,f])=>{c.listParents().forEach(b=>{b instanceof at||b.swap(c,f)}),c.dispose()})}function So(a,e){const t=a.getLogger(),s=a.getRoot().listSkins(),r=new Map,i=new Set(["joints"]);e.keepUniqueNames||i.add("name");for(let o=0;o<s.length;o++){const c=s[o];if(!r.has(c))for(let f=o+1;f<s.length;f++){const b=s[f];r.has(b)||c.equals(b,i)&&go(c.listJoints(),b.listJoints())&&r.set(b,c)}}t.debug(`${Ie}: Merged ${r.size} of ${s.length} skins.`),Array.from(r.entries()).forEach(([o,c])=>{o.listParents().forEach(f=>{f instanceof at||f.swap(o,c)}),o.dispose()})}function rn(a,e){const t=[];for(const n of a.listSemantics()){const s=a.getAttribute(n);t.push(n+":"+e.get(s))}if(a instanceof H){const n=a.getIndices();n&&t.push("indices:"+e.get(n));const s=a.getMaterial();s&&t.push("material:"+e.get(s)),t.push("mode:"+a.getMode());for(const r of a.listTargets())t.push("target:"+rn(r,e))}return t.join(",")}function ss(a,e){if(e.has(a))return e.get(a);const t=a.getGraph(),n=new Set,s=t.listParentEdges(a);for(;s.length>0;){const r=s.pop();if(r.getAttributes().modifyChild===!0)return e.set(a,!0),!0;const i=r.getChild();if(!n.has(i))for(const o of t.listChildEdges(i))s.push(o)}return e.set(a,!1),!1}function on(){var a=new Nt(4);return Nt!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),a}function Co(a,e,t){return a[0]=e[0]+t[0],a[1]=e[1]+t[1],a[2]=e[2]+t[2],a[3]=e[3]+t[3],a}function Oo(a,e,t){return a[0]=e[0]-t[0],a[1]=e[1]-t[1],a[2]=e[2]-t[2],a[3]=e[3]-t[3],a}function _o(a,e,t){return a[0]=e[0]*t[0],a[1]=e[1]*t[1],a[2]=e[2]*t[2],a[3]=e[3]*t[3],a}function Fo(a,e,t){return a[0]=e[0]*t,a[1]=e[1]*t,a[2]=e[2]*t,a[3]=e[3]*t,a}function Do(a){var e=a[0],t=a[1],n=a[2],s=a[3];return Math.hypot(e,t,n,s)}var cn=Oo,Uo=_o,fn=Do;(function(){var a=on();return function(e,t,n,s,r,i){var o,c;for(t||(t=4),n||(n=0),s?c=Math.min(s*t+n,e.length):c=e.length,o=n;o<c;o+=t)a[0]=e[o],a[1]=e[o+1],a[2]=e[o+2],a[3]=e[o+3],r(a,a,i),e[o]=a[0],e[o+1]=a[1],e[o+2]=a[2],e[o+3]=a[3];return e}})();const Bo=/color|emissive|diffuse/i;function Lo(a){return a.getGraph().listParentEdges(a).some(s=>s.getAttributes().isColor||Bo.test(s.getName()))?"srgb":null}function Go(a){const e=a.getGraph(),t=new Set,n=new Set;function s(r){const i=new Set;for(const o of e.listChildEdges(r))o.getChild()instanceof ut&&i.add(o.getName()+"Info");for(const o of e.listChildEdges(r)){const c=o.getChild();t.has(c)||(t.add(c),c instanceof U&&i.has(o.getName())?n.add(c):c instanceof V&&s(c))}}return s(a),Array.from(n)}function zo(a){const t=fe.fromGraph(a.getGraph()).getRoot(),n=a.getGraph().listParentEdges(a).filter(s=>s.getParent()!==t).map(s=>s.getName());return Array.from(new Set(n))}const Xe="prune",ra=3/255,ns={propertyTypes:[A.NODE,A.SKIN,A.MESH,A.CAMERA,A.PRIMITIVE,A.PRIMITIVE_TARGET,A.ANIMATION,A.MATERIAL,A.TEXTURE,A.ACCESSOR,A.BUFFER],keepLeaves:!1,keepAttributes:!1,keepIndices:!1,keepSolidTextures:!1,keepExtras:!1};function Bt(a=ns){const e=nt(ns,a),t=new Set(e.propertyTypes),n=e.keepExtras;return st(Xe,async s=>{const r=s.getLogger(),i=s.getRoot(),o=s.getGraph(),c=new Po,f=b=>c.dispose(b.target);if(o.addEventListener("node:dispose",f),t.has(A.MESH))for(const b of i.listMeshes())b.listPrimitives().length>0||b.dispose();if(t.has(A.NODE)){if(!e.keepLeaves)for(const b of i.listScenes())bn(o,b,n);for(const b of i.listNodes())ne(b,n)}if(t.has(A.SKIN))for(const b of i.listSkins())ne(b,n);if(t.has(A.MESH))for(const b of i.listMeshes())ne(b,n);if(t.has(A.CAMERA))for(const b of i.listCameras())ne(b,n);if(t.has(A.PRIMITIVE)&&rs(o,A.PRIMITIVE,n),t.has(A.PRIMITIVE_TARGET)&&rs(o,A.PRIMITIVE_TARGET,n),!e.keepAttributes&&t.has(A.ACCESSOR)){const b=new Map;for(const u of i.listMeshes())for(const d of u.listPrimitives()){const g=d.getMaterial();if(!g)continue;const l=dn(s,d,g),m=Ho(d,l);is(d,m),d.listTargets().forEach(p=>is(p,m)),b.has(g)?b.get(g).add(d):b.set(g,new Set([d]))}for(const[u,d]of b)qo(u,Array.from(d))}if(!e.keepIndices&&t.has(A.ACCESSOR))for(const b of i.listMeshes())for(const u of b.listPrimitives())Vo(u);if(t.has(A.ANIMATION))for(const b of i.listAnimations()){for(const u of b.listChannels())u.getTargetNode()||u.dispose();if(b.listChannels().length)b.listSamplers().forEach(u=>ne(u,n));else{const u=b.listSamplers();ne(b,n),u.forEach(d=>ne(d,n))}}if(t.has(A.MATERIAL)&&i.listMaterials().forEach(b=>ne(b,n)),t.has(A.TEXTURE)&&(i.listTextures().forEach(b=>ne(b,n)),e.keepSolidTextures||await Ko(s)),t.has(A.ACCESSOR)&&i.listAccessors().forEach(b=>ne(b,n)),t.has(A.BUFFER)&&i.listBuffers().forEach(b=>ne(b,n)),o.removeEventListener("node:dispose",f),c.empty())r.debug(`${Xe}: No unused properties found.`);else{const b=c.entries().map(([u,d])=>`${u} (${d})`).join(", ");r.info(`${Xe}: Removed types... ${b}`)}r.debug(`${Xe}: Complete.`)})}class Po{constructor(){this.disposed={}}empty(){for(const e in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(e){this.disposed[e.propertyType]=this.disposed[e.propertyType]||0,this.disposed[e.propertyType]++}}function ne(a,e){const t=a.listParents().filter(s=>!(s instanceof at||s instanceof et)),n=e&&!nn(a.getExtras());!t.length&&!n&&a.dispose()}function rs(a,e,t){for(const n of a.listEdges()){const s=n.getParent();s.propertyType===e&&ne(s,t)}}function bn(a,e,t){if(e.listChildren().forEach(i=>bn(a,i,t)),e instanceof Ft)return;const n=a.listParentEdges(e).some(i=>{const o=i.getParent().propertyType;return o!==A.ROOT&&o!==A.SCENE&&o!==A.NODE}),s=a.listChildren(e).length===0,r=t&&!nn(e.getExtras());s&&!n&&!r&&e.dispose()}function is(a,e){for(const t of e)a.setAttribute(t,null)}function Vo(a){const e=a.getIndices(),t=e&&e.getArray(),n=a.listAttributes()[0];if(!(!t||!n)&&e.getCount()===n.getCount()){for(let s=0,r=t.length;s<r;s++)if(s!==t[s])return;a.setIndices(null)}}function Ho(a,e){const t=[];for(const n of a.listSemantics())(n==="NORMAL"&&!e.has(n)||n==="TANGENT"&&!e.has(n)||n.startsWith("TEXCOORD_")&&!e.has(n)||n.startsWith("COLOR_")&&n!=="COLOR_0")&&t.push(n);return t}function dn(a,e,t,n=new Set){const r=a.getGraph().listChildEdges(t),i=new Set;for(const f of r)f.getChild()instanceof ut&&i.add(f.getName());for(const f of r){const b=f.getName(),u=f.getChild();u instanceof U&&i.has(b.replace(/Info$/,""))&&n.add(`TEXCOORD_${u.getTexCoord()}`),u instanceof ut&&b.match(/normalTexture/i)&&n.add("TANGENT"),u instanceof V&&dn(a,e,u,n)}const o=t instanceof ye&&!t.getExtension("KHR_materials_unlit"),c=e.getMode()===H.Mode.POINTS;return o&&!c&&n.add("NORMAL"),n}function qo(a,e){const t=Go(a),n=new Set(t.map(c=>c.getTexCoord())),s=Array.from(n).sort(),r=new Map(s.map((c,f)=>[c,f])),i=new Map(s.map((c,f)=>[`TEXCOORD_${c}`,`TEXCOORD_${f}`]));for(const c of t){const f=c.getTexCoord();c.setTexCoord(r.get(f))}for(const c of e){const f=c.listSemantics().filter(b=>b.startsWith("TEXCOORD_")).sort();o(c,f),c.listTargets().forEach(b=>o(b,f))}function o(c,f){for(const b of f){const u=c.getAttribute(b);if(!u)continue;const d=i.get(b);d!==b&&(c.setAttribute(d,u),c.setAttribute(b,null))}}}async function Ko(a){const e=a.getRoot(),t=a.getGraph(),n=a.getLogger(),r=e.listTextures().map(async i=>{var o;const c=await Xo(i);if(!c)return;Lo(i)==="srgb"&&jn.convertSRGBToLinear(c,c);const f=i.getName()||i.getURI(),b=(o=i.getSize())==null?void 0:o.join("x"),u=zo(i);for(const d of t.listParentEdges(i)){const g=d.getParent();g!==e&&Wo(g,c,d.getName(),n)&&d.dispose()}i.listParents().length===1&&(i.dispose(),n.debug(`${Xe}: Removed solid-color texture "${f}" (${b}px ${u.join(", ")})`))});await Promise.all(r)}function Wo(a,e,t,n){if(a instanceof ye)switch(t){case"baseColorTexture":return a.setBaseColorFactor(Uo(e,e,a.getBaseColorFactor())),!0;case"emissiveTexture":return a.setEmissiveFactor(jo([0,0,0],e.slice(0,3),a.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(e[0]-1)<=ra;case"metallicRoughnessTexture":return a.setRoughnessFactor(e[1]*a.getRoughnessFactor()),a.setMetallicFactor(e[2]*a.getMetallicFactor()),!0;case"normalTexture":return fn(cn(on(),e,[.5,.5,1,1]))<=ra}return n.warn(`${Xe}: Detected single-color ${t} texture. Pruning ${t} not yet supported.`),!1}async function Xo(a){const e=await Jo(a);if(!e)return null;const t=[1/0,1/0,1/0,1/0],n=[-1/0,-1/0,-1/0,-1/0],s=[0,0,0,0],[r,i]=e.shape;for(let o=0;o<r;o++){for(let c=0;c<i;c++)for(let f=0;f<4;f++)t[f]=Math.min(t[f],e.get(o,c,f)),n[f]=Math.max(n[f],e.get(o,c,f));if(fn(cn(s,n,t))/255>ra)return null}return Fo(s,Co(s,n,t),.5/255)}async function Jo(a){try{return await Br(a.getImage(),a.getMimeType())}catch{return null}}const Te=2**32-1;class Yo{constructor(e){this.attributes=[],this.u8=void 0,this.u32=void 0;let t=0;for(const n of Ca(e))t+=this._initAttribute(n);this.u8=new Uint8Array(t),this.u32=new Uint32Array(this.u8.buffer)}_initAttribute(e){const t=e.getArray(),n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=e.getElementSize()*e.getComponentSize(),r=O.padNumber(s);return this.attributes.push({u8:n,byteStride:s,paddedByteStride:r}),r}hash(e){let t=0;for(const{u8:n,byteStride:s,paddedByteStride:r}of this.attributes){for(let i=0;i<r;i++)i<s?this.u8[t+i]=n[e*s+i]:this.u8[t+i]=0;t+=r}return Qo(0,this.u32)}equal(e,t){for(const{u8:n,byteStride:s}of this.attributes)for(let r=0;r<s;r++)if(n[e*s+r]!==n[t*s+r])return!1;return!0}}function Qo(a,e){for(let s=0,r=e.length;s<r;s++){let i=e[s];i=Math.imul(i,1540483477)>>>0,i=(i^i>>24)>>>0,i=Math.imul(i,1540483477)>>>0,a=Math.imul(a,1540483477)>>>0,a=(a^i)>>>0}return a}function $o(a,e,t,n,s=Te){const r=e-1;let o=t.hash(n)&r;for(let c=0;c<=r;c++){const f=a[o];if(f===s||t.equal(f,n))return o;o=o+c+1&r}throw new Error("Hash table full.")}var J;(function(a){a.RENDER="render",a.RENDER_CACHED="render-cached",a.UPLOAD="upload",a.UPLOAD_NAIVE="upload-naive",a.DISTINCT="distinct",a.DISTINCT_POSITION="distinct-position",a.UNUSED="unused"})(J||(J={}));function ge(a,e){const t=a.getAttribute("POSITION"),n=a.getIndices();switch(e){case J.RENDER:return n?n.getCount():t.getCount();case J.RENDER_CACHED:return n?new Set(n.getArray()).size:t.getCount();case J.UPLOAD_NAIVE:case J.UPLOAD:return t.getCount();case J.DISTINCT:case J.DISTINCT_POSITION:return Zo(e);case J.UNUSED:return n?t.getCount()-new Set(n.getArray()).size:0;default:return ec(e)}}function Zo(a){throw new Error(`Not implemented: ${a}`)}function ec(a){throw new Error(`Unexpected value: ${a}`)}function Mt(a,e,t){const n=fe.fromGraph(a.getGraph());(!e||!t)&&([e,t]=tc(a));const s=a.getIndices(),r=s?s.getArray():null,i=ge(a,J.RENDER),o=n.createAccessor(),c=i,f=sn(c,t);for(let u=0;u<c;u++)f[u]=e[r?r[u]:u];a.setIndices(o.setArray(f));const b=Ca(a);for(const u of a.listAttributes()){const d=Ze(n,u);ia(u,s,e,d,t),a.swap(u,d)}for(const u of a.listTargets())for(const d of u.listAttributes()){const g=Ze(n,d);ia(d,s,e,g,t),u.swap(d,g)}s&&s.listParents().length===1&&s.dispose();for(const u of b)u.listParents().length===1&&u.dispose();return a}function ia(a,e,t,n,s){const r=a.getElementSize(),i=a.getArray(),o=e?e.getArray():null,c=e?e.getCount():a.getCount(),f=new i.constructor(s*r),b=new Uint8Array(s);for(let u=0;u<c;u++){const d=o?o[u]:u,g=t[d];if(!b[g]){for(let l=0;l<r;l++)f[g*r+l]=i[d*r+l];b[g]=1}}return n.setArray(f)}function tc(a){const e=ge(a,J.UPLOAD),t=a.getIndices(),n=t?t.getArray():null;if(!t||!n)return[po(e,1e6),e];const s=new Uint32Array(e).fill(Te);let r=0;for(let i=0;i<n.length;i++){const o=n[i];s[o]===Te&&(s[o]=r++)}return[s,r]}const oa="weld",St={overwrite:!0,cleanup:!0};function un(a=St){const e=nt(St,a);return st(oa,async t=>{const n=t.getLogger();for(const s of t.getRoot().listMeshes()){for(const r of s.listPrimitives())hn(r,e),ge(r,J.RENDER)===0&&r.dispose();s.listPrimitives().length===0&&s.dispose()}e.cleanup&&await t.transform(Bt({propertyTypes:[A.ACCESSOR,A.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),Ut({propertyTypes:[A.ACCESSOR]})),n.debug(`${oa}: Complete.`)})}function hn(a,e=St){const t=a.getGraph(),s=fe.fromGraph(t).getLogger(),r=Pe({},St,e);if(a.getIndices()&&!r.overwrite||a.getMode()===H.Mode.POINTS)return;const i=a.getAttribute("POSITION").getCount(),o=a.getIndices(),c=o==null?void 0:o.getArray(),f=o?o.getCount():i,b=new Yo(a),u=mo(i+i/4),d=new Uint32Array(u).fill(Te),g=new Uint32Array(i).fill(Te);let l=0;for(let m=0;m<f;m++){const p=c?c[m]:m;if(g[p]!==Te)continue;const h=$o(d,u,b,p,Te),I=d[h];I===Te?(d[h]=p,g[p]=l++):g[p]=g[I]}s.debug(`${oa}: ${Dt(i,l)} vertices.`),Mt(a,g,l)}S.ComponentType;const{LINES:Pc,LINE_STRIP:Vc,LINE_LOOP:Hc,TRIANGLES:ac,TRIANGLE_STRIP:sc,TRIANGLE_FAN:nc}=H.Mode;function rc(a){const e=a.getGraph(),t=fe.fromGraph(e);a.getIndices()||hn(a);const n=a.getIndices(),s=n.getArray(),r=uo(a),i=pt[n.getComponentType()],o=new i(r*3),c=a.getMode();if(c===sc)for(let b=0,u=s.length;b<u-2;b++)b%2?(o[b*3]=s[b+1],o[b*3+1]=s[b],o[b*3+2]=s[b+2]):(o[b*3]=s[b],o[b*3+1]=s[b+1],o[b*3+2]=s[b+2]);else if(c===nc)for(let b=0;b<r;b++)o[b*3]=s[0],o[b*3+1]=s[b+1],o[b*3+2]=s[b+2];else throw new Error("Only TRIANGLE_STRIP and TRIANGLE_FAN may be converted to TRIANGLES.");a.setMode(ac);const f=t.getRoot();n.listParents().some(b=>b!==f&&b!==a)?a.setIndices(Ze(t,n).setArray(o)):n.setArray(o)}function ca(a,e,t){const n=new Float32Array(a.length);for(let s=0,r=a.length;s<r;s++)t?n[s]=F.decodeNormalizedInt(a[s],e):n[s]=a[s];return n}const Wt="flatten",os={cleanup:!0};function ic(a=os){const e=nt(os,a);return st(Wt,async t=>{const n=t.getRoot(),s=t.getLogger(),r=new Set;for(const f of n.listSkins())for(const b of f.listJoints())r.add(b);const i=new Set;for(const f of n.listAnimations())for(const b of f.listChannels()){const u=b.getTargetNode();u&&b.getTargetPath()!=="weights"&&i.add(u)}const o=new Set,c=new Set;for(const f of n.listScenes())f.traverse(b=>{const u=b.getParentNode();u&&((r.has(u)||o.has(u))&&o.add(b),(i.has(u)||c.has(u))&&c.add(b))});for(const f of n.listScenes())f.traverse(b=>{i.has(b)||o.has(b)||c.has(b)||xo(b)});i.size&&s.debug(`${Wt}: Flattening node hierarchies with TRS animation not yet supported.`),e.cleanup&&await t.transform(Bt({propertyTypes:[A.NODE],keepLeaves:!1})),s.debug(`${Wt}: Complete.`)})}H.Mode;function oc(a,e=1/0){if(Number.isFinite(e)&&e%4||e<=0)throw new Error("Limit must be positive multiple of four.");const t=a.getAttribute("POSITION").getCount(),n=a.listSemantics().filter(f=>f.startsWith("WEIGHTS_")).length,s=new Uint16Array(n*4),r=new Float32Array(n*4),i=new Float32Array(n*4),o=new Uint32Array(n*4),c=new Uint32Array(n*4);for(let f=0;f<t;f++){Ct(a,f,"WEIGHTS",r),Ct(a,f,"JOINTS",o);for(let b=0;b<n*4;b++)s[b]=b;s.sort((b,u)=>r[b]>r[u]?-1:1);for(let b=0;b<s.length;b++)i[b]=r[s[b]],c[b]=o[s[b]];Ot(a,f,"WEIGHTS",i),Ot(a,f,"JOINTS",c)}for(let f=n;f*4>e;f--){const b=a.getAttribute(`WEIGHTS_${f-1}`),u=a.getAttribute(`JOINTS_${f-1}`);a.setAttribute(`WEIGHTS_${f-1}`,null),a.setAttribute(`JOINTS_${f-1}`,null),b.listParents().length===1&&b.dispose(),u.listParents().length===1&&u.dispose()}cc(a)}function cc(a){if(!fc(a))return;const e=a.getAttribute("POSITION").getCount(),t=a.listSemantics().filter(u=>u.startsWith("WEIGHTS_")).length,n=a.getAttribute("WEIGHTS_0"),s=n.getArray(),r=n.getComponentType(),i=n.getNormalized(),o=i?r:void 0,c=i?F.decodeNormalizedInt(1,r):Number.EPSILON,f=new Uint32Array(t*4).fill(0),b=s.slice(0,t*4).fill(0);for(let u=0;u<e;u++){Ct(a,u,"JOINTS",f),Ct(a,u,"WEIGHTS",b,o);let d=cs(b,o);if(d!==0&&d!==1){if(Math.abs(1-d)>c)for(let g=0;g<b.length;g++)if(i){const l=F.decodeNormalizedInt(b[g],r);b[g]=F.encodeNormalizedInt(l/d,r)}else b[g]/=d;if(d=cs(b,o),i&&d!==1){for(let g=b.length-1;g>=0;g--)if(b[g]>0){const l=1-d;b[g]+=Math.sign(l)*F.encodeNormalizedInt(Math.abs(l),r);break}}}for(let g=b.length-1;g>=0;g--)b[g]===0&&(f[g]=0);Ot(a,u,"JOINTS",f),Ot(a,u,"WEIGHTS",b,o)}}function Ct(a,e,t,n,s){let r;const i=[0,0,0,0];for(let o=0;r=a.getAttribute(`${t}_${o}`);o++){r.getElement(e,i);for(let c=0;c<4;c++)s?n[o*4+c]=F.encodeNormalizedInt(i[c],s):n[o*4+c]=i[c]}return n}function Ot(a,e,t,n,s){let r;const i=[0,0,0,0];for(let o=0;r=a.getAttribute(`${t}_${o}`);o++){for(let c=0;c<4;c++)s?i[c]=F.decodeNormalizedInt(n[o*4+c],s):i[c]=n[o*4+c];r.setElement(e,i)}}function cs(a,e){let t=0;for(let n=0;n<a.length;n++)e?t+=F.decodeNormalizedInt(a[n],e):t+=a[n];return t}function fc(a){const e=a.listSemantics().filter(s=>s.startsWith("WEIGHTS_")).map(s=>a.getAttribute(s)),t=e.map(s=>s.getNormalized()),n=e.map(s=>s.getComponentType());return new Set(t).size===1&&new Set(n).size===1}const Ee="quantize",bc=[Int8Array,Int16Array,Int32Array],{TRANSLATION:dc,ROTATION:uc,SCALE:hc,WEIGHTS:lc}=et.TargetPath,gc=[dc,uc,hc],At={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0,cleanup:!0};function fs(a=At){const e=nt(At,Pe({patternTargets:a.pattern||At.pattern},a));return st(Ee,async t=>{const n=t.getLogger(),s=t.getRoot();let r;e.quantizationVolume==="scene"&&(r=ds(Ac(s.listMeshes().map(us))));for(const o of t.getRoot().listMeshes()){e.quantizationVolume==="mesh"&&(r=ds(us(o))),r&&e.pattern.test("POSITION")&&(pc(t,o,r),xc(o,1/r.scale));for(const c of o.listPrimitives()){const f=ge(c,J.RENDER),b=ge(c,J.UPLOAD);f<b/2&&Mt(c),bs(t,c,r,e);for(const u of c.listTargets())bs(t,u,r,e)}}s.listMeshes().flatMap(o=>o.listPrimitives()).some(ln)&&t.createExtension(Sa).setRequired(!0),e.cleanup&&await t.transform(Bt({propertyTypes:[A.ACCESSOR,A.SKIN,A.MATERIAL],keepAttributes:!0,keepIndices:!0,keepLeaves:!0,keepSolidTextures:!0}),Ut({propertyTypes:[A.ACCESSOR,A.MATERIAL,A.SKIN],keepUniqueNames:!0})),n.debug(`${Ee}: Complete.`)})}function bs(a,e,t,n){const s=e instanceof vs,r=a.getLogger();for(const i of e.listSemantics()){if(!s&&!n.pattern.test(i)||s&&!n.patternTargets.test(i))continue;const o=e.getAttribute(i),{bits:c,ctor:f}=Ec(i,o,r,n);if(!f)continue;if(c<8||c>16)throw new Error(`${Ee}: Requires bits = 8–16.`);if(o.getComponentSize()<=c/8)continue;const b=o.clone();if(i==="POSITION"){const u=t.scale,d=[];e instanceof H?To(d,Lt(t)):Eo(d,[1/u,1/u,1/u]);for(let g=0,l=[0,0,0],m=b.getCount();g<m;g++)b.getElement(g,l),b.setElement(g,Ro(l,l,d))}Tc(b,f,c),e.setAttribute(i,b)}if(n.normalizeWeights&&e.getAttribute("WEIGHTS_0")&&oc(e,1/0),e instanceof H&&e.getIndices()&&e.listAttributes().length&&e.listAttributes()[0].getCount()<65535){const i=e.getIndices();i.setArray(new Uint16Array(i.getArray()))}}function ds(a){const{min:e,max:t}=a,n=Math.max((t[0]-e[0])/2,(t[1]-e[1])/2,(t[2]-e[2])/2);return{offset:[e[0]+(t[0]-e[0])/2,e[1]+(t[1]-e[1])/2,e[2]+(t[2]-e[2])/2],scale:n}}function pc(a,e,t){const n=Lt(t);for(const s of e.listParents()){if(!(s instanceof la))continue;const r=s.listParents().filter(d=>d instanceof et),i=r.some(d=>gc.includes(d.getTargetPath())),o=s.listChildren().length>0,c=s.getSkin();if(c){s.setSkin(mc(c,t));continue}const f=s.getExtension("EXT_mesh_gpu_instancing");if(f){s.setExtension("EXT_mesh_gpu_instancing",yc(f,t));continue}let b;o||i?(b=a.createNode("").setMesh(e),s.addChild(b).setMesh(null),r.filter(d=>d.getTargetPath()===lc).forEach(d=>d.setTargetNode(b))):b=s;const u=b.getMatrix();Oa(u,u,n),b.setMatrix(u)}}function mc(a,e){a=a.clone();const t=Lt(e),n=a.getInverseBindMatrices().clone(),s=[];for(let r=0,i=n.getCount();r<i;r++)n.getElement(r,s),Oa(s,s,t),n.setElement(r,s);return a.setInverseBindMatrices(n)}function yc(a,e){var t,n,s;if(!a.getAttribute("TRANSLATION")&&!a.getAttribute("ROTATION")&&!a.getAttribute("SCALE"))return a;a=a.clone();const r=(t=a.getAttribute("TRANSLATION"))==null?void 0:t.clone(),i=(n=a.getAttribute("ROTATION"))==null?void 0:n.clone(),o=(s=a.getAttribute("SCALE"))==null?void 0:s.clone(),c=r||i||o,f=[0,0,0],b=[0,0,0,1],u=[1,1,1],d=[0,0,0],g=[0,0,0,1],l=[1,1,1],m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p=Lt(e);for(let h=0,I=c.getCount();h<I;h++)F.compose(r?r.getElement(h,d):f,i?i.getElement(h,g):b,o?o.getElement(h,l):u,m),Oa(m,m,p),F.decompose(m,d,g,l),r&&r.setElement(h,d),i&&i.setElement(h,g),o&&o.setElement(h,l);return r&&a.setAttribute("TRANSLATION",r),i&&a.setAttribute("ROTATION",i),o&&a.setAttribute("SCALE",o),a}function xc(a,e){for(const t of a.listPrimitives()){let n=t.getMaterial();if(!n)continue;let s=n.getExtension("KHR_materials_volume");!s||s.getThicknessFactor()<=0||(s=s.clone().setThicknessFactor(s.getThicknessFactor()*e),n=n.clone().setExtension("KHR_materials_volume",s),t.setMaterial(n))}}function Tc(a,e,t){const n=new e(a.getArray().length),s=bc.includes(e)?1:0,r=t-s,i=e.BYTES_PER_ELEMENT*8-s,o=Math.pow(2,r)-1,c=i-r,f=2*r-i,b=[s>0?-1:0,1];for(let u=0,d=0,g=[];u<a.getCount();u++){a.getElement(u,g);for(let l=0;l<g.length;l++){let m=wc(g[l],b);m=Math.round(Math.abs(m)*o),m=m<<c|m>>f,n[d++]=m*Math.sign(g[l])}}a.setArray(n).setNormalized(!0).setSparse(!1)}function Ec(a,e,t,n){const s=e.getMinNormalized([]),r=e.getMaxNormalized([]);let i,o;if(a==="POSITION")i=n.quantizePosition,o=i<=8?Int8Array:Int16Array;else if(a==="NORMAL"||a==="TANGENT")i=n.quantizeNormal,o=i<=8?Int8Array:Int16Array;else if(a.startsWith("COLOR_"))i=n.quantizeColor,o=i<=8?Uint8Array:Uint16Array;else if(a.startsWith("TEXCOORD_")){if(s.some(c=>c<0)||r.some(c=>c>1))return t.warn(`${Ee}: Skipping ${a}; out of [0,1] range.`),{bits:-1};i=n.quantizeTexcoord,o=i<=8?Uint8Array:Uint16Array}else{if(a.startsWith("JOINTS_"))return i=Math.max(...e.getMax([]))<=255?8:16,o=i<=8?Uint8Array:Uint16Array,e.getComponentSize()>i/8&&e.setArray(new o(e.getArray())),{bits:-1};if(a.startsWith("WEIGHTS_")){if(s.some(c=>c<0)||r.some(c=>c>1))return t.warn(`${Ee}: Skipping ${a}; out of [0,1] range.`),{bits:-1};i=n.quantizeWeight,o=i<=8?Uint8Array:Uint16Array}else if(a.startsWith("_")){if(s.some(c=>c<-1)||r.some(c=>c>1))return t.warn(`${Ee}: Skipping ${a}; out of [-1,1] range.`),{bits:-1};i=n.quantizeGeneric,o=s.some(c=>c<0)?o=i<=8?Int8Array:Int16Array:o=i<=8?Uint8Array:Uint16Array}else throw new Error(`${Ee}: Unexpected semantic, "${a}".`)}return{bits:i,ctor:o}}function us(a){const e=[],t=[];for(const s of a.listPrimitives()){const r=s.getAttribute("POSITION");r&&e.push(r);for(const i of s.listTargets()){const o=i.getAttribute("POSITION");o&&t.push(o)}}if(e.length===0)throw new Error(`${Ee}: Missing "POSITION" attribute.`);const n=hs(e,3);if(t.length>0){const{min:s,max:r}=hs(t,3);sa(n.min,n.min,sa(s,as(s,s,2),[0,0,0])),na(n.max,n.max,na(r,as(r,r,2),[0,0,0]))}return n}function Ic(a,e){const t=e.getComponentSize();if(a==="POSITION"||a==="NORMAL"||a==="TANGENT")return t<4;if(a.startsWith("TEXCOORD_")){const n=e.getComponentType(),s=e.getNormalized();return t<4&&!(s&&n===S.ComponentType.UNSIGNED_BYTE)&&!(s&&n===S.ComponentType.UNSIGNED_SHORT)}return!1}function ln(a){for(const e of a.listSemantics()){const t=a.getAttribute("POSITION");if(Ic(e,t))return!0}return a.propertyType===A.PRIMITIVE?a.listTargets().some(ln):!1}function hs(a,e){const t=new Array(e).fill(1/0),n=new Array(e).fill(-1/0),s=[],r=[];for(const i of a){i.getMinNormalized(s),i.getMaxNormalized(r);for(let o=0;o<e;o++)t[o]=Math.min(t[o],s[o]),n[o]=Math.max(n[o],r[o])}return{min:t,max:n}}function Ac(a){const e=a[0];for(const t of a)sa(e.min,e.min,t.min),na(e.max,e.max,t.max);return e}function Lt(a){return Io([],[0,0,0,1],a.offset,[a.scale,a.scale,a.scale])}function wc(a,e){return Math.min(Math.max(a,e[0]),e[1])}Pe({level:"high"},At);const Rc="unweld";function jc(a,e=new Map){const t=a.getIndices();if(!t)return;const n=a.getGraph(),s=fe.fromGraph(n),r=s.getLogger(),i=a.getAttribute("POSITION").getCount();for(const c of a.listAttributes())a.swap(c,ls(s,c,t,e)),c.listParents().length===1&&c.dispose();for(const c of a.listTargets())for(const f of c.listAttributes())c.swap(f,ls(s,f,t,e)),f.listParents().length===1&&f.dispose();const o=a.getAttribute("POSITION").getCount();r.debug(`${Rc}: ${Dt(i,o)} vertices.`),a.setIndices(null),t.listParents().length===1&&t.dispose()}function ls(a,e,t,n){if(n.has(e)&&n.get(e).has(t))return n.get(e).get(t);const s=e.getArray(),r=s.constructor,i=new r(t.getCount()*e.getElementSize()),o=t.getArray(),c=e.getElementSize();for(let b=0,u=t.getCount();b<u;b++)for(let d=0;d<c;d++)i[b*c+d]=s[o[b]*c+d];n.has(e)||n.set(e,new Map);const f=Ze(a,e).setArray(i);return n.get(e).set(t,f),f}var gs;(function(a){a[a.STEP=0]="STEP",a[a.LERP=1]="LERP",a[a.SLERP=2]="SLERP"})(gs||(gs={}));const vc=1e-6;function kc(a,e,t,n=1e-4){const s=e.length/a.length,r=new Array(s).fill(0),i=new Array(s).fill(0),o=new Array(s).fill(0),c=new Array(s).fill(0),f=a.length-1;let b=1;for(let u=1;u<f;++u){const d=a[b-1],g=a[u],l=a[u+1],m=(g-d)/(l-d);let p=!1;if(g!==l&&(u!==1||g!==a[0]))if(it(e,b-1,c),it(e,u,i),it(e,u+1,o),t==="slerp"){const h=Sc(r,c,o,m),I=ms(c,i)+ms(i,o);p=!Et(i,h,n)||I+Number.EPSILON>=Math.PI}else if(t==="lerp"){const h=Mc(r,c,o,m);p=!Et(i,h,n)}else t==="step"&&(p=!Et(i,c)||!Et(i,o));p&&(u!==b&&(a[b]=a[u],ps(e,b,it(e,u,r))),b++)}return f>0&&(a[b]=a[f],ps(e,b,it(e,f,r)),b++),b}function it(a,e,t){for(let n=0,s=t.length;n<s;n++)t[n]=a[e*s+n];return t}function ps(a,e,t){for(let n=0,s=t.length;n<s;n++)a[e*s+n]=t[n]}function Et(a,e,t=0){if(a.length!==e.length)return!1;for(let n=0;n<a.length;n++)if(Math.abs(a[n]-e[n])>t)return!1;return!0}function Nc(a,e,t){return a*(1-t)+e*t}function Mc(a,e,t,n){for(let s=0;s<e.length;s++)a[s]=Nc(e[s],t[s],n);return a}function Sc(a,e,t,n){let s=e[0],r=e[1],i=e[2],o=e[3],c=t[0],f=t[1],b=t[2],u=t[3],d,g,l,m,p;return g=s*c+r*f+i*b+o*u,g<0&&(g=-g,c=-c,f=-f,b=-b,u=-u),1-g>vc?(d=Math.acos(g),l=Math.sin(d),m=Math.sin((1-n)*d)/l,p=Math.sin(n*d)/l):(m=1-n,p=n),a[0]=m*s+p*c,a[1]=m*r+p*f,a[2]=m*i+p*b,a[3]=m*o+p*u,a}function ms(a,e){const t=Cc(a,e);return Math.acos(2*t*t-1)}function Cc(a,e){return a[0]*e[0]+a[1]*e[1]+a[2]*e[2]+a[3]*e[3]}Promise.resolve();const Ge="simplify",{POINTS:gn,LINES:Oc,LINE_STRIP:_c,LINE_LOOP:Fc,TRIANGLES:Dc,TRIANGLE_STRIP:pn,TRIANGLE_FAN:mn}=H.Mode,yn={ratio:0,error:1e-4,lockBorder:!1,cleanup:!0};function Uc(a){const e=nt(yn,a),t=e.simplifier;if(!t)throw new Error(`${Ge}: simplifier dependency required — install "meshoptimizer".`);return st(Ge,async n=>{const s=n.getLogger();await t.ready,await n.transform(un({overwrite:!1,cleanup:e.cleanup}));let r=0;for(const i of n.getRoot().listMeshes()){for(const o of i.listPrimitives()){const c=o.getMode();c===Dc||c===pn||c===mn||o.getMode()===gn&&t.simplifyPoints?(ys(o,e),ge(o,J.RENDER)===0&&o.dispose()):r++}i.listPrimitives().length===0&&i.dispose()}r>0&&s.warn(`${Ge}: Skipping simplification of ${r} primitives: Unsupported draw mode.`),e.cleanup&&await n.transform(Bt({propertyTypes:[A.ACCESSOR,A.NODE],keepAttributes:!0,keepIndices:!0,keepLeaves:!1}),Ut({propertyTypes:[A.ACCESSOR]})),s.debug(`${Ge}: Complete.`)})}function ys(a,e){const t=Pe({},yn,e),n=t.simplifier,s=a.getGraph(),r=fe.fromGraph(s),i=r.getLogger();switch(a.getMode()){case gn:return Bc(r,a,t);case Oc:case _c:case Fc:return i.warn(`${Ge}: Skipping primitive simplification: Unsupported draw mode.`),a;case pn:case mn:rc(a);break}const o=ge(a,J.UPLOAD),c=ge(a,J.RENDER);c<o/2&&Mt(a);const f=a.getAttribute("POSITION"),b=a.getIndices();let u=f.getArray(),d=b.getArray();u instanceof Float32Array||(u=ca(u,f.getComponentType(),f.getNormalized())),d instanceof Uint32Array||(d=new Uint32Array(d));const g=Math.floor(t.ratio*c/3)*3,l=t.lockBorder?["LockBorder"]:[],[m,p]=n.simplify(d,u,3,g,t.error,l);a.setIndices(Ze(r,b).setArray(m)),b.listParents().length===1&&b.dispose(),Mt(a);const h=ge(a,J.UPLOAD);return h<=65534&&a.getIndices().setArray(new Uint16Array(a.getIndices().getArray())),i.debug(`${Ge}: ${Dt(o,h)} vertices, error: ${p.toFixed(4)}.`),a}function Bc(a,e,t){const n=t.simplifier,s=a.getLogger();e.getIndices()&&jc(e);const i=e.getAttribute("POSITION"),o=e.getAttribute("COLOR_0"),c=i.getCount();let f=i.getArray(),b=o?o.getArray():void 0;const u=o?o.getComponentSize():void 0;f instanceof Float32Array||(f=ca(f,i.getComponentType(),i.getNormalized())),b&&!(b instanceof Float32Array)&&(b=ca(b,i.getComponentType(),i.getNormalized())),n.useExperimentalFeatures=!0;const d=Math.floor(t.ratio*c),g=n.simplifyPoints(f,3,d,b,u);n.useExperimentalFeatures=!1;const[l,m]=n.compactMesh(g);s.debug(`${Ge}: ${Dt(i.getCount(),m)} vertices.`);for(const p of Ca(e)){const h=Ze(a,p);ia(p,null,l,h,m),lo(e,p,h),p.listParents().length===1&&p.dispose()}return e}var fa;(function(a){a.LANCZOS3="lanczos3",a.LANCZOS2="lanczos2"})(fa||(fa={}));fa.LANCZOS3;(function(){var a="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G;kekr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;C9oLdbk;GqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaC;acr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaC;acr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:dvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPaDydbgscL4cFeGc:cufcbasEgsaPas9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekavcb9hadcl6gqVhzarcdthxavce9hhHcbhdindndndnaHmbaqmdc:CuhDalhwarhminaDawydbgPcL4cFeGc:cufcbaPEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDazmbaohwalhmarhPinawamydbgscL4cFeGgkc8Aakc8A9kEc:cufcbasEBdbamclfhmawclfhwaPcufgPmbkkaqmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgOcjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohsxekcjjjj94hskabawfascFFFrGamcKtVBdbawclfhwaPcufgPmbkkabaxfhbalaxfhladcefgdae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbbaWbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var t,n=WebAssembly.instantiate(s(a),{}).then(function(g){t=g.instance,t.exports.__wasm_call_ctors(),t.exports.meshopt_encodeVertexVersion(0),t.exports.meshopt_encodeIndexVersion(1)});function s(g){for(var l=new Uint8Array(g.length),m=0;m<g.length;++m){var p=g.charCodeAt(m);l[m]=p>96?p-97:p>64?p-39:p+4}for(var h=0,m=0;m<g.length;++m)l[h++]=l[m]<60?e[l[m]]:(l[m]-60)*64+l[++m];return l.buffer.slice(0,h)}function r(g){if(!g)throw new Error("Assertion failed")}function i(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function o(g,l,m,p){var h=t.exports.sbrk,I=h(l.length*4),x=h(m*4),T=new Uint8Array(t.exports.memory.buffer),E=i(l);T.set(E,I),p&&p(I,I,l.length,m);var R=g(x,I,l.length,m);T=new Uint8Array(t.exports.memory.buffer);var y=new Uint32Array(m);new Uint8Array(y.buffer).set(T.subarray(x,x+m*4)),E.set(T.subarray(I,I+l.length*4)),h(I-h(0));for(var w=0;w<l.length;++w)l[w]=y[l[w]];return[y,R]}function c(g,l,m,p){var h=t.exports.sbrk,I=h(m*4),x=h(m*p),T=new Uint8Array(t.exports.memory.buffer);T.set(i(l),x),g(I,x,m,p),T=new Uint8Array(t.exports.memory.buffer);var E=new Uint32Array(m);return new Uint8Array(E.buffer).set(T.subarray(I,I+m*4)),h(I-h(0)),E}function f(g,l,m,p,h){var I=t.exports.sbrk,x=I(l),T=I(p*h),E=new Uint8Array(t.exports.memory.buffer);E.set(i(m),T);var R=g(x,l,T,p,h),y=new Uint8Array(R);return y.set(E.subarray(x,x+R)),I(x-I(0)),y}function b(g){for(var l=0,m=0;m<g.length;++m){var p=g[m];l=l<p?p:l}return l}function u(g,l){if(r(l==2||l==4),l==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var m=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(m)}function d(g,l,m,p,h,I,x){var T=t.exports.sbrk,E=T(m*p),R=T(m*I),y=new Uint8Array(t.exports.memory.buffer);y.set(i(l),R),g(E,m,p,h,R,x);var w=new Uint8Array(m*p);return w.set(y.subarray(E,E+m*p)),T(E-T(0)),w}return{ready:n,supported:!0,reorderMesh:function(g,l,m){var p=l?m?t.exports.meshopt_optimizeVertexCacheStrip:t.exports.meshopt_optimizeVertexCache:void 0;return o(t.exports.meshopt_optimizeVertexFetchRemap,g,b(g)+1,p)},reorderPoints:function(g,l){return r(g instanceof Float32Array),r(g.length%l==0),r(l>=3),c(t.exports.meshopt_spatialSortRemap,g,g.length/l,l*4)},encodeVertexBuffer:function(g,l,m){r(m>0&&m<=256),r(m%4==0);var p=t.exports.meshopt_encodeVertexBufferBound(l,m);return f(t.exports.meshopt_encodeVertexBuffer,p,g,l,m)},encodeIndexBuffer:function(g,l,m){r(m==2||m==4),r(l%3==0);var p=u(g,m),h=t.exports.meshopt_encodeIndexBufferBound(l,b(p)+1);return f(t.exports.meshopt_encodeIndexBuffer,h,p,l,4)},encodeIndexSequence:function(g,l,m){r(m==2||m==4);var p=u(g,m),h=t.exports.meshopt_encodeIndexSequenceBound(l,b(p)+1);return f(t.exports.meshopt_encodeIndexSequence,h,p,l,4)},encodeGltfBuffer:function(g,l,m,p){var h={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(h[p]),h[p](g,l,m)},encodeFilterOct:function(g,l,m,p){return r(m==4||m==8),r(p>=1&&p<=16),d(t.exports.meshopt_encodeFilterOct,g,l,m,p,16)},encodeFilterQuat:function(g,l,m,p){return r(m==8),r(p>=4&&p<=16),d(t.exports.meshopt_encodeFilterQuat,g,l,m,p,16)},encodeFilterExp:function(g,l,m,p,h){r(m>0&&m%4==0),r(p>=1&&p<=24);var I={Separate:0,SharedVector:1,SharedComponent:2};return d(t.exports.meshopt_encodeFilterExp,g,l,m,p,m,h?I[h]:1)}}})();(function(){var a="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=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]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?o(e):o(a),r,i=WebAssembly.instantiate(s,{}).then(function(h){r=h.instance,r.exports.__wasm_call_ctors()});function o(h){for(var I=new Uint8Array(h.length),x=0;x<h.length;++x){var T=h.charCodeAt(x);I[x]=T>96?T-97:T>64?T-39:T+4}for(var E=0,x=0;x<h.length;++x)I[E++]=I[x]<60?n[I[x]]:(I[x]-60)*64+I[++x];return I.buffer.slice(0,E)}function c(h,I,x,T,E,R,y){var w=h.exports.sbrk,j=T+3&-4,v=w(j*E),k=w(R.length),N=new Uint8Array(h.exports.memory.buffer);N.set(R,k);var M=I(v,T,E,k,R.length);if(M==0&&y&&y(v,j,E),x.set(N.subarray(v,v+T*E)),w(v-w(0)),M!=0)throw new Error("Malformed buffer data: "+M)}var f={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},b={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],d=0;function g(h){var I={object:new Worker(h),pending:0,requests:{}};return I.object.onmessage=function(x){var T=x.data;I.pending-=T.count,I.requests[T.id][T.action](T.value),delete I.requests[T.id]},I}function l(h){for(var I="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+p.name+";"+c.toString()+p.toString(),x=new Blob([I],{type:"text/javascript"}),T=URL.createObjectURL(x),E=u.length;E<h;++E)u[E]=g(T);for(var E=h;E<u.length;++E)u[E].object.postMessage({});u.length=h,URL.revokeObjectURL(T)}function m(h,I,x,T,E){for(var R=u[0],y=1;y<u.length;++y)u[y].pending<R.pending&&(R=u[y]);return new Promise(function(w,j){var v=new Uint8Array(x),k=++d;R.pending+=h,R.requests[k]={resolve:w,reject:j},R.object.postMessage({id:k,count:h,size:I,source:v,mode:T,filter:E},[v.buffer])})}function p(h){var I=h.data;if(!I.id)return self.close();self.ready.then(function(x){try{var T=new Uint8Array(I.count*I.size);c(x,x.exports[I.mode],T,I.count,I.size,I.source,x.exports[I.filter]),self.postMessage({id:I.id,count:I.count,action:"resolve",value:T},[T.buffer])}catch(E){self.postMessage({id:I.id,count:I.count,action:"reject",value:E})}})}return{ready:i,supported:!0,useWorkers:function(h){l(h)},decodeVertexBuffer:function(h,I,x,T,E){c(r,r.exports.meshopt_decodeVertexBuffer,h,I,x,T,r.exports[f[E]])},decodeIndexBuffer:function(h,I,x,T){c(r,r.exports.meshopt_decodeIndexBuffer,h,I,x,T)},decodeIndexSequence:function(h,I,x,T){c(r,r.exports.meshopt_decodeIndexSequence,h,I,x,T)},decodeGltfBuffer:function(h,I,x,T,E,R){c(r,r.exports[b[E]],h,I,x,T,r.exports[f[R]])},decodeGltfBufferAsync:function(h,I,x,T,E){return u.length>0?m(h,I,x,b[T],f[E]):i.then(function(){var R=new Uint8Array(h*I);return c(r,r.exports[b[T]],R,h,I,x,r.exports[f[E]]),R})}}})();var Lc=function(){var a="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj;jekr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq:f97sdbk:39si8Au8A99zu8Jjjjjbc;W;ab9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdndnamcdGmbcbhHxekasalcrfci4gecbyd;S1jjbHjjjjbbgOBdxasceBd2aOcbaez:ljjjbhAcbhlcbhednadTmbcbhlabheadhOinaAaeydbgCci4fgXaXRbbgXceaCcrGgCtV86bbaXcu7aC4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekasaecbyd;S1jjbHjjjjbbgHBdzascdBd2alcd4alfhCcehOinaOgecethOaeaC6mbkcdhzcbhQascuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbgCBdCasciBd2aCcFeaOz:ljjjbhLdnadTmbaecufhXcbhKinabaQcdtfgYydbgAc:v;t;h;Ev2hCcbhedndninaLaCaXGgCcdtfg8AydbgOcuSmeaHaOcdtfydbaASmdaecefgeaCfhCaeaX9nmbxdkkaHaKcdtfaABdba8AaKBdbaKhOaKcefhKkaYaOBdbaQcefgQad9hmbkkaLcbyd;O1jjbH:bjjjbbascdBd2kascxfazcdtfcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbgEBdbasaEBdlasazceVgeBd2ascxfaecdtfcuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbg3Bdbasa3BdwasazcdfgeBd2asclfabadalcbz:cjjjbascxfaecdtfcualcdtg5alcFFFFi0Eg8Ecbyd;S1jjbHjjjjbbgOBdbasazcifgeBd2ascxfaecdtfa8Ecbyd;S1jjbHjjjjbbg8FBdbasazclVgaBd2alcd4alfhXcehCinaCgecethCaeaX6mbkcbhKascxfaacdtfghcuaecdtgCaecFFFFi0Ecbyd;S1jjbHjjjjbbgXBdbasazcvVggBd2aXcFeaCz:ljjjbhQdnalTmbavcd4hAaecufhCinaKhednaHTmbaHaKcdtfydbhekaiaeaA2cdtfgeydlgXcH4aX7c:F:b:DD2aeydbgXcH4aX7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aCGheaKcdth8JdndndndndnaHTmbaHa8JfhYcbhXinaQaecdtfgLydbg8AcuSmlaiaHa8AcdtfydbaA2cdtfaiaYydbaA2cdtfcxz:ojjjbTmiaXcefgXaefaCGheaXaC9nmbxdkkaiaKaA2cdtfhYcbhXinaQaecdtfgLydbg8AcuSmiaia8AaA2cdtfaYcxz:ojjjbTmdaXcefgXaefaCGheaXaC9nmbkkcbhLkaLydbgecu9hmekaLaKBdbaKhekaOa8JfaeBdbaKcefgKal9hmbkcbhea8FhCinaCaeBdbaCclfhCalaecefge9hmbkcbheaOhCa8FhXindnaeaCydbgASmbaXa8FaAcdtfgAydbBdbaAaeBdbkaCclfhCaXclfhXalaecefge9hmbkkcbh8KaQcbyd;O1jjbH:bjjjbbasaaBd2ahalcbyd;S1jjbHjjjjbbgABdbasagBd2ascxfagcdtfa8Ecbyd;S1jjbHjjjjbbgeBdbasazcofgCBd2ascxfaCcdtfa8Ecbyd;S1jjbHjjjjbbgCBdbasazcrfg8LBd2aecFea5z:ljjjbh8MaCcFea5z:ljjjbh8NdnalTmba3cwfhyindnaEa8KgXcefg8Kcdtfydbg8AaEaXcdtgefydbgCSmba8AaC9Rh8Ja3aCcitfh5a8Naefhga8MaefhKcbhLindndna5aLcitfydbgQaX9hmbaKaXBdbagaXBdbxekdnaEaQcdtgafgeclfydbgCaeydbgeSmba3aecitg8AfydbaXSmeaCae9Rhhaecu7aCfhYaya8AfhCcbheinaYaeSmeaecefheaCydbh8AaCcwfhCa8AaX9hmbkaeah6meka8NaafgeaXaQaeydbcuSEBdbaKaQaXaKydbcuSEBdbkaLcefgLa8J9hmbkka8Kal9hmbkaOhCaHhLa8FhXa8Nh8Aa8MhQcbheindndnaeaCydbgY9hmbdnaqTmbaehYdnaHTmbaLydbhYkaqaYfRbbTmbaAaefcl86bbxdkdnaeaXydbgY9hmbaQydbhYdna8AydbgKcu9hmbaYcu9hmbaAaefcb86bbxikaAaefh8JdnaeaKSmbaeaYSmba8Jce86bbxika8Jcl86bbxdkdnaea8FaYcdtgKfydb9hmbdna8Aydbg8JcuSmbaea8JSmbaQydbg5cuSmbaea5Smba8NaKfydbgacuSmbaaaYSmba8MaKfydbgKcuSmbaKaYSmbdnaOa8JcdtfydbaOaKcdtfydb9hmbaOa5cdtfydbaOaacdtfydb9hmbaAaefcd86bbxlkaAaefcl86bbxikaAaefcl86bbxdkaAaefcl86bbxekaAaefaAaYfRbb86bbkaCclfhCaLclfhLaXclfhXa8Aclfh8AaQclfhQalaecefge9hmbkamceGTmbaAhealhCindnaeRbbce9hmbaecl86bbkaecefheaCcufgCmbkkascxfa8Lcdtfcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbggBdbasazcwVg8JBd2agaialavaHz:djjjbh8PdndnaDmbcbhvxekascxfa8JcdtfcualaD2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbgvBdbasazcDVg8JBd2alTmbarcd4hYdnaHTmbaDcdthKcbhLavhQinaoaHaLcdtfydbaY2cdtfheawhCaQhXaDh8AinaXaeIdbaCIdbNUdbaeclfheaCclfhCaXclfhXa8Acufg8AmbkaQaKfhQaLcefgLal9hmbxdkkaYcdthYaDcdthKcbhQavhLinaoheawhCaLhXaDh8AinaXaeIdbaCIdbNUdbaeclfheaCclfhCaXclfhXa8Acufg8AmbkaoaYfhoaLaKfhLaQcefgQal9hmbkkascxfa8Jcdtfcualc8S2gealc;D;O;f8U0EgXcbyd;S1jjbHjjjjbbgCBdbasa8Jcefg8ABd2aCcbaez:ljjjbh8KdndndnaDTmbascxfa8AcdtfaXcbyd;S1jjbHjjjjbbgqBdbasa8JcdfgCBd2aqcbaez:ljjjb8AascxfaCcdtfcualaD2gecltgCaecFFFFb0Ecbyd;S1jjbHjjjjbbgwBdbasa8JcifBd2awcbaCz:ljjjb8AadmexdkcbhqcbhwadTmekcbhLabhCindnagaCclfydbgQcx2fgeIdbagaCydbgYcx2fgXIdbgI:tg8RagaCcwfydbgKcx2fg8AIdlaXIdlg8S:tgRNa8AIdbaI:tg8UaeIdla8S:tg8VN:tg8Wa8WNa8Va8AIdwaXIdwg8X:tg8YNaRaeIdwa8X:tg8VN:tgRaRNa8Va8UNa8Ya8RN:tg8Ra8RNMM:rg8UJbbbb9ETmba8Wa8U:vh8Wa8Ra8U:vh8RaRa8U:vhRka8KaOaYcdtfydbc8S2fgeaRa8U:rg8UaRNNg8VaeIdbMUdbaea8Ra8Ua8RNg8ZNg8YaeIdlMUdlaea8Wa8Ua8WNg80Ng81aeIdwMUdwaea8ZaRNg8ZaeIdxMUdxaea80aRNgBaeIdzMUdzaea80a8RNg80aeIdCMUdCaeaRa8Ua8Wa8XNaRaINa8Sa8RNMM:mg8SNgINgRaeIdKMUdKaea8RaINg8RaeId3MUd3aea8WaINg8WaeIdaMUdaaeaIa8SNgIaeId8KMUd8Kaea8UaeIdyMUdya8KaOaQcdtfydbc8S2fgea8VaeIdbMUdbaea8YaeIdlMUdlaea81aeIdwMUdwaea8ZaeIdxMUdxaeaBaeIdzMUdzaea80aeIdCMUdCaeaRaeIdKMUdKaea8RaeId3MUd3aea8WaeIdaMUdaaeaIaeId8KMUd8Kaea8UaeIdyMUdya8KaOaKcdtfydbc8S2fgea8VaeIdbMUdbaea8YaeIdlMUdlaea81aeIdwMUdwaea8ZaeIdxMUdxaeaBaeIdzMUdzaea80aeIdCMUdCaeaRaeIdKMUdKaea8RaeId3MUd3aea8WaeIdaMUdaaeaIaeId8KMUd8Kaea8UaeIdyMUdyaCcxfhCaLcifgLad6mbkcbh8JabhYinaba8JcdtfhQcbhCinaAaQaCcj1jjbfydbcdtfydbgXfRbbhedndnaAaYaCfydbg8AfRbbgLc99fcFeGcpe0mbaeceSmbaecd9hmekdnaLcufcFeGce0mba8Ma8AcdtfydbaX9hmekdnaecufcFeGce0mba8NaXcdtfydba8A9hmekdnaLcv2aefc:q1jjbfRbbTmbaOaXcdtfydbaOa8Acdtfydb0mekdnagaXcx2fgKIdwaga8Acx2fgiIdwg8S:tgRaRNaKIdbaiIdbg8X:tg8Ra8RNaKIdlaiIdlg8V:tg8Ua8UNMM:rgIJbbbb9ETmbaRaI:vhRa8UaI:vh8Ua8RaI:vh8RkJbbacJbbacJbbjZaeceSEaLceSEh80dnagaQaCc:e1jjbfydbcdtfydbcx2fgeIdwa8S:tg8WaRa8WaRNaeIdba8X:tg81a8RNa8UaeIdla8V:tg8ZNMMg8YN:tg8Wa8WNa81a8Ra8YN:tgRaRNa8Za8Ua8YN:tg8Ra8RNMM:rg8UJbbbb9ETmba8Wa8U:vh8Wa8Ra8U:vh8RaRa8U:vhRka8KaOa8Acdtfydbc8S2fgeaRa80aINg8UaRNNg8YaeIdbMUdbaea8Ra8Ua8RNg80Ng81aeIdlMUdlaea8Wa8Ua8WNgINg8ZaeIdwMUdwaea80aRNg80aeIdxMUdxaeaIaRNgBaeIdzMUdzaeaIa8RNg83aeIdCMUdCaeaRa8Ua8Wa8SNaRa8XNa8Va8RNMM:mg8SNgINgRaeIdKMUdKaea8RaINg8RaeId3MUd3aea8WaINg8WaeIdaMUdaaeaIa8SNgIaeId8KMUd8Kaea8UaeIdyMUdya8KaOaXcdtfydbc8S2fgea8YaeIdbMUdbaea81aeIdlMUdlaea8ZaeIdwMUdwaea80aeIdxMUdxaeaBaeIdzMUdzaea83aeIdCMUdCaeaRaeIdKMUdKaea8RaeId3MUd3aea8WaeIdaMUdaaeaIaeId8KMUd8Kaea8UaeIdyMUdykaCclfgCcx9hmbkaYcxfhYa8Jcifg8Jad6mbkaDTmbcbhYinJbbbbh8XagabaYcdtfgeclfydbgKcx2fgCIdwagaeydbgicx2fgXIdwg8Z:tg8Ra8RNaCIdbaXIdbgB:tg8Wa8WNaCIdlaXIdlg83:tg8Ua8UNMMg80agaecwfydbg8Jcx2fgeIdwa8Z:tgINa8Ra8RaINa8WaeIdbaB:tg8SNa8UaeIdla83:tg8VNMMgRN:tJbbbbJbbjZa80aIaINa8Sa8SNa8Va8VNMMg81NaRaRN:tg8Y:va8YJbbbb9BEg8YNhUa81a8RNaIaRN:ta8YNh85a80a8VNa8UaRN:ta8YNh86a81a8UNa8VaRN:ta8YNh87a80a8SNa8WaRN:ta8YNh88a81a8WNa8SaRN:ta8YNh89a8Wa8VNa8Sa8UN:tgRaRNa8UaINa8Va8RN:tgRaRNa8Ra8SNaIa8WN:tgRaRNMM:r:rhRavaiaD2cdtfhCava8JaD2cdtfhXavaKaD2cdtfh8Aa8Z:mh8:a83:mhZaB:mhncbhLaDhQJbbbbh8VJbbbbh8YJbbbbh80Jbbbbh81Jbbbbh8ZJbbbbhBJbbbbh83JbbbbhcJbbbbh9cinasc;WbfaLfgecwfaRa85a8AIdbaCIdbgI:tg8UNaUaXIdbaI:tg8SNMg8RNUdbaeclfaRa87a8UNa86a8SNMg8WNUdbaeaRa89a8UNa88a8SNMg8UNUdbaecxfaRa8:a8RNaZa8WNaIana8UNMMMgINUdbaRa8Ra8WNNa81Mh81aRa8Ra8UNNa8ZMh8ZaRa8Wa8UNNaBMhBaRaIaINNa8XMh8XaRa8RaINNa8VMh8VaRa8WaINNa8YMh8YaRa8UaINNa80Mh80aRa8Ra8RNNa83Mh83aRa8Wa8WNNacMhcaRa8Ua8UNNa9cMh9caCclfhCa8Aclfh8AaXclfhXaLczfhLaQcufgQmbkaqaOaicdtfydbgCc8S2fgea9caeIdbMUdbaeacaeIdlMUdlaea83aeIdwMUdwaeaBaeIdxMUdxaea8ZaeIdzMUdzaea81aeIdCMUdCaea80aeIdKMUdKaea8YaeId3MUd3aea8VaeIdaMUdaaea8XaeId8KMUd8KaeaRaeIdyMUdyaqaOaKcdtfydbgKc8S2fgea9caeIdbMUdbaeacaeIdlMUdlaea83aeIdwMUdwaeaBaeIdxMUdxaea8ZaeIdzMUdzaea81aeIdCMUdCaea80aeIdKMUdKaea8YaeId3MUd3aea8VaeIdaMUdaaea8XaeId8KMUd8KaeaRaeIdyMUdyaqaOa8Jcdtfydbgic8S2fgea9caeIdbMUdbaeacaeIdlMUdlaea83aeIdwMUdwaeaBaeIdxMUdxaea8ZaeIdzMUdzaea81aeIdCMUdCaea80aeIdKMUdKaea8YaeId3MUd3aea8VaeIdaMUdaaea8XaeId8KMUd8KaeaRaeIdyMUdyawaCaD2cltfhQcbhCaDh8AinaQaCfgeasc;WbfaCfgXIdbaeIdbMUdbaeclfgLaXclfIdbaLIdbMUdbaecwfgLaXcwfIdbaLIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCa8Acufg8AmbkawaKaD2cltfhQcbhCaDh8AinaQaCfgeasc;WbfaCfgXIdbaeIdbMUdbaeclfgLaXclfIdbaLIdbMUdbaecwfgLaXcwfIdbaLIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCa8Acufg8AmbkawaiaD2cltfhQcbhCaDh8AinaQaCfgeasc;WbfaCfgXIdbaeIdbMUdbaeclfgLaXclfIdbaLIdbMUdbaecwfgLaXcwfIdbaLIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCa8Acufg8AmbkaYcifgYad6mbkkasydlhJcbhednalTmbaJclfheaJydbh8AaAhCalhLcbhXincbaeydbgQa8A9RaCRbbcpeGEaXfhXaCcefhCaeclfheaQh8AaLcufgLmbkaXce4hekcuadae9Rcifg8Lcx2a8Lc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhhascxfasyd2gecdtfahBdbasaecefgCBd2ascxfaCcdtfcua8Lcdta8LcFFFFi0Ecbyd;S1jjbHjjjjbbgzBdbasaecdfgCBd2ascxfaCcdtfa8Ecbyd;S1jjbHjjjjbbg3BdbasaecifgCBd2ascxfaCcdtfalcbyd;S1jjbHjjjjbbg9eBdbasaeclfBd2a8PJbbjZamclGEhcJbbbbh83dnadak9nmbdna8Lci6mbaxaxNacacN:vhBaDclthTahcwfhSJbbbbh83inasclfabadgoalaOz:cjjjbabhicbhEcbhyinabaycdtfh8JcbheindnaOaiaefydbgXcdtgKfydbg8AaOa8Jaec:S1jjbfydbcdtfydbgCcdtfydbgLSmbaAaCfRbbgYcv2aAaXfRbbgQfc;a1jjbfRbbgaaQcv2aYfg5c;a1jjbfRbbgdVcFeGTmbdnaLa8A9nmba5c:q1jjbfRbbcFeGmekdnaQaY9hmbaQcufcFeGce0mba8MaKfydbaC9hmekahaEcx2fg8AaCaXadcFeGgLEBdla8AaXaCaLEBdba8AaLaaGcb9hBdwaEcefhEkaeclfgecx9hmbkdnaycifgyao9pmbaicxfhiaEcifa8L9nmekkdnaEmbaohdxikcbhYinJbbbbJbbjZa8KaOahaYcx2fg8AydlgLa8AydbgQa8AydwgCEgicdtfydbgac8S2gdfgeIdygR:vaRJbbbb9BEaeIdwagaQaLaCEgKcx2fgCIdwg8UNaeIdzaCIdbgINaeIdaMgRaRMMa8UNaeIdlaCIdlg8SNaeIdCa8UNaeId3MgRaRMMa8SNaeIdbaINaeIdxa8SNaeIdKMgRaRMMaINaeId8KMMM:lNh80JbbbbJbbjZa8KaOaQcdtfydbgyc8S2gXfgeIdygR:vaRJbbbb9BEaeIdwagaLcx2fgCIdwg8WNaeIdzaCIdbg8XNaeIdaMgRaRMMa8WNaeIdlaCIdlg8VNaeIdCa8WNaeId3MgRaRMMa8VNaeIdba8XNaeIdxa8VNaeIdKMgRaRMMa8XNaeId8KMMM:lNh81a8Acwfh8Ja8Aclfh5dnaDTmbaqaXfgXIdwa8WNaXIdza8XNaXIdaMgRaRMMa8WNaXIdla8VNaXIdCa8WNaXId3MgRaRMMa8VNaXIdba8XNaXIdxa8VNaXIdKMgRaRMMa8XNaXId8KMMMh8RavaLaD2cdtfhCawayaD2cltfheaXIdyh8YaDhXinaCIdbgRJbbb;aNaecxfIdba8WaecwfIdbNa8XaeIdbNa8VaeclfIdbNMMMNaRaRNa8YNa8RMMh8RaCclfhCaeczfheaXcufgXmbkaqadfgXIdwa8UNaXIdzaINaXIdaMgRaRMMa8UNaXIdla8SNaXIdCa8UNaXId3MgRaRMMa8SNaXIdbaINaXIdxa8SNaXIdKMgRaRMMaINaXId8KMMMh8WavaKaD2cdtfhCawaaaD2cltfheaXIdyh8XaDhXinaCIdbgRJbbb;aNaecxfIdba8UaecwfIdbNaIaeIdbNa8SaeclfIdbNMMMNaRaRNa8XNa8WMMh8WaCclfhCaeczfheaXcufgXmbka80a8W:lMh80a81a8R:lMh81ka5aLaKa81a809FgeEBdba8AaQaiaeEBdba8Ja81a80aeEUdbaYcefgYaE9hmbkasc;Wbfcbcj;abz:ljjjb8AaSheaEhCinasc;WbfaeydbcO4c;8ZGfgXaXydbcefBdbaecxfheaCcufgCmbkcbhecbhCinasc;WbfaefgXydbh8AaXaCBdba8AaCfhCaeclfgecj;ab9hmbkcbheaShCinasc;WbfaCydbcO4c;8ZGfgXaXydbgXcefBdbazaXcdtfaeBdbaCcxfhCaEaecefge9hmbkaoak9RgXci9Uh9hdnalTmbcbhea3hCinaCaeBdbaCclfhCalaecefge9hmbkkcbh9ia9ecbalz:ljjjbh6aXcO9Uh9ka9hce4h0asydwh9mcbhdcbh5dninahaza5cdtfydbcx2fg8JIdwg8RaB9Emeada9h9pmeJFFuuhRdna0aE9pmbahaza0cdtfydbcx2fIdwJbb;aZNhRkdna8RaR9ETmbada9k0mdkdna6aOa8Jydlg9ncdtg9ofydbg8Afg9pRbba6aOa8Jydbgicdtg9qfydbg9rfg9sRbbVmbdnaJa9rcdtfgeclfydbgCaeydbgeSmbaCae9RhQa9maecitfheaga8Acx2fgKcwfhyaKclfh8Eaga9rcx2fgacwfhmaaclfhrcbhCcehYdnindna3aeydbcdtfydbgXa8ASmba3aeclfydbcdtfydbgLa8ASmbaXaLSmbagaLcx2fgLIdbagaXcx2fgXIdbg8W:tgRarIdbaXIdlg8U:tg8XNaaIdba8W:tg8VaLIdla8U:tg8RN:tgIaRa8EIdba8U:tg8YNaKIdba8W:tg80a8RN:tg8UNa8RamIdbaXIdwg8S:tg81Na8XaLIdwa8S:tg8WN:tg8Xa8RayIdba8S:tg8ZNa8Ya8WN:tg8RNa8Wa8VNa81aRN:tg8Sa8Wa80Na8ZaRN:tgRNMMaIaINa8Xa8XNa8Sa8SNMMa8Ua8UNa8Ra8RNaRaRNMMN:rJbbj8:N9FmdkaecwfheaCcefgCaQ6hYaQaC9hmbkkaYceGTmba0cefh0xeka8Ka8Ac8S2gXfgea8Ka9rc8S2gLfgCIdbaeIdbMUdbaeaCIdlaeIdlMUdlaeaCIdwaeIdwMUdwaeaCIdxaeIdxMUdxaeaCIdzaeIdzMUdzaeaCIdCaeIdCMUdCaeaCIdKaeIdKMUdKaeaCId3aeId3MUd3aeaCIdaaeIdaMUdaaeaCId8KaeId8KMUd8KaeaCIdyaeIdyMUdydnaDTmbaqaXfgeaqaLfgCIdbaeIdbMUdbaeaCIdlaeIdlMUdlaeaCIdwaeIdwMUdwaeaCIdxaeIdxMUdxaeaCIdzaeIdzMUdzaeaCIdCaeIdCMUdCaeaCIdKaeIdKMUdKaeaCId3aeId3MUd3aeaCIdaaeIdaMUdaaeaCId8KaeId8KMUd8KaeaCIdyaeIdyMUdyaTa9r2hYaTa8A2hKawhCaDhLinaCaKfgeaCaYfgXIdbaeIdbMUdbaeclfgQaXclfIdbaQIdbMUdbaecwfgQaXcwfIdbaQIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCaLcufgLmbkka8JcwfhCdndndndnaAaifgXRbbc9:fPdebdkaiheina3aecdtgefa8ABdba8Faefydbgeai9hmbxikka8Fa9ofydbhea8Fa9qfydbhia3a9qfa9nBdbaeh9nka3aicdtfa9nBdbka9sce86bba9pce86bbaCIdbgRa83a83aR9DEh83a9icefh9icecdaXRbbceSEadfhdka5cefg5aE9hmbkkdna9imbaohdxikdnalTmbcbhCa8MheindnaeydbgXcuSmbdnaCa3aXcdtg8AfydbgX9hmba8Ma8AfydbhXkaeaXBdbkaeclfhealaCcefgC9hmbkcbhCa8NheindnaeydbgXcuSmbdnaCa3aXcdtg8AfydbgX9hmba8Na8AfydbhXkaeaXBdbkaeclfhealaCcefgC9hmbkkcbhdabhecbhLindna3aeydbcdtfydbgCa3aeclfydbcdtfydbgXSmbaCa3aecwfydbcdtfydbg8ASmbaXa8ASmbabadcdtfgQaCBdbaQcwfa8ABdbaQclfaXBdbadcifhdkaecxfheaLcifgLao6mbkadak9nmdxbkkasclfabadalaOz:cjjjbkdnaHTmbadTmbadheinabaHabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaca83:rNUdbkasyd2gecdtascxffc98fhOdninaeTmeaOydbcbyd;O1jjbH:bjjjbbaOc98fhOaecufhexbkkasc;W;abf8Kjjjjbadk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk;3Aowud99wue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhmawcuaicdtgPaicFFFFi0Ecbyd;S1jjbHjjjjbbgsBdCawciBd2dndnar:Zgz:rJbbbZMgH:lJbbb9p9DTmbaH:Ohexekcjjjj94hekaicufhOc:bwhAcbhCcbhXadhQinaChLaeaAgKcufaeaK9iEamgDcefaeaD9kEhYdndnadTmbaYcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbh3cbh5indnaEaxa5cdtfydbgAcm4aA7c:v;t;h;Ev2gics4ai7aOGgmcdtfgCydbgecuSmbaeaASmbcehiinaEamaifaOGgmcdtfgCydbgecuSmeaicefhiaeaA9hmbkkaCaABdba3aecuSfh3a5cefg5ad9hmbxdkkascFeaPz:ljjjb8Acbh3kaDaYa3ar0giEhmaLa3aiEhCdna3arSmbaYaKaiEgAam9Rcd9imbdndnaXcl0mbdnaQ:ZgHaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa3:Zghaz:tNNNaHaz:taaNa8Aah:tNa8Aaz:ta8FNahaH:tNM:va8EMJbbbZMgH:lJbbb9p9DTmbaH:Ohexdkcjjjj94hexekamaAfcd9Theka3aQaiEhQaXcefgXcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg5BdKawclBd2dndnadTmbamcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbhDcbh3inaxa3cdtgYfydbgAcm4aA7c:v;t;h;Ev2gics4ai7hecbhidndninaEaeaOGgmcdtfgCydbgecuSmednaxaecdtgCfydbaASmbaicefgiamfheaiaO9nmekka5aCfydbhixekaCa3BdbaDhiaDcefhDka5aYfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekascFeaPz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhCavcd4hxdnadTmbdnalTmbaxcdthEa5hAalheaqhmadhOinaCaAydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaAclfhAaeaEfheamcxfhmaOcufgOmbxdkka5hmaqheadhAinaCamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaAcufgAmbkkdnaDTmbaChiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgH:vaHJbbbb9BEgHNUdbaiclfgmaHamIdbNUdbaicwfgmaHamIdbNUdbaicxfgmaHamIdbNUdbaiczfgmaHamIdbNUdbaicCfgmaHamIdbNUdbaic3fhiaecufgembkkcbhAawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbgEBd8KaecFeaYz:ljjjbh3dnadTmbaoaoNh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaCa5ydbgOc32fgiIdC:tgHaHNamIdbaiIdx:tgHaHNamIdlaiIdz:tgHaHNMMNaqcwfIdbaiIdw:tgHaHNaqIdbaiIdb:tgHaHNaqclfIdbaiIdl:tgHaHNMMMhHdndna3aOcdtgifgmydbcuSmbaEaifIdbaH9ETmekamaABdbaEaifaHUdbka5clfh5aeaxfheaqcxfhqadaAcefgA9hmbkkaba3aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oebbbdbbbbbbbebbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbbbbbbbbbbbbbbbbc;Owkxebbbdbbbj9Kbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var t,n=WebAssembly.instantiate(s(a),{}).then(function(l){t=l.instance,t.exports.__wasm_call_ctors()});function s(l){for(var m=new Uint8Array(l.length),p=0;p<l.length;++p){var h=l.charCodeAt(p);m[p]=h>96?h-97:h>64?h-39:h+4}for(var I=0,p=0;p<l.length;++p)m[I++]=m[p]<60?e[m[p]]:(m[p]-60)*64+m[++p];return m.buffer.slice(0,I)}function r(l){if(!l)throw new Error("Assertion failed")}function i(l){return new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}function o(l,m,p){var h=t.exports.sbrk,I=h(m.length*4),x=h(p*4),T=new Uint8Array(t.exports.memory.buffer),E=i(m);T.set(E,I);var R=l(x,I,m.length,p);T=new Uint8Array(t.exports.memory.buffer);var y=new Uint32Array(p);new Uint8Array(y.buffer).set(T.subarray(x,x+p*4)),E.set(T.subarray(I,I+m.length*4)),h(I-h(0));for(var w=0;w<m.length;++w)m[w]=y[m[w]];return[y,R]}function c(l){for(var m=0,p=0;p<l.length;++p){var h=l[p];m=m<h?h:m}return m}function f(l,m,p,h,I,x,T,E,R){var y=t.exports.sbrk,w=y(4),j=y(p*4),v=y(I*x),k=y(p*4),N=new Uint8Array(t.exports.memory.buffer);N.set(i(h),v),N.set(i(m),k);var M=l(j,k,p,v,I,x,T,E,R,w);N=new Uint8Array(t.exports.memory.buffer);var C=new Uint32Array(M);i(C).set(N.subarray(j,j+M*4));var _=new Float32Array(1);return i(_).set(N.subarray(w,w+4)),y(w-y(0)),[C,_[0]]}function b(l,m,p,h,I,x,T,E,R,y,w,j,v){var k=t.exports.sbrk,N=k(4),M=k(p*4),C=k(I*x),_=k(I*E),D=k(R.length*4),G=k(p*4),Y=y?k(I):0,z=new Uint8Array(t.exports.memory.buffer);z.set(i(h),C),z.set(i(T),_),z.set(i(R),D),z.set(i(m),G),y&&z.set(i(y),Y);var W=l(M,G,p,C,I,x,_,E,D,R.length,Y,w,j,v,N);z=new Uint8Array(t.exports.memory.buffer);var Q=new Uint32Array(W);i(Q).set(z.subarray(M,M+W*4));var ce=new Float32Array(1);return i(ce).set(z.subarray(N,N+4)),k(N-k(0)),[Q,ce[0]]}function u(l,m,p,h){var I=t.exports.sbrk,x=I(p*h),T=new Uint8Array(t.exports.memory.buffer);T.set(i(m),x);var E=l(x,p,h);return I(x-I(0)),E}function d(l,m,p,h,I,x,T,E){var R=t.exports.sbrk,y=R(E*4),w=R(p*h),j=R(p*x),v=new Uint8Array(t.exports.memory.buffer);v.set(i(m),w),I&&v.set(i(I),j);var k=l(y,w,p,h,j,x,T,E);v=new Uint8Array(t.exports.memory.buffer);var N=new Uint32Array(k);return i(N).set(v.subarray(y,y+k*4)),R(y-R(0)),N}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4};return{ready:n,supported:!0,useExperimentalFeatures:!1,compactMesh:function(l){r(l instanceof Uint32Array||l instanceof Int32Array||l instanceof Uint16Array||l instanceof Int16Array),r(l.length%3==0);var m=l.BYTES_PER_ELEMENT==4?l:new Uint32Array(l);return o(t.exports.meshopt_optimizeVertexFetchRemap,m,c(l)+1)},simplify:function(l,m,p,h,I,x){r(l instanceof Uint32Array||l instanceof Int32Array||l instanceof Uint16Array||l instanceof Int16Array),r(l.length%3==0),r(m instanceof Float32Array),r(m.length%p==0),r(p>=3),r(h>=0&&h<=l.length),r(h%3==0),r(I>=0);for(var T=0,E=0;E<(x?x.length:0);++E)r(x[E]in g),T|=g[x[E]];var R=l.BYTES_PER_ELEMENT==4?l:new Uint32Array(l),y=f(t.exports.meshopt_simplify,R,l.length,m,m.length/p,p*4,h,I,T);return y[0]=l instanceof Uint32Array?y[0]:new l.constructor(y[0]),y},simplifyWithAttributes:function(l,m,p,h,I,x,T,E,R,y){r(this.useExperimentalFeatures),r(l instanceof Uint32Array||l instanceof Int32Array||l instanceof Uint16Array||l instanceof Int16Array),r(l.length%3==0),r(m instanceof Float32Array),r(m.length%p==0),r(p>=3),r(h instanceof Float32Array),r(h.length%I==0),r(I>=0),r(T==null||T.length==m.length),r(E>=0&&E<=l.length),r(E%3==0),r(R>=0),r(Array.isArray(x)),r(I>=x.length),r(x.length<=16);for(var w=0,j=0;j<(y?y.length:0);++j)r(y[j]in g),w|=g[y[j]];var v=l.BYTES_PER_ELEMENT==4?l:new Uint32Array(l),k=b(t.exports.meshopt_simplifyWithAttributes,v,l.length,m,m.length/p,p*4,h,I*4,new Float32Array(x),T?new Uint8Array(T):null,E,R,w);return k[0]=l instanceof Uint32Array?k[0]:new l.constructor(k[0]),k},getScale:function(l,m){return r(l instanceof Float32Array),r(l.length%m==0),r(m>=3),u(t.exports.meshopt_simplifyScale,l,l.length/m,m*4)},simplifyPoints:function(l,m,p,h,I,x){return r(this.useExperimentalFeatures),r(l instanceof Float32Array),r(l.length%m==0),r(m>=3),r(p>=0&&p<=l.length/m),h?(r(h instanceof Float32Array),r(h.length%I==0),r(I>=3),r(l.length/m==h.length/I),d(t.exports.meshopt_simplifyPoints,l,l.length/m,m*4,h,I*4,x,p)):d(t.exports.meshopt_simplifyPoints,l,l.length/m,m*4,void 0,0,0,p)}}}();const Gc=new xs.GLTFExporter,ba=new nr;ba.registerExtensions([Sa]);const zc=()=>{const a=Tn.useRef(null);async function e(i){const o=await Gc.parseAsync(i,{binary:!0});a.current=await ba.readBinary(new Uint8Array(o))}async function t(){if(!a.current)return;const i=await a.current.transform(ic(),fs(),un(),Uc({simplifier:Lc,ratio:.1,error:1e-4}));a.current=i}async function n(){if(!a.current)return;const i=await a.current.transform(Ut({}));a.current=i}async function s(){if(!a.current)return;const i=await a.current.transform(fs({}));a.current=i}async function r(){if(a.current)return await ba.writeBinary(a.current)}return{load:e,getModel:r,simplifyOptimization:t,dedupOptimization:n,quantizeOptimization:s}};exports.useOptimizeModel=zc;
|