@vizbl/shopify-room-viewer 0.0.13 → 0.0.14

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.
@@ -131,7 +131,7 @@ version 0.8.2
131
131
 
132
132
  /**
133
133
  * @license
134
- * Copyright 2010-2025 Three.js Authors
134
+ * Copyright 2010-2026 Three.js Authors
135
135
  * SPDX-License-Identifier: MIT
136
136
  */
137
137
 
@@ -0,0 +1,9 @@
1
+ var BASIS=(()=>{var e="u">typeof document?document.currentScript?.src:void 0;return"u">typeof __filename&&(e||=__filename),function(r={}){var t,n,a,o,s,i,u,l,c,p,f,h,d,v,y,m,g,$,T,b,w,C,P,A,W=new Promise((e,r)=>{t=e,n=r}),_="object"==typeof window,S="function"==typeof importScripts,F="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,j=Object.assign({},r),E="";if(F){var k=require("fs"),O=require("path");E=__dirname+"/",o=e=>(e=z(e)?new URL(e):O.normalize(e),k.readFileSync(e)),a=(e,r=!0)=>(e=z(e)?new URL(e):O.normalize(e),new Promise((t,n)=>{k.readFile(e,r?void 0:"utf8",(e,a)=>{e?n(e):t(r?a.buffer:a)})})),!r.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else(_||S)&&(S?E=self.location.href:"u">typeof document&&document.currentScript&&(E=document.currentScript.src),e&&(E=e),E=E.startsWith("blob:")?"":E.substr(0,E.replace(/[?#].*/,"").lastIndexOf("/")+1),S&&(o=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),a=e=>z(e)?new Promise((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{(200==n.status||0==n.status&&n.response)&&t(n.response),r(n.status)},n.onerror=r,n.send(null)}):fetch(e,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(Error(e.status+" : "+e.url))));var R=r.print||console.log.bind(console),x=r.printErr||console.error.bind(console);Object.assign(r,j),j=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(s=r.wasmBinary);var D=!1;function I(){var e=i.buffer;r.HEAP8=u=new Int8Array(e),r.HEAP16=c=new Int16Array(e),r.HEAPU8=l=new Uint8Array(e),r.HEAPU16=p=new Uint16Array(e),r.HEAP32=f=new Int32Array(e),r.HEAPU32=h=new Uint32Array(e),r.HEAPF32=d=new Float32Array(e),r.HEAPF64=v=new Float64Array(e)}var V=[],U=[],H=[],B=0,M=null,q=null;function N(e){r.onAbort?.(e),x(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var z=e=>e.startsWith("file://");function L(e){if(e==y&&s)return new Uint8Array(s);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}function G(e,r,t){return(!s?a(e).then(e=>new Uint8Array(e),()=>L(e)):Promise.resolve().then(()=>L(e))).then(e=>WebAssembly.instantiate(e,r)).then(t,e=>{x(`failed to asynchronously prepare wasm: ${e}`),N(e)})}var X=e=>{for(;e.length>0;)e.shift()(r)};r.noExitRuntime;class J{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){h[this.ptr+4>>2]=e}get_type(){return h[this.ptr+4>>2]}set_destructor(e){h[this.ptr+8>>2]=e}get_destructor(){return h[this.ptr+8>>2]}set_caught(e){e=+!!e,u[this.ptr+12]=e}get_caught(){return 0!=u[this.ptr+12]}set_rethrown(e){e=+!!e,u[this.ptr+13]=e}get_rethrown(){return 0!=u[this.ptr+13]}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){h[this.ptr+16>>2]=e}get_adjusted_ptr(){return h[this.ptr+16>>2]}get_exception_ptr(){if(rl(this.get_type()))return h[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var K=0,Q=0,Z={},Y=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function ee(e){return this.fromWireType(h[e>>2])}var er={},et={},en={},ea=e=>{throw new m(e)},eo=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&ea("Mismatched type converter count");for(var a=0;a<e.length;++a)eu(e[a],n[a])}e.forEach(function(e){en[e]=r});var a=Array(r.length),o=[],s=0;r.forEach((e,r)=>{et.hasOwnProperty(e)?a[r]=et[e]:(o.push(e),er.hasOwnProperty(e)||(er[e]=[]),er[e].push(()=>{a[r]=et[e],++s===o.length&&n(a)}))}),0===o.length&&n(a)},es=e=>{for(var r="",t=e;l[t];)r+=g[l[t++]];return r},ei=e=>{throw new $(e)};function eu(e,r,t={}){if(!("argPackAdvance"in r))throw TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||ei(`type "${n}" must have a positive integer typeid pointer`),et.hasOwnProperty(e))if(t.ignoreDuplicateRegistrations)return;else ei(`Cannot register type '${n}' twice`);if(et[e]=r,delete en[e],er.hasOwnProperty(e)){var a=er[e];delete er[e],a.forEach(e=>e())}}(e,r,t)}var el=e=>{ei(e.$$.ptrType.registeredClass.name+" instance already deleted")},ec=!1,ep=e=>{},ef=e=>{e.count.value-=1,0===e.count.value&&(e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr))},eh=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=eh(e,r,t.baseClass);return null===n?null:t.downcast(n)},ed={},ev=[],ey=()=>{for(;ev.length;){var e=ev.pop();e.$$.deleteScheduled=!1,e.delete()}},em={},eg=(e,r)=>(r.ptrType&&r.ptr||ea("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&ea("Both smartPtrType and smartPtr must be specified"),r.count={value:1},e$(Object.create(e,{$$:{value:r,writable:!0}}))),e$=e=>"u"<typeof FinalizationRegistry?(e$=e=>e,e):(ec=new FinalizationRegistry(e=>{ef(e.$$)}),e$=e=>{var r=e.$$;return r.smartPtr&&ec.register(e,{$$:r},e),e},ep=e=>ec.unregister(e),e$(e));function eT(){}var eb=(e,r)=>Object.defineProperty(r,"name",{value:e}),ew=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||ei(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},eC=(e,t,n)=>{r.hasOwnProperty(e)?((void 0===n||void 0!==r[e].overloadTable&&void 0!==r[e].overloadTable[n])&&ei(`Cannot register public name '${e}' twice`),ew(r,e,e),r.hasOwnProperty(n)&&ei(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),r[e].overloadTable[n]=t):(r[e]=t,void 0!==n&&(r[e].numArguments=n))};function eP(e,r,t,n,a,o,s,i){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=i,this.pureVirtualFunctions=[]}var eA=(e,r,t)=>{for(;r!==t;)r.upcast||ei(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function eW(e,r){if(null===r)return this.isReference&&ei(`null is not a valid ${this.name}`),0;r.$$||ei(`Cannot pass "${eG(r)}" as a ${this.name}`),r.$$.ptr||ei(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return eA(r.$$.ptr,t,this.registeredClass)}function e_(e,r){if(null===r)return(this.isReference&&ei(`null is not a valid ${this.name}`),this.isSmartPointer)?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||ei(`Cannot pass "${eG(r)}" as a ${this.name}`),r.$$.ptr||ei(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&ei(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var t,n=r.$$.ptrType.registeredClass;if(t=eA(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&ei("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:ei(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var a=r.clone();t=this.rawShare(t,eN.toHandle(()=>a.delete())),null!==e&&e.push(this.rawDestructor,t)}break;default:ei("Unsupporting sharing policy")}return t}function eS(e,r){if(null===r)return this.isReference&&ei(`null is not a valid ${this.name}`),0;r.$$||ei(`Cannot pass "${eG(r)}" as a ${this.name}`),r.$$.ptr||ei(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&ei(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return eA(r.$$.ptr,t,this.registeredClass)}function eF(e,r,t,n,a,o,s,i,u,l,c){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=i,this.rawConstructor=u,this.rawShare=l,this.rawDestructor=c,a||void 0!==r.baseClass?this.toWireType=e_:(n?this.toWireType=eW:this.toWireType=eS,this.destructorFunction=null)}var ej=(e,t,n)=>{r.hasOwnProperty(e)||ea("Replacing nonexistent public symbol"),void 0!==r[e].overloadTable&&void 0!==n?r[e].overloadTable[n]=t:(r[e]=t,r[e].argCount=n)},eE=[],ek=e=>{var r=eE[e];return r||(e>=eE.length&&(eE.length=e+1),eE[e]=r=b.get(e)),r},eO=(e,t)=>{e=es(e);var n=function(){if(e.includes("j")){let n;return n=e,(...e)=>((e,t,n=[])=>{if(e.includes("j")){var a;return(0,r["dynCall_"+(a=(a=e).replace(/p/g,"i"))])(t,...n)}return ek(t)(...n)})(n,t,e)}return ek(t)}();return"function"!=typeof n&&ei(`unknown function pointer with signature ${e}: ${t}`),n},eR=e=>{var r=rs(e),t=es(r);return ru(r),t},ex=(e,r)=>{var t=[],n={};throw r.forEach(function e(r){if(!n[r]&&!et[r]){if(en[r])return void en[r].forEach(e);t.push(r),n[r]=!0}}),new w(`${e}: `+t.map(eR).join([", "]))},eD=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(h[r+4*n>>2]);return t};function eI(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function eV(e,r){if(!(e instanceof Function))throw TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=eb(e.name||"unknownFunctionName",function(){});t.prototype=e.prototype;var n=new t,a=e.apply(n,r);return a instanceof Object?a:n}function eU(e,r,t,n,a,o){var s=r.length;s<2&&ei("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=null!==r[1]&&null!==t,u=eI(r),l="void"!==r[0].name,c=[e,ei,n,a,Y,r[0],r[1]],p=0;p<s-2;++p)c.push(r[p+2]);if(!u)for(var p=i?1:2;p<r.length;++p)null!==r[p].destructorFunction&&c.push(r[p].destructorFunction);let[f,h]=function(e,r,t,n){for(var a=eI(e),o=e.length,s="",i="",u=0;u<o-2;++u)s+=(0!==u?", ":"")+"arg"+u,i+=(0!==u?", ":"")+"arg"+u+"Wired";var l=`
2
+ return function (${s}) {
3
+ if (arguments.length !== ${o-2}) {
4
+ throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${o-2}');
5
+ }`;a&&(l+="var destructors = [];\n");var c=a?"destructors":"null",p=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];r&&(l+="var thisWired = classParam['toWireType']("+c+", this);\n");for(var u=0;u<o-2;++u)l+="var arg"+u+"Wired = argType"+u+"['toWireType']("+c+", arg"+u+");\n",p.push("argType"+u);if(r&&(i="thisWired"+(i.length>0?", ":"")+i),l+=(t||n?"var rv = ":"")+"invoker(fn"+(i.length>0?", ":"")+i+");\n",a)l+="runDestructors(destructors);\n";else for(var u=r?1:2;u<e.length;++u){var f=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(l+=`${f}_dtor(${f});
6
+ `,p.push(`${f}_dtor`))}return t&&(l+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[p,l+="}\n"]}(r,i,l,o);return f.push(h),eb(e,eV(Function,f)(...c))}var eH=e=>{let r=(e=e.trim()).indexOf("(");return -1!==r?e.substr(0,r):e},eB=[],eM=[],eq=e=>{e>9&&0==--eM[e+1]&&(eM[e]=void 0,eB.push(e))},eN={toValue:e=>(e||ei("Cannot use deleted val. handle = "+e),eM[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=eB.pop()||eM.length;return eM[r]=e,eM[r+1]=1,r}}}},ez={name:"emscripten::val",fromWireType:e=>{var r=eN.toValue(e);return eq(e),r},toWireType:(e,r)=>eN.toHandle(r),argPackAdvance:8,readValueFromPointer:ee,destructorFunction:null},eL=(e,r)=>{var t=et[e];return void 0===t&&ei(`${r} has unknown type ${eR(e)}`),t},eG=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},eX="u">typeof TextDecoder?new TextDecoder:void 0,eJ=(e,r,t)=>{for(var n=r+t,a=r;e[a]&&!(a>=n);)++a;if(a-r>16&&e.buffer&&eX)return eX.decode(e.subarray(r,a));for(var o="";r<a;){var s=e[r++];if(!(128&s)){o+=String.fromCharCode(s);continue}var i=63&e[r++];if((224&s)==192){o+=String.fromCharCode((31&s)<<6|i);continue}var u=63&e[r++];if((s=(240&s)==224?(15&s)<<12|i<<6|u:(7&s)<<18|i<<12|u<<6|63&e[r++])<65536)o+=String.fromCharCode(s);else{var l=s-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}return o},eK=(e,r)=>e?eJ(l,e,r):"",eQ="u">typeof TextDecoder?new TextDecoder("utf-16le"):void 0,eZ=(e,r)=>{for(var t=e,n=t>>1,a=n+r/2;!(n>=a)&&p[n];)++n;if((t=n<<1)-e>32&&eQ)return eQ.decode(l.subarray(e,t));for(var o="",s=0;!(s>=r/2);++s){var i=c[e+2*s>>1];if(0==i)break;o+=String.fromCharCode(i)}return o},eY=(e,r,t)=>{if((t??=0x7fffffff)<2)return 0;for(var n=r,a=(t-=2)<2*e.length?t/2:e.length,o=0;o<a;++o){var s=e.charCodeAt(o);c[r>>1]=s,r+=2}return c[r>>1]=0,r-n},e0=e=>2*e.length,e1=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var a=f[e+4*t>>2];if(0==a)break;if(++t,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|1023&o)}else n+=String.fromCharCode(a)}return n},e2=(e,r,t)=>{if((t??=0x7fffffff)<4)return 0;for(var n=r,a=n+t-4,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),f[r>>2]=s,(r+=4)+4>a)break}return f[r>>2]=0,r-n},e6=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},e3=(e,r,t)=>{var n=[],a=e.toWireType(n,t);return n.length&&(h[r>>2]=eN.toHandle(n)),a},e5=[],e4={},e8=e=>{var r=e4[e];return void 0===r?es(e):r},e7=()=>"object"==typeof globalThis?globalThis:Function("return this")(),e9=e=>{var r=(e-i.buffer.byteLength+65535)/65536;try{return i.grow(r),I(),1}catch(e){}},re=[null,[],[]],rr=(e,r)=>{var t=re[e];0===r||10===r?((1===e?R:x)(eJ(t,0)),t.length=0):t.push(r)};m=r.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}};for(var rt=Array(256),rn=0;rn<256;++rn)rt[rn]=String.fromCharCode(rn);g=rt,$=r.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(eT.prototype,{isAliasOf(e){if(!(this instanceof eT)||!(e instanceof eT))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,a=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return r===n&&t===a},clone(){if(this.$$.ptr||el(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;{let r;var e=e$(Object.create(Object.getPrototypeOf(this),{$$:{value:{count:(r=this.$$).count,deleteScheduled:r.deleteScheduled,preservePointerOnDelete:r.preservePointerOnDelete,ptr:r.ptr,ptrType:r.ptrType,smartPtr:r.smartPtr,smartPtrType:r.smartPtrType}}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}},delete(){this.$$.ptr||el(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ei("Object already scheduled for deletion"),ep(this),ef(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||el(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ei("Object already scheduled for deletion"),ev.push(this),1===ev.length&&T&&T(ey),this.$$.deleteScheduled=!0,this}}),r.getInheritedInstanceCount=()=>Object.keys(em).length,r.getLiveInheritedInstances=()=>{var e=[];for(var r in em)em.hasOwnProperty(r)&&e.push(em[r]);return e},r.flushPendingDeletes=ey,r.setDelayFunction=e=>{T=e,ev.length&&T&&T(ey)},Object.assign(eF.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:ee,fromWireType:function(e){var r,t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=em[((e,r)=>{for(void 0===r&&ei("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(this.registeredClass,t)];if(void 0!==n)if(0===n.$$.count.value)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();else{var a=n.clone();return this.destructor(e),a}function o(){return this.isSmartPointer?eg(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):eg(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s=ed[this.registeredClass.getActualType(t)];if(!s)return o.call(this);r=this.isConst?s.constPointerType:s.pointerType;var i=eh(t,this.registeredClass,r.registeredClass);return null===i?o.call(this):this.isSmartPointer?eg(r.registeredClass.instancePrototype,{ptrType:r,ptr:i,smartPtrType:this,smartPtr:e}):eg(r.registeredClass.instancePrototype,{ptrType:r,ptr:i})}}),P=Error,(A=eb("UnboundTypeError",function(e){this.name="UnboundTypeError",this.message=e;var r=Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))})).prototype=Object.create(P.prototype),A.prototype.constructor=A,A.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},w=r.UnboundTypeError=A,eM.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>eM.length/2-5-eB.length;var ra={K:(e,r,t)=>{throw new J(e).init(r,t),K=e,Q++,K},G:()=>{N("")},s:e=>{var r=Z[e];delete Z[e];var t=r.rawConstructor,n=r.rawDestructor,a=r.fields;eo([e],a.map(e=>e.getterReturnType).concat(a.map(e=>e.setterArgumentType)),e=>{var o={};return a.forEach((r,t)=>{var n=r.fieldName,s=e[t],i=r.getter,u=r.getterContext,l=e[t+a.length],c=r.setter,p=r.setterContext;o[n]={read:e=>s.fromWireType(i(u,e)),write:(e,r)=>{var t=[];c(p,e,l.toWireType(t,r)),Y(t)}}}),[{name:r.name,fromWireType:e=>{var r={};for(var t in o)r[t]=o[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var a in o)if(!(a in r))throw TypeError(`Missing field: "${a}"`);var s=t();for(a in o)o[a].write(s,r[a]);return null!==e&&e.push(n,s),s},argPackAdvance:8,readValueFromPointer:ee,destructorFunction:n}]})},C:(e,r,t,n,a)=>{},I:(e,r,t,n)=>{eu(e,{name:r=es(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(l[e])},destructorFunction:null})},w:(e,r,t,n,a,o,s,i,u,l,c,p,f)=>{c=es(c),o=eO(a,o),i&&=eO(s,i),l&&=eO(u,l),f=eO(p,f);var h=(e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(c);eC(h,function(){ex(`Cannot construct ${c} due to unbound types`,[n])}),eo([e,r,t],n?[n]:[],r=>{r=r[0];var t,a=n?(t=r.registeredClass).instancePrototype:eT.prototype,s=eb(c,function(...e){if(Object.getPrototypeOf(this)!==u)throw new $("Use 'new' to construct "+c);if(void 0===p.constructor_body)throw new $(c+" has no accessible constructor");var r=p.constructor_body[e.length];if(void 0===r)throw new $(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)}),u=Object.create(a,{constructor:{value:s}});s.prototype=u;var p=new eP(c,s,u,f,t,o,i,l);p.baseClass&&(p.baseClass.__derivedClasses??=[],p.baseClass.__derivedClasses.push(p));var d=new eF(c,p,!0,!1,!1),v=new eF(c+"*",p,!1,!1,!1),y=new eF(c+" const*",p,!1,!0,!1);return ed[e]={pointerType:v,constPointerType:y},ej(h,s),[d,v,y]})},v:(e,r,t,n,a,o)=>{var s=eD(r,t);a=eO(n,a),eo([],[e],e=>{e=e[0];var t=`constructor ${e.name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new $(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{ex(`Cannot construct ${e.name} due to unbound types`,s)},eo([],s,n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=eU(t,n,null,a,o),[])),[]})},d:(e,r,t,n,a,o,s,i,u)=>{var l=eD(t,n);r=eH(r=es(r)),o=eO(a,o),eo([],[e],e=>{e=e[0];var n=`${e.name}.${r}`;function a(){ex(`Cannot call ${n} due to unbound types`,l)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(r);var c=e.registeredClass.instancePrototype,p=c[r];return void 0===p||void 0===p.overloadTable&&p.className!==e.name&&p.argCount===t-2?(a.argCount=t-2,a.className=e.name,c[r]=a):(ew(c,r,n),c[r].overloadTable[t-2]=a),eo([],l,a=>{var i=eU(n,a,e,o,s,u);return void 0===c[r].overloadTable?(i.argCount=t-2,c[r]=i):c[r].overloadTable[t-2]=i,[]}),[]})},m:(e,t,n)=>{e=es(e),eo([],[t],t=>(t=t[0],r[e]=t.fromWireType(n),[]))},H:e=>eu(e,ez),o:(e,r,t,n)=>{function a(){}r=es(r),a.values={},eu(e,{name:r,constructor:a,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,r)=>r.value,argPackAdvance:8,readValueFromPointer:((e,r,t)=>{switch(r){case 1:return t?function(e){return this.fromWireType(u[e])}:function(e){return this.fromWireType(l[e])};case 2:return t?function(e){return this.fromWireType(c[e>>1])}:function(e){return this.fromWireType(p[e>>1])};case 4:return t?function(e){return this.fromWireType(f[e>>2])}:function(e){return this.fromWireType(h[e>>2])};default:throw TypeError(`invalid integer width (${r}): ${e}`)}})(r,t,n),destructorFunction:null}),eC(r,a)},a:(e,r,t)=>{var n=eL(e,"enum");r=es(r);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:eb(`${n.name}_${r}`,function(){})}});a.values[t]=o,a[r]=o},A:(e,r,t)=>{eu(e,{name:r=es(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:((e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(d[e>>2])};case 8:return function(e){return this.fromWireType(v[e>>3])};default:throw TypeError(`invalid float width (${r}): ${e}`)}})(r,t),destructorFunction:null})},i:(e,r,t,n,a,o,s)=>{var i=eD(r,t);e=eH(e=es(e)),a=eO(n,a),eC(e,function(){ex(`Cannot call ${e} due to unbound types`,i)},r-1),eo([],i,t=>{var n=[t[0],null].concat(t.slice(1));return ej(e,eU(e,n,null,a,o,s),r-1),[]})},l:(e,r,t,n,a)=>{r=es(r),-1===a&&(a=0xffffffff);var o=e=>e;if(0===n){var s=32-8*t;o=e=>e<<s>>>s}var i=r.includes("unsigned"),d=(e,r)=>{};eu(e,{name:r,fromWireType:o,toWireType:i?function(e,r){return d(r,this.name),r>>>0}:function(e,r){return d(r,this.name),r},argPackAdvance:8,readValueFromPointer:((e,r,t)=>{switch(r){case 1:return t?e=>u[e]:e=>l[e];case 2:return t?e=>c[e>>1]:e=>p[e>>1];case 4:return t?e=>f[e>>2]:e=>h[e>>2];default:throw TypeError(`invalid integer width (${r}): ${e}`)}})(r,t,0!==n),destructorFunction:null})},f:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=h[e>>2],t=h[e+4>>2];return new n(u.buffer,t,r)}eu(e,{name:t=es(t),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},z:(e,r)=>{var t="std::string"===(r=es(r));eu(e,{name:r,fromWireType(e){var r,n=h[e>>2],a=e+4;if(t)for(var o=a,s=0;s<=n;++s){var i=a+s;if(s==n||0==l[i]){var u=i-o,c=eK(o,u);void 0===r?r=c:(r+="\0",r+=c),o=i+1}}else{for(var p=Array(n),s=0;s<n;++s)p[s]=String.fromCharCode(l[a+s]);r=p.join("")}return ru(e),r},toWireType(e,r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n,a="string"==typeof r;a||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||ei("Cannot pass non-string to std::string"),n=t&&a?(e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r})(r):r.length;var o=ri(4+n+1),s=o+4;if(h[o>>2]=n,t&&a)((e,r,t,n)=>{if(n>0){for(var a=t+n-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0}})(r,l,s,n+1);else if(a)for(var i=0;i<n;++i){var u=r.charCodeAt(i);u>255&&(ru(s),ei("String has UTF-16 code units that do not fit in 8 bits")),l[s+i]=u}else for(var i=0;i<n;++i)l[s+i]=r[i];return null!==e&&e.push(ru,o),o},argPackAdvance:8,readValueFromPointer:ee,destructorFunction(e){ru(e)}})},u:(e,r,t)=>{var n,a,o,s;t=es(t),2===r?(n=eZ,a=eY,s=e0,o=e=>p[e>>1]):4===r&&(n=e1,a=e2,s=e6,o=e=>h[e>>2]),eu(e,{name:t,fromWireType:e=>{for(var t,a=h[e>>2],s=e+4,i=0;i<=a;++i){var u=e+4+i*r;if(i==a||0==o(u)){var l=u-s,c=n(s,l);void 0===t?t=c:(t+="\0",t+=c),s=u+r}}return ru(e),t},toWireType:(e,n)=>{"string"!=typeof n&&ei(`Cannot pass non-string to C++ string type ${t}`);var o=s(n),i=ri(4+o+r);return h[i>>2]=o/r,a(n,i+4,o+r),null!==e&&e.push(ru,i),i},argPackAdvance:8,readValueFromPointer:ee,destructorFunction(e){ru(e)}})},t:(e,r,t,n,a,o)=>{Z[e]={name:es(r),rawConstructor:eO(t,n),rawDestructor:eO(a,o),fields:[]}},c:(e,r,t,n,a,o,s,i,u,l)=>{Z[e].fields.push({fieldName:es(r),getterReturnType:t,getter:eO(n,a),getterContext:o,setterArgumentType:s,setter:eO(i,u),setterContext:l})},J:(e,r)=>{eu(e,{isVoid:!0,name:r=es(r),argPackAdvance:0,fromWireType:()=>void 0,toWireType:(e,r)=>void 0})},F:(e,r,t)=>l.copyWithin(e,r,r+t),n:(e,r,t)=>(e=eN.toValue(e),e3(r=eL(r,"emval::as"),t,e)),q:(e,r,t,n)=>(e=e5[e])(null,r=eN.toValue(r),t,n),p:(e,r,t,n,a)=>(e=e5[e],e(r=eN.toValue(r),r[t=e8(t)],n,a)),b:eq,x:e=>0===e?eN.toHandle(e7()):(e=e8(e),eN.toHandle(e7()[e])),j:(e,r,t)=>{var n,a,o=((e,r)=>{for(var t=Array(e),n=0;n<e;++n)t[n]=eL(h[r+4*n>>2],"parameter "+n);return t})(e,r),s=o.shift();e--;var i=`return function (obj, func, destructorsRef, args) {
7
+ `,u=0,l=[];0===t&&l.push("obj");for(var c=["retType"],p=[s],f=0;f<e;++f)l.push("arg"+f),c.push("argType"+f),p.push(o[f]),i+=` var arg${f} = argType${f}.readValueFromPointer(args${u?"+"+u:""});
8
+ `,u+=o[f].argPackAdvance;i+=` var rv = ${1===t?"new func":"func.call"}(${l.join(", ")});
9
+ `,s.isVoid||(c.push("emval_returnValue"),p.push(e3),i+=" return emval_returnValue(retType, destructorsRef, rv);\n"),i+="};\n",c.push(i);var d=eV(Function,c)(...p);return n=eb(`methodCaller<(${o.map(e=>e.name).join(", ")}) => ${s.name}>`,d),a=e5.length,e5.push(n),a},r:e=>(e=e8(e),eN.toHandle(r[e])),g:(e,r)=>(e=eN.toValue(e),r=eN.toValue(r),eN.toHandle(e[r])),k:e=>{e>9&&(eM[e+1]+=1)},h:e=>eN.toHandle(e8(e)),e:e=>{Y(eN.toValue(e)),eq(e)},D:e=>{var r=l.length;if((e>>>=0)>0x80000000)return!1;for(var t=(e,r)=>e+(r-e%r)%r,n=1;n<=4;n*=2){var a=r*(1+.2/n);if(a=Math.min(a,e+0x6000000),e9(Math.min(0x80000000,t(Math.max(e,a),65536))))return!0}return!1},E:e=>52,B:function(e,r,t,n,a){return 70},y:(e,r,t,n)=>{for(var a=0,o=0;o<t;o++){var s=h[r>>2],i=h[r+4>>2];r+=8;for(var u=0;u<i;u++)rr(e,l[s+u]);a+=i}return h[n>>2]=a,0}},ro=function(){var e,t,a,o,u={a:ra};function l(e,t){var n;if(i=(ro=e.exports).L,I(),b=ro.P,n=ro.M,U.unshift(n),B--,r.monitorRunDependencies?.(B),0==B&&(null!==M&&(clearInterval(M),M=null),q)){var a=q;q=null,a()}return ro}if(B++,r.monitorRunDependencies?.(B),r.instantiateWasm)try{return r.instantiateWasm(u,l)}catch(e){x(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return y||(y=function(){var e="basis_transcoder.wasm";return e.startsWith("data:application/octet-stream;base64,")?e:r.locateFile?r.locateFile(e,E):E+e}()),(e=s,t=y,a=u,o=function(e){l(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||t.startsWith("data:application/octet-stream;base64,")||z(t)||F||"function"!=typeof fetch?G(t,a,o):fetch(t,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(o,function(e){return x(`wasm streaming compile failed: ${e}`),x("falling back to ArrayBuffer instantiation"),G(t,a,o)}))).catch(n),{}}(),rs=e=>(rs=ro.N)(e),ri=e=>(ri=ro.O)(e),ru=e=>(ru=ro.Q)(e),rl=e=>(rl=ro.R)(e);function rc(){if(!(B>0)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;){var e;e=r.preRun.shift(),V.unshift(e)}X(V),B>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),n()},1)):n())}function n(){if(!C&&(C=!0,r.calledRun=!0,!D)){if(X(U),t(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e;e=r.postRun.shift(),H.unshift(e)}X(H)}}}if(r.dynCall_jiji=(e,t,n,a,o)=>(r.dynCall_jiji=ro.S)(e,t,n,a,o),q=function e(){C||rc(),C||(q=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return rc(),W}})();"object"==typeof exports&&"object"==typeof module?module.exports=BASIS:"function"==typeof define&&define.amd&&define([],()=>BASIS);