@dcl/wearable-preview 2.7.1 → 2.7.2-20143799834.commit-b2765f6
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/assets/{babylon.inspector.bundle.max-DLoRMI18.js → babylon.inspector.bundle.max-BvsMNuix.js} +1 -1
- package/assets/{index-COHTSOeg.js → index-BPKcx_vM.js} +4 -4
- package/index.html +3 -3
- package/package.json +3 -3
- package/static-local/assets/{babylon.inspector.bundle.max-BeSzUjE_.js → babylon.inspector.bundle.max-O86_PLqu.js} +1 -1
- package/static-local/assets/{index-BS_QmslQ.js → index-BXfsUIEW.js} +4 -4
- package/static-local/index.html +1 -1
- package/static-local/package.json +1 -1
|
@@ -48,7 +48,7 @@ Error generating stack: `+F.message+`
|
|
|
48
48
|
|| ${U} === "boolean" || ${M} === null`).assign(V,(0,r._)`[${M}]`)}}}function p({gen:S,parentData:C,parentDataProperty:O},A){S.if((0,r._)`${C} !== undefined`,()=>S.assign((0,r._)`${C}[${O}]`,A))}function _(S,C,O,A=a.Correct){const M=A===a.Correct?r.operators.EQ:r.operators.NEQ;let D;switch(S){case"null":return(0,r._)`${C} ${M} null`;case"array":D=(0,r._)`Array.isArray(${C})`;break;case"object":D=(0,r._)`${C} && typeof ${C} == "object" && !Array.isArray(${C})`;break;case"integer":D=U((0,r._)`!(${C} % 1) && !isNaN(${C})`);break;case"number":D=U();break;default:return(0,r._)`typeof ${C} ${M} ${S}`}return A===a.Correct?D:(0,r.not)(D);function U(V=r.nil){return(0,r.and)((0,r._)`typeof ${C} == "number"`,V,O?(0,r._)`isFinite(${C})`:r.nil)}}n.checkDataType=_;function g(S,C,O,A){if(S.length===1)return _(S[0],C,O,A);let M;const D=(0,o.toHash)(S);if(D.array&&D.object){const U=(0,r._)`typeof ${C} != "object"`;M=D.null?U:(0,r._)`!${C} || ${U}`,delete D.null,delete D.array,delete D.object}else M=r.nil;D.number&&delete D.integer;for(const U in D)M=(0,r.and)(M,_(U,C,O,A));return M}n.checkDataTypes=g;const v={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:C})=>typeof S=="string"?(0,r._)`{type: ${S}}`:(0,r._)`{type: ${C}}`};function E(S){const C=T(S);(0,i.reportError)(C,v)}n.reportTypeError=E;function T(S){const{gen:C,data:O,schema:A}=S,M=(0,o.schemaRefOrVal)(S,A,"type");return{gen:C,keyword:"type",data:O,schema:A.type,schemaCode:M,schemaValue:M,parentSchema:A,params:{},it:S}}}(pm)),pm}var Qu={},jT;function oL(){if(jT)return Qu;jT=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.assignDefaults=void 0;const n=Xt(),t=gi();function e(r,o){const{properties:a,items:s}=r.schema;if(o==="object"&&a)for(const l in a)i(r,l,a[l].default);else o==="array"&&Array.isArray(s)&&s.forEach((l,u)=>i(r,u,l.default))}Qu.assignDefaults=e;function i(r,o,a){const{gen:s,compositeRule:l,data:u,opts:f}=r;if(a===void 0)return;const c=(0,n._)`${u}${(0,n.getProperty)(o)}`;if(l){(0,t.checkStrictMode)(r,`default is ignored for: ${c}`);return}let h=(0,n._)`${c} === undefined`;f.useDefaults==="empty"&&(h=(0,n._)`${h} || ${c} === null || ${c} === ""`),s.if(h,(0,n._)`${c} = ${(0,n.stringify)(a)}`)}return Qu}var vo={},Si={},XT;function Po(){if(XT)return Si;XT=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.validateUnion=Si.validateArray=Si.usePattern=Si.callValidateCode=Si.schemaProperties=Si.allSchemaProperties=Si.noPropertyInData=Si.propertyInData=Si.isOwnProperty=Si.hasPropFunc=Si.reportMissingProp=Si.checkMissingProp=Si.checkReportMissingProp=void 0;const n=Xt(),t=gi(),e=Aa(),i=gi();function r(T,S){const{gen:C,data:O,it:A}=T;C.if(f(C,O,S,A.opts.ownProperties),()=>{T.setParams({missingProperty:(0,n._)`${S}`},!0),T.error()})}Si.checkReportMissingProp=r;function o({gen:T,data:S,it:{opts:C}},O,A){return(0,n.or)(...O.map(M=>(0,n.and)(f(T,S,M,C.ownProperties),(0,n._)`${A} = ${M}`)))}Si.checkMissingProp=o;function a(T,S){T.setParams({missingProperty:S},!0),T.error()}Si.reportMissingProp=a;function s(T){return T.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,n._)`Object.prototype.hasOwnProperty`})}Si.hasPropFunc=s;function l(T,S,C){return(0,n._)`${s(T)}.call(${S}, ${C})`}Si.isOwnProperty=l;function u(T,S,C,O){const A=(0,n._)`${S}${(0,n.getProperty)(C)} !== undefined`;return O?(0,n._)`${A} && ${l(T,S,C)}`:A}Si.propertyInData=u;function f(T,S,C,O){const A=(0,n._)`${S}${(0,n.getProperty)(C)} === undefined`;return O?(0,n.or)(A,(0,n.not)(l(T,S,C))):A}Si.noPropertyInData=f;function c(T){return T?Object.keys(T).filter(S=>S!=="__proto__"):[]}Si.allSchemaProperties=c;function h(T,S){return c(S).filter(C=>!(0,t.alwaysValidSchema)(T,S[C]))}Si.schemaProperties=h;function p({schemaCode:T,data:S,it:{gen:C,topSchemaRef:O,schemaPath:A,errorPath:M},it:D},U,V,B){const z=B?(0,n._)`${T}, ${S}, ${O}${A}`:S,J=[[e.default.instancePath,(0,n.strConcat)(e.default.instancePath,M)],[e.default.parentData,D.parentData],[e.default.parentDataProperty,D.parentDataProperty],[e.default.rootData,e.default.rootData]];D.opts.dynamicRef&&J.push([e.default.dynamicAnchors,e.default.dynamicAnchors]);const X=(0,n._)`${z}, ${C.object(...J)}`;return V!==n.nil?(0,n._)`${U}.call(${V}, ${X})`:(0,n._)`${U}(${X})`}Si.callValidateCode=p;const _=(0,n._)`new RegExp`;function g({gen:T,it:{opts:S}},C){const O=S.unicodeRegExp?"u":"",{regExp:A}=S.code,M=A(C,O);return T.scopeValue("pattern",{key:M.toString(),ref:M,code:(0,n._)`${A.code==="new RegExp"?_:(0,i.useFunc)(T,A)}(${C}, ${O})`})}Si.usePattern=g;function v(T){const{gen:S,data:C,keyword:O,it:A}=T,M=S.name("valid");if(A.allErrors){const U=S.let("valid",!0);return D(()=>S.assign(U,!1)),U}return S.var(M,!0),D(()=>S.break()),M;function D(U){const V=S.const("len",(0,n._)`${C}.length`);S.forRange("i",0,V,B=>{T.subschema({keyword:O,dataProp:B,dataPropType:t.Type.Num},M),S.if((0,n.not)(M),U)})}}Si.validateArray=v;function E(T){const{gen:S,schema:C,keyword:O,it:A}=T;if(!Array.isArray(C))throw new Error("ajv implementation error");if(C.some(V=>(0,t.alwaysValidSchema)(A,V))&&!A.opts.unevaluated)return;const D=S.let("valid",!1),U=S.name("_valid");S.block(()=>C.forEach((V,B)=>{const z=T.subschema({keyword:O,schemaProp:B,compositeRule:!0},U);S.assign(D,(0,n._)`${D} || ${U}`),T.mergeValidEvaluated(z,U)||S.if((0,n.not)(D))})),T.result(D,()=>T.reset(),()=>T.error(!0))}return Si.validateUnion=E,Si}var YT;function aL(){if(YT)return vo;YT=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.validateKeywordUsage=vo.validSchemaType=vo.funcKeywordCode=vo.macroKeywordCode=void 0;const n=Xt(),t=Aa(),e=Po(),i=nc();function r(h,p){const{gen:_,keyword:g,schema:v,parentSchema:E,it:T}=h,S=p.macro.call(T.self,v,E,T),C=u(_,g,S);T.opts.validateSchema!==!1&&T.self.validateSchema(S,!0);const O=_.name("valid");h.subschema({schema:S,schemaPath:n.nil,errSchemaPath:`${T.errSchemaPath}/${g}`,topSchemaRef:C,compositeRule:!0},O),h.pass(O,()=>h.error(!0))}vo.macroKeywordCode=r;function o(h,p){var _;const{gen:g,keyword:v,schema:E,parentSchema:T,$data:S,it:C}=h;l(C,p);const O=!S&&p.compile?p.compile.call(C.self,E,T,C):p.validate,A=u(g,v,O),M=g.let("valid");h.block$data(M,D),h.ok((_=p.valid)!==null&&_!==void 0?_:M);function D(){if(p.errors===!1)B(),p.modifying&&a(h),z(()=>h.error());else{const J=p.async?U():V();p.modifying&&a(h),z(()=>s(h,J))}}function U(){const J=g.let("ruleErrs",null);return g.try(()=>B((0,n._)`await `),X=>g.assign(M,!1).if((0,n._)`${X} instanceof ${C.ValidationError}`,()=>g.assign(J,(0,n._)`${X}.errors`),()=>g.throw(X))),J}function V(){const J=(0,n._)`${A}.errors`;return g.assign(J,null),B(n.nil),J}function B(J=p.async?(0,n._)`await `:n.nil){const X=C.opts.passContext?t.default.this:t.default.self,re=!("compile"in p&&!S||p.schema===!1);g.assign(M,(0,n._)`${J}${(0,e.callValidateCode)(h,A,X,re)}`,p.modifying)}function z(J){var X;g.if((0,n.not)((X=p.valid)!==null&&X!==void 0?X:M),J)}}vo.funcKeywordCode=o;function a(h){const{gen:p,data:_,it:g}=h;p.if(g.parentData,()=>p.assign(_,(0,n._)`${g.parentData}[${g.parentDataProperty}]`))}function s(h,p){const{gen:_}=h;_.if((0,n._)`Array.isArray(${p})`,()=>{_.assign(t.default.vErrors,(0,n._)`${t.default.vErrors} === null ? ${p} : ${t.default.vErrors}.concat(${p})`).assign(t.default.errors,(0,n._)`${t.default.vErrors}.length`),(0,i.extendErrors)(h)},()=>h.error())}function l({schemaEnv:h},p){if(p.async&&!h.$async)throw new Error("async keyword in sync schema")}function u(h,p,_){if(_===void 0)throw new Error(`keyword "${p}" failed to compile`);return h.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,n.stringify)(_)})}function f(h,p,_=!1){return!p.length||p.some(g=>g==="array"?Array.isArray(h):g==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==g||_&&typeof h>"u")}vo.validSchemaType=f;function c({schema:h,opts:p,self:_,errSchemaPath:g},v,E){if(Array.isArray(v.keyword)?!v.keyword.includes(E):v.keyword!==E)throw new Error("ajv implementation error");const T=v.dependencies;if(T!=null&&T.some(S=>!Object.prototype.hasOwnProperty.call(h,S)))throw new Error(`parent schema must have dependencies of ${E}: ${T.join(",")}`);if(v.validateSchema&&!v.validateSchema(h[E])){const C=`keyword "${E}" value is invalid at path "${g}": `+_.errorsText(v.validateSchema.errors);if(p.validateSchema==="log")_.logger.error(C);else throw new Error(C)}}return vo.validateKeywordUsage=c,vo}var la={},KT;function sL(){if(KT)return la;KT=1,Object.defineProperty(la,"__esModule",{value:!0}),la.extendSubschemaMode=la.extendSubschemaData=la.getSubschema=void 0;const n=Xt(),t=gi();function e(o,{keyword:a,schemaProp:s,schema:l,schemaPath:u,errSchemaPath:f,topSchemaRef:c}){if(a!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const h=o.schema[a];return s===void 0?{schema:h,schemaPath:(0,n._)`${o.schemaPath}${(0,n.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${a}`}:{schema:h[s],schemaPath:(0,n._)`${o.schemaPath}${(0,n.getProperty)(a)}${(0,n.getProperty)(s)}`,errSchemaPath:`${o.errSchemaPath}/${a}/${(0,t.escapeFragment)(s)}`}}if(l!==void 0){if(u===void 0||f===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:c,errSchemaPath:f}}throw new Error('either "keyword" or "schema" must be passed')}la.getSubschema=e;function i(o,a,{dataProp:s,dataPropType:l,data:u,dataTypes:f,propertyName:c}){if(u!==void 0&&s!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=a;if(s!==void 0){const{errorPath:_,dataPathArr:g,opts:v}=a,E=h.let("data",(0,n._)`${a.data}${(0,n.getProperty)(s)}`,!0);p(E),o.errorPath=(0,n.str)`${_}${(0,t.getErrorPath)(s,l,v.jsPropertySyntax)}`,o.parentDataProperty=(0,n._)`${s}`,o.dataPathArr=[...g,o.parentDataProperty]}if(u!==void 0){const _=u instanceof n.Name?u:h.let("data",u,!0);p(_),c!==void 0&&(o.propertyName=c)}f&&(o.dataTypes=f);function p(_){o.data=_,o.dataLevel=a.dataLevel+1,o.dataTypes=[],a.definedProperties=new Set,o.parentData=a.data,o.dataNames=[...a.dataNames,_]}}la.extendSubschemaData=i;function r(o,{jtdDiscriminator:a,jtdMetadata:s,compositeRule:l,createErrors:u,allErrors:f}){l!==void 0&&(o.compositeRule=l),u!==void 0&&(o.createErrors=u),f!==void 0&&(o.allErrors=f),o.jtdDiscriminator=a,o.jtdMetadata=s}return la.extendSubschemaMode=r,la}var sn={},_m,qT;function Jd(){return qT||(qT=1,_m=function n(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var i,r,o;if(Array.isArray(t)){if(i=t.length,i!=e.length)return!1;for(r=i;r--!==0;)if(!n(t[r],e[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(e).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;for(r=i;r--!==0;){var a=o[r];if(!n(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}),_m}var mm={exports:{}},QT;function lL(){if(QT)return mm.exports;QT=1;var n=mm.exports=function(i,r,o){typeof r=="function"&&(o=r,r={}),o=r.cb||o;var a=typeof o=="function"?o:o.pre||function(){},s=o.post||function(){};t(r,a,s,i,"",i)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(i,r,o,a,s,l,u,f,c,h){if(a&&typeof a=="object"&&!Array.isArray(a)){r(a,s,l,u,f,c,h);for(var p in a){var _=a[p];if(Array.isArray(_)){if(p in n.arrayKeywords)for(var g=0;g<_.length;g++)t(i,r,o,_[g],s+"/"+p+"/"+g,l,s,p,a,g)}else if(p in n.propsKeywords){if(_&&typeof _=="object")for(var v in _)t(i,r,o,_[v],s+"/"+p+"/"+e(v),l,s,p,a,v)}else(p in n.keywords||i.allKeys&&!(p in n.skipKeywords))&&t(i,r,o,_,s+"/"+p,l,s,p,a)}o(a,s,l,u,f,c,h)}}function e(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}return mm.exports}var $T;function ep(){if($T)return sn;$T=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.getSchemaRefs=sn.resolveUrl=sn.normalizeId=sn._getFullPath=sn.getFullPath=sn.inlineRef=void 0;const n=gi(),t=Jd(),e=lL(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function r(g,v=!0){return typeof g=="boolean"?!0:v===!0?!a(g):v?s(g)<=v:!1}sn.inlineRef=r;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(g){for(const v in g){if(o.has(v))return!0;const E=g[v];if(Array.isArray(E)&&E.some(a)||typeof E=="object"&&a(E))return!0}return!1}function s(g){let v=0;for(const E in g){if(E==="$ref")return 1/0;if(v++,!i.has(E)&&(typeof g[E]=="object"&&(0,n.eachItem)(g[E],T=>v+=s(T)),v===1/0))return 1/0}return v}function l(g,v="",E){E!==!1&&(v=c(v));const T=g.parse(v);return u(g,T)}sn.getFullPath=l;function u(g,v){return g.serialize(v).split("#")[0]+"#"}sn._getFullPath=u;const f=/#\/?$/;function c(g){return g?g.replace(f,""):""}sn.normalizeId=c;function h(g,v,E){return E=c(E),g.resolve(v,E)}sn.resolveUrl=h;const p=/^[a-z_][-a-z0-9._]*$/i;function _(g,v){if(typeof g=="boolean")return{};const{schemaId:E,uriResolver:T}=this.opts,S=c(g[E]||v),C={"":S},O=l(T,S,!1),A={},M=new Set;return e(g,{allKeys:!0},(V,B,z,J)=>{if(J===void 0)return;const X=O+B;let re=C[J];typeof V[E]=="string"&&(re=ae.call(this,V[E])),se.call(this,V.$anchor),se.call(this,V.$dynamicAnchor),C[B]=re;function ae(H){const Z=this.opts.uriResolver.resolve;if(H=c(re?Z(re,H):H),M.has(H))throw U(H);M.add(H);let q=this.refs[H];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?D(V,q.schema,H):H!==c(X)&&(H[0]==="#"?(D(V,A[H],H),A[H]=V):this.refs[H]=X),H}function se(H){if(typeof H=="string"){if(!p.test(H))throw new Error(`invalid anchor "${H}"`);ae.call(this,`#${H}`)}}}),A;function D(V,B,z){if(B!==void 0&&!t(V,B))throw U(z)}function U(V){return new Error(`reference "${V}" resolves to more than one schema`)}}return sn.getSchemaRefs=_,sn}var ZT;function oc(){if(ZT)return aa;ZT=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.getData=aa.KeywordCxt=aa.validateFunctionCode=void 0;const n=nL(),t=Bd(),e=lM(),i=Bd(),r=oL(),o=aL(),a=sL(),s=Xt(),l=Aa(),u=ep(),f=gi(),c=nc();function h(ee){if(O(ee)&&(M(ee),C(ee))){v(ee);return}p(ee,()=>(0,n.topBoolOrEmptySchema)(ee))}aa.validateFunctionCode=h;function p({gen:ee,validateName:pe,schema:Pe,schemaEnv:xe,opts:We},je){We.code.es5?ee.func(pe,(0,s._)`${l.default.data}, ${l.default.valCxt}`,xe.$async,()=>{ee.code((0,s._)`"use strict"; ${T(Pe,We)}`),g(ee,We),ee.code(je)}):ee.func(pe,(0,s._)`${l.default.data}, ${_(We)}`,xe.$async,()=>ee.code(T(Pe,We)).code(je))}function _(ee){return(0,s._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${ee.dynamicRef?(0,s._)`, ${l.default.dynamicAnchors}={}`:s.nil}}={}`}function g(ee,pe){ee.if(l.default.valCxt,()=>{ee.var(l.default.instancePath,(0,s._)`${l.default.valCxt}.${l.default.instancePath}`),ee.var(l.default.parentData,(0,s._)`${l.default.valCxt}.${l.default.parentData}`),ee.var(l.default.parentDataProperty,(0,s._)`${l.default.valCxt}.${l.default.parentDataProperty}`),ee.var(l.default.rootData,(0,s._)`${l.default.valCxt}.${l.default.rootData}`),pe.dynamicRef&&ee.var(l.default.dynamicAnchors,(0,s._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{ee.var(l.default.instancePath,(0,s._)`""`),ee.var(l.default.parentData,(0,s._)`undefined`),ee.var(l.default.parentDataProperty,(0,s._)`undefined`),ee.var(l.default.rootData,l.default.data),pe.dynamicRef&&ee.var(l.default.dynamicAnchors,(0,s._)`{}`)})}function v(ee){const{schema:pe,opts:Pe,gen:xe}=ee;p(ee,()=>{Pe.$comment&&pe.$comment&&J(ee),V(ee),xe.let(l.default.vErrors,null),xe.let(l.default.errors,0),Pe.unevaluated&&E(ee),D(ee),X(ee)})}function E(ee){const{gen:pe,validateName:Pe}=ee;ee.evaluated=pe.const("evaluated",(0,s._)`${Pe}.evaluated`),pe.if((0,s._)`${ee.evaluated}.dynamicProps`,()=>pe.assign((0,s._)`${ee.evaluated}.props`,(0,s._)`undefined`)),pe.if((0,s._)`${ee.evaluated}.dynamicItems`,()=>pe.assign((0,s._)`${ee.evaluated}.items`,(0,s._)`undefined`))}function T(ee,pe){const Pe=typeof ee=="object"&&ee[pe.schemaId];return Pe&&(pe.code.source||pe.code.process)?(0,s._)`/*# sourceURL=${Pe} */`:s.nil}function S(ee,pe){if(O(ee)&&(M(ee),C(ee))){A(ee,pe);return}(0,n.boolOrEmptySchema)(ee,pe)}function C({schema:ee,self:pe}){if(typeof ee=="boolean")return!ee;for(const Pe in ee)if(pe.RULES.all[Pe])return!0;return!1}function O(ee){return typeof ee.schema!="boolean"}function A(ee,pe){const{schema:Pe,gen:xe,opts:We}=ee;We.$comment&&Pe.$comment&&J(ee),B(ee),z(ee);const je=xe.const("_errs",l.default.errors);D(ee,je),xe.var(pe,(0,s._)`${je} === ${l.default.errors}`)}function M(ee){(0,f.checkUnknownRules)(ee),U(ee)}function D(ee,pe){if(ee.opts.jtd)return ae(ee,[],!1,pe);const Pe=(0,t.getSchemaTypes)(ee.schema),xe=(0,t.coerceAndCheckDataType)(ee,Pe);ae(ee,Pe,!xe,pe)}function U(ee){const{schema:pe,errSchemaPath:Pe,opts:xe,self:We}=ee;pe.$ref&&xe.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(pe,We.RULES)&&We.logger.warn(`$ref: keywords ignored in schema at path "${Pe}"`)}function V(ee){const{schema:pe,opts:Pe}=ee;pe.default!==void 0&&Pe.useDefaults&&Pe.strictSchema&&(0,f.checkStrictMode)(ee,"default is ignored in the schema root")}function B(ee){const pe=ee.schema[ee.opts.schemaId];pe&&(ee.baseId=(0,u.resolveUrl)(ee.opts.uriResolver,ee.baseId,pe))}function z(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw new Error("async schema in sync schema")}function J({gen:ee,schemaEnv:pe,schema:Pe,errSchemaPath:xe,opts:We}){const je=Pe.$comment;if(We.$comment===!0)ee.code((0,s._)`${l.default.self}.logger.log(${je})`);else if(typeof We.$comment=="function"){const Xe=(0,s.str)`${xe}/$comment`,ft=ee.scopeValue("root",{ref:pe.root});ee.code((0,s._)`${l.default.self}.opts.$comment(${je}, ${Xe}, ${ft}.schema)`)}}function X(ee){const{gen:pe,schemaEnv:Pe,validateName:xe,ValidationError:We,opts:je}=ee;Pe.$async?pe.if((0,s._)`${l.default.errors} === 0`,()=>pe.return(l.default.data),()=>pe.throw((0,s._)`new ${We}(${l.default.vErrors})`)):(pe.assign((0,s._)`${xe}.errors`,l.default.vErrors),je.unevaluated&&re(ee),pe.return((0,s._)`${l.default.errors} === 0`))}function re({gen:ee,evaluated:pe,props:Pe,items:xe}){Pe instanceof s.Name&&ee.assign((0,s._)`${pe}.props`,Pe),xe instanceof s.Name&&ee.assign((0,s._)`${pe}.items`,xe)}function ae(ee,pe,Pe,xe){const{gen:We,schema:je,data:Xe,allErrors:ft,opts:we,self:Ye}=ee,{RULES:tt}=Ye;if(je.$ref&&(we.ignoreKeywordsWithRef||!(0,f.schemaHasRulesButRef)(je,tt))){We.block(()=>Y(ee,"$ref",tt.all.$ref.definition));return}we.jtd||H(ee,pe),We.block(()=>{for(const yt of tt.rules)lt(yt);lt(tt.post)});function lt(yt){(0,e.shouldUseGroup)(je,yt)&&(yt.type?(We.if((0,i.checkDataType)(yt.type,Xe,we.strictNumbers)),se(ee,yt),pe.length===1&&pe[0]===yt.type&&Pe&&(We.else(),(0,i.reportTypeError)(ee)),We.endIf()):se(ee,yt),ft||We.if((0,s._)`${l.default.errors} === ${xe||0}`))}}function se(ee,pe){const{gen:Pe,schema:xe,opts:{useDefaults:We}}=ee;We&&(0,r.assignDefaults)(ee,pe.type),Pe.block(()=>{for(const je of pe.rules)(0,e.shouldUseRule)(xe,je)&&Y(ee,je.keyword,je.definition,pe.type)})}function H(ee,pe){ee.schemaEnv.meta||!ee.opts.strictTypes||(Z(ee,pe),ee.opts.allowUnionTypes||q(ee,pe),N(ee,ee.dataTypes))}function Z(ee,pe){if(pe.length){if(!ee.dataTypes.length){ee.dataTypes=pe;return}pe.forEach(Pe=>{$(ee.dataTypes,Pe)||L(ee,`type "${Pe}" not allowed by context "${ee.dataTypes.join(",")}"`)}),ee.dataTypes=ee.dataTypes.filter(Pe=>$(pe,Pe))}}function q(ee,pe){pe.length>1&&!(pe.length===2&&pe.includes("null"))&&L(ee,"use allowUnionTypes to allow union type keyword")}function N(ee,pe){const Pe=ee.self.RULES.all;for(const xe in Pe){const We=Pe[xe];if(typeof We=="object"&&(0,e.shouldUseRule)(ee.schema,We)){const{type:je}=We.definition;je.length&&!je.some(Xe=>W(pe,Xe))&&L(ee,`missing type "${je.join(",")}" for keyword "${xe}"`)}}}function W(ee,pe){return ee.includes(pe)||pe==="number"&&ee.includes("integer")}function $(ee,pe){return ee.includes(pe)||pe==="integer"&&ee.includes("number")}function L(ee,pe){const Pe=ee.schemaEnv.baseId+ee.errSchemaPath;pe+=` at "${Pe}" (strictTypes)`,(0,f.checkStrictMode)(ee,pe,ee.opts.strictTypes)}class G{constructor(pe,Pe,xe){if((0,o.validateKeywordUsage)(pe,Pe,xe),this.gen=pe.gen,this.allErrors=pe.allErrors,this.keyword=xe,this.data=pe.data,this.schema=pe.schema[xe],this.$data=Pe.$data&&pe.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(pe,this.schema,xe,this.$data),this.schemaType=Pe.schemaType,this.parentSchema=pe.schema,this.params={},this.it=pe,this.def=Pe,this.$data)this.schemaCode=pe.gen.const("vSchema",Se(this.$data,pe));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,Pe.schemaType,Pe.allowUndefined))throw new Error(`${xe} value must be ${JSON.stringify(Pe.schemaType)}`);("code"in Pe?Pe.trackErrors:Pe.errors!==!1)&&(this.errsCount=pe.gen.const("_errs",l.default.errors))}result(pe,Pe,xe){this.failResult((0,s.not)(pe),Pe,xe)}failResult(pe,Pe,xe){this.gen.if(pe),xe?xe():this.error(),Pe?(this.gen.else(),Pe(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(pe,Pe){this.failResult((0,s.not)(pe),void 0,Pe)}fail(pe){if(pe===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(pe),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(pe){if(!this.$data)return this.fail(pe);const{schemaCode:Pe}=this;this.fail((0,s._)`${Pe} !== undefined && (${(0,s.or)(this.invalid$data(),pe)})`)}error(pe,Pe,xe){if(Pe){this.setParams(Pe),this._error(pe,xe),this.setParams({});return}this._error(pe,xe)}_error(pe,Pe){(pe?c.reportExtraError:c.reportError)(this,this.def.error,Pe)}$dataError(){(0,c.reportError)(this,this.def.$dataError||c.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,c.resetErrorsCount)(this.gen,this.errsCount)}ok(pe){this.allErrors||this.gen.if(pe)}setParams(pe,Pe){Pe?Object.assign(this.params,pe):this.params=pe}block$data(pe,Pe,xe=s.nil){this.gen.block(()=>{this.check$data(pe,xe),Pe()})}check$data(pe=s.nil,Pe=s.nil){if(!this.$data)return;const{gen:xe,schemaCode:We,schemaType:je,def:Xe}=this;xe.if((0,s.or)((0,s._)`${We} === undefined`,Pe)),pe!==s.nil&&xe.assign(pe,!0),(je.length||Xe.validateSchema)&&(xe.elseIf(this.invalid$data()),this.$dataError(),pe!==s.nil&&xe.assign(pe,!1)),xe.else()}invalid$data(){const{gen:pe,schemaCode:Pe,schemaType:xe,def:We,it:je}=this;return(0,s.or)(Xe(),ft());function Xe(){if(xe.length){if(!(Pe instanceof s.Name))throw new Error("ajv implementation error");const we=Array.isArray(xe)?xe:[xe];return(0,s._)`${(0,i.checkDataTypes)(we,Pe,je.opts.strictNumbers,i.DataType.Wrong)}`}return s.nil}function ft(){if(We.validateSchema){const we=pe.scopeValue("validate$data",{ref:We.validateSchema});return(0,s._)`!${we}(${Pe})`}return s.nil}}subschema(pe,Pe){const xe=(0,a.getSubschema)(this.it,pe);(0,a.extendSubschemaData)(xe,this.it,pe),(0,a.extendSubschemaMode)(xe,pe);const We={...this.it,...xe,items:void 0,props:void 0};return S(We,Pe),We}mergeEvaluated(pe,Pe){const{it:xe,gen:We}=this;xe.opts.unevaluated&&(xe.props!==!0&&pe.props!==void 0&&(xe.props=f.mergeEvaluated.props(We,pe.props,xe.props,Pe)),xe.items!==!0&&pe.items!==void 0&&(xe.items=f.mergeEvaluated.items(We,pe.items,xe.items,Pe)))}mergeValidEvaluated(pe,Pe){const{it:xe,gen:We}=this;if(xe.opts.unevaluated&&(xe.props!==!0||xe.items!==!0))return We.if(Pe,()=>this.mergeEvaluated(pe,s.Name)),!0}}aa.KeywordCxt=G;function Y(ee,pe,Pe,xe){const We=new G(ee,Pe,pe);"code"in Pe?Pe.code(We,xe):We.$data&&Pe.validate?(0,o.funcKeywordCode)(We,Pe):"macro"in Pe?(0,o.macroKeywordCode)(We,Pe):(Pe.compile||Pe.validate)&&(0,o.funcKeywordCode)(We,Pe)}const Q=/^\/(?:[^~]|~0|~1)*$/,fe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Se(ee,{dataLevel:pe,dataNames:Pe,dataPathArr:xe}){let We,je;if(ee==="")return l.default.rootData;if(ee[0]==="/"){if(!Q.test(ee))throw new Error(`Invalid JSON-pointer: ${ee}`);We=ee,je=l.default.rootData}else{const Ye=fe.exec(ee);if(!Ye)throw new Error(`Invalid JSON-pointer: ${ee}`);const tt=+Ye[1];if(We=Ye[2],We==="#"){if(tt>=pe)throw new Error(we("property/index",tt));return xe[pe-tt]}if(tt>pe)throw new Error(we("data",tt));if(je=Pe[pe-tt],!We)return je}let Xe=je;const ft=We.split("/");for(const Ye of ft)Ye&&(je=(0,s._)`${je}${(0,s.getProperty)((0,f.unescapeJsonPointer)(Ye))}`,Xe=(0,s._)`${Xe} && ${je}`);return Xe;function we(Ye,tt){return`Cannot access ${Ye} ${tt} levels up, current level is ${pe}`}}return aa.getData=Se,aa}var vh={},JT;function uM(){if(JT)return vh;JT=1,Object.defineProperty(vh,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}return vh.default=n,vh}var yh={},eS;function fM(){if(eS)return yh;eS=1,Object.defineProperty(yh,"__esModule",{value:!0});const n=ep();class t extends Error{constructor(i,r,o,a){super(a||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,n.resolveUrl)(i,r,o),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(i,this.missingRef))}}return yh.default=t,yh}var kn={},tS;function cb(){if(tS)return kn;tS=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.resolveSchema=kn.getCompilingSchema=kn.resolveRef=kn.compileSchema=kn.SchemaEnv=void 0;const n=Xt(),t=uM(),e=Aa(),i=ep(),r=gi(),o=oc();class a{constructor(E){var T;this.refs={},this.dynamicAnchors={};let S;typeof E.schema=="object"&&(S=E.schema),this.schema=E.schema,this.schemaId=E.schemaId,this.root=E.root||this,this.baseId=(T=E.baseId)!==null&&T!==void 0?T:(0,i.normalizeId)(S==null?void 0:S[E.schemaId||"$id"]),this.schemaPath=E.schemaPath,this.localRefs=E.localRefs,this.meta=E.meta,this.$async=S==null?void 0:S.$async,this.refs={}}}kn.SchemaEnv=a;function s(v){const E=f.call(this,v);if(E)return E;const T=(0,i.getFullPath)(this.opts.uriResolver,v.root.baseId),{es5:S,lines:C}=this.opts.code,{ownProperties:O}=this.opts,A=new n.CodeGen(this.scope,{es5:S,lines:C,ownProperties:O});let M;v.$async&&(M=A.scopeValue("Error",{ref:t.default,code:(0,n._)`require("ajv/dist/runtime/validation_error").default`}));const D=A.scopeName("validate");v.validateName=D;const U={gen:A,allErrors:this.opts.allErrors,data:e.default.data,parentData:e.default.parentData,parentDataProperty:e.default.parentDataProperty,dataNames:[e.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:v.schema,code:(0,n.stringify)(v.schema)}:{ref:v.schema}),validateName:D,ValidationError:M,schema:v.schema,schemaEnv:v,rootId:T,baseId:v.baseId||T,schemaPath:n.nil,errSchemaPath:v.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n._)`""`,opts:this.opts,self:this};let V;try{this._compilations.add(v),(0,o.validateFunctionCode)(U),A.optimize(this.opts.code.optimize);const B=A.toString();V=`${A.scopeRefs(e.default.scope)}return ${B}`,this.opts.code.process&&(V=this.opts.code.process(V,v));const J=new Function(`${e.default.self}`,`${e.default.scope}`,V)(this,this.scope.get());if(this.scope.value(D,{ref:J}),J.errors=null,J.schema=v.schema,J.schemaEnv=v,v.$async&&(J.$async=!0),this.opts.code.source===!0&&(J.source={validateName:D,validateCode:B,scopeValues:A._values}),this.opts.unevaluated){const{props:X,items:re}=U;J.evaluated={props:X instanceof n.Name?void 0:X,items:re instanceof n.Name?void 0:re,dynamicProps:X instanceof n.Name,dynamicItems:re instanceof n.Name},J.source&&(J.source.evaluated=(0,n.stringify)(J.evaluated))}return v.validate=J,v}catch(B){throw delete v.validate,delete v.validateName,V&&this.logger.error("Error compiling schema, function code:",V),B}finally{this._compilations.delete(v)}}kn.compileSchema=s;function l(v,E,T){var S;T=(0,i.resolveUrl)(this.opts.uriResolver,E,T);const C=v.refs[T];if(C)return C;let O=h.call(this,v,T);if(O===void 0){const A=(S=v.localRefs)===null||S===void 0?void 0:S[T],{schemaId:M}=this.opts;A&&(O=new a({schema:A,schemaId:M,root:v,baseId:E}))}if(O!==void 0)return v.refs[T]=u.call(this,O)}kn.resolveRef=l;function u(v){return(0,i.inlineRef)(v.schema,this.opts.inlineRefs)?v.schema:v.validate?v:s.call(this,v)}function f(v){for(const E of this._compilations)if(c(E,v))return E}kn.getCompilingSchema=f;function c(v,E){return v.schema===E.schema&&v.root===E.root&&v.baseId===E.baseId}function h(v,E){let T;for(;typeof(T=this.refs[E])=="string";)E=T;return T||this.schemas[E]||p.call(this,v,E)}function p(v,E){const T=this.opts.uriResolver.parse(E),S=(0,i._getFullPath)(this.opts.uriResolver,T);let C=(0,i.getFullPath)(this.opts.uriResolver,v.baseId,void 0);if(Object.keys(v.schema).length>0&&S===C)return g.call(this,T,v);const O=(0,i.normalizeId)(S),A=this.refs[O]||this.schemas[O];if(typeof A=="string"){const M=p.call(this,v,A);return typeof(M==null?void 0:M.schema)!="object"?void 0:g.call(this,T,M)}if(typeof(A==null?void 0:A.schema)=="object"){if(A.validate||s.call(this,A),O===(0,i.normalizeId)(E)){const{schema:M}=A,{schemaId:D}=this.opts,U=M[D];return U&&(C=(0,i.resolveUrl)(this.opts.uriResolver,C,U)),new a({schema:M,schemaId:D,root:v,baseId:C})}return g.call(this,T,A)}}kn.resolveSchema=p;const _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(v,{baseId:E,schema:T,root:S}){var C;if(((C=v.fragment)===null||C===void 0?void 0:C[0])!=="/")return;for(const M of v.fragment.slice(1).split("/")){if(typeof T=="boolean")return;const D=T[(0,r.unescapeFragment)(M)];if(D===void 0)return;T=D;const U=typeof T=="object"&&T[this.opts.schemaId];!_.has(M)&&U&&(E=(0,i.resolveUrl)(this.opts.uriResolver,E,U))}let O;if(typeof T!="boolean"&&T.$ref&&!(0,r.schemaHasRulesButRef)(T,this.RULES)){const M=(0,i.resolveUrl)(this.opts.uriResolver,E,T.$ref);O=p.call(this,S,M)}const{schemaId:A}=this.opts;if(O=O||new a({schema:T,schemaId:A,root:S,baseId:E}),O.schema!==O.root.schema)return O}return kn}const uL="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",fL="Meta-schema for $data reference (JSON AnySchema extension proposal)",cL="object",hL=["$data"],dL={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},pL=!1,_L={$id:uL,description:fL,type:cL,required:hL,properties:dL,additionalProperties:pL};var bh={},cf={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */var mL=cf.exports,iS;function gL(){return iS||(iS=1,function(n,t){(function(e,i){i(t)})(mL,function(e){function i(){for(var ve=arguments.length,le=Array(ve),be=0;be<ve;be++)le[be]=arguments[be];if(le.length>1){le[0]=le[0].slice(0,-1);for(var Le=le.length-1,Ne=1;Ne<Le;++Ne)le[Ne]=le[Ne].slice(1,-1);return le[Le]=le[Le].slice(1),le.join("")}else return le[0]}function r(ve){return"(?:"+ve+")"}function o(ve){return ve===void 0?"undefined":ve===null?"null":Object.prototype.toString.call(ve).split(" ").pop().split("]").shift().toLowerCase()}function a(ve){return ve.toUpperCase()}function s(ve){return ve!=null?ve instanceof Array?ve:typeof ve.length!="number"||ve.split||ve.setInterval||ve.call?[ve]:Array.prototype.slice.call(ve):[]}function l(ve,le){var be=ve;if(le)for(var Le in le)be[Le]=le[Le];return be}function u(ve){var le="[A-Za-z]",be="[0-9]",Le=i(be,"[A-Fa-f]"),Ne=r(r("%[EFef]"+Le+"%"+Le+Le+"%"+Le+Le)+"|"+r("%[89A-Fa-f]"+Le+"%"+Le+Le)+"|"+r("%"+Le+Le)),Ge="[\\:\\/\\?\\#\\[\\]\\@]",$e="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",qe=i(Ge,$e),Ft=ve?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",xt=ve?"[\\uE000-\\uF8FF]":"[]",Bt=i(le,be,"[\\-\\.\\_\\~]",Ft);r(le+i(le,be,"[\\+\\-\\.]")+"*"),r(r(Ne+"|"+i(Bt,$e,"[\\:]"))+"*");var ai=r(r("25[0-5]")+"|"+r("2[0-4]"+be)+"|"+r("1"+be+be)+"|"+r("0?[1-9]"+be)+"|0?0?"+be),yi=r(ai+"\\."+ai+"\\."+ai+"\\."+ai),Dt=r(Le+"{1,4}"),pi=r(r(Dt+"\\:"+Dt)+"|"+yi),Di=r(r(Dt+"\\:")+"{6}"+pi),Ei=r("\\:\\:"+r(Dt+"\\:")+"{5}"+pi),ci=r(r(Dt)+"?\\:\\:"+r(Dt+"\\:")+"{4}"+pi),Kn=r(r(r(Dt+"\\:")+"{0,1}"+Dt)+"?\\:\\:"+r(Dt+"\\:")+"{3}"+pi),pn=r(r(r(Dt+"\\:")+"{0,2}"+Dt)+"?\\:\\:"+r(Dt+"\\:")+"{2}"+pi),Qo=r(r(r(Dt+"\\:")+"{0,3}"+Dt)+"?\\:\\:"+Dt+"\\:"+pi),qn=r(r(r(Dt+"\\:")+"{0,4}"+Dt)+"?\\:\\:"+pi),_n=r(r(r(Dt+"\\:")+"{0,5}"+Dt)+"?\\:\\:"+Dt),Nn=r(r(r(Dt+"\\:")+"{0,6}"+Dt)+"?\\:\\:"),Qn=r([Di,Ei,ci,Kn,pn,Qo,qn,_n,Nn].join("|")),mr=r(r(Bt+"|"+Ne)+"+");r("[vV]"+Le+"+\\."+i(Bt,$e,"[\\:]")+"+"),r(r(Ne+"|"+i(Bt,$e))+"*");var ls=r(Ne+"|"+i(Bt,$e,"[\\:\\@]"));return r(r(Ne+"|"+i(Bt,$e,"[\\@]"))+"+"),r(r(ls+"|"+i("[\\/\\?]",xt))+"*"),{NOT_SCHEME:new RegExp(i("[^]",le,be,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(i("[^\\%\\:]",Bt,$e),"g"),NOT_HOST:new RegExp(i("[^\\%\\[\\]\\:]",Bt,$e),"g"),NOT_PATH:new RegExp(i("[^\\%\\/\\:\\@]",Bt,$e),"g"),NOT_PATH_NOSCHEME:new RegExp(i("[^\\%\\/\\@]",Bt,$e),"g"),NOT_QUERY:new RegExp(i("[^\\%]",Bt,$e,"[\\:\\@\\/\\?]",xt),"g"),NOT_FRAGMENT:new RegExp(i("[^\\%]",Bt,$e,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(i("[^]",Bt,$e),"g"),UNRESERVED:new RegExp(Bt,"g"),OTHER_CHARS:new RegExp(i("[^\\%]",Bt,qe),"g"),PCT_ENCODED:new RegExp(Ne,"g"),IPV4ADDRESS:new RegExp("^("+yi+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Qn+")"+r(r("\\%25|\\%(?!"+Le+"{2})")+"("+mr+")")+"?\\]?$")}}var f=u(!1),c=u(!0),h=function(){function ve(le,be){var Le=[],Ne=!0,Ge=!1,$e=void 0;try{for(var qe=le[Symbol.iterator](),Ft;!(Ne=(Ft=qe.next()).done)&&(Le.push(Ft.value),!(be&&Le.length===be));Ne=!0);}catch(xt){Ge=!0,$e=xt}finally{try{!Ne&&qe.return&&qe.return()}finally{if(Ge)throw $e}}return Le}return function(le,be){if(Array.isArray(le))return le;if(Symbol.iterator in Object(le))return ve(le,be);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(ve){if(Array.isArray(ve)){for(var le=0,be=Array(ve.length);le<ve.length;le++)be[le]=ve[le];return be}else return Array.from(ve)},_=2147483647,g=36,v=1,E=26,T=38,S=700,C=72,O=128,A="-",M=/^xn--/,D=/[^\0-\x7E]/,U=/[\x2E\u3002\uFF0E\uFF61]/g,V={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},B=g-v,z=Math.floor,J=String.fromCharCode;function X(ve){throw new RangeError(V[ve])}function re(ve,le){for(var be=[],Le=ve.length;Le--;)be[Le]=le(ve[Le]);return be}function ae(ve,le){var be=ve.split("@"),Le="";be.length>1&&(Le=be[0]+"@",ve=be[1]),ve=ve.replace(U,".");var Ne=ve.split("."),Ge=re(Ne,le).join(".");return Le+Ge}function se(ve){for(var le=[],be=0,Le=ve.length;be<Le;){var Ne=ve.charCodeAt(be++);if(Ne>=55296&&Ne<=56319&&be<Le){var Ge=ve.charCodeAt(be++);(Ge&64512)==56320?le.push(((Ne&1023)<<10)+(Ge&1023)+65536):(le.push(Ne),be--)}else le.push(Ne)}return le}var H=function(le){return String.fromCodePoint.apply(String,p(le))},Z=function(le){return le-48<10?le-22:le-65<26?le-65:le-97<26?le-97:g},q=function(le,be){return le+22+75*(le<26)-((be!=0)<<5)},N=function(le,be,Le){var Ne=0;for(le=Le?z(le/S):le>>1,le+=z(le/be);le>B*E>>1;Ne+=g)le=z(le/B);return z(Ne+(B+1)*le/(le+T))},W=function(le){var be=[],Le=le.length,Ne=0,Ge=O,$e=C,qe=le.lastIndexOf(A);qe<0&&(qe=0);for(var Ft=0;Ft<qe;++Ft)le.charCodeAt(Ft)>=128&&X("not-basic"),be.push(le.charCodeAt(Ft));for(var xt=qe>0?qe+1:0;xt<Le;){for(var Bt=Ne,ai=1,yi=g;;yi+=g){xt>=Le&&X("invalid-input");var Dt=Z(le.charCodeAt(xt++));(Dt>=g||Dt>z((_-Ne)/ai))&&X("overflow"),Ne+=Dt*ai;var pi=yi<=$e?v:yi>=$e+E?E:yi-$e;if(Dt<pi)break;var Di=g-pi;ai>z(_/Di)&&X("overflow"),ai*=Di}var Ei=be.length+1;$e=N(Ne-Bt,Ei,Bt==0),z(Ne/Ei)>_-Ge&&X("overflow"),Ge+=z(Ne/Ei),Ne%=Ei,be.splice(Ne++,0,Ge)}return String.fromCodePoint.apply(String,be)},$=function(le){var be=[];le=se(le);var Le=le.length,Ne=O,Ge=0,$e=C,qe=!0,Ft=!1,xt=void 0;try{for(var Bt=le[Symbol.iterator](),ai;!(qe=(ai=Bt.next()).done);qe=!0){var yi=ai.value;yi<128&&be.push(J(yi))}}catch(Mo){Ft=!0,xt=Mo}finally{try{!qe&&Bt.return&&Bt.return()}finally{if(Ft)throw xt}}var Dt=be.length,pi=Dt;for(Dt&&be.push(A);pi<Le;){var Di=_,Ei=!0,ci=!1,Kn=void 0;try{for(var pn=le[Symbol.iterator](),Qo;!(Ei=(Qo=pn.next()).done);Ei=!0){var qn=Qo.value;qn>=Ne&&qn<Di&&(Di=qn)}}catch(Mo){ci=!0,Kn=Mo}finally{try{!Ei&&pn.return&&pn.return()}finally{if(ci)throw Kn}}var _n=pi+1;Di-Ne>z((_-Ge)/_n)&&X("overflow"),Ge+=(Di-Ne)*_n,Ne=Di;var Nn=!0,Qn=!1,mr=void 0;try{for(var ls=le[Symbol.iterator](),mn;!(Nn=(mn=ls.next()).done);Nn=!0){var pc=mn.value;if(pc<Ne&&++Ge>_&&X("overflow"),pc==Ne){for(var ol=Ge,al=g;;al+=g){var $o=al<=$e?v:al>=$e+E?E:al-$e;if(ol<$o)break;var us=ol-$o,Ma=g-$o;be.push(J(q($o+us%Ma,0))),ol=z(us/Ma)}be.push(J(q(ol,0))),$e=N(Ge,_n,pi==Dt),Ge=0,++pi}}}catch(Mo){Qn=!0,mr=Mo}finally{try{!Nn&&ls.return&&ls.return()}finally{if(Qn)throw mr}}++Ge,++Ne}return be.join("")},L=function(le){return ae(le,function(be){return M.test(be)?W(be.slice(4).toLowerCase()):be})},G=function(le){return ae(le,function(be){return D.test(be)?"xn--"+$(be):be})},Y={version:"2.1.0",ucs2:{decode:se,encode:H},decode:W,encode:$,toASCII:G,toUnicode:L},Q={};function fe(ve){var le=ve.charCodeAt(0),be=void 0;return le<16?be="%0"+le.toString(16).toUpperCase():le<128?be="%"+le.toString(16).toUpperCase():le<2048?be="%"+(le>>6|192).toString(16).toUpperCase()+"%"+(le&63|128).toString(16).toUpperCase():be="%"+(le>>12|224).toString(16).toUpperCase()+"%"+(le>>6&63|128).toString(16).toUpperCase()+"%"+(le&63|128).toString(16).toUpperCase(),be}function Se(ve){for(var le="",be=0,Le=ve.length;be<Le;){var Ne=parseInt(ve.substr(be+1,2),16);if(Ne<128)le+=String.fromCharCode(Ne),be+=3;else if(Ne>=194&&Ne<224){if(Le-be>=6){var Ge=parseInt(ve.substr(be+4,2),16);le+=String.fromCharCode((Ne&31)<<6|Ge&63)}else le+=ve.substr(be,6);be+=6}else if(Ne>=224){if(Le-be>=9){var $e=parseInt(ve.substr(be+4,2),16),qe=parseInt(ve.substr(be+7,2),16);le+=String.fromCharCode((Ne&15)<<12|($e&63)<<6|qe&63)}else le+=ve.substr(be,9);be+=9}else le+=ve.substr(be,3),be+=3}return le}function ee(ve,le){function be(Le){var Ne=Se(Le);return Ne.match(le.UNRESERVED)?Ne:Le}return ve.scheme&&(ve.scheme=String(ve.scheme).replace(le.PCT_ENCODED,be).toLowerCase().replace(le.NOT_SCHEME,"")),ve.userinfo!==void 0&&(ve.userinfo=String(ve.userinfo).replace(le.PCT_ENCODED,be).replace(le.NOT_USERINFO,fe).replace(le.PCT_ENCODED,a)),ve.host!==void 0&&(ve.host=String(ve.host).replace(le.PCT_ENCODED,be).toLowerCase().replace(le.NOT_HOST,fe).replace(le.PCT_ENCODED,a)),ve.path!==void 0&&(ve.path=String(ve.path).replace(le.PCT_ENCODED,be).replace(ve.scheme?le.NOT_PATH:le.NOT_PATH_NOSCHEME,fe).replace(le.PCT_ENCODED,a)),ve.query!==void 0&&(ve.query=String(ve.query).replace(le.PCT_ENCODED,be).replace(le.NOT_QUERY,fe).replace(le.PCT_ENCODED,a)),ve.fragment!==void 0&&(ve.fragment=String(ve.fragment).replace(le.PCT_ENCODED,be).replace(le.NOT_FRAGMENT,fe).replace(le.PCT_ENCODED,a)),ve}function pe(ve){return ve.replace(/^0*(.*)/,"$1")||"0"}function Pe(ve,le){var be=ve.match(le.IPV4ADDRESS)||[],Le=h(be,2),Ne=Le[1];return Ne?Ne.split(".").map(pe).join("."):ve}function xe(ve,le){var be=ve.match(le.IPV6ADDRESS)||[],Le=h(be,3),Ne=Le[1],Ge=Le[2];if(Ne){for(var $e=Ne.toLowerCase().split("::").reverse(),qe=h($e,2),Ft=qe[0],xt=qe[1],Bt=xt?xt.split(":").map(pe):[],ai=Ft.split(":").map(pe),yi=le.IPV4ADDRESS.test(ai[ai.length-1]),Dt=yi?7:8,pi=ai.length-Dt,Di=Array(Dt),Ei=0;Ei<Dt;++Ei)Di[Ei]=Bt[Ei]||ai[pi+Ei]||"";yi&&(Di[Dt-1]=Pe(Di[Dt-1],le));var ci=Di.reduce(function(_n,Nn,Qn){if(!Nn||Nn==="0"){var mr=_n[_n.length-1];mr&&mr.index+mr.length===Qn?mr.length++:_n.push({index:Qn,length:1})}return _n},[]),Kn=ci.sort(function(_n,Nn){return Nn.length-_n.length})[0],pn=void 0;if(Kn&&Kn.length>1){var Qo=Di.slice(0,Kn.index),qn=Di.slice(Kn.index+Kn.length);pn=Qo.join(":")+"::"+qn.join(":")}else pn=Di.join(":");return Ge&&(pn+="%"+Ge),pn}else return ve}var We=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,je="".match(/(){0}/)[1]===void 0;function Xe(ve){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be={},Le=le.iri!==!1?c:f;le.reference==="suffix"&&(ve=(le.scheme?le.scheme+":":"")+"//"+ve);var Ne=ve.match(We);if(Ne){je?(be.scheme=Ne[1],be.userinfo=Ne[3],be.host=Ne[4],be.port=parseInt(Ne[5],10),be.path=Ne[6]||"",be.query=Ne[7],be.fragment=Ne[8],isNaN(be.port)&&(be.port=Ne[5])):(be.scheme=Ne[1]||void 0,be.userinfo=ve.indexOf("@")!==-1?Ne[3]:void 0,be.host=ve.indexOf("//")!==-1?Ne[4]:void 0,be.port=parseInt(Ne[5],10),be.path=Ne[6]||"",be.query=ve.indexOf("?")!==-1?Ne[7]:void 0,be.fragment=ve.indexOf("#")!==-1?Ne[8]:void 0,isNaN(be.port)&&(be.port=ve.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?Ne[4]:void 0)),be.host&&(be.host=xe(Pe(be.host,Le),Le)),be.scheme===void 0&&be.userinfo===void 0&&be.host===void 0&&be.port===void 0&&!be.path&&be.query===void 0?be.reference="same-document":be.scheme===void 0?be.reference="relative":be.fragment===void 0?be.reference="absolute":be.reference="uri",le.reference&&le.reference!=="suffix"&&le.reference!==be.reference&&(be.error=be.error||"URI is not a "+le.reference+" reference.");var Ge=Q[(le.scheme||be.scheme||"").toLowerCase()];if(!le.unicodeSupport&&(!Ge||!Ge.unicodeSupport)){if(be.host&&(le.domainHost||Ge&&Ge.domainHost))try{be.host=Y.toASCII(be.host.replace(Le.PCT_ENCODED,Se).toLowerCase())}catch($e){be.error=be.error||"Host's domain name can not be converted to ASCII via punycode: "+$e}ee(be,f)}else ee(be,Le);Ge&&Ge.parse&&Ge.parse(be,le)}else be.error=be.error||"URI can not be parsed.";return be}function ft(ve,le){var be=le.iri!==!1?c:f,Le=[];return ve.userinfo!==void 0&&(Le.push(ve.userinfo),Le.push("@")),ve.host!==void 0&&Le.push(xe(Pe(String(ve.host),be),be).replace(be.IPV6ADDRESS,function(Ne,Ge,$e){return"["+Ge+($e?"%25"+$e:"")+"]"})),(typeof ve.port=="number"||typeof ve.port=="string")&&(Le.push(":"),Le.push(String(ve.port))),Le.length?Le.join(""):void 0}var we=/^\.\.?\//,Ye=/^\/\.(\/|$)/,tt=/^\/\.\.(\/|$)/,lt=/^\/?(?:.|\n)*?(?=\/|$)/;function yt(ve){for(var le=[];ve.length;)if(ve.match(we))ve=ve.replace(we,"");else if(ve.match(Ye))ve=ve.replace(Ye,"/");else if(ve.match(tt))ve=ve.replace(tt,"/"),le.pop();else if(ve==="."||ve==="..")ve="";else{var be=ve.match(lt);if(be){var Le=be[0];ve=ve.slice(Le.length),le.push(Le)}else throw new Error("Unexpected dot segment condition")}return le.join("")}function bt(ve){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be=le.iri?c:f,Le=[],Ne=Q[(le.scheme||ve.scheme||"").toLowerCase()];if(Ne&&Ne.serialize&&Ne.serialize(ve,le),ve.host&&!be.IPV6ADDRESS.test(ve.host)){if(le.domainHost||Ne&&Ne.domainHost)try{ve.host=le.iri?Y.toUnicode(ve.host):Y.toASCII(ve.host.replace(be.PCT_ENCODED,Se).toLowerCase())}catch(qe){ve.error=ve.error||"Host's domain name can not be converted to "+(le.iri?"Unicode":"ASCII")+" via punycode: "+qe}}ee(ve,be),le.reference!=="suffix"&&ve.scheme&&(Le.push(ve.scheme),Le.push(":"));var Ge=ft(ve,le);if(Ge!==void 0&&(le.reference!=="suffix"&&Le.push("//"),Le.push(Ge),ve.path&&ve.path.charAt(0)!=="/"&&Le.push("/")),ve.path!==void 0){var $e=ve.path;!le.absolutePath&&(!Ne||!Ne.absolutePath)&&($e=yt($e)),Ge===void 0&&($e=$e.replace(/^\/\//,"/%2F")),Le.push($e)}return ve.query!==void 0&&(Le.push("?"),Le.push(ve.query)),ve.fragment!==void 0&&(Le.push("#"),Le.push(ve.fragment)),Le.join("")}function Yt(ve,le){var be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Le=arguments[3],Ne={};return Le||(ve=Xe(bt(ve,be),be),le=Xe(bt(le,be),be)),be=be||{},!be.tolerant&&le.scheme?(Ne.scheme=le.scheme,Ne.userinfo=le.userinfo,Ne.host=le.host,Ne.port=le.port,Ne.path=yt(le.path||""),Ne.query=le.query):(le.userinfo!==void 0||le.host!==void 0||le.port!==void 0?(Ne.userinfo=le.userinfo,Ne.host=le.host,Ne.port=le.port,Ne.path=yt(le.path||""),Ne.query=le.query):(le.path?(le.path.charAt(0)==="/"?Ne.path=yt(le.path):((ve.userinfo!==void 0||ve.host!==void 0||ve.port!==void 0)&&!ve.path?Ne.path="/"+le.path:ve.path?Ne.path=ve.path.slice(0,ve.path.lastIndexOf("/")+1)+le.path:Ne.path=le.path,Ne.path=yt(Ne.path)),Ne.query=le.query):(Ne.path=ve.path,le.query!==void 0?Ne.query=le.query:Ne.query=ve.query),Ne.userinfo=ve.userinfo,Ne.host=ve.host,Ne.port=ve.port),Ne.scheme=ve.scheme),Ne.fragment=le.fragment,Ne}function Ut(ve,le,be){var Le=l({scheme:"null"},be);return bt(Yt(Xe(ve,Le),Xe(le,Le),Le,!0),Le)}function ei(ve,le){return typeof ve=="string"?ve=bt(Xe(ve,le),le):o(ve)==="object"&&(ve=Xe(bt(ve,le),le)),ve}function ar(ve,le,be){return typeof ve=="string"?ve=bt(Xe(ve,be),be):o(ve)==="object"&&(ve=bt(ve,be)),typeof le=="string"?le=bt(Xe(le,be),be):o(le)==="object"&&(le=bt(le,be)),ve===le}function xi(ve,le){return ve&&ve.toString().replace(!le||!le.iri?f.ESCAPE:c.ESCAPE,fe)}function si(ve,le){return ve&&ve.toString().replace(!le||!le.iri?f.PCT_ENCODED:c.PCT_ENCODED,Se)}var Kt={scheme:"http",domainHost:!0,parse:function(le,be){return le.host||(le.error=le.error||"HTTP URIs must have a host."),le},serialize:function(le,be){var Le=String(le.scheme).toLowerCase()==="https";return(le.port===(Le?443:80)||le.port==="")&&(le.port=void 0),le.path||(le.path="/"),le}},sr={scheme:"https",domainHost:Kt.domainHost,parse:Kt.parse,serialize:Kt.serialize};function Wt(ve){return typeof ve.secure=="boolean"?ve.secure:String(ve.scheme).toLowerCase()==="wss"}var lr={scheme:"ws",domainHost:!0,parse:function(le,be){var Le=le;return Le.secure=Wt(Le),Le.resourceName=(Le.path||"/")+(Le.query?"?"+Le.query:""),Le.path=void 0,Le.query=void 0,Le},serialize:function(le,be){if((le.port===(Wt(le)?443:80)||le.port==="")&&(le.port=void 0),typeof le.secure=="boolean"&&(le.scheme=le.secure?"wss":"ws",le.secure=void 0),le.resourceName){var Le=le.resourceName.split("?"),Ne=h(Le,2),Ge=Ne[0],$e=Ne[1];le.path=Ge&&Ge!=="/"?Ge:void 0,le.query=$e,le.resourceName=void 0}return le.fragment=void 0,le}},er={scheme:"wss",domainHost:lr.domainHost,parse:lr.parse,serialize:lr.serialize},Pi={},Yi="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ai="[0-9A-Fa-f]",nn=r(r("%[EFef]"+Ai+"%"+Ai+Ai+"%"+Ai+Ai)+"|"+r("%[89A-Fa-f]"+Ai+"%"+Ai+Ai)+"|"+r("%"+Ai+Ai)),ur="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",pr="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",zi=i(pr,'[\\"\\\\]'),Sr="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",dn=new RegExp(Yi,"g"),tr=new RegExp(nn,"g"),kr=new RegExp(i("[^]",ur,"[\\.]",'[\\"]',zi),"g"),Fi=new RegExp(i("[^]",Yi,Sr),"g"),Lr=Fi;function Ki(ve){var le=Se(ve);return le.match(dn)?le:ve}var Ii={scheme:"mailto",parse:function(le,be){var Le=le,Ne=Le.to=Le.path?Le.path.split(","):[];if(Le.path=void 0,Le.query){for(var Ge=!1,$e={},qe=Le.query.split("&"),Ft=0,xt=qe.length;Ft<xt;++Ft){var Bt=qe[Ft].split("=");switch(Bt[0]){case"to":for(var ai=Bt[1].split(","),yi=0,Dt=ai.length;yi<Dt;++yi)Ne.push(ai[yi]);break;case"subject":Le.subject=si(Bt[1],be);break;case"body":Le.body=si(Bt[1],be);break;default:Ge=!0,$e[si(Bt[0],be)]=si(Bt[1],be);break}}Ge&&(Le.headers=$e)}Le.query=void 0;for(var pi=0,Di=Ne.length;pi<Di;++pi){var Ei=Ne[pi].split("@");if(Ei[0]=si(Ei[0]),be.unicodeSupport)Ei[1]=si(Ei[1],be).toLowerCase();else try{Ei[1]=Y.toASCII(si(Ei[1],be).toLowerCase())}catch(ci){Le.error=Le.error||"Email address's domain name can not be converted to ASCII via punycode: "+ci}Ne[pi]=Ei.join("@")}return Le},serialize:function(le,be){var Le=le,Ne=s(le.to);if(Ne){for(var Ge=0,$e=Ne.length;Ge<$e;++Ge){var qe=String(Ne[Ge]),Ft=qe.lastIndexOf("@"),xt=qe.slice(0,Ft).replace(tr,Ki).replace(tr,a).replace(kr,fe),Bt=qe.slice(Ft+1);try{Bt=be.iri?Y.toUnicode(Bt):Y.toASCII(si(Bt,be).toLowerCase())}catch(pi){Le.error=Le.error||"Email address's domain name can not be converted to "+(be.iri?"Unicode":"ASCII")+" via punycode: "+pi}Ne[Ge]=xt+"@"+Bt}Le.path=Ne.join(",")}var ai=le.headers=le.headers||{};le.subject&&(ai.subject=le.subject),le.body&&(ai.body=le.body);var yi=[];for(var Dt in ai)ai[Dt]!==Pi[Dt]&&yi.push(Dt.replace(tr,Ki).replace(tr,a).replace(Fi,fe)+"="+ai[Dt].replace(tr,Ki).replace(tr,a).replace(Lr,fe));return yi.length&&(Le.query=yi.join("&")),Le}},_r=/^([^\:]+)\:(.*)/,vi={scheme:"urn",parse:function(le,be){var Le=le.path&&le.path.match(_r),Ne=le;if(Le){var Ge=be.scheme||Ne.scheme||"urn",$e=Le[1].toLowerCase(),qe=Le[2],Ft=Ge+":"+(be.nid||$e),xt=Q[Ft];Ne.nid=$e,Ne.nss=qe,Ne.path=void 0,xt&&(Ne=xt.parse(Ne,be))}else Ne.error=Ne.error||"URN can not be parsed.";return Ne},serialize:function(le,be){var Le=be.scheme||le.scheme||"urn",Ne=le.nid,Ge=Le+":"+(be.nid||Ne),$e=Q[Ge];$e&&(le=$e.serialize(le,be));var qe=le,Ft=le.nss;return qe.path=(Ne||be.nid)+":"+Ft,qe}},fi=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ri={scheme:"urn:uuid",parse:function(le,be){var Le=le;return Le.uuid=Le.nss,Le.nss=void 0,!be.tolerant&&(!Le.uuid||!Le.uuid.match(fi))&&(Le.error=Le.error||"UUID is not valid."),Le},serialize:function(le,be){var Le=le;return Le.nss=(le.uuid||"").toLowerCase(),Le}};Q[Kt.scheme]=Kt,Q[sr.scheme]=sr,Q[lr.scheme]=lr,Q[er.scheme]=er,Q[Ii.scheme]=Ii,Q[vi.scheme]=vi,Q[ri.scheme]=ri,e.SCHEMES=Q,e.pctEncChar=fe,e.pctDecChars=Se,e.parse=Xe,e.removeDotSegments=yt,e.serialize=bt,e.resolveComponents=Yt,e.resolve=Ut,e.normalize=ei,e.equal=ar,e.escapeComponent=xi,e.unescapeComponent=si,Object.defineProperty(e,"__esModule",{value:!0})})}(cf,cf.exports)),cf.exports}var rS;function vL(){if(rS)return bh;rS=1,Object.defineProperty(bh,"__esModule",{value:!0});const n=gL();return n.code='require("ajv/dist/runtime/uri").default',bh.default=n,bh}var nS;function yL(){return nS||(nS=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CodeGen=n.Name=n.nil=n.stringify=n.str=n._=n.KeywordCxt=void 0;var t=oc();Object.defineProperty(n,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var e=Xt();Object.defineProperty(n,"_",{enumerable:!0,get:function(){return e._}}),Object.defineProperty(n,"str",{enumerable:!0,get:function(){return e.str}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return e.stringify}}),Object.defineProperty(n,"nil",{enumerable:!0,get:function(){return e.nil}}),Object.defineProperty(n,"Name",{enumerable:!0,get:function(){return e.Name}}),Object.defineProperty(n,"CodeGen",{enumerable:!0,get:function(){return e.CodeGen}});const i=uM(),r=fM(),o=sM(),a=cb(),s=Xt(),l=ep(),u=Bd(),f=gi(),c=_L,h=vL(),p=(q,N)=>new RegExp(q,N);p.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},E={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},T=200;function S(q){var N,W,$,L,G,Y,Q,fe,Se,ee,pe,Pe,xe,We,je,Xe,ft,we,Ye,tt,lt,yt,bt,Yt,Ut;const ei=q.strict,ar=(N=q.code)===null||N===void 0?void 0:N.optimize,xi=ar===!0||ar===void 0?1:ar||0,si=($=(W=q.code)===null||W===void 0?void 0:W.regExp)!==null&&$!==void 0?$:p,Kt=(L=q.uriResolver)!==null&&L!==void 0?L:h.default;return{strictSchema:(Y=(G=q.strictSchema)!==null&&G!==void 0?G:ei)!==null&&Y!==void 0?Y:!0,strictNumbers:(fe=(Q=q.strictNumbers)!==null&&Q!==void 0?Q:ei)!==null&&fe!==void 0?fe:!0,strictTypes:(ee=(Se=q.strictTypes)!==null&&Se!==void 0?Se:ei)!==null&&ee!==void 0?ee:"log",strictTuples:(Pe=(pe=q.strictTuples)!==null&&pe!==void 0?pe:ei)!==null&&Pe!==void 0?Pe:"log",strictRequired:(We=(xe=q.strictRequired)!==null&&xe!==void 0?xe:ei)!==null&&We!==void 0?We:!1,code:q.code?{...q.code,optimize:xi,regExp:si}:{optimize:xi,regExp:si},loopRequired:(je=q.loopRequired)!==null&&je!==void 0?je:T,loopEnum:(Xe=q.loopEnum)!==null&&Xe!==void 0?Xe:T,meta:(ft=q.meta)!==null&&ft!==void 0?ft:!0,messages:(we=q.messages)!==null&&we!==void 0?we:!0,inlineRefs:(Ye=q.inlineRefs)!==null&&Ye!==void 0?Ye:!0,schemaId:(tt=q.schemaId)!==null&&tt!==void 0?tt:"$id",addUsedSchema:(lt=q.addUsedSchema)!==null&<!==void 0?lt:!0,validateSchema:(yt=q.validateSchema)!==null&&yt!==void 0?yt:!0,validateFormats:(bt=q.validateFormats)!==null&&bt!==void 0?bt:!0,unicodeRegExp:(Yt=q.unicodeRegExp)!==null&&Yt!==void 0?Yt:!0,int32range:(Ut=q.int32range)!==null&&Ut!==void 0?Ut:!0,uriResolver:Kt}}class C{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...S(N)};const{es5:W,lines:$}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:g,es5:W,lines:$}),this.logger=z(N.logger);const L=N.validateFormats;N.validateFormats=!1,this.RULES=(0,o.getRules)(),O.call(this,v,N,"NOT SUPPORTED"),O.call(this,E,N,"DEPRECATED","warn"),this._metaOpts=V.call(this),N.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&U.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),M.call(this),N.validateFormats=L}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:W,schemaId:$}=this.opts;let L=c;$==="id"&&(L={...c},L.id=L.$id,delete L.$id),W&&N&&this.addMetaSchema(L,L[$],!1)}defaultMeta(){const{meta:N,schemaId:W}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[W]||N:void 0}validate(N,W){let $;if(typeof N=="string"){if($=this.getSchema(N),!$)throw new Error(`no schema with key or ref "${N}"`)}else $=this.compile(N);const L=$(W);return"$async"in $||(this.errors=$.errors),L}compile(N,W){const $=this._addSchema(N,W);return $.validate||this._compileSchemaEnv($)}compileAsync(N,W){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:$}=this.opts;return L.call(this,N,W);async function L(ee,pe){await G.call(this,ee.$schema);const Pe=this._addSchema(ee,pe);return Pe.validate||Y.call(this,Pe)}async function G(ee){ee&&!this.getSchema(ee)&&await L.call(this,{$ref:ee},!0)}async function Y(ee){try{return this._compileSchemaEnv(ee)}catch(pe){if(!(pe instanceof r.default))throw pe;return Q.call(this,pe),await fe.call(this,pe.missingSchema),Y.call(this,ee)}}function Q({missingSchema:ee,missingRef:pe}){if(this.refs[ee])throw new Error(`AnySchema ${ee} is loaded but ${pe} cannot be resolved`)}async function fe(ee){const pe=await Se.call(this,ee);this.refs[ee]||await G.call(this,pe.$schema),this.refs[ee]||this.addSchema(pe,ee,W)}async function Se(ee){const pe=this._loading[ee];if(pe)return pe;try{return await(this._loading[ee]=$(ee))}finally{delete this._loading[ee]}}}addSchema(N,W,$,L=this.opts.validateSchema){if(Array.isArray(N)){for(const Y of N)this.addSchema(Y,void 0,$,L);return this}let G;if(typeof N=="object"){const{schemaId:Y}=this.opts;if(G=N[Y],G!==void 0&&typeof G!="string")throw new Error(`schema ${Y} must be string`)}return W=(0,l.normalizeId)(W||G),this._checkUnique(W),this.schemas[W]=this._addSchema(N,$,W,L,!0),this}addMetaSchema(N,W,$=this.opts.validateSchema){return this.addSchema(N,W,!0,$),this}validateSchema(N,W){if(typeof N=="boolean")return!0;let $;if($=N.$schema,$!==void 0&&typeof $!="string")throw new Error("$schema must be a string");if($=$||this.opts.defaultMeta||this.defaultMeta(),!$)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const L=this.validate($,N);if(!L&&W){const G="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(G);else throw new Error(G)}return L}getSchema(N){let W;for(;typeof(W=A.call(this,N))=="string";)N=W;if(W===void 0){const{schemaId:$}=this.opts,L=new a.SchemaEnv({schema:{},schemaId:$});if(W=a.resolveSchema.call(this,L,N),!W)return;this.refs[N]=W}return W.validate||this._compileSchemaEnv(W)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const W=A.call(this,N);return typeof W=="object"&&this._cache.delete(W.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const W=N;this._cache.delete(W);let $=N[this.opts.schemaId];return $&&($=(0,l.normalizeId)($),delete this.schemas[$],delete this.refs[$]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const W of N)this.addKeyword(W);return this}addKeyword(N,W){let $;if(typeof N=="string")$=N,typeof W=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),W.keyword=$);else if(typeof N=="object"&&W===void 0){if(W=N,$=W.keyword,Array.isArray($)&&!$.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(X.call(this,$,W),!W)return(0,f.eachItem)($,G=>re.call(this,G)),this;se.call(this,W);const L={...W,type:(0,u.getJSONTypes)(W.type),schemaType:(0,u.getJSONTypes)(W.schemaType)};return(0,f.eachItem)($,L.type.length===0?G=>re.call(this,G,L):G=>L.type.forEach(Y=>re.call(this,G,L,Y))),this}getKeyword(N){const W=this.RULES.all[N];return typeof W=="object"?W.definition:!!W}removeKeyword(N){const{RULES:W}=this;delete W.keywords[N],delete W.all[N];for(const $ of W.rules){const L=$.rules.findIndex(G=>G.keyword===N);L>=0&&$.rules.splice(L,1)}return this}addFormat(N,W){return typeof W=="string"&&(W=new RegExp(W)),this.formats[N]=W,this}errorsText(N=this.errors,{separator:W=", ",dataVar:$="data"}={}){return!N||N.length===0?"No errors":N.map(L=>`${$}${L.instancePath} ${L.message}`).reduce((L,G)=>L+W+G)}$dataMetaSchema(N,W){const $=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const L of W){const G=L.split("/").slice(1);let Y=N;for(const Q of G)Y=Y[Q];for(const Q in $){const fe=$[Q];if(typeof fe!="object")continue;const{$data:Se}=fe.definition,ee=Y[Q];Se&&ee&&(Y[Q]=Z(ee))}}return N}_removeAllSchemas(N,W){for(const $ in N){const L=N[$];(!W||W.test($))&&(typeof L=="string"?delete N[$]:L&&!L.meta&&(this._cache.delete(L.schema),delete N[$]))}}_addSchema(N,W,$,L=this.opts.validateSchema,G=this.opts.addUsedSchema){let Y;const{schemaId:Q}=this.opts;if(typeof N=="object")Y=N[Q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let fe=this._cache.get(N);if(fe!==void 0)return fe;$=(0,l.normalizeId)(Y||$);const Se=l.getSchemaRefs.call(this,N,$);return fe=new a.SchemaEnv({schema:N,schemaId:Q,meta:W,baseId:$,localRefs:Se}),this._cache.set(fe.schema,fe),G&&!$.startsWith("#")&&($&&this._checkUnique($),this.refs[$]=fe),L&&this.validateSchema(N,!0),fe}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):a.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const W=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,N)}finally{this.opts=W}}}n.default=C,C.ValidationError=i.default,C.MissingRefError=r.default;function O(q,N,W,$="error"){for(const L in q){const G=L;G in N&&this.logger[$](`${W}: option ${L}. ${q[G]}`)}}function A(q){return q=(0,l.normalizeId)(q),this.schemas[q]||this.refs[q]}function M(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const N in q)this.addSchema(q[N],N)}function D(){for(const q in this.opts.formats){const N=this.opts.formats[q];N&&this.addFormat(q,N)}}function U(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in q){const W=q[N];W.keyword||(W.keyword=N),this.addKeyword(W)}}function V(){const q={...this.opts};for(const N of _)delete q[N];return q}const B={log(){},warn(){},error(){}};function z(q){if(q===!1)return B;if(q===void 0)return console;if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const J=/^[a-z_$][a-z0-9_$:-]*$/i;function X(q,N){const{RULES:W}=this;if((0,f.eachItem)(q,$=>{if(W.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!J.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function re(q,N,W){var $;const L=N==null?void 0:N.post;if(W&&L)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:G}=this;let Y=L?G.post:G.rules.find(({type:fe})=>fe===W);if(Y||(Y={type:W,rules:[]},G.rules.push(Y)),G.keywords[q]=!0,!N)return;const Q={keyword:q,definition:{...N,type:(0,u.getJSONTypes)(N.type),schemaType:(0,u.getJSONTypes)(N.schemaType)}};N.before?ae.call(this,Y,Q,N.before):Y.rules.push(Q),G.all[q]=Q,($=N.implements)===null||$===void 0||$.forEach(fe=>this.addKeyword(fe))}function ae(q,N,W){const $=q.rules.findIndex(L=>L.keyword===W);$>=0?q.rules.splice($,0,N):(q.rules.push(N),this.logger.warn(`rule ${W} is not defined`))}function se(q){let{metaSchema:N}=q;N!==void 0&&(q.$data&&this.opts.$data&&(N=Z(N)),q.validateSchema=this.compile(N,!0))}const H={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Z(q){return{anyOf:[q,H]}}}(lm)),lm}var Eh={},Th={},Sh={},oS;function bL(){if(oS)return Sh;oS=1,Object.defineProperty(Sh,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Sh.default=n,Sh}var qa={},aS;function EL(){if(aS)return qa;aS=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.callRef=qa.getValidate=void 0;const n=fM(),t=Po(),e=Xt(),i=Aa(),r=cb(),o=gi(),a={keyword:"$ref",schemaType:"string",code(u){const{gen:f,schema:c,it:h}=u,{baseId:p,schemaEnv:_,validateName:g,opts:v,self:E}=h,{root:T}=_;if((c==="#"||c==="#/")&&p===T.baseId)return C();const S=r.resolveRef.call(E,T,p,c);if(S===void 0)throw new n.default(h.opts.uriResolver,p,c);if(S instanceof r.SchemaEnv)return O(S);return A(S);function C(){if(_===T)return l(u,g,_,_.$async);const M=f.scopeValue("root",{ref:T});return l(u,(0,e._)`${M}.validate`,T,T.$async)}function O(M){const D=s(u,M);l(u,D,M,M.$async)}function A(M){const D=f.scopeValue("schema",v.code.source===!0?{ref:M,code:(0,e.stringify)(M)}:{ref:M}),U=f.name("valid"),V=u.subschema({schema:M,dataTypes:[],schemaPath:e.nil,topSchemaRef:D,errSchemaPath:c},U);u.mergeEvaluated(V),u.ok(U)}}};function s(u,f){const{gen:c}=u;return f.validate?c.scopeValue("validate",{ref:f.validate}):(0,e._)`${c.scopeValue("wrapper",{ref:f})}.validate`}qa.getValidate=s;function l(u,f,c,h){const{gen:p,it:_}=u,{allErrors:g,schemaEnv:v,opts:E}=_,T=E.passContext?i.default.this:e.nil;h?S():C();function S(){if(!v.$async)throw new Error("async schema referenced by sync schema");const M=p.let("valid");p.try(()=>{p.code((0,e._)`await ${(0,t.callValidateCode)(u,f,T)}`),A(f),g||p.assign(M,!0)},D=>{p.if((0,e._)`!(${D} instanceof ${_.ValidationError})`,()=>p.throw(D)),O(D),g||p.assign(M,!1)}),u.ok(M)}function C(){u.result((0,t.callValidateCode)(u,f,T),()=>A(f),()=>O(f))}function O(M){const D=(0,e._)`${M}.errors`;p.assign(i.default.vErrors,(0,e._)`${i.default.vErrors} === null ? ${D} : ${i.default.vErrors}.concat(${D})`),p.assign(i.default.errors,(0,e._)`${i.default.vErrors}.length`)}function A(M){var D;if(!_.opts.unevaluated)return;const U=(D=c==null?void 0:c.validate)===null||D===void 0?void 0:D.evaluated;if(_.props!==!0)if(U&&!U.dynamicProps)U.props!==void 0&&(_.props=o.mergeEvaluated.props(p,U.props,_.props));else{const V=p.var("props",(0,e._)`${M}.evaluated.props`);_.props=o.mergeEvaluated.props(p,V,_.props,e.Name)}if(_.items!==!0)if(U&&!U.dynamicItems)U.items!==void 0&&(_.items=o.mergeEvaluated.items(p,U.items,_.items));else{const V=p.var("items",(0,e._)`${M}.evaluated.items`);_.items=o.mergeEvaluated.items(p,V,_.items,e.Name)}}}return qa.callRef=l,qa.default=a,qa}var sS;function TL(){if(sS)return Th;sS=1,Object.defineProperty(Th,"__esModule",{value:!0});const n=bL(),t=EL(),e=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,t.default];return Th.default=e,Th}var Ch={},Ph={},lS;function SL(){if(lS)return Ph;lS=1,Object.defineProperty(Ph,"__esModule",{value:!0});const n=Xt(),t=n.operators,e={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},i={message:({keyword:o,schemaCode:a})=>(0,n.str)`must be ${e[o].okStr} ${a}`,params:({keyword:o,schemaCode:a})=>(0,n._)`{comparison: ${e[o].okStr}, limit: ${a}}`},r={keyword:Object.keys(e),type:"number",schemaType:"number",$data:!0,error:i,code(o){const{keyword:a,data:s,schemaCode:l}=o;o.fail$data((0,n._)`${s} ${e[a].fail} ${l} || isNaN(${s})`)}};return Ph.default=r,Ph}var Ah={},uS;function CL(){if(uS)return Ah;uS=1,Object.defineProperty(Ah,"__esModule",{value:!0});const n=Xt(),e={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:i})=>(0,n.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0,n._)`{multipleOf: ${i}}`},code(i){const{gen:r,data:o,schemaCode:a,it:s}=i,l=s.opts.multipleOfPrecision,u=r.let("res"),f=l?(0,n._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${l}`:(0,n._)`${u} !== parseInt(${u})`;i.fail$data((0,n._)`(${a} === 0 || (${u} = ${o}/${a}, ${f}))`)}};return Ah.default=e,Ah}var Rh={},Oh={},fS;function PL(){if(fS)return Oh;fS=1,Object.defineProperty(Oh,"__esModule",{value:!0});function n(t){const e=t.length;let i=0,r=0,o;for(;r<e;)i++,o=t.charCodeAt(r++),o>=55296&&o<=56319&&r<e&&(o=t.charCodeAt(r),(o&64512)===56320&&r++);return i}return Oh.default=n,n.code='require("ajv/dist/runtime/ucs2length").default',Oh}var cS;function AL(){if(cS)return Rh;cS=1,Object.defineProperty(Rh,"__esModule",{value:!0});const n=Xt(),t=gi(),e=PL(),r={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:a}){const s=o==="maxLength"?"more":"fewer";return(0,n.str)`must NOT have ${s} than ${a} characters`},params:({schemaCode:o})=>(0,n._)`{limit: ${o}}`},code(o){const{keyword:a,data:s,schemaCode:l,it:u}=o,f=a==="maxLength"?n.operators.GT:n.operators.LT,c=u.opts.unicode===!1?(0,n._)`${s}.length`:(0,n._)`${(0,t.useFunc)(o.gen,e.default)}(${s})`;o.fail$data((0,n._)`${c} ${f} ${l}`)}};return Rh.default=r,Rh}var Mh={},hS;function RL(){if(hS)return Mh;hS=1,Object.defineProperty(Mh,"__esModule",{value:!0});const n=Po(),t=Xt(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,t.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,t._)`{pattern: ${r}}`},code(r){const{data:o,$data:a,schema:s,schemaCode:l,it:u}=r,f=u.opts.unicodeRegExp?"u":"",c=a?(0,t._)`(new RegExp(${l}, ${f}))`:(0,n.usePattern)(r,s);r.fail$data((0,t._)`!${c}.test(${o})`)}};return Mh.default=i,Mh}var xh={},dS;function OL(){if(dS)return xh;dS=1,Object.defineProperty(xh,"__esModule",{value:!0});const n=Xt(),e={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:r}){const o=i==="maxProperties"?"more":"fewer";return(0,n.str)`must NOT have ${o} than ${r} properties`},params:({schemaCode:i})=>(0,n._)`{limit: ${i}}`},code(i){const{keyword:r,data:o,schemaCode:a}=i,s=r==="maxProperties"?n.operators.GT:n.operators.LT;i.fail$data((0,n._)`Object.keys(${o}).length ${s} ${a}`)}};return xh.default=e,xh}var Ih={},pS;function ML(){if(pS)return Ih;pS=1,Object.defineProperty(Ih,"__esModule",{value:!0});const n=Po(),t=Xt(),e=gi(),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:a,schema:s,schemaCode:l,data:u,$data:f,it:c}=o,{opts:h}=c;if(!f&&s.length===0)return;const p=s.length>=h.loopRequired;if(c.allErrors?_():g(),h.strictRequired){const T=o.parentSchema.properties,{definedProperties:S}=o.it;for(const C of s)if((T==null?void 0:T[C])===void 0&&!S.has(C)){const O=c.schemaEnv.baseId+c.errSchemaPath,A=`required property "${C}" is not defined at "${O}" (strictRequired)`;(0,e.checkStrictMode)(c,A,c.opts.strictRequired)}}function _(){if(p||f)o.block$data(t.nil,v);else for(const T of s)(0,n.checkReportMissingProp)(o,T)}function g(){const T=a.let("missing");if(p||f){const S=a.let("valid",!0);o.block$data(S,()=>E(T,S)),o.ok(S)}else a.if((0,n.checkMissingProp)(o,s,T)),(0,n.reportMissingProp)(o,T),a.else()}function v(){a.forOf("prop",l,T=>{o.setParams({missingProperty:T}),a.if((0,n.noPropertyInData)(a,u,T,h.ownProperties),()=>o.error())})}function E(T,S){o.setParams({missingProperty:T}),a.forOf(T,l,()=>{a.assign(S,(0,n.propertyInData)(a,u,T,h.ownProperties)),a.if((0,t.not)(S),()=>{o.error(),a.break()})},t.nil)}}};return Ih.default=r,Ih}var Dh={},_S;function xL(){if(_S)return Dh;_S=1,Object.defineProperty(Dh,"__esModule",{value:!0});const n=Xt(),e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:r}){const o=i==="maxItems"?"more":"fewer";return(0,n.str)`must NOT have ${o} than ${r} items`},params:({schemaCode:i})=>(0,n._)`{limit: ${i}}`},code(i){const{keyword:r,data:o,schemaCode:a}=i,s=r==="maxItems"?n.operators.GT:n.operators.LT;i.fail$data((0,n._)`${o}.length ${s} ${a}`)}};return Dh.default=e,Dh}var wh={},Lh={},mS;function hb(){if(mS)return Lh;mS=1,Object.defineProperty(Lh,"__esModule",{value:!0});const n=Jd();return n.code='require("ajv/dist/runtime/equal").default',Lh.default=n,Lh}var gS;function IL(){if(gS)return wh;gS=1,Object.defineProperty(wh,"__esModule",{value:!0});const n=Bd(),t=Xt(),e=gi(),i=hb(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:s}})=>(0,t.str)`must NOT have duplicate items (items ## ${s} and ${a} are identical)`,params:({params:{i:a,j:s}})=>(0,t._)`{i: ${a}, j: ${s}}`},code(a){const{gen:s,data:l,$data:u,schema:f,parentSchema:c,schemaCode:h,it:p}=a;if(!u&&!f)return;const _=s.let("valid"),g=c.items?(0,n.getSchemaTypes)(c.items):[];a.block$data(_,v,(0,t._)`${h} === false`),a.ok(_);function v(){const C=s.let("i",(0,t._)`${l}.length`),O=s.let("j");a.setParams({i:C,j:O}),s.assign(_,!0),s.if((0,t._)`${C} > 1`,()=>(E()?T:S)(C,O))}function E(){return g.length>0&&!g.some(C=>C==="object"||C==="array")}function T(C,O){const A=s.name("item"),M=(0,n.checkDataTypes)(g,A,p.opts.strictNumbers,n.DataType.Wrong),D=s.const("indices",(0,t._)`{}`);s.for((0,t._)`;${C}--;`,()=>{s.let(A,(0,t._)`${l}[${C}]`),s.if(M,(0,t._)`continue`),g.length>1&&s.if((0,t._)`typeof ${A} == "string"`,(0,t._)`${A} += "_"`),s.if((0,t._)`typeof ${D}[${A}] == "number"`,()=>{s.assign(O,(0,t._)`${D}[${A}]`),a.error(),s.assign(_,!1).break()}).code((0,t._)`${D}[${A}] = ${C}`)})}function S(C,O){const A=(0,e.useFunc)(s,i.default),M=s.name("outer");s.label(M).for((0,t._)`;${C}--;`,()=>s.for((0,t._)`${O} = ${C}; ${O}--;`,()=>s.if((0,t._)`${A}(${l}[${C}], ${l}[${O}])`,()=>{a.error(),s.assign(_,!1).break(M)})))}}};return wh.default=o,wh}var Nh={},vS;function DL(){if(vS)return Nh;vS=1,Object.defineProperty(Nh,"__esModule",{value:!0});const n=Xt(),t=gi(),e=hb(),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,n._)`{allowedValue: ${o}}`},code(o){const{gen:a,data:s,$data:l,schemaCode:u,schema:f}=o;l||f&&typeof f=="object"?o.fail$data((0,n._)`!${(0,t.useFunc)(a,e.default)}(${s}, ${u})`):o.fail((0,n._)`${f} !== ${s}`)}};return Nh.default=r,Nh}var Fh={},yS;function wL(){if(yS)return Fh;yS=1,Object.defineProperty(Fh,"__esModule",{value:!0});const n=Xt(),t=gi(),e=hb(),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,n._)`{allowedValues: ${o}}`},code(o){const{gen:a,data:s,$data:l,schema:u,schemaCode:f,it:c}=o;if(!l&&u.length===0)throw new Error("enum must have non-empty array");const h=u.length>=c.opts.loopEnum;let p;const _=()=>p??(p=(0,t.useFunc)(a,e.default));let g;if(h||l)g=a.let("valid"),o.block$data(g,v);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const T=a.const("vSchema",f);g=(0,n.or)(...u.map((S,C)=>E(T,C)))}o.pass(g);function v(){a.assign(g,!1),a.forOf("v",f,T=>a.if((0,n._)`${_()}(${s}, ${T})`,()=>a.assign(g,!0).break()))}function E(T,S){const C=u[S];return typeof C=="object"&&C!==null?(0,n._)`${_()}(${s}, ${T}[${S}])`:(0,n._)`${s} === ${C}`}}};return Fh.default=r,Fh}var bS;function LL(){if(bS)return Ch;bS=1,Object.defineProperty(Ch,"__esModule",{value:!0});const n=SL(),t=CL(),e=AL(),i=RL(),r=OL(),o=ML(),a=xL(),s=IL(),l=DL(),u=wL(),f=[n.default,t.default,e.default,i.default,r.default,o.default,a.default,s.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];return Ch.default=f,Ch}var Bh={},Ml={},ES;function cM(){if(ES)return Ml;ES=1,Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.validateAdditionalItems=void 0;const n=Xt(),t=gi(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,n.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,n._)`{limit: ${o}}`},code(o){const{parentSchema:a,it:s}=o,{items:l}=a;if(!Array.isArray(l)){(0,t.checkStrictMode)(s,'"additionalItems" is ignored when "items" is not an array of schemas');return}r(o,l)}};function r(o,a){const{gen:s,schema:l,data:u,keyword:f,it:c}=o;c.items=!0;const h=s.const("len",(0,n._)`${u}.length`);if(l===!1)o.setParams({len:a.length}),o.pass((0,n._)`${h} <= ${a.length}`);else if(typeof l=="object"&&!(0,t.alwaysValidSchema)(c,l)){const _=s.var("valid",(0,n._)`${h} <= ${a.length}`);s.if((0,n.not)(_),()=>p(_)),o.ok(_)}function p(_){s.forRange("i",a.length,h,g=>{o.subschema({keyword:f,dataProp:g,dataPropType:t.Type.Num},_),c.allErrors||s.if((0,n.not)(_),()=>s.break())})}}return Ml.validateAdditionalItems=r,Ml.default=i,Ml}var Vh={},xl={},TS;function hM(){if(TS)return xl;TS=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.validateTuple=void 0;const n=Xt(),t=gi(),e=Po(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:a,it:s}=o;if(Array.isArray(a))return r(o,"additionalItems",a);s.items=!0,!(0,t.alwaysValidSchema)(s,a)&&o.ok((0,e.validateArray)(o))}};function r(o,a,s=o.schema){const{gen:l,parentSchema:u,data:f,keyword:c,it:h}=o;g(u),h.opts.unevaluated&&s.length&&h.items!==!0&&(h.items=t.mergeEvaluated.items(l,s.length,h.items));const p=l.name("valid"),_=l.const("len",(0,n._)`${f}.length`);s.forEach((v,E)=>{(0,t.alwaysValidSchema)(h,v)||(l.if((0,n._)`${_} > ${E}`,()=>o.subschema({keyword:c,schemaProp:E,dataProp:E},p)),o.ok(p))});function g(v){const{opts:E,errSchemaPath:T}=h,S=s.length,C=S===v.minItems&&(S===v.maxItems||v[a]===!1);if(E.strictTuples&&!C){const O=`"${c}" is ${S}-tuple, but minItems or maxItems/${a} are not specified or different at path "${T}"`;(0,t.checkStrictMode)(h,O,E.strictTuples)}}}return xl.validateTuple=r,xl.default=i,xl}var SS;function NL(){if(SS)return Vh;SS=1,Object.defineProperty(Vh,"__esModule",{value:!0});const n=hM(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};return Vh.default=t,Vh}var Uh={},CS;function FL(){if(CS)return Uh;CS=1,Object.defineProperty(Uh,"__esModule",{value:!0});const n=Xt(),t=gi(),e=Po(),i=cM(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,n.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,n._)`{limit: ${a}}`},code(a){const{schema:s,parentSchema:l,it:u}=a,{prefixItems:f}=l;u.items=!0,!(0,t.alwaysValidSchema)(u,s)&&(f?(0,i.validateAdditionalItems)(a,f):a.ok((0,e.validateArray)(a)))}};return Uh.default=o,Uh}var kh={},PS;function BL(){if(PS)return kh;PS=1,Object.defineProperty(kh,"__esModule",{value:!0});const n=Xt(),t=gi(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:r,max:o}})=>o===void 0?(0,n.str)`must contain at least ${r} valid item(s)`:(0,n.str)`must contain at least ${r} and no more than ${o} valid item(s)`,params:({params:{min:r,max:o}})=>o===void 0?(0,n._)`{minContains: ${r}}`:(0,n._)`{minContains: ${r}, maxContains: ${o}}`},code(r){const{gen:o,schema:a,parentSchema:s,data:l,it:u}=r;let f,c;const{minContains:h,maxContains:p}=s;u.opts.next?(f=h===void 0?1:h,c=p):f=1;const _=o.const("len",(0,n._)`${l}.length`);if(r.setParams({min:f,max:c}),c===void 0&&f===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&f>c){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,t.alwaysValidSchema)(u,a)){let S=(0,n._)`${_} >= ${f}`;c!==void 0&&(S=(0,n._)`${S} && ${_} <= ${c}`),r.pass(S);return}u.items=!0;const g=o.name("valid");c===void 0&&f===1?E(g,()=>o.if(g,()=>o.break())):f===0?(o.let(g,!0),c!==void 0&&o.if((0,n._)`${l}.length > 0`,v)):(o.let(g,!1),v()),r.result(g,()=>r.reset());function v(){const S=o.name("_valid"),C=o.let("count",0);E(S,()=>o.if(S,()=>T(C)))}function E(S,C){o.forRange("i",0,_,O=>{r.subschema({keyword:"contains",dataProp:O,dataPropType:t.Type.Num,compositeRule:!0},S),C()})}function T(S){o.code((0,n._)`${S}++`),c===void 0?o.if((0,n._)`${S} >= ${f}`,()=>o.assign(g,!0).break()):(o.if((0,n._)`${S} > ${c}`,()=>o.assign(g,!1).break()),f===1?o.assign(g,!0):o.if((0,n._)`${S} >= ${f}`,()=>o.assign(g,!0)))}}};return kh.default=i,kh}var gm={},AS;function VL(){return AS||(AS=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.validateSchemaDeps=n.validatePropertyDeps=n.error=void 0;const t=Xt(),e=gi(),i=Po();n.error={message:({params:{property:l,depsCount:u,deps:f}})=>{const c=u===1?"property":"properties";return(0,t.str)`must have ${c} ${f} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:f,missingProperty:c}})=>(0,t._)`{property: ${l},
|
|
49
49
|
missingProperty: ${c},
|
|
50
50
|
depsCount: ${u},
|
|
51
|
-
deps: ${f}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:n.error,code(l){const[u,f]=o(l);a(l,u),s(l,f)}};function o({schema:l}){const u={},f={};for(const c in l){if(c==="__proto__")continue;const h=Array.isArray(l[c])?u:f;h[c]=l[c]}return[u,f]}function a(l,u=l.schema){const{gen:f,data:c,it:h}=l;if(Object.keys(u).length===0)return;const p=f.let("missing");for(const _ in u){const g=u[_];if(g.length===0)continue;const v=(0,i.propertyInData)(f,c,_,h.opts.ownProperties);l.setParams({property:_,depsCount:g.length,deps:g.join(", ")}),h.allErrors?f.if(v,()=>{for(const E of g)(0,i.checkReportMissingProp)(l,E)}):(f.if((0,t._)`${v} && (${(0,i.checkMissingProp)(l,g,p)})`),(0,i.reportMissingProp)(l,p),f.else())}}n.validatePropertyDeps=a;function s(l,u=l.schema){const{gen:f,data:c,keyword:h,it:p}=l,_=f.name("valid");for(const g in u)(0,e.alwaysValidSchema)(p,u[g])||(f.if((0,i.propertyInData)(f,c,g,p.opts.ownProperties),()=>{const v=l.subschema({keyword:h,schemaProp:g},_);l.mergeValidEvaluated(v,_)},()=>f.var(_,!0)),l.ok(_))}n.validateSchemaDeps=s,n.default=r}(gm)),gm}var zh={},RS;function UL(){if(RS)return zh;RS=1,Object.defineProperty(zh,"__esModule",{value:!0});const n=Xt(),t=gi(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:r})=>(0,n._)`{propertyName: ${r.propertyName}}`},code(r){const{gen:o,schema:a,data:s,it:l}=r;if((0,t.alwaysValidSchema)(l,a))return;const u=o.name("valid");o.forIn("key",s,f=>{r.setParams({propertyName:f}),r.subschema({keyword:"propertyNames",data:f,dataTypes:["string"],propertyName:f,compositeRule:!0},u),o.if((0,n.not)(u),()=>{r.error(!0),l.allErrors||o.break()})}),r.ok(u)}};return zh.default=i,zh}var Gh={},OS;function dM(){if(OS)return Gh;OS=1,Object.defineProperty(Gh,"__esModule",{value:!0});const n=Po(),t=Xt(),e=Aa(),i=gi(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:s,schema:l,parentSchema:u,data:f,errsCount:c,it:h}=a;if(!c)throw new Error("ajv implementation error");const{allErrors:p,opts:_}=h;if(h.props=!0,_.removeAdditional!=="all"&&(0,i.alwaysValidSchema)(h,l))return;const g=(0,n.allSchemaProperties)(u.properties),v=(0,n.allSchemaProperties)(u.patternProperties);E(),a.ok((0,t._)`${c} === ${e.default.errors}`);function E(){s.forIn("key",f,A=>{!g.length&&!v.length?C(A):s.if(T(A),()=>C(A))})}function T(A){let M;if(g.length>8){const D=(0,i.schemaRefOrVal)(h,u.properties,"properties");M=(0,n.isOwnProperty)(s,D,A)}else g.length?M=(0,t.or)(...g.map(D=>(0,t._)`${A} === ${D}`)):M=t.nil;return v.length&&(M=(0,t.or)(M,...v.map(D=>(0,t._)`${(0,n.usePattern)(a,D)}.test(${A})`))),(0,t.not)(M)}function S(A){s.code((0,t._)`delete ${f}[${A}]`)}function C(A){if(_.removeAdditional==="all"||_.removeAdditional&&l===!1){S(A);return}if(l===!1){a.setParams({additionalProperty:A}),a.error(),p||s.break();return}if(typeof l=="object"&&!(0,i.alwaysValidSchema)(h,l)){const M=s.name("valid");_.removeAdditional==="failing"?(O(A,M,!1),s.if((0,t.not)(M),()=>{a.reset(),S(A)})):(O(A,M),p||s.if((0,t.not)(M),()=>s.break()))}}function O(A,M,D){const U={keyword:"additionalProperties",dataProp:A,dataPropType:i.Type.Str};D===!1&&Object.assign(U,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(U,M)}}};return Gh.default=o,Gh}var Wh={},MS;function kL(){if(MS)return Wh;MS=1,Object.defineProperty(Wh,"__esModule",{value:!0});const n=oc(),t=Po(),e=gi(),i=dM(),r={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:a,schema:s,parentSchema:l,data:u,it:f}=o;f.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&i.default.code(new n.KeywordCxt(f,i.default,"additionalProperties"));const c=(0,t.allSchemaProperties)(s);for(const v of c)f.definedProperties.add(v);f.opts.unevaluated&&c.length&&f.props!==!0&&(f.props=e.mergeEvaluated.props(a,(0,e.toHash)(c),f.props));const h=c.filter(v=>!(0,e.alwaysValidSchema)(f,s[v]));if(h.length===0)return;const p=a.name("valid");for(const v of h)_(v)?g(v):(a.if((0,t.propertyInData)(a,u,v,f.opts.ownProperties)),g(v),f.allErrors||a.else().var(p,!0),a.endIf()),o.it.definedProperties.add(v),o.ok(p);function _(v){return f.opts.useDefaults&&!f.compositeRule&&s[v].default!==void 0}function g(v){o.subschema({keyword:"properties",schemaProp:v,dataProp:v},p)}}};return Wh.default=r,Wh}var Hh={},xS;function zL(){if(xS)return Hh;xS=1,Object.defineProperty(Hh,"__esModule",{value:!0});const n=Po(),t=Xt(),e=gi(),i=gi(),r={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:a,schema:s,data:l,parentSchema:u,it:f}=o,{opts:c}=f,h=(0,n.allSchemaProperties)(s),p=h.filter(C=>(0,e.alwaysValidSchema)(f,s[C]));if(h.length===0||p.length===h.length&&(!f.opts.unevaluated||f.props===!0))return;const _=c.strictSchema&&!c.allowMatchingProperties&&u.properties,g=a.name("valid");f.props!==!0&&!(f.props instanceof t.Name)&&(f.props=(0,i.evaluatedPropsToName)(a,f.props));const{props:v}=f;E();function E(){for(const C of h)_&&T(C),f.allErrors?S(C):(a.var(g,!0),S(C),a.if(g))}function T(C){for(const O in _)new RegExp(C).test(O)&&(0,e.checkStrictMode)(f,`property ${O} matches pattern ${C} (use allowMatchingProperties)`)}function S(C){a.forIn("key",l,O=>{a.if((0,t._)`${(0,n.usePattern)(o,C)}.test(${O})`,()=>{const A=p.includes(C);A||o.subschema({keyword:"patternProperties",schemaProp:C,dataProp:O,dataPropType:i.Type.Str},g),f.opts.unevaluated&&v!==!0?a.assign((0,t._)`${v}[${O}]`,!0):!A&&!f.allErrors&&a.if((0,t.not)(g),()=>a.break())})})}}};return Hh.default=r,Hh}var jh={},IS;function GL(){if(IS)return jh;IS=1,Object.defineProperty(jh,"__esModule",{value:!0});const n=gi(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:i,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r)){e.fail();return}const a=i.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};return jh.default=t,jh}var Xh={},DS;function WL(){if(DS)return Xh;DS=1,Object.defineProperty(Xh,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Po().validateUnion,error:{message:"must match a schema in anyOf"}};return Xh.default=t,Xh}var Yh={},wS;function HL(){if(wS)return Yh;wS=1,Object.defineProperty(Yh,"__esModule",{value:!0});const n=Xt(),t=gi(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:r})=>(0,n._)`{passingSchemas: ${r.passing}}`},code(r){const{gen:o,schema:a,parentSchema:s,it:l}=r;if(!Array.isArray(a))throw new Error("ajv implementation error");if(l.opts.discriminator&&s.discriminator)return;const u=a,f=o.let("valid",!1),c=o.let("passing",null),h=o.name("_valid");r.setParams({passing:c}),o.block(p),r.result(f,()=>r.reset(),()=>r.error(!0));function p(){u.forEach((_,g)=>{let v;(0,t.alwaysValidSchema)(l,_)?o.var(h,!0):v=r.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},h),g>0&&o.if((0,n._)`${h} && ${f}`).assign(f,!1).assign(c,(0,n._)`[${c}, ${g}]`).else(),o.if(h,()=>{o.assign(f,!0),o.assign(c,g),v&&r.mergeEvaluated(v,n.Name)})})}}};return Yh.default=i,Yh}var Kh={},LS;function jL(){if(LS)return Kh;LS=1,Object.defineProperty(Kh,"__esModule",{value:!0});const n=gi(),t={keyword:"allOf",schemaType:"array",code(e){const{gen:i,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const a=i.name("valid");r.forEach((s,l)=>{if((0,n.alwaysValidSchema)(o,s))return;const u=e.subschema({keyword:"allOf",schemaProp:l},a);e.ok(a),e.mergeEvaluated(u)})}};return Kh.default=t,Kh}var qh={},NS;function XL(){if(NS)return qh;NS=1,Object.defineProperty(qh,"__esModule",{value:!0});const n=Xt(),t=gi(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,n.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,n._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:a,parentSchema:s,it:l}=o;s.then===void 0&&s.else===void 0&&(0,t.checkStrictMode)(l,'"if" without "then" and "else" is ignored');const u=r(l,"then"),f=r(l,"else");if(!u&&!f)return;const c=a.let("valid",!0),h=a.name("_valid");if(p(),o.reset(),u&&f){const g=a.let("ifClause");o.setParams({ifClause:g}),a.if(h,_("then",g),_("else",g))}else u?a.if(h,_("then")):a.if((0,n.not)(h),_("else"));o.pass(c,()=>o.error(!0));function p(){const g=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);o.mergeEvaluated(g)}function _(g,v){return()=>{const E=o.subschema({keyword:g},h);a.assign(c,h),o.mergeValidEvaluated(E,c),v?a.assign(v,(0,n._)`${g}`):o.setParams({ifClause:g})}}}};function r(o,a){const s=o.schema[a];return s!==void 0&&!(0,t.alwaysValidSchema)(o,s)}return qh.default=i,qh}var Qh={},FS;function YL(){if(FS)return Qh;FS=1,Object.defineProperty(Qh,"__esModule",{value:!0});const n=gi(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:i,it:r}){i.if===void 0&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};return Qh.default=t,Qh}var BS;function KL(){if(BS)return Bh;BS=1,Object.defineProperty(Bh,"__esModule",{value:!0});const n=cM(),t=NL(),e=hM(),i=FL(),r=BL(),o=VL(),a=UL(),s=dM(),l=kL(),u=zL(),f=GL(),c=WL(),h=HL(),p=jL(),_=XL(),g=YL();function v(E=!1){const T=[f.default,c.default,h.default,p.default,_.default,g.default,a.default,s.default,o.default,l.default,u.default];return E?T.push(t.default,i.default):T.push(n.default,e.default),T.push(r.default),T}return Bh.default=v,Bh}var $h={},Zh={},VS;function qL(){if(VS)return Zh;VS=1,Object.defineProperty(Zh,"__esModule",{value:!0});const n=Xt(),e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,n.str)`must match format "${i}"`,params:({schemaCode:i})=>(0,n._)`{format: ${i}}`},code(i,r){const{gen:o,data:a,$data:s,schema:l,schemaCode:u,it:f}=i,{opts:c,errSchemaPath:h,schemaEnv:p,self:_}=f;if(!c.validateFormats)return;s?g():v();function g(){const E=o.scopeValue("formats",{ref:_.formats,code:c.code.formats}),T=o.const("fDef",(0,n._)`${E}[${u}]`),S=o.let("fType"),C=o.let("format");o.if((0,n._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`,()=>o.assign(S,(0,n._)`${T}.type || "string"`).assign(C,(0,n._)`${T}.validate`),()=>o.assign(S,(0,n._)`"string"`).assign(C,T)),i.fail$data((0,n.or)(O(),A()));function O(){return c.strictSchema===!1?n.nil:(0,n._)`${u} && !${C}`}function A(){const M=p.$async?(0,n._)`(${T}.async ? await ${C}(${a}) : ${C}(${a}))`:(0,n._)`${C}(${a})`,D=(0,n._)`(typeof ${C} == "function" ? ${M} : ${C}.test(${a}))`;return(0,n._)`${C} && ${C} !== true && ${S} === ${r} && !${D}`}}function v(){const E=_.formats[l];if(!E){O();return}if(E===!0)return;const[T,S,C]=A(E);T===r&&i.pass(M());function O(){if(c.strictSchema===!1){_.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${l}" ignored in schema at path "${h}"`}}function A(D){const U=D instanceof RegExp?(0,n.regexpCode)(D):c.code.formats?(0,n._)`${c.code.formats}${(0,n.getProperty)(l)}`:void 0,V=o.scopeValue("formats",{key:l,ref:D,code:U});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,n._)`${V}.validate`]:["string",D,V]}function M(){if(typeof E=="object"&&!(E instanceof RegExp)&&E.async){if(!p.$async)throw new Error("async format in sync schema");return(0,n._)`await ${C}(${a})`}return typeof S=="function"?(0,n._)`${C}(${a})`:(0,n._)`${C}.test(${a})`}}}};return Zh.default=e,Zh}var US;function QL(){if(US)return $h;US=1,Object.defineProperty($h,"__esModule",{value:!0});const t=[qL().default];return $h.default=t,$h}var As={},kS;function $L(){return kS||(kS=1,Object.defineProperty(As,"__esModule",{value:!0}),As.contentVocabulary=As.metadataVocabulary=void 0,As.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],As.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),As}var zS;function ZL(){if(zS)return Eh;zS=1,Object.defineProperty(Eh,"__esModule",{value:!0});const n=TL(),t=LL(),e=KL(),i=QL(),r=$L(),o=[n.default,t.default,(0,e.default)(),i.default,r.metadataVocabulary,r.contentVocabulary];return Eh.default=o,Eh}var Jh={},vm={},GS;function JL(){return GS||(GS=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(n.DiscrError||(n.DiscrError={}))}(vm)),vm}var WS;function eN(){if(WS)return Jh;WS=1,Object.defineProperty(Jh,"__esModule",{value:!0});const n=Xt(),t=JL(),e=cb(),i=gi(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:s}})=>a===t.DiscrError.Tag?`tag "${s}" must be string`:`value of tag "${s}" must be in oneOf`,params:({params:{discrError:a,tag:s,tagName:l}})=>(0,n._)`{error: ${a}, tag: ${l}, tagValue: ${s}}`},code(a){const{gen:s,data:l,schema:u,parentSchema:f,it:c}=a,{oneOf:h}=f;if(!c.opts.discriminator)throw new Error("discriminator: requires discriminator option");const p=u.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const _=s.let("valid",!1),g=s.const("tag",(0,n._)`${l}${(0,n.getProperty)(p)}`);s.if((0,n._)`typeof ${g} == "string"`,()=>v(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:g,tagName:p})),a.ok(_);function v(){const S=T();s.if(!1);for(const C in S)s.elseIf((0,n._)`${g} === ${C}`),s.assign(_,E(S[C]));s.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:g,tagName:p}),s.endIf()}function E(S){const C=s.name("valid"),O=a.subschema({keyword:"oneOf",schemaProp:S},C);return a.mergeEvaluated(O,n.Name),C}function T(){var S;const C={},O=M(f);let A=!0;for(let V=0;V<h.length;V++){let B=h[V];B!=null&&B.$ref&&!(0,i.schemaHasRulesButRef)(B,c.self.RULES)&&(B=e.resolveRef.call(c.self,c.schemaEnv.root,c.baseId,B==null?void 0:B.$ref),B instanceof e.SchemaEnv&&(B=B.schema));const z=(S=B==null?void 0:B.properties)===null||S===void 0?void 0:S[p];if(typeof z!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);A=A&&(O||M(B)),D(z,V)}if(!A)throw new Error(`discriminator: "${p}" must be required`);return C;function M({required:V}){return Array.isArray(V)&&V.includes(p)}function D(V,B){if(V.const)U(V.const,B);else if(V.enum)for(const z of V.enum)U(z,B);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function U(V,B){if(typeof V!="string"||V in C)throw new Error(`discriminator: "${p}" values must be unique strings`);C[V]=B}}}};return Jh.default=o,Jh}const tN="http://json-schema.org/draft-07/schema#",iN="http://json-schema.org/draft-07/schema#",rN="Core schema meta-schema",nN={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},oN=["object","boolean"],aN={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},sN={$schema:tN,$id:iN,title:rN,definitions:nN,type:oN,properties:aN,default:!0};var HS;function pM(){return HS||(HS=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const e=yL(),i=ZL(),r=eN(),o=sN,a=["/properties"],s="http://json-schema.org/draft-07/schema";class l extends e.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const h=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(h,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}n.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=oc();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Xt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}(mh,mh.exports)),mh.exports}var hf={exports:{}},df={exports:{}},pf={exports:{}},ed={exports:{}},jS;function lN(){return jS||(jS=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=["undefined","string","number","object","function","boolean","symbol"];function r(){return{keyword:"typeof",schemaType:["string","array"],code(o){const{data:a,schema:s,schemaValue:l}=o;o.fail(typeof s=="string"?(0,e._)`typeof ${a} != ${s}`:(0,e._)`${l}.indexOf(typeof ${a}) < 0`)},metaSchema:{anyOf:[{type:"string",enum:i},{type:"array",items:{type:"string",enum:i}}]}}}t.default=r,n.exports=r}(ed,ed.exports)),ed.exports}var XS=pf.exports,YS;function uN(){return YS||(YS=1,function(n,t){var e=XS&&XS.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(lN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(pf,pf.exports)),pf.exports}var _f={exports:{}},td={exports:{}},KS;function fN(){return KS||(KS=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e={Object,Array,Function,Number,String,Date,RegExp};typeof Buffer<"u"&&(e.Buffer=Buffer),typeof Promise<"u"&&(e.Promise=Promise);const i=Object.assign(r,{CONSTRUCTORS:e});function r(){return{keyword:"instanceof",schemaType:["string","array"],compile(a){if(typeof a=="string"){const s=o(a);return l=>l instanceof s}if(Array.isArray(a)){const s=a.map(o);return l=>{for(const u of s)if(l instanceof u)return!0;return!1}}throw new Error("ajv implementation error")},metaSchema:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}}function o(a){const s=e[a];if(s)return s;throw new Error(`invalid "instanceof" keyword value ${a}`)}t.default=i,n.exports=i}(td,td.exports)),td.exports}var qS=_f.exports,QS;function cN(){return QS||(QS=1,function(n,t){var e=qS&&qS.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(fN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(_f,_f.exports)),_f.exports}var mf={exports:{}},gf={exports:{}},id={},$S;function _M(){if($S)return id;$S=1,Object.defineProperty(id,"__esModule",{value:!0});function n(t){return()=>({keyword:t,type:"number",schemaType:"array",macro:function([i,r]){return e(i,r),t==="range"?{minimum:i,maximum:r}:{exclusiveMinimum:i,exclusiveMaximum:r}},metaSchema:{type:"array",minItems:2,maxItems:2,items:{type:"number"}}});function e(i,r){if(i>r||t==="exclusiveRange"&&i===r)throw new Error("There are no numbers in range")}}return id.default=n,id}var ZS=gf.exports,JS;function hN(){return JS||(JS=1,function(n,t){var e=ZS&&ZS.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(_M()).default)("range");t.default=r,n.exports=r}(gf,gf.exports)),gf.exports}var eC=mf.exports,tC;function dN(){return tC||(tC=1,function(n,t){var e=eC&&eC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(hN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(mf,mf.exports)),mf.exports}var vf={exports:{}},yf={exports:{}},iC=yf.exports,rC;function pN(){return rC||(rC=1,function(n,t){var e=iC&&iC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(_M()).default)("exclusiveRange");t.default=r,n.exports=r}(yf,yf.exports)),yf.exports}var nC=vf.exports,oC;function _N(){return oC||(oC=1,function(n,t){var e=nC&&nC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(pN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(vf,vf.exports)),vf.exports}var bf={exports:{}},rd={exports:{}},Rs={},aC;function tp(){if(aC)return Rs;aC=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.usePattern=Rs.metaSchemaRef=void 0;const n=Xt(),t="http://json-schema.org/schema";function e({defaultMeta:r}={}){return r===!1?{}:{$ref:r||t}}Rs.metaSchemaRef=e;function i({gen:r,it:{opts:o}},a,s=o.unicodeRegExp?"u":""){const l=new RegExp(a,s);return r.scopeValue("pattern",{key:l.toString(),ref:l,code:(0,n._)`new RegExp(${a}, ${s})`})}return Rs.usePattern=i,Rs}var sC;function mN(){return sC||(sC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=tp(),r={type:"object",properties:{pattern:{type:"string"},flags:{type:"string",nullable:!0}},required:["pattern"],additionalProperties:!1},o=/^\/(.*)\/([gimuy]*)$/;function a(){return{keyword:"regexp",type:"string",schemaType:["string","object"],code(s){const{data:l,schema:u}=s,f=c(u);s.pass((0,e._)`${f}.test(${l})`);function c(h){if(typeof h=="object")return(0,i.usePattern)(s,h.pattern,h.flags);const p=o.exec(h);if(p)return(0,i.usePattern)(s,p[1],p[2]);throw new Error("cannot parse string into RegExp")}},metaSchema:{anyOf:[{type:"string"},r]}}}t.default=a,n.exports=a}(rd,rd.exports)),rd.exports}var lC=bf.exports,uC;function gN(){return uC||(uC=1,function(n,t){var e=lC&&lC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(mN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(bf,bf.exports)),bf.exports}var Ef={exports:{}},nd={exports:{}},fC;function vN(){return fC||(fC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i={trimStart:l=>l.trimStart(),trimEnd:l=>l.trimEnd(),trimLeft:l=>l.trimStart(),trimRight:l=>l.trimEnd(),trim:l=>l.trim(),toLowerCase:l=>l.toLowerCase(),toUpperCase:l=>l.toUpperCase(),toEnumCase:(l,u)=>(u==null?void 0:u.hash[s(l)])||l},r=Object.assign(o,{transform:i});function o(){return{keyword:"transform",schemaType:"array",before:"enum",code(l){const{gen:u,data:f,schema:c,parentSchema:h,it:p}=l,{parentData:_,parentDataProperty:g}=p,v=c;if(!v.length)return;let E;if(v.includes("toEnumCase")){const S=a(h);E=u.scopeValue("obj",{ref:S,code:(0,e.stringify)(S)})}u.if((0,e._)`typeof ${f} == "string" && ${_} !== undefined`,()=>{u.assign(f,T(v.slice())),u.assign((0,e._)`${_}[${g}]`,f)});function T(S){if(!S.length)return f;const C=S.pop();if(!(C in i))throw new Error(`transform: unknown transformation ${C}`);const O=u.scopeValue("func",{ref:i[C],code:(0,e._)`require("ajv-keywords/dist/definitions/transform").transform${(0,e.getProperty)(C)}`}),A=T(S);return E&&C==="toEnumCase"?(0,e._)`${O}(${A}, ${E})`:(0,e._)`${O}(${A})`}},metaSchema:{type:"array",items:{type:"string",enum:Object.keys(i)}}}}function a(l){const u={hash:{}};if(!l.enum)throw new Error('transform: "toEnumCase" requires "enum"');for(const f of l.enum){if(typeof f!="string")continue;const c=s(f);if(u.hash[c])throw new Error('transform: "toEnumCase" requires all lowercased "enum" values to be unique');u.hash[c]=f}return u}function s(l){return l.toLowerCase()}t.default=r,n.exports=r}(nd,nd.exports)),nd.exports}var cC=Ef.exports,hC;function yN(){return hC||(hC=1,function(n,t){var e=cC&&cC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(vN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Ef,Ef.exports)),Ef.exports}var Tf={exports:{}},od={exports:{}},dC;function bN(){return dC||(dC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Jd(),i=["number","integer","string","boolean","null"];function r(){return{keyword:"uniqueItemProperties",type:"array",schemaType:"array",compile(a,s){const l=o(a,s);return u=>{if(u.length<=1)return!0;for(let f=0;f<a.length;f++){const c=a[f];if(l[f]){const h={};for(const p of u){if(!p||typeof p!="object")continue;let _=p[c];if(!(_&&typeof _=="object")){if(typeof _=="string"&&(_='"'+_),h[_])return!1;h[_]=!0}}}else for(let h=u.length;h--;){const p=u[h];if(!(!p||typeof p!="object"))for(let _=h;_--;){const g=u[_];if(g&&typeof g=="object"&&e(p[c],g[c]))return!1}}}return!0}},metaSchema:{type:"array",items:{type:"string"}}}}t.default=r;function o(a,s){return a.map(l=>{var u,f,c;const h=(c=(f=(u=s.items)===null||u===void 0?void 0:u.properties)===null||f===void 0?void 0:f[l])===null||c===void 0?void 0:c.type;return Array.isArray(h)?!h.includes("object")&&!h.includes("array"):i.includes(h)})}n.exports=r}(od,od.exports)),od.exports}var pC=Tf.exports,_C;function EN(){return _C||(_C=1,function(n,t){var e=pC&&pC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(bN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Tf,Tf.exports)),Tf.exports}var Sf={exports:{}},ad={exports:{}},mC;function TN(){return mC||(mC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});function e(){return{keyword:"allRequired",type:"object",schemaType:"boolean",macro(i,r){if(!i)return!0;const o=Object.keys(r.properties);return o.length===0?!0:{required:o}},dependencies:["properties"]}}t.default=e,n.exports=e}(ad,ad.exports)),ad.exports}var gC=Sf.exports,vC;function SN(){return vC||(vC=1,function(n,t){var e=gC&&gC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(TN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Sf,Sf.exports)),Sf.exports}var Cf={exports:{}},Pf={exports:{}},sd={},yC;function mM(){if(yC)return sd;yC=1,Object.defineProperty(sd,"__esModule",{value:!0});function n(t){return()=>({keyword:t,type:"object",schemaType:"array",macro(e){return e.length===0?!0:e.length===1?{required:e}:{[t==="anyRequired"?"anyOf":"oneOf"]:e.map(r=>({required:[r]}))}},metaSchema:{type:"array",items:{type:"string"}}})}return sd.default=n,sd}var bC=Pf.exports,EC;function CN(){return EC||(EC=1,function(n,t){var e=bC&&bC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(mM()).default)("anyRequired");t.default=r,n.exports=r}(Pf,Pf.exports)),Pf.exports}var TC=Cf.exports,SC;function PN(){return SC||(SC=1,function(n,t){var e=TC&&TC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(CN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Cf,Cf.exports)),Cf.exports}var Af={exports:{}},Rf={exports:{}},CC=Rf.exports,PC;function AN(){return PC||(PC=1,function(n,t){var e=CC&&CC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(mM()).default)("oneRequired");t.default=r,n.exports=r}(Rf,Rf.exports)),Rf.exports}var AC=Af.exports,RC;function RN(){return RC||(RC=1,function(n,t){var e=AC&&AC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(AN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Af,Af.exports)),Af.exports}var Of={exports:{}},ld={exports:{}},OC;function ON(){return OC||(OC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=tp(),r={message:({params:{missingPattern:a}})=>(0,e.str)`should have property matching pattern '${a}'`,params:({params:{missingPattern:a}})=>(0,e._)`{missingPattern: ${a}}`};function o(){return{keyword:"patternRequired",type:"object",schemaType:"array",error:r,code(a){const{gen:s,schema:l,data:u}=a;if(l.length===0)return;const f=s.let("valid",!0);for(const h of l)c(h);function c(h){const p=s.let("matched",!1);s.forIn("key",u,_=>{s.assign(p,(0,e._)`${(0,i.usePattern)(a,h)}.test(${_})`),s.if(p,()=>s.break())}),a.setParams({missingPattern:h}),s.assign(f,(0,e.and)(f,p)),a.pass(f)}},metaSchema:{type:"array",items:{type:"string",format:"regex"},uniqueItems:!0}}}t.default=o,n.exports=o}(ld,ld.exports)),ld.exports}var MC=Of.exports,xC;function MN(){return xC||(xC=1,function(n,t){var e=MC&&MC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(ON()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Of,Of.exports)),Of.exports}var Mf={exports:{}},ud={exports:{}},IC;function xN(){return IC||(IC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});function e(){return{keyword:"prohibited",type:"object",schemaType:"array",macro:function(i){return i.length===0?!0:i.length===1?{not:{required:i}}:{not:{anyOf:i.map(r=>({required:[r]}))}}},metaSchema:{type:"array",items:{type:"string"}}}}t.default=e,n.exports=e}(ud,ud.exports)),ud.exports}var DC=Mf.exports,wC;function IN(){return wC||(wC=1,function(n,t){var e=DC&&DC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(xN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Mf,Mf.exports)),Mf.exports}var xf={exports:{}},fd={exports:{}},LC;function DN(){return LC||(LC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=tp();function i(a){return{keyword:"deepProperties",type:"object",schemaType:"object",macro:function(s){const l=[];for(const u in s)l.push(r(u,s[u]));return{allOf:l}},metaSchema:{type:"object",propertyNames:{type:"string",format:"json-pointer"},additionalProperties:(0,e.metaSchemaRef)(a)}}}t.default=i;function r(a,s){const l=a.split("/"),u={};let f=u;for(let c=1;c<l.length;c++){let h=l[c];const p=c===l.length-1;h=o(h);const _=f.properties={};let g;if(/[0-9]+/.test(h)){let v=+h;for(g=f.items=[],f.type=["object","array"];v--;)g.push({})}else f.type="object";f=p?s:{},_[h]=f,g&&g.push(f)}return u}function o(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}n.exports=i}(fd,fd.exports)),fd.exports}var NC=xf.exports,FC;function wN(){return FC||(FC=1,function(n,t){var e=NC&&NC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(DN()),r=(o,a)=>o.addKeyword((0,i.default)(a));t.default=r,n.exports=r}(xf,xf.exports)),xf.exports}var If={exports:{}},cd={exports:{}},BC;function LN(){return BC||(BC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt();function i(){return{keyword:"deepRequired",type:"object",schemaType:"array",code(o){const{schema:a,data:s}=o,l=a.map(f=>(0,e._)`(${u(f)}) === undefined`);o.fail((0,e.or)(...l));function u(f){if(f==="")throw new Error("empty JSON pointer not allowed");const c=f.split("/");let h=s;const p=c.map((_,g)=>g?h=(0,e._)`${h}${(0,e.getProperty)(r(_))}`:h);return(0,e.and)(...p)}},metaSchema:{type:"array",items:{type:"string",format:"json-pointer"}}}}t.default=i;function r(o){return o.replace(/~1/g,"/").replace(/~0/g,"~")}n.exports=i}(cd,cd.exports)),cd.exports}var VC=If.exports,UC;function NN(){return UC||(UC=1,function(n,t){var e=VC&&VC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(LN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(If,If.exports)),If.exports}var Df={exports:{}},hd={exports:{}},kC;function FN(){return kC||(kC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e={},i={timestamp:()=>()=>Date.now(),datetime:()=>()=>new Date().toISOString(),date:()=>()=>new Date().toISOString().slice(0,10),time:()=>()=>new Date().toISOString().slice(11),random:()=>()=>Math.random(),randomint:f=>{var c;const h=(c=f==null?void 0:f.max)!==null&&c!==void 0?c:2;return()=>Math.floor(Math.random()*h)},seq:f=>{var c;const h=(c=f==null?void 0:f.name)!==null&&c!==void 0?c:"";return e[h]||(e[h]=0),()=>e[h]++}},r=Object.assign(o,{DEFAULTS:i});function o(){return{keyword:"dynamicDefaults",type:"object",schemaType:["string","object"],modifying:!0,valid:!0,compile(f,c,h){if(!h.opts.useDefaults||h.compositeRule)return()=>!0;const p={};for(const g in f)p[g]=a(f[g]);const _=h.opts.useDefaults==="empty";return g=>{for(const v in f)(g[v]===void 0||_&&(g[v]===null||g[v]===""))&&(g[v]=p[v]());return!0}},metaSchema:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"object",additionalProperties:!1,required:["func","args"],properties:{func:{type:"string"},args:{type:"object"}}}]}}}}function a(f){return typeof f=="object"?s(f):l(f)}function s({func:f,args:c}){const h=i[f];return u(f,h),h(c)}function l(f=""){const c=i[f];return u(f,c),c()}function u(f,c){if(!c)throw new Error(`invalid "dynamicDefaults" keyword property value: ${f}`)}t.default=r,n.exports=r}(hd,hd.exports)),hd.exports}var zC=Df.exports,GC;function BN(){return GC||(GC=1,function(n,t){var e=zC&&zC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(FN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Df,Df.exports)),Df.exports}var wf={exports:{}},dd={exports:{}},WC;function VN(){return WC||(WC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=tp(),r={message:({params:{schemaProp:a}})=>a?(0,e.str)`should match case "${a}" schema`:(0,e.str)`should match default case schema`,params:({params:{schemaProp:a}})=>a?(0,e._)`{failingCase: ${a}}`:(0,e._)`{failingDefault: true}`};function o(a){const s=(0,i.metaSchemaRef)(a);return[{keyword:"select",schemaType:["string","number","boolean","null"],$data:!0,error:r,dependencies:["selectCases"],code(l){const{gen:u,schemaCode:f,parentSchema:c}=l;l.block$data(e.nil,()=>{const h=u.let("valid",!0),p=u.name("_valid"),_=u.const("value",(0,e._)`${f} === null ? "null" : ${f}`);u.if(!1);for(const g in c.selectCases){l.setParams({schemaProp:g}),u.elseIf((0,e._)`"" + ${_} == ${g}`);const v=l.subschema({keyword:"selectCases",schemaProp:g},p);l.mergeEvaluated(v,e.Name),u.assign(h,p)}if(u.else(),c.selectDefault!==void 0){l.setParams({schemaProp:void 0});const g=l.subschema({keyword:"selectDefault"},p);l.mergeEvaluated(g,e.Name),u.assign(h,p)}u.endIf(),l.pass(h)})}},{keyword:"selectCases",dependencies:["select"],metaSchema:{type:"object",additionalProperties:s}},{keyword:"selectDefault",dependencies:["select","selectCases"],metaSchema:s}]}t.default=o,n.exports=o}(dd,dd.exports)),dd.exports}var HC=wf.exports,jC;function UN(){return jC||(jC=1,function(n,t){var e=HC&&HC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(VN()),r=(o,a)=>((0,i.default)(a).forEach(s=>o.addKeyword(s)),o);t.default=r,n.exports=r}(wf,wf.exports)),wf.exports}var XC=df.exports,YC;function kN(){return YC||(YC=1,function(n,t){var e=XC&&XC.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(uN()),r=e(cN()),o=e(dN()),a=e(_N()),s=e(gN()),l=e(yN()),u=e(EN()),f=e(SN()),c=e(PN()),h=e(RN()),p=e(MN()),_=e(IN()),g=e(wN()),v=e(NN()),E=e(BN()),T=e(UN()),S={typeof:i.default,instanceof:r.default,range:o.default,exclusiveRange:a.default,regexp:s.default,transform:l.default,uniqueItemProperties:u.default,allRequired:f.default,anyRequired:c.default,oneRequired:h.default,patternRequired:p.default,prohibited:_.default,deepProperties:g.default,deepRequired:v.default,dynamicDefaults:E.default,select:T.default};t.default=S,n.exports=S}(df,df.exports)),df.exports}var KC=hf.exports,qC;function zN(){return qC||(qC=1,function(n,t){var e=KC&&KC.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(kN()),r=(a,s)=>{if(Array.isArray(s)){for(const l of s)o(l)(a);return a}if(s)return o(s)(a),a;for(s in i.default)o(s)(a);return a};r.get=o;function o(a){const s=i.default[a];if(!s)throw new Error("Unknown keyword "+a);return s}t.default=r,n.exports=r,n.exports.default=r}(hf,hf.exports)),hf.exports}var pd={exports:{}},QC;function GN(){return QC||(QC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=pM(),i=Xt(),r=Gf(),o=oc(),a=nc(),s=Aa(),l="errorMessage",u=new e.Name("emUsed"),f={required:"missingProperty",dependencies:"property",dependentRequired:"property"},c=/\$\{[^}]+\}/,h=/\$\{([^}]+)\}/g,p=/^""\s*\+\s*|\s*\+\s*""$/g;function _(v){return{keyword:l,schemaType:["string","object"],post:!0,code(E){const{gen:T,data:S,schema:C,schemaValue:O,it:A}=E;if(A.createErrors===!1)return;const M=C,D=i.strConcat(s.default.instancePath,A.errorPath);T.if(e._`${s.default.errors} > 0`,()=>{if(typeof M=="object"){const[$,L]=V(M);L&&B(L),$&&z($),J(U(M))}const W=typeof M=="string"?M:M._;W&&X(W),v.keepErrors||re()});function U({properties:W,items:$}){const L={};if(W){L.props={};for(const G in W)L.props[G]=[]}if($){L.items={};for(let G=0;G<$.length;G++)L.items[G]=[]}return L}function V(W){let $,L;for(const G in W){if(G==="properties"||G==="items")continue;const Y=W[G];if(typeof Y=="object"){$||($={});const Q=$[G]={};for(const fe in Y)Q[fe]=[]}else L||(L={}),L[G]=[]}return[$,L]}function B(W){const $=T.const("emErrors",e.stringify(W)),L=T.const("templates",Z(W,C));T.forOf("err",s.default.vErrors,fe=>T.if(ae(fe,$),()=>T.code(e._`${$}[${fe}.keyword].push(${fe})`).assign(e._`${fe}.${u}`,!0)));const{singleError:G}=v;if(G){const fe=T.let("message",e._`""`),Se=T.let("paramsErrors",e._`[]`);Y(ee=>{T.if(fe,()=>T.code(e._`${fe} += ${typeof G=="string"?G:";"}`)),T.code(e._`${fe} += ${Q(ee)}`),T.assign(Se,e._`${Se}.concat(${$}[${ee}])`)}),a.reportError(E,{message:fe,params:e._`{errors: ${Se}}`})}else Y(fe=>a.reportError(E,{message:Q(fe),params:e._`{errors: ${$}[${fe}]}`}));function Y(fe){T.forIn("key",$,Se=>T.if(e._`${$}[${Se}].length`,()=>fe(Se)))}function Q(fe){return e._`${fe} in ${L} ? ${L}[${fe}]() : ${O}[${fe}]`}}function z(W){const $=T.const("emErrors",e.stringify(W)),L=[];for(const Se in W)L.push([Se,Z(W[Se],C[Se])]);const G=T.const("templates",T.object(...L)),Y=T.scopeValue("obj",{ref:f,code:e.stringify(f)}),Q=T.let("emPropParams"),fe=T.let("emParamsErrors");T.forOf("err",s.default.vErrors,Se=>T.if(ae(Se,$),()=>{T.assign(Q,e._`${Y}[${Se}.keyword]`),T.assign(fe,e._`${$}[${Se}.keyword][${Se}.params[${Q}]]`),T.if(fe,()=>T.code(e._`${fe}.push(${Se})`).assign(e._`${Se}.${u}`,!0))})),T.forIn("key",$,Se=>T.forIn("keyProp",e._`${$}[${Se}]`,ee=>{T.assign(fe,e._`${$}[${Se}][${ee}]`),T.if(e._`${fe}.length`,()=>{const pe=T.const("tmpl",e._`${G}[${Se}] && ${G}[${Se}][${ee}]`);a.reportError(E,{message:e._`${pe} ? ${pe}() : ${O}[${Se}][${ee}]`,params:e._`{errors: ${fe}}`})})}))}function J(W){const{props:$,items:L}=W;if(!$&&!L)return;const G=e._`typeof ${S} == "object"`,Y=e._`Array.isArray(${S})`,Q=T.let("emErrors");let fe,Se;const ee=T.let("templates");$&&L?(fe=T.let("emChildKwd"),T.if(G),T.if(Y,()=>{pe(L,C.items),T.assign(fe,e.str`items`)},()=>{pe($,C.properties),T.assign(fe,e.str`properties`)}),Se=e._`[${fe}]`):L?(T.if(Y),pe(L,C.items),Se=e._`.items`):$&&(T.if(i.and(G,i.not(Y))),pe($,C.properties),Se=e._`.properties`),T.forOf("err",s.default.vErrors,Pe=>se(Pe,Q,xe=>T.code(e._`${Q}[${xe}].push(${Pe})`).assign(e._`${Pe}.${u}`,!0))),T.forIn("key",Q,Pe=>T.if(e._`${Q}[${Pe}].length`,()=>{a.reportError(E,{message:e._`${Pe} in ${ee} ? ${ee}[${Pe}]() : ${O}${Se}[${Pe}]`,params:e._`{errors: ${Q}[${Pe}]}`}),T.assign(e._`${s.default.vErrors}[${s.default.errors}-1].instancePath`,e._`${D} + "/" + ${Pe}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),T.endIf();function pe(Pe,xe){T.assign(Q,e.stringify(Pe)),T.assign(ee,Z(Pe,xe))}}function X(W){const $=T.const("emErrs",e._`[]`);T.forOf("err",s.default.vErrors,L=>T.if(H(L),()=>T.code(e._`${$}.push(${L})`).assign(e._`${L}.${u}`,!0))),T.if(e._`${$}.length`,()=>a.reportError(E,{message:q(W),params:e._`{errors: ${$}}`}))}function re(){const W=T.const("emErrs",e._`[]`);T.forOf("err",s.default.vErrors,$=>T.if(e._`!${$}.${u}`,()=>T.code(e._`${W}.push(${$})`))),T.assign(s.default.vErrors,W).assign(s.default.errors,e._`${W}.length`)}function ae(W,$){return i.and(e._`${W}.keyword !== ${l}`,e._`!${W}.${u}`,e._`${W}.instancePath === ${D}`,e._`${W}.keyword in ${$}`,e._`${W}.schemaPath.indexOf(${A.errSchemaPath}) === 0`,e._`/^\\/[^\\/]*$/.test(${W}.schemaPath.slice(${A.errSchemaPath.length}))`)}function se(W,$,L){T.if(i.and(e._`${W}.keyword !== ${l}`,e._`!${W}.${u}`,e._`${W}.instancePath.indexOf(${D}) === 0`),()=>{const G=T.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:e._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),Y=T.const("emMatches",e._`${G}.exec(${W}.instancePath.slice(${D}.length))`),Q=T.const("emChild",e._`${Y} && ${Y}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);T.if(e._`${Q} !== undefined && ${Q} in ${$}`,()=>L(Q))})}function H(W){return i.and(e._`${W}.keyword !== ${l}`,e._`!${W}.${u}`,i.or(e._`${W}.instancePath === ${D}`,i.and(e._`${W}.instancePath.indexOf(${D}) === 0`,e._`${W}.instancePath[${D}.length] === "/"`)),e._`${W}.schemaPath.indexOf(${A.errSchemaPath}) === 0`,e._`${W}.schemaPath[${A.errSchemaPath}.length] === "/"`)}function Z(W,$){const L=[];for(const G in W){const Y=$[G];c.test(Y)&&L.push([G,N(Y)])}return T.object(...L)}function q(W){return c.test(W)?new r._Code(r.safeStringify(W).replace(h,($,L)=>`" + JSON.stringify(${o.getData(L,A)}) + "`).replace(p,"")):e.stringify(W)}function N(W){return e._`function(){return ${q(W)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const g=(v,E={})=>{if(!v.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(v.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return v.addKeyword(_(E))};t.default=g,n.exports=g,n.exports.default=g}(pd,pd.exports)),pd.exports}var $C;function st(){if($C)return go;$C=1;var n=go&&go.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(go,"__esModule",{value:!0}),go.validateType=go.generateLazyValidator=go.Ajv=void 0;const t=n(pM());go.Ajv=t.default;const e=n(zN()),i=n(GN());function r(a,s){let l=null;const u=(f,c)=>{if(!l){const h=new t.default({$data:!0,allErrors:!0});(0,e.default)(h),(0,i.default)(h,{singleError:!0}),s==null||s.forEach(p=>h.addKeyword(p)),l=h.compile(a),Object.defineProperty(u,"errors",{get(){return l==null?void 0:l.errors}})}return l(f,c)};return u}go.generateLazyValidator=r;function o(a,s){return a.validate(s)}return go.validateType=o,go}var ZC;function WN(){return ZC||(ZC=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SceneUpdate=n.SCENE_UPDATE=void 0;const t=st();n.SCENE_UPDATE="SCENE_UPDATE",function(e){e.schema={type:"object",properties:{type:{type:"string",enum:[n.SCENE_UPDATE]},payload:{type:"object",properties:{sceneId:{type:"string"},sceneType:{type:"string"}},additionalProperties:!1,required:["sceneId","sceneType"]}},required:["payload","type"]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.SceneUpdate||(n.SceneUpdate={}))}(sm)),sm}var ym={},JC;function HN(){return JC||(JC=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Update=n.UPDATE=void 0;const t=st();n.UPDATE="update",function(e){e.schema={type:"object",properties:{type:{type:"string",enum:[n.UPDATE]}},required:["type"]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Update||(n.Update={}))}(ym)),ym}var eP;function jN(){return eP||(eP=1,function(n){var t=Ss&&Ss.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ss&&Ss.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(WN(),n),e(HN(),n)}(Ss)),Ss}var Os={},bm={},tP;function XN(){return tP||(tP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProjectType=void 0;const t=st();(function(e){e.SCENE="scene",e.SMART_ITEM="smart-item",e.PORTABLE_EXPERIENCE="portable-experience",e.LIBRARY="library"})(n.ProjectType||(n.ProjectType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.ProjectType||(n.ProjectType={}))}(bm)),bm}var Em={},Tm={},iP;function ip(){return iP||(iP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Rarity=void 0;const t=st();(function(e){e.UNIQUE="unique",e.MYTHIC="mythic",e.EXOTIC="exotic",e.LEGENDARY="legendary",e.EPIC="epic",e.RARE="rare",e.UNCOMMON="uncommon",e.COMMON="common"})(n.Rarity||(n.Rarity={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema);const i={[e.UNIQUE]:1,[e.MYTHIC]:10,[e.EXOTIC]:50,[e.LEGENDARY]:100,[e.EPIC]:1e3,[e.RARE]:5e3,[e.UNCOMMON]:1e4,[e.COMMON]:1e5},r={[e.UNIQUE]:"#FFE617",[e.MYTHIC]:"#FB7DE3",[e.EXOTIC]:"#E4FFB8",[e.LEGENDARY]:"#A657ED",[e.EPIC]:"#6397F2",[e.RARE]:"#3AD682",[e.UNCOMMON]:"#FF8563",[e.COMMON]:"#D4E0E0"},o={[e.UNIQUE]:"#FFB626",[e.MYTHIC]:"#FF63E1",[e.EXOTIC]:"#CAFF73",[e.LEGENDARY]:"#842DDA",[e.EPIC]:"#3D85E6",[e.RARE]:"#36CF75",[e.UNCOMMON]:"#ED6D4F",[e.COMMON]:"#ABC1C1"};function a(f){return i[f]}e.getMaxSupply=a;function s(f){return o[f]}e.getColor=s;function l(){return[e.UNIQUE,e.MYTHIC,e.EXOTIC,e.LEGENDARY,e.EPIC,e.RARE,e.UNCOMMON,e.COMMON]}e.getRarities=l;function u(f){return[r[f],o[f]]}e.getGradient=u}(n.Rarity||(n.Rarity={}))}(Tm)),Tm}var Sm={},rP;function Zs(){return rP||(rP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WearableCategory=void 0;const t=st();(function(e){e.EYEBROWS="eyebrows",e.EYES="eyes",e.FACIAL_HAIR="facial_hair",e.HAIR="hair",e.BODY_SHAPE="body_shape",e.MOUTH="mouth",e.UPPER_BODY="upper_body",e.LOWER_BODY="lower_body",e.FEET="feet",e.EARRING="earring",e.EYEWEAR="eyewear",e.HAT="hat",e.HELMET="helmet",e.MASK="mask",e.TIARA="tiara",e.TOP_HEAD="top_head",e.SKIN="skin",e.HANDS_WEAR="hands_wear"})(n.WearableCategory||(n.WearableCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.WearableCategory||(n.WearableCategory={}))}(Sm)),Sm}var Cm={},Pm={},nP;function db(){return nP||(nP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.BodyShape=void 0;const t=st();(function(e){e.MALE="urn:decentraland:off-chain:base-avatars:BaseMale",e.FEMALE="urn:decentraland:off-chain:base-avatars:BaseFemale"})(n.BodyShape||(n.BodyShape={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.BodyShape||(n.BodyShape={}))}(Pm)),Pm}var Am={},Rm={},oP;function gM(){return oP||(oP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.BodyPartCategory=void 0;const t=st();(function(e){e.HEAD="head",e.HANDS="hands"})(n.BodyPartCategory||(n.BodyPartCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.BodyPartCategory||(n.BodyPartCategory={}))}(Rm)),Rm}var aP;function pb(){return aP||(aP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.HideableWearableCategory=void 0;const t=Zs(),e=st(),i=gM();(function(r){r.schema={oneOf:[Object.assign({},t.WearableCategory.schema),Object.assign({},i.BodyPartCategory.schema)]},r.validate=(0,e.generateLazyValidator)(r.schema)})(n.HideableWearableCategory||(n.HideableWearableCategory={}))}(Am)),Am}var sP;function _b(){return sP||(sP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WearableRepresentation=void 0;const t=st(),e=db(),i=pb();(function(r){r.schema={type:"object",properties:{bodyShapes:{type:"array",items:e.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}}},overrideHides:{type:"array",items:i.HideableWearableCategory.schema},overrideReplaces:{type:"array",items:i.HideableWearableCategory.schema}},required:["bodyShapes","mainFile","contents","overrideHides","overrideReplaces"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(n.WearableRepresentation||(n.WearableRepresentation={}))}(Cm)),Cm}var Ms={},xs={},Om={},Mm={},lP;function Js(){return lP||(lP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.IPFSv1=n.IPFSv2=n.EthAddress=n.Color3=void 0;const t=st();(function(e){e.schema={type:"object",required:["r","g","b"],properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}}};const i=(0,t.generateLazyValidator)(e.schema);e.validate=r=>i(r)})(n.Color3||(n.Color3={})),function(e){e.schema={type:"string",pattern:"^0x[a-fA-F0-9]{40}$"};const i=new RegExp(e.schema.pattern);e.validate=r=>i.test(r)}(n.EthAddress||(n.EthAddress={})),function(e){e.schema={type:"string",pattern:"^(ba)[a-zA-Z0-9]{57}$"};const i=new RegExp(e.schema.pattern);e.validate=r=>i.test(r)}(n.IPFSv2||(n.IPFSv2={})),function(e){e.schema={type:"string",pattern:"^(Qm)[a-zA-Z0-9]{44}$"};const i=new RegExp(e.schema.pattern);e.validate=r=>i.test(r)}(n.IPFSv1||(n.IPFSv1={}))}(Mm)),Mm}var uP;function vM(){return uP||(uP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Avatar=n.Link=n.LinkUrl=n.AvatarInfo=n.Snapshots=void 0;const t=Zs(),e=Js(),i=st();var r;(function(l){l.schema={type:"object",required:["face256","body"],properties:{face256:e.IPFSv2.schema,body:e.IPFSv2.schema}},l.validate=(0,i.generateLazyValidator)(l.schema)})(r=n.Snapshots||(n.Snapshots={}));var o;(function(l){l.schema={type:"object",required:["bodyShape","eyes","hair","skin"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:e.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:e.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:e.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:t.WearableCategory.schema},emotes:{type:"array",items:{type:"object",properties:{slot:{type:"number"},urn:{type:"string"}},required:["slot","urn"]},nullable:!0},snapshots:Object.assign(Object.assign({},r.schema),{nullable:!0})},additionalProperties:!0},l.validate=(0,i.generateLazyValidator)(l.schema)})(o=n.AvatarInfo||(n.AvatarInfo={}));var a;(function(l){l.schema={type:"string",maxLength:2083,pattern:"^(?:https?):\\/\\/[^\\s/$.?#].[^\\s]*$"};const u=new RegExp(l.schema.pattern,"i");l.validate=f=>u.test(f)})(a=n.LinkUrl||(n.LinkUrl={}));var s;(function(l){l.schema={type:"object",required:["title","url"],properties:{title:{type:"string"},url:a.schema}}})(s=n.Link||(n.Link={})),function(l){l.schema={type:"object",required:["name","description","ethAddress","version","tutorialStep","avatar","hasClaimedName"],properties:{userId:{type:"string"},name:{type:"string"},description:{type:"string"},links:{type:"array",maxItems:5,items:s.schema,nullable:!0},country:{nullable:!0,type:"string"},employmentStatus:{nullable:!0,type:"string"},gender:{nullable:!0,type:"string"},pronouns:{nullable:!0,type:"string"},relationshipStatus:{nullable:!0,type:"string"},sexualOrientation:{nullable:!0,type:"string"},language:{nullable:!0,type:"string"},profession:{nullable:!0,type:"string"},birthdate:{nullable:!0,type:"number"},realName:{nullable:!0,type:"string"},hobbies:{nullable:!0,type:"string"},ethAddress:e.EthAddress.schema,version:{type:"number"},tutorialStep:{type:"number"},email:{type:"string",nullable:!0},blocked:{type:"array",items:{type:"string"},nullable:!0},muted:{type:"array",items:{type:"string"},nullable:!0},interests:{type:"array",items:{type:"string"},nullable:!0},hasClaimedName:{type:"boolean"},hasConnectedWeb3:{type:"boolean",nullable:!0},avatar:o.schema},additionalProperties:!0},l.validate=(0,i.generateLazyValidator)(l.schema)}(n.Avatar||(n.Avatar={}))}(Om)),Om}var xm={},fP;function YN(){return fP||(fP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Profile=void 0;const t=st(),e=vM();(function(i){i.schema={type:"object",required:["avatars"],properties:{avatars:{type:"array",items:e.Avatar.schema}},additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.Profile||(n.Profile={}))}(xm)),xm}var cP;function KN(){return cP||(cP=1,function(n){var t=xs&&xs.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=xs&&xs.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(vM(),n),e(YN(),n)}(xs)),xs}var Im={},Dm={},hP;function yM(){return hP||(hP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.FeatureToggles=n.portableExperiencesToggles=n.toggles=void 0;const t=st();n.toggles=["enabled","disabled"],n.portableExperiencesToggles=[...n.toggles,"hideUi"],function(e){e.schema={type:"object",properties:{voiceChat:{type:"string",enum:n.toggles,nullable:!0},portableExperiences:{type:"string",enum:n.portableExperiencesToggles,nullable:!0,errorMessage:`valid options are ${n.portableExperiencesToggles.join(", ")}`}},errorMessage:`valid options are ${n.toggles.join(", ")}`,required:[]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.FeatureToggles||(n.FeatureToggles={}))}(Dm)),Dm}var wm={},dP;function bM(){return dP||(dP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WorldConfiguration=void 0;const t=st();(function(e){e.schema={type:"object",properties:{name:{type:"string",nullable:!0},skybox:{type:"number",nullable:!0},minimapVisible:{type:"boolean",nullable:!0},miniMapConfig:{type:"object",nullable:!0,properties:{visible:{type:"boolean",nullable:!0},dataImage:{type:"string",nullable:!0},estateImage:{type:"string",nullable:!0}}},skyboxConfig:{type:"object",nullable:!0,properties:{fixedTime:{type:"number",nullable:!0},textures:{type:"array",nullable:!0,items:{type:"string"},oneOf:[{minItems:0,maxItems:0},{minItems:1,maxItems:1},{minItems:6,maxItems:6}],errorMessage:"customSkybox must be an array of 0, 1 or 6 strings"}}},fixedAdapter:{type:"string",nullable:!0},placesConfig:{type:"object",nullable:!0,properties:{optOut:{type:"boolean",nullable:!0}}}},required:[]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.WorldConfiguration||(n.WorldConfiguration={}))}(wm)),wm}var Lm={},pP;function EM(){return pP||(pP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SceneParcels=void 0;const t=st();(function(e){e.schema={description:'Describes a scene, a set of parcels whose content is treated as the same entity. A list of parcels is listed, for which one of them is considered the "base" for positioning purposes.',type:"object",properties:{base:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},parcels:{type:"array",items:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},minItems:1}},additionalProperties:!0,required:["base","parcels"]},e.schemaValidator=(0,t.generateLazyValidator)(e.schema),e.validate=i=>e.schemaValidator(i)&&i.parcels.includes(i.base)})(n.SceneParcels||(n.SceneParcels={}))}(Lm)),Lm}var Nm={},$u={},_P;function mb(){return _P||(_P=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.displayableProperties=void 0,$u.displayableProperties={menuBarIcon:{description:"Name of the file used as icon for the MenuBar",type:"string",nullable:!0}}),$u}var Fm={},mP;function TM(){return mP||(mP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Source=void 0;const t=st();(function(e){e.schema={type:"object",properties:{version:{type:"number",nullable:!0},origin:{type:"string"},projectId:{type:"string"},point:{type:"object",properties:{x:{type:"integer"},y:{type:"integer"}},nullable:!0,required:["x","y"]},rotation:{type:"string",enum:["north","east","south","west"],nullable:!0},layout:{type:"object",properties:{rows:{type:"integer"},cols:{type:"integer"}},nullable:!0,required:["rows","cols"]},isEmpty:{type:"boolean",nullable:!0}},additionalProperties:!0,required:["origin","projectId"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.Source||(n.Source={}))}(Fm)),Fm}var Bm={},gP;function SM(){return gP||(gP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SpawnPoint=void 0;const t=st();(function(e){e.schema={type:"object",properties:{name:{type:"string",nullable:!0},position:{type:"object",oneOf:[{$ref:"#single-position"},{$ref:"#multi-position"}],required:["x","y","z"]},default:{type:"boolean",nullable:!0},cameraTarget:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],nullable:!0}},required:["position"],definitions:{"single-position":{$id:"#single-position",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"]},"multi-position":{$id:"#multi-position",type:"object",properties:{x:{type:"array",items:{type:"number"},minItems:1},y:{type:"array",items:{type:"number"},minItems:1},z:{type:"array",items:{type:"number"},minItems:1}},required:["x","y","z"]}}},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.SpawnPoint||(n.SpawnPoint={}))}(Bm)),Bm}var vP;function qN(){return vP||(vP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Scene=n.RequiredPermission=void 0;const t=st(),e=mb(),i=yM(),r=EM(),o=TM(),a=SM(),s=bM();var l;(function(u){u.ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE="ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE",u.ALLOW_TO_TRIGGER_AVATAR_EMOTE="ALLOW_TO_TRIGGER_AVATAR_EMOTE",u.ALLOW_MEDIA_HOSTNAMES="ALLOW_MEDIA_HOSTNAMES",u.USE_WEB3_API="USE_WEB3_API",u.USE_FETCH="USE_FETCH",u.USE_WEBSOCKET="USE_WEBSOCKET",u.OPEN_EXTERNAL_LINK="OPEN_EXTERNAL_LINK"})(l=n.RequiredPermission||(n.RequiredPermission={})),function(u){u.schema={type:"object",properties:Object.assign(Object.assign({isPortableExperience:{description:"Define the current scene as a Portable Experience",type:"boolean",nullable:!0},main:{description:"File that contains the entry point of the scene's code",type:"string",minLength:1},scene:r.SceneParcels.schema},e.displayableProperties),{display:{description:"Information related to how should this land be displayed apart from the normal rendering of the scene",type:"object",properties:{title:{description:"A name so other users can identify what the contents of this land should be",type:"string",nullable:!0},favicon:{description:"DEPRECATED. Allow the land owner to set up a favicon to this land",type:"string",nullable:!0},description:{description:"A description that will be shown on client's nav map when the scene is selected",type:"string",nullable:!0},navmapThumbnail:{type:"string",nullable:!0}},nullable:!0,required:[]},owner:{type:"string",nullable:!0},contact:{description:"Describe different ways of contacting the land owner",type:"object",properties:{name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},im:{type:"string",nullable:!0},url:{type:"string",nullable:!0}},nullable:!0,required:[]},tags:{type:"array",items:{type:"string",minLength:1},nullable:!0},source:Object.assign(Object.assign({},o.Source.schema),{nullable:!0}),spawnPoints:{type:"array",items:a.SpawnPoint.schema,nullable:!0},requiredPermissions:{type:"array",items:{type:"string",enum:Object.values(l)},uniqueItems:!0,nullable:!0},featureToggles:Object.assign(Object.assign({},i.FeatureToggles.schema),{nullable:!0}),worldConfiguration:Object.assign(Object.assign({},s.WorldConfiguration.schema),{nullable:!0}),allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!0}}),additionalProperties:!0,required:["main","scene"],dependencies:{requiredPermissions:{if:{properties:{requiredPermissions:{type:"array",contains:{const:l.ALLOW_MEDIA_HOSTNAMES}}}},then:{properties:{allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!1,minItems:1}},required:["allowedMediaHostnames"]},else:{properties:{allowedMediaHostnames:{type:["null","array"],nullable:!0,maxItems:0}}}}}},u.validate=(0,t.generateLazyValidator)(u.schema)}(n.Scene||(n.Scene={}))}(Nm)),Nm}var yP;function QN(){return yP||(yP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SpawnPoint=n.Source=n.RequiredPermission=n.Scene=n.SceneParcels=n.WorldConfiguration=n.FeatureToggles=void 0;var t=yM();Object.defineProperty(n,"FeatureToggles",{enumerable:!0,get:function(){return t.FeatureToggles}});var e=bM();Object.defineProperty(n,"WorldConfiguration",{enumerable:!0,get:function(){return e.WorldConfiguration}});var i=EM();Object.defineProperty(n,"SceneParcels",{enumerable:!0,get:function(){return i.SceneParcels}});var r=qN();Object.defineProperty(n,"Scene",{enumerable:!0,get:function(){return r.Scene}}),Object.defineProperty(n,"RequiredPermission",{enumerable:!0,get:function(){return r.RequiredPermission}});var o=TM();Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return o.Source}});var a=SM();Object.defineProperty(n,"SpawnPoint",{enumerable:!0,get:function(){return a.SpawnPoint}})}(Im)),Im}var Is={},Vm={},Um={},bP;function CM(){return bP||(bP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Locale=void 0;const t=st();(function(e){e.EN="en",e.ES="es"})(n.Locale||(n.Locale={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Locale||(n.Locale={}))}(Um)),Um}var EP;function PM(){return EP||(EP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.I18N=void 0;const t=st(),e=CM();(function(i){i.schema={type:"object",properties:{code:e.Locale.schema,text:{type:"string"}},additionalProperties:!0,required:["code","text"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.I18N||(n.I18N={}))}(Vm)),Vm}var km={},TP;function AM(){return TP||(TP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Metrics=void 0;const t=st();(function(e){e.schema={type:"object",properties:{triangles:{type:"number"},materials:{type:"number"},textures:{type:"number"},meshes:{type:"number"},bodies:{type:"number"},entities:{type:"number"}},required:["triangles","materials","textures","meshes","bodies","entities"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.Metrics||(n.Metrics={}))}(km)),km}var zm={},SP;function gb(){return SP||(SP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isStandard=n.standardProperties=void 0;const t=ip(),e=st();n.standardProperties={collectionAddress:{type:"string",nullable:!1},rarity:t.Rarity.schema};const i={type:"object",properties:Object.assign({},n.standardProperties),required:["collectionAddress","rarity"]},r=(0,e.generateLazyValidator)(i);function o(a){return r(a)}n.isStandard=o}(zm)),zm}var Gm={},Ds={},Wm={},CP;function $N(){return CP||(CP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.MerkleProof=void 0;const t=st();(function(e){e.schema={type:"object",properties:{proof:{type:"array",items:{type:"string"}},index:{type:"number"},hashingKeys:{type:"array",items:{type:"string"}},entityHash:{type:"string"}},required:["entityHash","hashingKeys","index","proof"],additionalProperties:!0},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.MerkleProof||(n.MerkleProof={}))}(Wm)),Wm}var PP;function RM(){return PP||(PP=1,function(n){var t=Ds&&Ds.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ds&&Ds.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e($N(),n)}(Ds)),Ds}var Hm={},AP;function vb(){return AP||(AP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createMappingsHelper=n.AddMappingError=n.Mappings=n.Mapping=n.MultipleMapping=n.RangeMapping=n.AnyMapping=n.SingleMapping=n.ContractNetwork=n.MappingType=void 0;const t=st();var e;(function(c){c.SINGLE="single",c.ANY="any",c.MULTIPLE="multiple",c.RANGE="range"})(e=n.MappingType||(n.MappingType={}));var i;(function(c){c.MAINNET="mainnet",c.MATIC="matic",c.SEPOLIA="sepolia",c.AMOY="amoy"})(i=n.ContractNetwork||(n.ContractNetwork={}));var r;(function(c){c.schema={type:"object",properties:{type:{type:"string",const:e.SINGLE},id:{type:"string",pattern:"^[0-9]+$"}},required:["type","id"],additionalProperties:!1},c.validate=(0,t.generateLazyValidator)(c.schema)})(r=n.SingleMapping||(n.SingleMapping={}));var o;(function(c){c.schema={type:"object",properties:{type:{type:"string",const:e.ANY}},required:["type"],additionalProperties:!1},c.validate=(0,t.generateLazyValidator)(c.schema)})(o=n.AnyMapping||(n.AnyMapping={}));var a;(function(c){c._fromLessThanOrEqualTo={keyword:"_fromLessThanOrEqualTo",validate:function(p,_){if(!_||!_.from||!_.to)return!1;let{to:g,from:v}=_;return(typeof v!="bigint"||typeof g!="bigint")&&(v=BigInt(v),g=BigInt(g)),v<=g},errors:!1},c.schema={type:"object",properties:{type:{type:"string",const:e.RANGE},from:{type:"string",pattern:"^[0-9]+$"},to:{type:"string",pattern:"^[0-9]+$"}},required:["type","from","to"],additionalProperties:!1,_fromLessThanOrEqualTo:!0},c.validate=(0,t.generateLazyValidator)(c.schema,[c._fromLessThanOrEqualTo])})(a=n.RangeMapping||(n.RangeMapping={}));var s;(function(c){c.schema={type:"object",properties:{type:{type:"string",const:e.MULTIPLE},ids:{type:"array",items:{type:"string",pattern:"^[0-9]+$"},minItems:1,uniqueItems:!0}},required:["type","ids"],additionalProperties:!1},c.validate=(0,t.generateLazyValidator)(c.schema)})(s=n.MultipleMapping||(n.MultipleMapping={}));var l;(function(c){c.schema={type:"object",properties:{type:{type:"string",enum:Object.values(e)}},required:["type"],oneOf:[r.schema,o.schema,a.schema,s.schema]},c.validate=(0,t.generateLazyValidator)(c.schema,[a._fromLessThanOrEqualTo])})(l=n.Mapping||(n.Mapping={})),function(c){c._isMappingsValid={keyword:"_isMappingsValid",validate:function(p,_){try{f(_)}catch{return!1}return!0},errors:!1},c.innerSchema={type:"object",patternProperties:{"^0x[0-9a-fA-F]{40}$":{type:"array",items:l.schema}},minProperties:1,required:[],additionalProperties:!1};const h=Object.values(i).reduce((p,_)=>(p[_]=c.innerSchema,p),{});c.schema={type:"object",properties:h,minProperties:1,additionalProperties:!1,_isMappingsValid:!0},c.validate=(0,t.generateLazyValidator)(c.schema,[a._fromLessThanOrEqualTo,c._isMappingsValid])}(n.Mappings||(n.Mappings={}));class u extends Error{constructor(h,p,_){super(h),this.existingMapping=p,this.conflictingMapping=_}}n.AddMappingError=u;function f(c={}){const h={};for(const[O,A]of Object.entries(c)){h[O]={};for(const[M,D]of Object.entries(A))for(const U of D)S(O,M,U)}function p(){return JSON.parse(JSON.stringify(h))}function _(O,A,M){const D=BigInt(O);return D>=BigInt(A)&&D<=BigInt(M)}function g(O,A){switch(A.type){case e.SINGLE:return O.id===A.id;case e.MULTIPLE:return A.ids.includes(O.id);case e.RANGE:return _(O.id,A.from,A.to);default:return!1}}function v(O,A){switch(A.type){case e.SINGLE:return O.ids.includes(A.id);case e.MULTIPLE:return O.ids.some(M=>A.ids.includes(M));case e.RANGE:return O.ids.some(M=>_(M,A.from,A.to));default:return!1}}function E(O,A){switch(A.type){case e.SINGLE:return _(A.id,O.from,O.to);case e.MULTIPLE:return A.ids.some(M=>_(M,O.from,O.to));case e.RANGE:return BigInt(O.from)<=BigInt(A.to)&&BigInt(O.to)>=BigInt(A.from)}}function T(O,A){if(O.type===e.ANY||A.type===e.ANY)return!0;switch(O.type){case e.SINGLE:return g(O,A);case e.MULTIPLE:return v(O,A);case e.RANGE:return E(O,A)}}function S(O,A,M){var D,U;const V=A.toLowerCase();h[O]=(D=h[O])!==null&&D!==void 0?D:{},h[O][V]=(U=h[O][V])!==null&&U!==void 0?U:[];for(const B of h[O][V])if(T(B,M))throw new u(`Cannot add mapping to contract ${V} on network ${O} because it overlaps with existing mapping`,B,M);h[O][V].push(M)}function C(O,A,M){var D;return!((D=h[O])===null||D===void 0)&&D[A]?h[O][A].some(U=>{switch(U.type){case e.SINGLE:return U.id===M;case e.ANY:return!0;case e.MULTIPLE:return U.ids.includes(M);case e.RANGE:return BigInt(M)>=BigInt(U.from)&&BigInt(M)<=BigInt(U.to)}}):!1}return{addMapping:S,getMappings:p,includesNft:C}}n.createMappingsHelper=f}(Hm)),Hm}var RP;function yb(){return RP||(RP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isThirdParty=n.schema=void 0;const t=st(),e=RM(),i=vb();n.schema={type:"object",properties:{merkleProof:e.MerkleProof.schema,content:{type:"object",nullable:!1,additionalProperties:{type:"string"},required:[]},mappings:Object.assign({nullable:!0},i.Mappings.schema)},required:["merkleProof","content"],_containsHashingKeys:!0};const r={keyword:"_containsHashingKeys",validate:function(s,l){var u;const f=l;return!((u=f==null?void 0:f.merkleProof)===null||u===void 0)&&u.hashingKeys?f.merkleProof.hashingKeys.every(c=>f.hasOwnProperty(c)):!1},errors:!1},o=(0,t.generateLazyValidator)(n.schema,[r,i.RangeMapping._fromLessThanOrEqualTo,i.Mappings._isMappingsValid]);function a(s){return o(s)}n.isThirdParty=a}(Gm)),Gm}var jm={},Xm={},yo={},OP;function OM(){if(OP)return yo;OP=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.isBaseEmote=yo.isBaseAvatar=yo.requiredBaseItemProps=yo.baseItemProperties=void 0;const n=PM(),t=AM(),e=mb();yo.baseItemProperties=Object.assign(Object.assign({},e.displayableProperties),{id:{type:"string"},name:{type:"string"},description:{type:"string"},i18n:{type:"array",items:n.I18N.schema,minItems:1,uniqueItemProperties:["code"],errorMessage:'${0#} array should not have duplicates for "code"'},thumbnail:{type:"string"},image:{type:"string"},metrics:Object.assign(Object.assign({},t.Metrics.schema),{nullable:!0})}),yo.requiredBaseItemProps=["id","name","description","i18n","thumbnail","image"];function i(o){if(!o||!o.id)return!1;const a=o.id.split(":"),s=a[1]==="decentraland",l=a[3]==="base-avatars";return a.length===5&&s&&l}yo.isBaseAvatar=i;function r(o){if(!o||!o.id)return!1;const a=o.id.split(":");return a.length===5&&a[1]==="decentraland"&&a[3]==="base-emotes"}return yo.isBaseEmote=r,yo}var MP;function ZN(){return MP||(MP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Wearable=void 0;const t=st(),e=Zs(),i=_b(),r=OM(),o=gb(),a=yb(),s=pb(),l=vb();(function(u){u.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},r.baseItemProperties),o.standardProperties),a.schema.properties.thirdPartyProps),{data:{type:"object",properties:{replaces:{type:"array",items:s.HideableWearableCategory.schema},hides:{type:"array",items:s.HideableWearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:i.WearableRepresentation.schema,minItems:1},category:e.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:s.HideableWearableCategory.schema},blockVrmExport:{type:"boolean",nullable:!0},outlineCompatible:{type:"boolean",nullable:!0}},required:["replaces","hides","tags","representations","category"]}}),additionalProperties:!0,required:[],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity","mappings"],_isBaseAvatar:!0},{required:[...r.requiredBaseItemProps,"data","collectionAddress","rarity"],prohibited:["merkleProof","content","mappings"]},{required:[...r.requiredBaseItemProps,"data","merkleProof","content"],prohibited:["collectionAddress","rarity"],_isThirdParty:!0}],errorMessage:{oneOf:"either standard XOR thirdparty properties conditions must be met"}};const f={keyword:"_isThirdParty",validate:(h,p)=>!h||(0,a.isThirdParty)(p),errors:!1},c={keyword:"_isBaseAvatar",validate:(h,p)=>!h||(0,r.isBaseAvatar)(p),errors:!1};u.validate=(0,t.generateLazyValidator)(u.schema,[f,c,l.RangeMapping._fromLessThanOrEqualTo,l.Mappings._isMappingsValid])})(n.Wearable||(n.Wearable={}))}(Xm)),Xm}var xP;function JN(){return xP||(xP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.HideableWearableCategory=n.BodyPartCategory=n.WearableCategory=n.Wearable=n.WearableRepresentation=void 0;var t=_b();Object.defineProperty(n,"WearableRepresentation",{enumerable:!0,get:function(){return t.WearableRepresentation}});var e=ZN();Object.defineProperty(n,"Wearable",{enumerable:!0,get:function(){return e.Wearable}});var i=Zs();Object.defineProperty(n,"WearableCategory",{enumerable:!0,get:function(){return i.WearableCategory}});var r=gM();Object.defineProperty(n,"BodyPartCategory",{enumerable:!0,get:function(){return r.BodyPartCategory}});var o=pb();Object.defineProperty(n,"HideableWearableCategory",{enumerable:!0,get:function(){return o.HideableWearableCategory}})}(jm)),jm}var Ym={},Km={},qm={},Qm={},IP;function MM(){return IP||(IP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteCategory=void 0;const t=st();(function(e){e.DANCE="dance",e.STUNT="stunt",e.GREETINGS="greetings",e.FUN="fun",e.POSES="poses",e.REACTIONS="reactions",e.HORROR="horror",e.MISCELLANEOUS="miscellaneous"})(n.EmoteCategory||(n.EmoteCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.EmoteCategory||(n.EmoteCategory={}))}(Qm)),Qm}var $m={},DP;function xM(){return DP||(DP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteRepresentationADR74=void 0;const t=st(),e=db();(function(i){i.schema={type:"object",properties:{bodyShapes:{type:"array",items:e.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}},errorMessage:{contains:"contents should contain mainFile: ${1/mainFile}"}}},required:["bodyShapes","mainFile","contents"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.EmoteRepresentationADR74||(n.EmoteRepresentationADR74={}))}($m)),$m}var Zm={},wP;function IM(){return wP||(wP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.OutcomeGroup=n.StartAnimation=n.EmoteClip=n.ArmatureId=void 0;const t=st();var e;(function(r){r.Armature="Armature",r.Armature_Prop="Armature_Prop",r.Armature_Other="Armature_Other"})(e=n.ArmatureId||(n.ArmatureId={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)}(e=n.ArmatureId||(n.ArmatureId={}));var i;(function(r){r.schema={type:"object",properties:{animation:{type:"string",minLength:1,errorMessage:"animation must be a non-empty string (GLB clip name)"}},required:["animation"],additionalProperties:!1,errorMessage:{required:{animation:"animation is required (GLB clip name)"}}},r.validate=(0,t.generateLazyValidator)(r.schema)})(i=n.EmoteClip||(n.EmoteClip={})),function(r){r.schema={type:"object",properties:{loop:{type:"boolean",errorMessage:"startAnimation.loop must be a boolean"},[e.Armature]:Object.assign(Object.assign({},i.schema),{errorMessage:"startAnimation.Armature is required and must contain valid animation data"}),[e.Armature_Prop]:Object.assign(Object.assign({},i.schema),{nullable:!0,errorMessage:"startAnimation.Armature_Prop must contain valid animation data when provided"}),audio:{type:"string",nullable:!0,errorMessage:"audio must be a string (audio clip filename) when provided"}},required:["loop",e.Armature],additionalProperties:!1,errorMessage:{required:{loop:"startAnimation.loop is required",[e.Armature]:"startAnimation.Armature is required"}}},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.StartAnimation||(n.StartAnimation={})),function(r){r.schema={type:"object",properties:{title:{type:"string",minLength:1,errorMessage:"outcome.title must be a non-empty string"},loop:{type:"boolean",errorMessage:"outcome.loop must be a boolean"},clips:{type:"object",properties:Object.values(e).reduce((o,a)=>(o[a]=Object.assign(Object.assign({},i.schema),{nullable:!0,errorMessage:`outcome.clips.${a} must contain valid animation data when provided`}),o),{}),additionalProperties:!0,minProperties:1,errorMessage:"outcome.clips must contain at least one armature animation"},audio:{type:"string",nullable:!0,errorMessage:"audio must be a string (audio clip filename) when provided"}},required:["title","loop","clips"],additionalProperties:!1,errorMessage:{required:{title:"outcome.title is required",loop:"outcome.loop is required",clips:"outcome.clips is required"}}},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.OutcomeGroup||(n.OutcomeGroup={}))}(Zm)),Zm}var LP;function DM(){return LP||(LP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteDataADR74=void 0;const t=MM(),e=st(),i=xM(),r=IM();(function(o){o.schema={type:"object",properties:{tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:i.EmoteRepresentationADR74.schema,minItems:1},category:t.EmoteCategory.schema,loop:{type:"boolean"},startAnimation:Object.assign(Object.assign({},r.StartAnimation.schema),{nullable:!0}),randomizeOutcomes:{type:"boolean",nullable:!0},outcomes:{type:"array",items:r.OutcomeGroup.schema,minItems:1,maxItems:3,nullable:!0}},required:["category","tags","representations","loop"],dependencies:{startAnimation:["randomizeOutcomes","outcomes"],randomizeOutcomes:["startAnimation","outcomes"],outcomes:["startAnimation","randomizeOutcomes"]},additionalProperties:!0},o.validate=(0,e.generateLazyValidator)(o.schema)})(n.EmoteDataADR74||(n.EmoteDataADR74={}))}(qm)),qm}var NP;function e1(){return NP||(NP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Emote=void 0;const t=wM(),e=st(),i=OM(),r=gb(),o=yb(),a=DM();(function(s){s.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},i.baseItemProperties),r.standardProperties),o.schema.properties),{emoteDataADR74:a.EmoteDataADR74.schema}),additionalProperties:!0,required:[...i.requiredBaseItemProps],oneOf:[{required:["emoteDataADR74"],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity"],_isBaseEmote:!0},{required:["collectionAddress","rarity"],prohibited:["merkleProof","content"],errorMessage:"standard properties conditions are not met"},{required:["merkleProof","content","id","name","description","i18n","image","thumbnail","emoteDataADR74"],_isThirdParty:!0,prohibited:["collectionAddress","rarity"],errorMessage:"thirdparty properties conditions are not met"}],errorMessage:{oneOf:"emote should have either standard or thirdparty properties"}}],errorMessage:{oneOf:'emote should have "emoteDataADR74" and match its schema'}};const l={keyword:"_isThirdParty",validate:(f,c)=>!f||(0,t.isThirdParty)(c),errors:!1},u={keyword:"_isBaseEmote",validate:(f,c)=>!f||(0,i.isBaseEmote)(c),errors:!1};s.validate=(0,e.generateLazyValidator)(s.schema,[l,u,t.RangeMapping._fromLessThanOrEqualTo,t.Mappings._isMappingsValid])})(n.Emote||(n.Emote={}))}(Km)),Km}var Jm={},FP;function t1(){return FP||(FP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmotePlayMode=void 0;const t=st();(function(e){e.SIMPLE="simple",e.LOOP="loop"})(n.EmotePlayMode||(n.EmotePlayMode={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.EmotePlayMode||(n.EmotePlayMode={}))}(Jm)),Jm}var eg={},BP;function i1(){return BP||(BP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteOutcomeType=void 0;const t=st();(function(e){e.SIMPLE_OUTCOME="so",e.MULTIPLE_OUTCOME="mo",e.RANDOM_OUTCOME="ro"})(n.EmoteOutcomeType||(n.EmoteOutcomeType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.EmoteOutcomeType||(n.EmoteOutcomeType={}))}(eg)),eg}var VP;function r1(){return VP||(VP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteOutcomeType=n.EmotePlayMode=n.EmoteCategory=n.StartAnimation=n.OutcomeGroup=n.EmoteClip=n.ArmatureId=n.EmoteDataADR74=n.EmoteRepresentationADR74=n.Emote=void 0;var t=e1();Object.defineProperty(n,"Emote",{enumerable:!0,get:function(){return t.Emote}});var e=xM();Object.defineProperty(n,"EmoteRepresentationADR74",{enumerable:!0,get:function(){return e.EmoteRepresentationADR74}});var i=DM();Object.defineProperty(n,"EmoteDataADR74",{enumerable:!0,get:function(){return i.EmoteDataADR74}});var r=IM();Object.defineProperty(n,"ArmatureId",{enumerable:!0,get:function(){return r.ArmatureId}}),Object.defineProperty(n,"EmoteClip",{enumerable:!0,get:function(){return r.EmoteClip}}),Object.defineProperty(n,"OutcomeGroup",{enumerable:!0,get:function(){return r.OutcomeGroup}}),Object.defineProperty(n,"StartAnimation",{enumerable:!0,get:function(){return r.StartAnimation}});var o=MM();Object.defineProperty(n,"EmoteCategory",{enumerable:!0,get:function(){return o.EmoteCategory}});var a=t1();Object.defineProperty(n,"EmotePlayMode",{enumerable:!0,get:function(){return a.EmotePlayMode}});var s=i1();Object.defineProperty(n,"EmoteOutcomeType",{enumerable:!0,get:function(){return s.EmoteOutcomeType}})}(Ym)),Ym}var UP;function wM(){return UP||(UP=1,function(n){var t=Is&&Is.__createBinding||(Object.create?function(u,f,c,h){h===void 0&&(h=c);var p=Object.getOwnPropertyDescriptor(f,c);(!p||("get"in p?!f.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return f[c]}}),Object.defineProperty(u,h,p)}:function(u,f,c,h){h===void 0&&(h=c),u[h]=f[c]}),e=Is&&Is.__exportStar||function(u,f){for(var c in u)c!=="default"&&!Object.prototype.hasOwnProperty.call(f,c)&&t(f,u,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.isThirdParty=n.isStandard=n.BodyShape=n.Metrics=n.Locale=n.I18N=void 0;var i=PM();Object.defineProperty(n,"I18N",{enumerable:!0,get:function(){return i.I18N}});var r=CM();Object.defineProperty(n,"Locale",{enumerable:!0,get:function(){return r.Locale}});var o=AM();Object.defineProperty(n,"Metrics",{enumerable:!0,get:function(){return o.Metrics}});var a=db();Object.defineProperty(n,"BodyShape",{enumerable:!0,get:function(){return a.BodyShape}});var s=gb();Object.defineProperty(n,"isStandard",{enumerable:!0,get:function(){return s.isStandard}});var l=yb();Object.defineProperty(n,"isThirdParty",{enumerable:!0,get:function(){return l.isThirdParty}}),e(vb(),n),e(JN(),n),e(r1(),n)}(Is)),Is}var tg={},ig={},kP;function ac(){return kP||(kP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.AuthChain=n.AuthLink=n.AuthLinkType=void 0;const t=st();var e;(function(r){r.SIGNER="SIGNER",r.ECDSA_PERSONAL_EPHEMERAL="ECDSA_EPHEMERAL",r.ECDSA_PERSONAL_SIGNED_ENTITY="ECDSA_SIGNED_ENTITY",r.ECDSA_EIP_1654_EPHEMERAL="ECDSA_EIP_1654_EPHEMERAL",r.ECDSA_EIP_1654_SIGNED_ENTITY="ECDSA_EIP_1654_SIGNED_ENTITY"})(e=n.AuthLinkType||(n.AuthLinkType={}));var i;(function(r){r.schema={type:"object",properties:{type:{type:"string",enum:Object.values(e)},payload:{type:"string"},signature:{type:"string",nullable:!0}},required:["payload","type"],if:{properties:{type:{not:{const:e.SIGNER}}}},then:{required:["signature"]},else:{oneOf:[{properties:{signature:{type:"string",const:""}},required:["signature"]},{properties:{signature:{type:"null"}}}]}},r.validate=(0,t.generateLazyValidator)(r.schema)})(i=n.AuthLink||(n.AuthLink={})),function(r){r.schema={type:"array",items:i.schema,minItems:1},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.AuthChain||(n.AuthChain={}))}(ig)),ig}var zP;function n1(){return zP||(zP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PointerChangesSyncDeployment=n.SnapshotSyncDeployment=void 0;const t=Js(),e=ac(),i=st();(function(r){r.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:e.AuthChain.schema,entityTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:t.IPFSv1.schema}},{properties:{entityId:t.IPFSv2.schema}}],required:["entityId","entityType","pointers","entityTimestamp","authChain"]},r.validate=(0,i.generateLazyValidator)(r.schema)})(n.SnapshotSyncDeployment||(n.SnapshotSyncDeployment={})),function(r){r.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:e.AuthChain.schema,entityTimestamp:{type:"number",minimum:0},localTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:t.IPFSv1.schema}},{properties:{entityId:t.IPFSv2.schema}}],required:["entityId","entityType","pointers","localTimestamp","entityTimestamp","authChain"]},r.validate=(0,i.generateLazyValidator)(r.schema)}(n.PointerChangesSyncDeployment||(n.PointerChangesSyncDeployment={}))}(tg)),tg}var rg={},ng={},GP;function LM(){return GP||(GP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ContentMapping=void 0;const t=Js(),e=st();(function(i){i.schema={type:"object",properties:{file:{type:"string",minLength:1},hash:{type:"string",oneOf:[t.IPFSv1.schema,t.IPFSv2.schema]}},required:["file","hash"]},i.validate=(0,e.generateLazyValidator)(i.schema)})(n.ContentMapping||(n.ContentMapping={}))}(ng)),ng}var WP;function NM(){return WP||(WP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Entity=n.EntityType=void 0;const t=Js(),e=LM(),i=st();(function(r){r.SCENE="scene",r.PROFILE="profile",r.WEARABLE="wearable",r.STORE="store",r.EMOTE="emote",r.OUTFITS="outfits"})(n.EntityType||(n.EntityType={})),function(r){r.schema={type:"object",properties:{version:{type:"string",enum:["v3"]},id:{type:"string",oneOf:[t.IPFSv1.schema,t.IPFSv2.schema]},type:{type:"string"},pointers:{type:"array",items:{type:"string",minLength:1}},timestamp:{type:"number",minimum:0},content:{type:"array",items:e.ContentMapping.schema},metadata:{type:"object",nullable:!0}},required:["version","id","type","pointers","timestamp","content"]},r.validate=(0,i.generateLazyValidator)(r.schema)}(n.Entity||(n.Entity={}))}(rg)),rg}var og={},HP;function o1(){return HP||(HP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DeploymentWithAuthChain=void 0;const t=ac(),e=st();(function(i){i.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},localTimestamp:{type:"number",minimum:0},authChain:t.AuthChain.schema},required:["entityId","entityType","pointers","localTimestamp","authChain"]},i.validate=(0,e.generateLazyValidator)(i.schema)})(n.DeploymentWithAuthChain||(n.DeploymentWithAuthChain={}))}(og)),og}var ws={},ag={},jP;function a1(){return jP||(jP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Outfits=n.Outfit=void 0;const t=Zs(),e=Js(),i=st();var r;(function(o){o.schema={type:"object",required:["bodyShape","eyes","hair","skin","wearables"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:e.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:e.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:e.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:t.WearableCategory.schema}},additionalProperties:!0},o.validate=(0,i.generateLazyValidator)(o.schema)})(r=n.Outfit||(n.Outfit={})),function(o){o.schema={type:"object",required:["outfits","namesForExtraSlots"],properties:{outfits:{type:"array",items:{type:"object",required:["slot","outfit"],properties:{slot:{type:"number"},outfit:r.schema}}},namesForExtraSlots:{type:"array",uniqueItems:!0,items:{type:"string"}}},additionalProperties:!0},o.validate=(0,i.generateLazyValidator)(o.schema)}(n.Outfits||(n.Outfits={}))}(ag)),ag}var XP;function s1(){return XP||(XP=1,function(n){var t=ws&&ws.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=ws&&ws.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(a1(),n)}(ws)),ws}var Ls={},sg={},YP;function FM(){return YP||(YP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.NotificationType=void 0,function(t){t.BADGE_GRANTED="badge_granted",t.BID_ACCEPTED="bid_accepted",t.BID_RECEIVED="bid_received",t.EVENTS_STARTED="events_started",t.EVENTS_STARTS_SOON="events_starts_soon",t.EVENT_CREATED="event_created",t.GOVERNANCE_ANNOUNCEMENT="governance_announcement",t.GOVERNANCE_AUTHORED_PROPOSAL_FINISHED="governance_authored_proposal_finished",t.GOVERNANCE_COAUTHOR_REQUESTED="governance_coauthor_requested",t.GOVERNANCE_CLIFF_ENDED="governance_cliff_ended",t.GOVERNANCE_NEW_COMMENT_ON_PROJECT_UPDATE="governance_new_comment_on_project_update",t.GOVERNANCE_NEW_COMMENT_ON_PROPOSAL="governance_new_comment_on_proposal",t.GOVERNANCE_PROPOSAL_ENACTED="governance_proposal_enacted",t.GOVERNANCE_VOTING_ENDED_VOTER="governance_voting_ended_voter",t.GOVERNANCE_PITCH_PASSED="governance_pitch_passed",t.GOVERNANCE_TENDER_PASSED="governance_tender_passed",t.GOVERNANCE_WHALE_VOTE="governance_whale_vote",t.GOVERNANCE_VOTED_ON_BEHALF="governance_voted_on_behalf",t.ITEM_SOLD="item_sold",t.ITEM_PUBLISHED="item_published",t.LAND_RENTAL_ENDED="rental_ended",t.LAND_RENTED="rental_started",t.REWARD_ASSIGNED="reward_assignment",t.REWARD_CAMPAIGN_OUT_OF_FUNDS="reward_campaign_out_of_funds",t.REWARD_CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED="reward_campaign_gas_price_higher_than_expected",t.REWARD_CAMPAIGN_OUT_OF_STOCK="reward_campaign_out_of_stock",t.REWARD_DELAYED="reward_delayed",t.REWARD_IN_PROGRESS="reward_in_progress",t.ROYALTIES_EARNED="royalties_earned",t.SOCIAL_SERVICE_FRIENDSHIP_REQUEST="social_service_friendship_request",t.SOCIAL_SERVICE_FRIENDSHIP_ACCEPTED="social_service_friendship_accepted",t.WORLDS_ACCESS_RESTORED="worlds_access_restored",t.WORLDS_ACCESS_RESTRICTED="worlds_access_restricted",t.WORLDS_MISSING_RESOURCES="worlds_missing_resources",t.WORLDS_PERMISSION_GRANTED="worlds_permission_granted",t.WORLDS_PERMISSION_REVOKED="worlds_permission_revoked",t.CREDITS_GOAL_COMPLETED="credits_goal_completed",t.CREDITS_ON_DEMAND_GRANTED="credits_on_demand_granted",t.STREAMING_KEY_RESET="streaming_key_reset",t.STREAMING_KEY_REVOKE="streaming_key_revoke",t.STREAMING_KEY_EXPIRED="streaming_key_expired",t.STREAMING_TIME_EXCEEDED="streaming_time_exceeded",t.STREAMING_PLACE_UPDATED="streaming_place_updated",t.CREDITS_REMINDER_COMPLETE_GOALS="credits_reminder_complete_goals",t.CREDITS_REMINDER_CLAIM_CREDITS="credits_reminder_claim_credits",t.CREDITS_REMINDER_USAGE="credits_reminder_usage",t.CREDITS_REMINDER_USAGE_24_HOURS="credits_reminder_usage_24_hours",t.CREDITS_REMINDER_DO_NOT_MISS_OUT="credits_reminder_do_not_miss_out",t.CREDITS_NEW_SEASON_REMINDER="credits_new_season_reminder",t.REFERRAL_INVITED_USERS_ACCEPTED="referral_invited_users_accepted",t.REFERRAL_NEW_TIER_REACHED="referral_new_tier_reached",t.COMMUNITY_DELETED="community_deleted",t.COMMUNITY_DELETED_CONTENT_VIOLATION="community_deleted_content_violation",t.COMMUNITY_RENAMED="community_renamed",t.COMMUNITY_MEMBER_BANNED="community_member_banned",t.COMMUNITY_MEMBER_REMOVED="community_member_removed",t.COMMUNITY_REQUEST_TO_JOIN_RECEIVED="community_request_to_join_received",t.COMMUNITY_REQUEST_TO_JOIN_ACCEPTED="community_request_to_join_accepted",t.COMMUNITY_INVITE_RECEIVED="community_invite_received",t.COMMUNITY_OWNERSHIP_TRANSFERRED="community_ownership_transferred",t.COMMUNITY_POST_ADDED="community_post_added",t.USER_BANNED_FROM_SCENE="user_banned_from_scene",t.USER_UNBANNED_FROM_SCENE="user_unbanned_from_scene"}(n.NotificationType||(n.NotificationType={}))}(sg)),sg}var lg={},ug={},KP;function BM(){return KP||(KP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SubscriptionDetails=void 0;const t=st(),e=FM(),i={type:"object",required:["email","in_app"],properties:{email:{type:"boolean"},in_app:{type:"boolean"}}},r=Object.values(e.NotificationType).reduce((o,a)=>(o[a]=i,o),{});(function(o){o.schema={type:"object",required:["ignore_all_email","ignore_all_in_app","message_type"],properties:{ignore_all_email:{type:"boolean"},ignore_all_in_app:{type:"boolean"},message_type:{type:"object",required:Object.values(e.NotificationType),additionalProperties:!1,properties:r}}},o.validate=(0,t.generateLazyValidator)(o.schema)})(n.SubscriptionDetails||(n.SubscriptionDetails={}))}(ug)),ug}var fg={},qP;function VM(){return qP||(qP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Email=void 0,function(t){t.schema={type:"string",pattern:"^[\\w\\-\\.]+@([\\w-]+\\.)+[\\w-]{2,}$"};const e=new RegExp(t.schema.pattern);t.validate=i=>e.test(i)}(n.Email||(n.Email={}))}(fg)),fg}var QP;function l1(){return QP||(QP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Subscription=void 0;const t=st(),e=BM(),i=Js(),r=VM();(function(o){o.schema={type:"object",required:["address","details"],properties:{address:i.EthAddress.schema,email:Object.assign(Object.assign({},r.Email.schema),{nullable:!0}),details:e.SubscriptionDetails.schema}},o.validate=(0,t.generateLazyValidator)(o.schema)})(n.Subscription||(n.Subscription={}))}(lg)),lg}var $P;function u1(){return $P||($P=1,function(n){var t=Ls&&Ls.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ls&&Ls.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(FM(),n),e(l1(),n),e(BM(),n)}(Ls)),Ls}var Ns={},cg={},ZP;function Ln(){return ZP||(ZP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Events=void 0,function(t){(function(e){e.BLOCKCHAIN="blockchain",e.CATALYST_DEPLOYMENT="catalyst-deployment",e.WORLD="world",e.CLIENT="client",e.WEB="web",e.MARKETPLACE="marketplace",e.REWARDS="rewards",e.BADGE="badge",e.ASSET_BUNDLE="asset-bundle",e.SOCIAL_SERVICE="social-service",e.CREDITS_SERVICE="credits-service",e.STREAMING="streaming",e.COMMS="comms",e.REFERRAL="referral",e.COMMUNITY="community",e.CAMERA="camera",e.EVENT="event",e.GOVERNANCE="governance"})(t.Type||(t.Type={})),function(e){(function(i){i.BID_ACCEPTED="bid-accepted",i.ITEM_SOLD="item-sold",i.RENTAL_ENDED="land-rental-ended",i.RENTAL_STARTED="land-rental-started",i.ROYALTIES_EARNED="royalties-earned",i.COLLECTION_CREATED="collection-created",i.ITEM_PUBLISHED="item-published"})(e.Blockchain||(e.Blockchain={})),function(i){i.BID_RECEIVED="bid-received"}(e.Marketplace||(e.Marketplace={})),function(i){i.SCENE="scene",i.PROFILE="profile",i.WEARABLE="wearable",i.STORE="store",i.EMOTE="emote",i.OUTFITS="outfits"}(e.CatalystDeployment||(e.CatalystDeployment={})),function(i){i.DEPLOYMENT="deployment",i.WORLDS_PERMISSION_GRANTED="worlds_permission_granted",i.WORLDS_PERMISSION_REVOKED="worlds_permission_revoked",i.WORLDS_ACCESS_RESTORED="worlds_access_restored",i.WORLDS_ACCESS_RESTRICTED="worlds_access_restricted",i.WORLDS_MISSING_RESOURCES="worlds_missing_resources"}(e.Worlds||(e.Worlds={})),function(i){i.LOGGED_IN="logged-in",i.LOGGED_IN_CACHED="logged-in-cached",i.MOVE_TO_PARCEL="move-to-parcel",i.USED_EMOTE="used-emote",i.PASSPORT_OPENED="passport-opened",i.WALKED_DISTANCE="walked-distance",i.VERTICAL_HEIGHT_REACHED="vertical-height-reached"}(e.Client||(e.Client={})),function(i){i.AUTH_IDENTIFY="auth-identify"}(e.Web||(e.Web={})),function(i){i.REWARD_IN_PROGRESS="reward-in-progress",i.REWARD_ASSIGNED="reward-assigned",i.CAMPAIGN_OUT_OF_FUNDS="campaign-out-of-funds",i.CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED="campaign-gas-price-higher-than-expected",i.CAMPAIGN_OUT_OF_STOCK="campaign-out-of-stock",i.REWARD_DELAYED="reward-delayed"}(e.Rewards||(e.Rewards={})),function(i){i.GRANTED="badge-granted"}(e.Badge||(e.Badge={})),function(i){i.CONVERTED="converted",i.MANUALLY_QUEUED="manually-queued"}(e.AssetBundle||(e.AssetBundle={})),function(i){i.FRIENDSHIP_REQUEST="friendship-request",i.FRIENDSHIP_ACCEPTED="friendship-accepted"}(e.SocialService||(e.SocialService={})),function(i){i.CREDITS_GOAL_COMPLETED="credits-goal-completed",i.COMPLETE_GOALS_REMINDER="complete-goals-reminder",i.CLAIM_CREDITS_REMINDER="claim-credits-reminder",i.DO_NOT_MISS_OUT_REMINDER="do-not-miss-out-reminder",i.USAGE_REMINDER="usage-reminder",i.USAGE_24_HOURS_REMINDER="usage-24-hours-reminder",i.ON_DEMAND_CREDITS_GRANTED="on-demand-credits-granted",i.NEW_SEASON_REMINDER="new-season-reminder"}(e.CreditsService||(e.CreditsService={})),function(i){i.STREAMING_KEY_RESET="streaming-key-reset",i.STREAMING_KEY_REVOKE="streaming-key-revoke",i.STREAMING_KEY_EXPIRED="streaming-key-expired",i.STREAMING_TIME_EXCEEDED="streaming-time-exceeded",i.STREAMING_PLACE_UPDATED="streaming-place-updated",i.COMMUNITY_STREAMING_ENDED="community-streaming-ended"}(e.Streaming||(e.Streaming={})),function(i){i.USER_JOINED_ROOM="user-joined-room",i.USER_LEFT_ROOM="user-left-room",i.USER_BANNED_FROM_SCENE="user-banned-from-scene",i.USER_UNBANNED_FROM_SCENE="user-unbanned-from-scene"}(e.Comms||(e.Comms={})),function(i){i.REFERRAL_INVITED_USERS_ACCEPTED="referral-invited-users-accepted",i.REFERRAL_NEW_TIER_REACHED="referral-new-tier-reached"}(e.Referral||(e.Referral={})),function(i){i.DELETED="community-deleted",i.DELETED_CONTENT_VIOLATION="community-deleted-content-violation",i.RENAMED="community-renamed",i.MEMBER_BANNED="community-member-banned",i.MEMBER_REMOVED="community-member-removed",i.REQUEST_TO_JOIN_RECEIVED="community-request-to-join-received",i.REQUEST_TO_JOIN_ACCEPTED="community-request-to-join-accepted",i.INVITE_RECEIVED="community-invite-received",i.OWNERSHIP_TRANSFERRED="community-ownership-transferred",i.POST_ADDED="community-post-added"}(e.Community||(e.Community={})),function(i){i.PHOTO_TAKEN="photo-taken",i.PHOTO_PRIVACY_CHANGED="photo-privacy-changed"}(e.Camera||(e.Camera={})),function(i){i.EVENT_CREATED="event-created",i.EVENT_STARTS_SOON="event-starts-soon",i.EVENT_STARTED="event-started",i.EVENT_ENDED="event-ended"}(e.Event||(e.Event={})),function(i){i.PROPOSAL_ENACTED="governance_proposal_enacted",i.COAUTHOR_REQUESTED="governance_coauthor_requested",i.PITCH_PASSED="governance_pitch_passed",i.TENDER_PASSED="governance_tender_passed",i.AUTHORED_PROPOSAL_FINISHED="governance_authored_proposal_finished",i.VOTING_ENDED_VOTER="governance_voting_ended_voter",i.NEW_COMMENT_ON_PROPOSAL="governance_new_comment_on_proposal",i.NEW_COMMENT_ON_PROJECT_UPDATED="governance_new_comment_on_project_update",i.WHALE_VOTE="governance_whale_vote",i.VOTED_ON_BEHALF="governance_voted_on_behalf",i.CLIFF_ENDED="governance_cliff_ended"}(e.Governance||(e.Governance={}))}(t.SubType||(t.SubType={}))}(n.Events||(n.Events={}))}(cg)),cg}var hg={},JP;function f1(){return JP||(JP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CollectionCreatedEvent=n.RoyaltiesEarnedEvent=n.RentalStartedEvent=n.RentalEndedEvent=n.ItemPublishedEvent=n.ItemSoldEvent=n.BidAcceptedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.BID_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},price:{type:"string"},title:{type:"string"},description:{type:"string"},network:{type:"string"}},required:["address","image","seller","category","link","price","title","network"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.BidAcceptedEvent||(n.BidAcceptedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.ITEM_SOLD},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},buyer:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},tokenId:{type:"string"},network:{type:"string"},title:{type:"string"},description:{type:"string"}},required:["address","image","seller","category","link","network","title","description"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.ItemSoldEvent||(n.ItemSoldEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.ITEM_PUBLISHED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creator:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},itemId:{type:"string"},network:{type:"string"},urn:{type:"string"}},required:["creator","category","itemId","network","urn"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.ItemPublishedEvent||(n.ItemPublishedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.RENTAL_ENDED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},contract:{type:"string"},land:{type:"string",nullable:!0},lessor:{type:"string"},tenant:{type:"string"},operator:{type:"string"},startedAt:{type:"string"},endedAt:{type:"string"},tokenId:{type:"string"},link:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","contract","lessor","tenant","operator","startedAt","endedAt","tokenId","link","title"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.RentalEndedEvent||(n.RentalEndedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.RENTAL_STARTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},contract:{type:"string"},land:{type:"string",nullable:!0},lessor:{type:"string"},tenant:{type:"string"},operator:{type:"string"},startedAt:{type:"string"},endedAt:{type:"string"},tokenId:{type:"string"},link:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","contract","lessor","tenant","operator","startedAt","endedAt","tokenId","link","title"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.RentalStartedEvent||(n.RentalStartedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.ROYALTIES_EARNED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},royaltiesCut:{type:"string"},royaltiesCollector:{type:"string"},network:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","image","category","link","royaltiesCut","royaltiesCollector","network","title"]}},required:["type","subType","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.RoyaltiesEarnedEvent||(n.RoyaltiesEarnedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.COLLECTION_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creator:{type:"string"},name:{type:"string"}},required:["creator","name"]}},required:["type","subType","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CollectionCreatedEvent||(n.CollectionCreatedEvent={}))}(hg)),hg}var dg={},eA;function c1(){return eA||(eA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CatalystDeploymentEvent=void 0;const t=ac(),e=st(),i=NM(),r=Ln();(function(o){o.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CATALYST_DEPLOYMENT},subType:{type:"string",enum:Object.values(r.Events.SubType.CatalystDeployment)},key:{type:"string"},timestamp:{type:"number",minimum:1},entity:i.Entity.schema,authChain:t.AuthChain.schema},required:["type","subType","entity","authChain","key","timestamp"],additionalProperties:!1},o.validate=(0,e.generateLazyValidator)(o.schema)})(n.CatalystDeploymentEvent||(n.CatalystDeploymentEvent={}))}(dg)),dg}var pg={},tA;function h1(){return tA||(tA=1,Object.defineProperty(pg,"__esModule",{value:!0})),pg}var _g={},iA;function d1(){return iA||(iA=1,Object.defineProperty(_g,"__esModule",{value:!0})),_g}var mg={},rA;function p1(){return rA||(rA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.BidReceivedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.MARKETPLACE},subType:{type:"string",const:e.Events.SubType.Marketplace.BID_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},price:{type:"string"},title:{type:"string"},description:{type:"string"},network:{type:"string"}},required:["address","image","seller","category","link","price","title","network"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.BidReceivedEvent||(n.BidReceivedEvent={}))}(mg)),mg}var gg={},Zu={},nA;function rp(){if(nA)return Zu;nA=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.createEventSchema=void 0;function n(t,e,i){return{type:"object",properties:{type:{type:"string",const:t},subType:{type:"string",const:e},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:i},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1}}return Zu.createEventSchema=n,Zu}var oA;function _1(){return oA||(oA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.RewardDelayedEvent=n.CampaignOutOfStockEvent=n.CampaignGasPriceHigherThanExpectedEvent=n.CampaignOutOfFundsEvent=n.RewardAssignedEvent=n.RewardInProgressEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{title:{type:"string"},description:{type:"string"},link:{type:"string",nullable:!0},beneficiary:{type:"string"},tokenName:{type:"string"},tokenImage:{type:"string"},tokenRarity:{type:"string",nullable:!0},tokenCategory:{type:"string",nullable:!0}},required:["title","description","beneficiary","tokenName","tokenImage"],additionalProperties:!1},o={type:"object",properties:{title:{type:"string"},description:{type:"string"},link:{type:"string",nullable:!0},owner:{type:"string"},campaignId:{type:"string"},campaignName:{type:"string"}},required:["title","description","owner","campaignId","campaignName"],additionalProperties:!1};(function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.REWARD_IN_PROGRESS,r),a.validate=(0,t.generateLazyValidator)(a.schema)})(n.RewardInProgressEvent||(n.RewardInProgressEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.REWARD_ASSIGNED,r),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.RewardAssignedEvent||(n.RewardAssignedEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.CAMPAIGN_OUT_OF_FUNDS,o),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.CampaignOutOfFundsEvent||(n.CampaignOutOfFundsEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED,o),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.CampaignGasPriceHigherThanExpectedEvent||(n.CampaignGasPriceHigherThanExpectedEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.CAMPAIGN_OUT_OF_STOCK,o),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.CampaignOutOfStockEvent||(n.CampaignOutOfStockEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.REWARD_DELAYED,r),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.RewardDelayedEvent||(n.RewardDelayedEvent={}))}(gg)),gg}var vg={},aA;function m1(){return aA||(aA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CreditsClaimReminderEvent=n.CreditsDoNotMissOutReminderEvent=n.CreditsUsage24HoursReminderEvent=n.CreditsNewSeasonReminderEvent=n.CreditsUsageReminderEvent=n.CreditsCompleteGoalsReminderEvent=n.CreditsGoalCompletedEvent=n.CreditsOnDemandEvent=n.FriendshipAcceptedEvent=n.FriendshipRequestEvent=n.AssetBundleConversionManuallyQueuedEvent=n.AssetBundleConversionFinishedEvent=n.BadgeGrantedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BADGE},subType:{type:"string",const:e.Events.SubType.Badge.GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{badgeId:{type:"string"},badgeTierName:{type:"string",nullable:!0},badgeName:{type:"string"},badgeImageUrl:{type:"string"},address:{type:"string"}},required:["badgeId","badgeName","badgeImageUrl","address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.BadgeGrantedEvent||(n.BadgeGrantedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.ASSET_BUNDLE},subType:{type:"string",const:e.Events.SubType.AssetBundle.CONVERTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{entityId:{type:"string"},platform:{type:"string",enum:["windows","mac","webgl"]},statusCode:{type:"number"},isLods:{type:"boolean"},isWorld:{type:"boolean"},version:{type:"string"}},required:["entityId","platform","statusCode","isLods","isWorld","version"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.AssetBundleConversionFinishedEvent||(n.AssetBundleConversionFinishedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.ASSET_BUNDLE},subType:{type:"string",const:e.Events.SubType.AssetBundle.MANUALLY_QUEUED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{entityId:{type:"string"},platform:{type:"string",enum:["windows","mac","webgl"]},isLods:{type:"boolean"},isPriority:{type:"boolean"},version:{type:"string"}},required:["entityId","platform","isLods"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.AssetBundleConversionManuallyQueuedEvent||(n.AssetBundleConversionManuallyQueuedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.SOCIAL_SERVICE},subType:{type:"string",const:e.Events.SubType.SocialService.FRIENDSHIP_REQUEST},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{requestId:{type:"string"},sender:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},receiver:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},message:{type:"string",nullable:!0}},required:["requestId","sender","receiver"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.FriendshipRequestEvent||(n.FriendshipRequestEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.SOCIAL_SERVICE},subType:{type:"string",const:e.Events.SubType.SocialService.FRIENDSHIP_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{requestId:{type:"string"},sender:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},receiver:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]}},required:["requestId","sender","receiver"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.FriendshipAcceptedEvent||(n.FriendshipAcceptedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.ON_DEMAND_CREDITS_GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creditsGranted:{type:"number",minimum:1},address:{type:"string"},granterAddress:{type:"string"}},required:["creditsGranted","address","granterAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsOnDemandEvent||(n.CreditsOnDemandEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.CREDITS_GOAL_COMPLETED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{goalId:{type:"string"},creditsObtained:{type:"number",minimum:0},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1},address:{type:"string"}},required:["goalId","creditsObtained","seasonId","weekNumber","address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsGoalCompletedEvent||(n.CreditsGoalCompletedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.COMPLETE_GOALS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1},pendingGoalIds:{type:"array",items:{type:"string"},minItems:1}},required:["address","seasonId","weekNumber","pendingGoalIds"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsCompleteGoalsReminderEvent||(n.CreditsCompleteGoalsReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.USAGE_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},creditsAmount:{type:"number",minimum:1},expirationDate:{type:"string"},expirationDay:{type:"string"}},required:["address","creditsAmount","expirationDate","expirationDay"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsUsageReminderEvent||(n.CreditsUsageReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.NEW_SEASON_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{addresses:{type:"array",items:{type:"string"}},seasonName:{type:"string"},startDate:{type:"string"},endDate:{type:"string"}},required:["addresses","seasonName","startDate","endDate"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsNewSeasonReminderEvent||(n.CreditsNewSeasonReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.USAGE_24_HOURS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},creditsAmount:{type:"number",minimum:1},expirationDate:{type:"string"}},required:["address","creditsAmount","expirationDate"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsUsage24HoursReminderEvent||(n.CreditsUsage24HoursReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.DO_NOT_MISS_OUT_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"}},required:["address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsDoNotMissOutReminderEvent||(n.CreditsDoNotMissOutReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.CLAIM_CREDITS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1}},required:["address","seasonId","weekNumber"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsClaimReminderEvent||(n.CreditsClaimReminderEvent={}))}(vg)),vg}var yg={},sA;function g1(){return sA||(sA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CommunityStreamingEndedEvent=n.StreamingPlaceUpdatedEvent=n.StreamingTimeExceededEvent=n.StreamingKeyExpiredEvent=n.StreamingKeyRevokeEvent=n.StreamingKeyResetEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{title:{type:"string"},description:{type:"string"},position:{type:"string"},worldName:{type:"string",nullable:!0},isWorld:{type:"boolean"},url:{type:"string"},address:{type:"string"},image:{type:"string"}},required:["position","isWorld","url","title","description","address","image"],additionalProperties:!1};(function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_KEY_RESET,r),o.validate=(0,t.generateLazyValidator)(o.schema)})(n.StreamingKeyResetEvent||(n.StreamingKeyResetEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_KEY_REVOKE,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingKeyRevokeEvent||(n.StreamingKeyRevokeEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_KEY_EXPIRED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingKeyExpiredEvent||(n.StreamingKeyExpiredEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_TIME_EXCEEDED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingTimeExceededEvent||(n.StreamingTimeExceededEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_PLACE_UPDATED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingPlaceUpdatedEvent||(n.StreamingPlaceUpdatedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.COMMUNITY_STREAMING_ENDED,{type:"object",properties:{communityId:{type:"string"},totalParticipants:{type:"number"}},required:["communityId","totalParticipants"],additionalProperties:!1}),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.CommunityStreamingEndedEvent||(n.CommunityStreamingEndedEvent={}))}(yg)),yg}var bg={},lA;function v1(){return lA||(lA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.UserUnbannedFromSceneEvent=n.UserBannedFromSceneEvent=n.UserLeftRoomEvent=n.UserJoinedRoomEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_JOINED_ROOM},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{parcel:{type:"string"},sceneId:{type:"string"},userAddress:{type:"string"},realmName:{type:"string"},isWorld:{type:"boolean"}},required:["parcel","sceneId","userAddress","realmName","isWorld"]}},required:["type","subType","key","timestamp","metadata"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.UserJoinedRoomEvent||(n.UserJoinedRoomEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_LEFT_ROOM},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{isWorld:{type:"boolean"},sceneId:{type:"string",nullable:!0},userAddress:{type:"string"},realmName:{type:"string"}},required:["isWorld","userAddress","realmName"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.UserLeftRoomEvent||(n.UserLeftRoomEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_BANNED_FROM_SCENE},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{placeTitle:{type:"string"},userAddress:{type:"string"}},required:["placeTitle","userAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.UserBannedFromSceneEvent||(n.UserBannedFromSceneEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_UNBANNED_FROM_SCENE},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{placeTitle:{type:"string"},userAddress:{type:"string"}},required:["placeTitle","userAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.UserUnbannedFromSceneEvent||(n.UserUnbannedFromSceneEvent={}))}(bg)),bg}var Eg={},uA;function y1(){return uA||(uA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ReferralNewTierReachedEvent=n.ReferralInvitedUsersAcceptedEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{title:{type:"string"},description:{type:"string"},address:{type:"string"},tier:{type:"number",minimum:1},url:{type:"string"},image:{type:"string"},invitedUserAddress:{type:"string"},invitedUsers:{type:"number",minimum:1},rarity:{type:"string",nullable:!0}},required:["address","tier","url","title","description","image","invitedUserAddress"],additionalProperties:!1};(function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.REFERRAL,e.Events.SubType.Referral.REFERRAL_INVITED_USERS_ACCEPTED,r),o.validate=(0,t.generateLazyValidator)(o.schema)})(n.ReferralInvitedUsersAcceptedEvent||(n.ReferralInvitedUsersAcceptedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.REFERRAL,e.Events.SubType.Referral.REFERRAL_NEW_TIER_REACHED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.ReferralNewTierReachedEvent||(n.ReferralNewTierReachedEvent={}))}(Eg)),Eg}var Tg={},fA;function b1(){return fA||(fA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CommunityOwnershipTransferredEvent=n.CommunityPostAddedEvent=n.CommunityInviteReceivedEvent=n.CommunityRequestToJoinAcceptedEvent=n.CommunityRequestToJoinReceivedEvent=n.CommunityMemberRemovedEvent=n.CommunityMemberBannedEvent=n.CommunityRenamedEvent=n.CommunityDeletedContentViolationEvent=n.CommunityDeletedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.DELETED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddresses:{type:"array",items:{type:"string"}},thumbnailUrl:{type:"string"}},required:["id","name","memberAddresses","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.CommunityDeletedEvent||(n.CommunityDeletedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.DELETED_CONTENT_VIOLATION},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},ownerAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","ownerAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityDeletedContentViolationEvent||(n.CommunityDeletedContentViolationEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.RENAMED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},oldName:{type:"string"},newName:{type:"string"},memberAddresses:{type:"array",items:{type:"string"}},thumbnailUrl:{type:"string"}},required:["id","oldName","newName","memberAddresses","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityRenamedEvent||(n.CommunityRenamedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.MEMBER_BANNED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityMemberBannedEvent||(n.CommunityMemberBannedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.MEMBER_REMOVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityMemberRemovedEvent||(n.CommunityMemberRemovedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.REQUEST_TO_JOIN_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},memberName:{type:"string"},thumbnailUrl:{type:"string"},addressesToNotify:{type:"array",items:{type:"string"}}},required:["communityId","communityName","memberAddress","memberName","thumbnailUrl","addressesToNotify"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityRequestToJoinReceivedEvent||(n.CommunityRequestToJoinReceivedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.REQUEST_TO_JOIN_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityRequestToJoinAcceptedEvent||(n.CommunityRequestToJoinAcceptedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.INVITE_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityInviteReceivedEvent||(n.CommunityInviteReceivedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.POST_ADDED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},thumbnailUrl:{type:"string"},postId:{type:"string"},authorAddress:{type:"string"},addressesToNotify:{type:"array",items:{type:"string"}}},required:["addressesToNotify","communityId","communityName","thumbnailUrl","postId","authorAddress"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityPostAddedEvent||(n.CommunityPostAddedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.OWNERSHIP_TRANSFERRED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},oldOwnerAddress:{type:"string"},newOwnerAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","oldOwnerAddress","newOwnerAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityOwnershipTransferredEvent||(n.CommunityOwnershipTransferredEvent={}))}(Tg)),Tg}var Sg={},cA;function E1(){return cA||(cA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PhotoTakenEvent=n.PhotoPrivacyChangedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CAMERA},subType:{type:"string",const:e.Events.SubType.Camera.PHOTO_PRIVACY_CHANGED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{userAddress:{type:"string"},photoId:{type:"string"},isPublic:{type:"boolean"}},required:["userAddress","photoId","isPublic"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.PhotoPrivacyChangedEvent||(n.PhotoPrivacyChangedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CAMERA},subType:{type:"string",const:e.Events.SubType.Camera.PHOTO_TAKEN},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{sceneId:{type:"string"},userAddress:{type:"string"},realm:{type:"string"},photoId:{type:"string"},isPublic:{type:"boolean"},users:{type:"array",items:{type:"object",properties:{address:{type:"string"},isEmoting:{type:"boolean"}},required:["address","isEmoting"],additionalProperties:!1}},placeId:{type:"string",nullable:!0}},required:["userAddress","realm","photoId","isPublic","users"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.PhotoTakenEvent||(n.PhotoTakenEvent={}))}(Sg)),Sg}var Cg={},hA;function T1(){return hA||(hA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EventEndedEvent=n.EventCreatedEvent=n.EventStartsSoonEvent=n.EventStartedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_STARTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},link:{type:"string"},communityThumbnail:{type:"string",nullable:!0},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image","link"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.EventStartedEvent||(n.EventStartedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_STARTS_SOON},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},link:{type:"string"},startsAt:{type:"string"},endsAt:{type:"string"},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image","link","startsAt","endsAt"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.EventStartsSoonEvent||(n.EventStartsSoonEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},communityId:{type:"string"},communityName:{type:"string"},communityThumbnail:{type:"string",nullable:!0},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.EventCreatedEvent||(n.EventCreatedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_ENDED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{communityId:{type:"string",nullable:!0},totalAttendees:{type:"number"}},required:["totalAttendees"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.EventEndedEvent||(n.EventEndedEvent={}))}(Cg)),Cg}var Pg={},dA;function S1(){return dA||(dA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.GovernanceCliffEndedEvent=n.GovernanceVotedOnBehalfEvent=n.GovernanceWhaleVoteEvent=n.GovernanceNewCommentOnProjectUpdatedEvent=n.GovernanceNewCommentOnProposalEvent=n.GovernanceVotingEndedVoterEvent=n.GovernanceAuthoredProposalFinishedEvent=n.GovernanceTenderPassedEvent=n.GovernancePitchPassedEvent=n.GovernanceCoauthorRequestedEvent=n.GovernanceProposalEnactedEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{proposalId:{type:"string"},proposalTitle:{type:"string"},title:{type:"string"},description:{type:"string"},link:{type:"string"},address:{type:"string"}},required:["proposalId","proposalTitle","title","description","link","address"],additionalProperties:!1};(function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.PROPOSAL_ENACTED,r),o.validate=(0,t.generateLazyValidator)(o.schema)})(n.GovernanceProposalEnactedEvent||(n.GovernanceProposalEnactedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.COAUTHOR_REQUESTED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceCoauthorRequestedEvent||(n.GovernanceCoauthorRequestedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.PITCH_PASSED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernancePitchPassedEvent||(n.GovernancePitchPassedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.TENDER_PASSED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceTenderPassedEvent||(n.GovernanceTenderPassedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.AUTHORED_PROPOSAL_FINISHED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceAuthoredProposalFinishedEvent||(n.GovernanceAuthoredProposalFinishedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.VOTING_ENDED_VOTER,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceVotingEndedVoterEvent||(n.GovernanceVotingEndedVoterEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.NEW_COMMENT_ON_PROPOSAL,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceNewCommentOnProposalEvent||(n.GovernanceNewCommentOnProposalEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.NEW_COMMENT_ON_PROJECT_UPDATED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceNewCommentOnProjectUpdatedEvent||(n.GovernanceNewCommentOnProjectUpdatedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.WHALE_VOTE,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceWhaleVoteEvent||(n.GovernanceWhaleVoteEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.VOTED_ON_BEHALF,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceVotedOnBehalfEvent||(n.GovernanceVotedOnBehalfEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.CLIFF_ENDED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceCliffEndedEvent||(n.GovernanceCliffEndedEvent={}))}(Pg)),Pg}var Ag={},pA;function C1(){return pA||(pA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WorldsMissingResourcesEvent=n.WorldsAccessRestrictedEvent=n.WorldsPermissionGrantedEvent=n.WorldsPermissionRevokedEvent=n.WorldsAccessRestoredEvent=n.WorldDeploymentEvent=void 0;const t=ac(),e=st(),i=Ln();(function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.DEPLOYMENT},key:{type:"string"},timestamp:{type:"number",minimum:0},entity:{type:"object",properties:{entityId:{type:"string"},authChain:t.AuthChain.schema},additionalProperties:!0,required:["entityId","authChain"]},contentServerUrls:{type:"array",items:{type:"string"},nullable:!0},force:{type:"boolean",nullable:!0},animation:{type:"string",nullable:!0},lods:{type:"array",items:{type:"string"},nullable:!0}},required:["type","subType","key","timestamp","entity"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)})(n.WorldDeploymentEvent||(n.WorldDeploymentEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_ACCESS_RESTORED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},url:{type:"string"},attendee:{type:"string"}},required:["title","description","url","attendee"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsAccessRestoredEvent||(n.WorldsAccessRestoredEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_PERMISSION_REVOKED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},world:{type:"string"},permissions:{type:"array",items:{type:"string"}},url:{type:"string"},address:{type:"string"}},required:["title","description","world","permissions","url","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsPermissionRevokedEvent||(n.WorldsPermissionRevokedEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_PERMISSION_GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},world:{type:"string"},permissions:{type:"array",items:{type:"string"}},url:{type:"string"},address:{type:"string"}},required:["title","description","world","permissions","url","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsPermissionGrantedEvent||(n.WorldsPermissionGrantedEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_ACCESS_RESTRICTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},when:{type:"number"},address:{type:"string"}},required:["title","description","when","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsAccessRestrictedEvent||(n.WorldsAccessRestrictedEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_MISSING_RESOURCES},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},url:{type:"string"},when:{type:"number"},address:{type:"string"}},required:["title","description","url","when","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsMissingResourcesEvent||(n.WorldsMissingResourcesEvent={}))}(Ag)),Ag}var _A;function P1(){return _A||(_A=1,function(n){var t=Ns&&Ns.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ns&&Ns.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(Ln(),n),e(f1(),n),e(c1(),n),e(h1(),n),e(d1(),n),e(p1(),n),e(_1(),n),e(m1(),n),e(g1(),n),e(v1(),n),e(y1(),n),e(b1(),n),e(E1(),n),e(T1(),n),e(S1(),n),e(C1(),n)}(Ns)),Ns}var mA;function bb(){return mA||(mA=1,function(n){var t=Ms&&Ms.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ms&&Ms.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(KN(),n),e(QN(),n),e(wM(),n),e(mb(),n),e(RM(),n),e(n1(),n),e(NM(),n),e(o1(),n),e(s1(),n),e(u1(),n),e(P1(),n)}(Ms)),Ms}var gA;function A1(){return gA||(gA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WearableJson=void 0;const t=ip(),e=Zs(),i=_b(),r=st(),o=bb();(function(a){a.schema={type:"object",properties:{description:{type:"string"},rarity:Object.assign(Object.assign({},t.Rarity.schema),{nullable:!0}),name:{type:"string"},data:{type:"object",properties:{replaces:{type:"array",items:e.WearableCategory.schema},hides:{type:"array",items:e.WearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:i.WearableRepresentation.schema,minItems:1},category:e.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:o.HideableWearableCategory.schema},blockVrmExport:{type:"boolean",nullable:!0},outlineCompatible:{type:"boolean",nullable:!0}},required:["replaces","hides","tags","representations","category"]}},additionalProperties:!0,required:["description","name","data"]},a.validate=(0,r.generateLazyValidator)(a.schema)})(n.WearableJson||(n.WearableJson={}))}(Em)),Em}var vA;function R1(){return vA||(vA=1,function(n){var t=Os&&Os.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Os&&Os.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(XN(),n),e(A1(),n)}(Os)),Os}var yA;function O1(){return yA||(yA=1,function(n){var t=Ts&&Ts.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ts&&Ts.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(jN(),n),e(R1(),n)}(Ts)),Ts}var Fs={},Rg={},bA;function M1(){return bA||(bA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Account=n.AccountSortBy=void 0;const t=st();(function(e){e.MOST_SALES="most_sales",e.MOST_PURCHASES="most_purchases",e.MOST_SPENT="most_spent",e.MOST_EARNED="most_earned",e.MOST_ROYALTIES="most_royalties",e.MOST_COLLECTIONS="most_collections"})(n.AccountSortBy||(n.AccountSortBy={})),function(e){e.schema={type:"object",properties:{id:{type:"string"},address:{type:"string"},sales:{type:"integer"},purchases:{type:"integer"},spent:{type:"string"},earned:{type:"string"},royalties:{type:"string"},collections:{type:"number"}},required:["id","address","sales","purchases","spent","earned","royalties","collections"]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Account||(n.Account={}))}(Rg)),Rg}var Og={},Mg={},EA;function UM(){return EA||(EA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getChainId=n.ChainName=void 0;const t=st(),e=Ro();var i;(function(o){o.ETHEREUM_MAINNET="Ethereum Mainnet",o.ETHEREUM_ROPSTEN="Ropsten",o.ETHEREUM_RINKEBY="Rinkeby",o.ETHEREUM_GOERLI="Goerli",o.ETHEREUM_KOVAN="Kovan",o.ETHEREUM_SEPOLIA="Sepolia",o.MATIC_MAINNET="Polygon",o.MATIC_MUMBAI="Mumbai",o.MATIC_AMOY="Amoy",o.AVALANCHE_MAINNET="Avalanche",o.BINANCE_MAINNET="Binance Smart Chain",o.ARBITRUM_MAINNET="Arbitrum",o.OPTIMISM_MAINNET="Optimism",o.FANTOM_MAINNET="Fantom"})(i=n.ChainName||(n.ChainName={}));function r(o){switch(o){case i.ETHEREUM_MAINNET:return e.ChainId.ETHEREUM_MAINNET;case i.ETHEREUM_ROPSTEN:return e.ChainId.ETHEREUM_ROPSTEN;case i.ETHEREUM_RINKEBY:return e.ChainId.ETHEREUM_RINKEBY;case i.ETHEREUM_GOERLI:return e.ChainId.ETHEREUM_GOERLI;case i.ETHEREUM_KOVAN:return e.ChainId.ETHEREUM_KOVAN;case i.ETHEREUM_SEPOLIA:return e.ChainId.ETHEREUM_SEPOLIA;case i.MATIC_MAINNET:return e.ChainId.MATIC_MAINNET;case i.MATIC_MUMBAI:return e.ChainId.MATIC_MUMBAI;case i.MATIC_AMOY:return e.ChainId.MATIC_AMOY;case i.AVALANCHE_MAINNET:return e.ChainId.AVALANCHE_MAINNET;case i.BINANCE_MAINNET:return e.ChainId.BSC_MAINNET;case i.ARBITRUM_MAINNET:return e.ChainId.ARBITRUM_MAINNET;case i.OPTIMISM_MAINNET:return e.ChainId.OPTIMISM_MAINNET;case i.FANTOM_MAINNET:return e.ChainId.FANTOM_MAINNET;default:return null}}n.getChainId=r,function(o){o.schema={type:"string",enum:Object.values(o)},o.validate=(0,t.generateLazyValidator)(o.schema)}(i=n.ChainName||(n.ChainName={}))}(Mg)),Mg}var xg={},TA;function Ao(){return TA||(TA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Network=void 0;const t=st();(function(e){e.ETHEREUM="ETHEREUM",e.MATIC="MATIC",e.AVALANCHE="AVALANCHE",e.BSC="BINANCE SMART CHAIN",e.OPTIMISM="OPTIMISM",e.ARBITRUM="ARBITRUM",e.FANTOM="FANTOM"})(n.Network||(n.Network={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Network||(n.Network={}))}(xg)),xg}var SA;function Ro(){return SA||(SA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getNetwork=n.getNetworkMapping=n.getURNProtocol=n.getChainName=n.ChainId=void 0;const t=st(),e=UM(),i=Ao();var r;(function(u){u[u.ETHEREUM_MAINNET=1]="ETHEREUM_MAINNET",u[u.ETHEREUM_ROPSTEN=3]="ETHEREUM_ROPSTEN",u[u.ETHEREUM_RINKEBY=4]="ETHEREUM_RINKEBY",u[u.ETHEREUM_GOERLI=5]="ETHEREUM_GOERLI",u[u.ETHEREUM_KOVAN=42]="ETHEREUM_KOVAN",u[u.ETHEREUM_SEPOLIA=11155111]="ETHEREUM_SEPOLIA",u[u.MATIC_MAINNET=137]="MATIC_MAINNET",u[u.MATIC_MUMBAI=80001]="MATIC_MUMBAI",u[u.MATIC_AMOY=80002]="MATIC_AMOY",u[u.BSC_MAINNET=56]="BSC_MAINNET",u[u.OPTIMISM_MAINNET=10]="OPTIMISM_MAINNET",u[u.ARBITRUM_MAINNET=42161]="ARBITRUM_MAINNET",u[u.FANTOM_MAINNET=250]="FANTOM_MAINNET",u[u.AVALANCHE_MAINNET=43114]="AVALANCHE_MAINNET"})(r=n.ChainId||(n.ChainId={}));function o(u){switch(u){case r.ETHEREUM_MAINNET:return e.ChainName.ETHEREUM_MAINNET;case r.ETHEREUM_ROPSTEN:return e.ChainName.ETHEREUM_ROPSTEN;case r.ETHEREUM_RINKEBY:return e.ChainName.ETHEREUM_RINKEBY;case r.ETHEREUM_GOERLI:return e.ChainName.ETHEREUM_GOERLI;case r.ETHEREUM_KOVAN:return e.ChainName.ETHEREUM_KOVAN;case r.ETHEREUM_SEPOLIA:return e.ChainName.ETHEREUM_SEPOLIA;case r.MATIC_MAINNET:return e.ChainName.MATIC_MAINNET;case r.MATIC_MUMBAI:return e.ChainName.MATIC_MUMBAI;case r.MATIC_AMOY:return e.ChainName.MATIC_AMOY;case r.BSC_MAINNET:return e.ChainName.BINANCE_MAINNET;case r.ARBITRUM_MAINNET:return e.ChainName.ARBITRUM_MAINNET;case r.OPTIMISM_MAINNET:return e.ChainName.OPTIMISM_MAINNET;case r.FANTOM_MAINNET:return e.ChainName.FANTOM_MAINNET;case r.AVALANCHE_MAINNET:return e.ChainName.AVALANCHE_MAINNET;default:return null}}n.getChainName=o;function a(u){switch(u){case r.ETHEREUM_MAINNET:return"ethereum";case r.ETHEREUM_ROPSTEN:return"ropsten";case r.ETHEREUM_RINKEBY:return"rinkeby";case r.ETHEREUM_GOERLI:return"goerli";case r.ETHEREUM_KOVAN:return"kovan";case r.ETHEREUM_SEPOLIA:return"sepolia";case r.MATIC_MAINNET:return"matic";case r.MATIC_MUMBAI:return"mumbai";case r.MATIC_AMOY:return"amoy";default:return""}}n.getURNProtocol=a;function s(u){const f={[i.Network.BSC]:r.BSC_MAINNET,[i.Network.OPTIMISM]:r.OPTIMISM_MAINNET,[i.Network.ARBITRUM]:r.ARBITRUM_MAINNET,[i.Network.FANTOM]:r.FANTOM_MAINNET,[i.Network.AVALANCHE]:r.AVALANCHE_MAINNET};switch(u){case r.ETHEREUM_MAINNET:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_MAINNET,[i.Network.MATIC]:r.MATIC_MAINNET},f);case r.ETHEREUM_ROPSTEN:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_ROPSTEN,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_RINKEBY:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_RINKEBY,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_GOERLI:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_GOERLI,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_KOVAN:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_KOVAN,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_SEPOLIA:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_SEPOLIA,[i.Network.MATIC]:r.MATIC_AMOY},f);case r.MATIC_MAINNET:return Object.assign({[i.Network.ETHEREUM]:r.MATIC_MAINNET,[i.Network.MATIC]:r.MATIC_MAINNET},f);case r.MATIC_MUMBAI:return Object.assign({[i.Network.ETHEREUM]:r.MATIC_MUMBAI,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.MATIC_AMOY:return Object.assign({[i.Network.ETHEREUM]:r.MATIC_AMOY,[i.Network.MATIC]:r.MATIC_AMOY},f);default:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_MAINNET,[i.Network.MATIC]:r.MATIC_MAINNET},f)}}n.getNetworkMapping=s;function l(u){switch(u){case r.ETHEREUM_MAINNET:case r.ETHEREUM_ROPSTEN:case r.ETHEREUM_GOERLI:case r.ETHEREUM_KOVAN:case r.ETHEREUM_RINKEBY:case r.ETHEREUM_SEPOLIA:return i.Network.ETHEREUM;case r.MATIC_MAINNET:case r.MATIC_MUMBAI:case r.MATIC_AMOY:return i.Network.MATIC;case r.BSC_MAINNET:return i.Network.BSC;case r.OPTIMISM_MAINNET:return i.Network.OPTIMISM;case r.ARBITRUM_MAINNET:return i.Network.ARBITRUM;case r.FANTOM_MAINNET:return i.Network.FANTOM;case r.AVALANCHE_MAINNET:return i.Network.AVALANCHE}}n.getNetwork=l,function(u){u.schema={type:"number",enum:Object.values(u)},u.validate=(0,t.generateLazyValidator)(u.schema)}(r=n.ChainId||(n.ChainId={}))}(Og)),Og}var Ig={},CA;function x1(){return CA||(CA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Collection=n.CollectionSortBy=void 0;const t=st(),e=Ro(),i=Ao();(function(r){r.NEWEST="newest",r.NAME="name",r.RECENTLY_REVIEWED="recently_reviewed",r.RECENTLY_LISTED="recently_listed",r.SIZE="size"})(n.CollectionSortBy||(n.CollectionSortBy={})),function(r){r.schema={type:"object",properties:{urn:{type:"string"},creator:{type:"string"},name:{type:"string"},contractAddress:{type:"string"},size:{type:"integer"},isOnSale:{type:"boolean"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},network:i.Network.schema,chainId:e.ChainId.schema,firstListedAt:{type:"integer",nullable:!0}},required:["urn","creator","name","contractAddress","isOnSale","size","createdAt","updatedAt","reviewedAt","network","chainId"]},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.Collection||(n.Collection={}))}(Ig)),Ig}var Dg={},wg={},PA;function np(){return PA||(PA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.NFTCategory=void 0;const t=st();(function(e){e.PARCEL="parcel",e.ESTATE="estate",e.WEARABLE="wearable",e.ENS="ens",e.EMOTE="emote"})(n.NFTCategory||(n.NFTCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.NFTCategory||(n.NFTCategory={}))}(wg)),wg}var AA;function I1(){return AA||(AA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Contract=n.ContractSortBy=void 0;const t=st(),e=Ro(),i=Ao(),r=np();(function(o){o.NAME="name"})(n.ContractSortBy||(n.ContractSortBy={})),function(o){o.schema={type:"object",properties:{name:{type:"string"},address:{type:"string"},category:r.NFTCategory.schema,network:i.Network.schema,chainId:e.ChainId.schema},required:["name","address","category","network","chainId"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Contract||(n.Contract={}))}(Dg)),Dg}var Lg={},Ng={},RA;function kM(){return RA||(RA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.NFT=n.NFTSortBy=void 0;const t=st(),e=Ro(),i=bb(),r=Ao(),o=np(),a=ip(),s=Zs();(function(l){l.NAME="name",l.NEWEST="newest",l.RECENTLY_LISTED="recently_listed",l.RECENTLY_SOLD="recently_sold",l.CHEAPEST="cheapest",l.RENTAL_LISTING_DATE="rental_listing_date",l.RENTAL_DATE="rented_date",l.MAX_RENTAL_PRICE="max_rental_price",l.MIN_RENTAL_PRICE="min_rental_price"})(n.NFTSortBy||(n.NFTSortBy={})),function(l){l.schema={type:"object",properties:{id:{type:"string"},tokenId:{type:"string"},contractAddress:{type:"string"},activeOrderId:{type:"string",nullable:!0},utility:{type:"string",nullable:!0},openRentalId:{type:"string",nullable:!0},owner:{type:"string"},name:{type:"string"},image:{type:"string"},url:{type:"string"},data:{type:"object",nullable:!1,properties:{parcel:{type:"object",properties:{description:{type:["string"],nullable:!0},x:{type:"string"},y:{type:"string"},estate:{type:"object",properties:{tokenId:{type:"string"},name:{type:"string"}},required:["tokenId","name"],nullable:!0}},required:["description","x","y","estate"],nullable:!0},estate:{type:"object",properties:{description:{type:["string"],nullable:!0},size:{type:"integer"},parcels:{type:"array",items:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"]}}},required:["description","size","parcels"],nullable:!0},wearable:{type:"object",properties:{bodyShapes:{type:"array",items:i.BodyShape.schema},category:s.WearableCategory.schema,description:{type:"string"},rarity:a.Rarity.schema,isSmart:{type:"boolean"}},required:["bodyShapes","category","description","rarity","isSmart"],nullable:!0},ens:{type:"object",properties:{subdomain:{type:"string"}},required:["subdomain"],nullable:!0},emote:{type:"object",properties:{bodyShapes:{type:"array",items:i.BodyShape.schema},category:i.EmoteCategory.schema,description:{type:"string"},rarity:a.Rarity.schema,loop:{type:"boolean"},hasSound:{type:"boolean"},hasGeometry:{type:"boolean"},outcomeType:{type:"string",nullable:!0}},required:["bodyShapes","category","description","rarity","loop"],nullable:!0}},required:[]},issuedId:{type:"string",nullable:!0},itemId:{type:"string",nullable:!0},category:o.NFTCategory.schema,network:r.Network.schema,chainId:e.ChainId.schema,createdAt:{type:"integer"},updatedAt:{type:"integer"},soldAt:{type:"integer"},urn:{type:"string",nullable:!0}},required:["id","tokenId","contractAddress","activeOrderId","openRentalId","owner","name","image","url","data","issuedId","itemId","category","network","chainId","createdAt","updatedAt","soldAt"]},l.validate=(0,t.generateLazyValidator)(l.schema)}(n.NFT||(n.NFT={}))}(Ng)),Ng}var OA;function D1(){return OA||(OA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Item=n.ItemSortBy=void 0;const t=st(),e=Ro(),i=Ao(),r=kM(),o=np();(function(a){a.NAME="name",a.NEWEST="newest",a.RECENTLY_REVIEWED="recently_reviewed",a.RECENTLY_SOLD="recently_sold",a.RECENTLY_LISTED="recently_listed",a.CHEAPEST="cheapest"})(n.ItemSortBy||(n.ItemSortBy={})),function(a){a.schema={type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail:{type:"string"},url:{type:"string"},category:o.NFTCategory.schema,contractAddress:{type:"string"},itemId:{type:"string"},rarity:{type:"string"},price:{type:"string"},available:{type:"integer"},isOnSale:{type:"boolean"},creator:{type:"string"},beneficiary:{type:"string",nullable:!0},tradeId:{type:"string",nullable:!0},tradeContractAddress:{type:"string",nullable:!0},data:r.NFT.schema.properties.data,network:i.Network.schema,chainId:e.ChainId.schema,urn:{type:"string"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},soldAt:{type:"integer"},firstListedAt:{type:"integer",nullable:!0},picks:{type:"object",properties:{pickedByUser:{type:"boolean",nullable:!0},count:{type:"integer"}},required:["count"],nullable:!0},minPrice:{type:"string",nullable:!0},utility:{type:"string",nullable:!0},minListingPrice:{type:"string",nullable:!0},maxListingPrice:{type:"string",nullable:!0},listings:{type:"integer",nullable:!0},owners:{type:"integer",nullable:!0},tradeExpiresAt:{type:"integer",nullable:!0}},required:["id","name","thumbnail","url","category","contractAddress","itemId","rarity","price","available","isOnSale","creator","data","network","chainId","createdAt","updatedAt","soldAt"]},a.validate=(0,t.generateLazyValidator)(a.schema)}(n.Item||(n.Item={}))}(Lg)),Lg}var Fg={},MA;function Eb(){return MA||(MA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ListingStatus=void 0;const t=st();(function(e){e.OPEN="open",e.SOLD="sold",e.CANCELLED="cancelled"})(n.ListingStatus||(n.ListingStatus={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.ListingStatus||(n.ListingStatus={}))}(Fg)),Fg}var Bg={},xA;function w1(){return xA||(xA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.MetaTransaction=void 0;const t=st();(function(e){e.schema={type:"object",properties:{from:{type:"string"},params:{type:"array",items:[{type:"string"},{type:"string"}],additionalItems:!1,minItems:2}},additionalProperties:!1,required:["from","params"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.MetaTransaction||(n.MetaTransaction={}))}(Bg)),Bg}var Vg={},IA;function L1(){return IA||(IA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Mint=n.MintSortBy=void 0;const t=st(),e=Ro(),i=Ao();(function(r){r.RECENTLY_MINTED="recently_minted",r.MOST_EXPENSIVE="most_expensive"})(n.MintSortBy||(n.MintSortBy={})),function(r){r.schema={type:"object",properties:{id:{type:"string"},creator:{type:"string"},beneficiary:{type:"string"},minter:{type:"string"},price:{type:"string",nullable:!0},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},issuedId:{type:"string"},timestamp:{type:"integer"},network:i.Network.schema,chainId:e.ChainId.schema},required:["id","creator","beneficiary","minter","itemId","tokenId","issuedId","contractAddress","price","timestamp","network","chainId"]},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.Mint||(n.Mint={}))}(Vg)),Vg}var Ug={},DA;function N1(){return DA||(DA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CatalogSortDirection=n.CatalogSortBy=void 0,function(t){t.NEWEST="newest",t.RECENTLY_SOLD="recently_sold",t.CHEAPEST="cheapest",t.MOST_EXPENSIVE="most_expensive",t.RECENTLY_LISTED="recently_listed"}(n.CatalogSortBy||(n.CatalogSortBy={})),function(t){t.ASC="asc",t.DESC="desc"}(n.CatalogSortDirection||(n.CatalogSortDirection={}))}(Ug)),Ug}var kg={},wA;function F1(){return wA||(wA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Order=n.OrderSortBy=void 0;const t=st(),e=Ro(),i=Eb(),r=Ao();(function(o){o.RECENTLY_LISTED="recently_listed",o.RECENTLY_UPDATED="recently_updated",o.CHEAPEST="cheapest",o.ISSUED_ID_ASC="issued_id_asc",o.ISSUED_ID_DESC="issued_id_desc",o.OLDEST="oldest"})(n.OrderSortBy||(n.OrderSortBy={})),function(o){o.schema={type:"object",properties:{id:{type:"string"},marketplaceAddress:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},owner:{type:"string"},buyer:{type:["string"],nullable:!0},price:{type:"string"},status:i.ListingStatus.schema,network:r.Network.schema,chainId:e.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"},issuedId:{type:"string"},tradeId:{type:"string",nullable:!0}},required:["id","marketplaceAddress","contractAddress","tokenId","owner","buyer","price","status","network","chainId","expiresAt","createdAt","updatedAt"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Order||(n.Order={}))}(kg)),kg}var zg={},LA;function B1(){return LA||(LA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProviderType=void 0;const t=st();(function(e){e.INJECTED="injected",e.MAGIC="magic",e.MAGIC_TEST="magic_test",e.FORTMATIC="formatic",e.NETWORK="network",e.WALLET_CONNECT="wallet_connect",e.WALLET_CONNECT_V2="wallet_connect_v2",e.WALLET_LINK="wallet_link",e.METAMASK_MOBILE="metamask_mobile",e.AUTH_SERVER="auth_server"})(n.ProviderType||(n.ProviderType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.ProviderType||(n.ProviderType={}))}(zg)),zg}var Gg={},NA;function zM(){return NA||(NA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SaleType=void 0;const t=st();(function(e){e.ORDER="order",e.BID="bid",e.MINT="mint"})(n.SaleType||(n.SaleType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.SaleType||(n.SaleType={}))}(Gg)),Gg}var Wg={},FA;function V1(){return FA||(FA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Sale=n.SaleSortBy=void 0;const t=st(),e=Ro(),i=zM(),r=Ao();(function(o){o.RECENTLY_SOLD="recently_sold",o.MOST_EXPENSIVE="most_expensive"})(n.SaleSortBy||(n.SaleSortBy={})),function(o){o.schema={type:"object",properties:{id:{type:"string"},type:i.SaleType.schema,buyer:{type:"string"},seller:{type:"string"},price:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},txHash:{type:"string"},timestamp:{type:"integer"},network:r.Network.schema,chainId:e.ChainId.schema},required:["id","buyer","seller","itemId","tokenId","price","contractAddress","timestamp","txHash","network","chainId"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Sale||(n.Sale={}))}(Wg)),Wg}var Hg={},BA;function U1(){return BA||(BA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.RentalListingCreation=n.PeriodCreation=n.RentalsListingsSortBy=n.RentalsListingsFilterByCategory=n.RentalsListingSortDirection=n.RentalStatus=void 0;const t=st(),e=Ro(),i=Ao();(function(o){o.OPEN="open",o.CANCELLED="cancelled",o.EXECUTED="executed",o.CLAIMED="claimed"})(n.RentalStatus||(n.RentalStatus={})),function(o){o.ASC="asc",o.DESC="desc"}(n.RentalsListingSortDirection||(n.RentalsListingSortDirection={})),function(o){o.PARCEL="parcel",o.ESTATE="estate"}(n.RentalsListingsFilterByCategory||(n.RentalsListingsFilterByCategory={})),function(o){o.LAND_CREATION_DATE="land_creation_date",o.RENTAL_LISTING_DATE="rental_listing_date",o.RENTAL_DATE="rented_date",o.NAME="name",o.MAX_RENTAL_PRICE="max_rental_price",o.MIN_RENTAL_PRICE="min_rental_price"}(n.RentalsListingsSortBy||(n.RentalsListingsSortBy={}));var r;(function(o){o.schema={type:"object",properties:{minDays:{type:"integer",minimum:0,maximum:2147483647},maxDays:{type:"integer",minimum:0,maximum:2147483647},pricePerDay:{type:"string",pattern:"^[0-9]+$"}},additionalProperties:!1,required:["minDays","maxDays","pricePerDay"]},o.validate=(0,t.generateLazyValidator)(o.schema)})(r=n.PeriodCreation||(n.PeriodCreation={})),function(o){o.schema={type:"object",properties:{network:i.Network.schema,chainId:e.ChainId.schema,expiration:{type:"number",minimum:0},signature:{type:"string",minLength:1},tokenId:{type:"string",minLength:1},nonces:{type:"array",minItems:3,maxItems:3,items:{minLength:1,type:"string",pattern:"^[0-9]+$"}},contractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},rentalContractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},periods:{type:"array",minItems:1,maxItems:100,uniqueItems:!0,items:r.schema},target:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"}},additionalProperties:!1,required:["network","chainId","expiration","signature","nonces","tokenId","contractAddress","rentalContractAddress","periods","target"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.RentalListingCreation||(n.RentalListingCreation={}))}(Hg)),Hg}var jg={},VA;function k1(){return VA||(VA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.AnalyticsDayDataSortBy=void 0,function(t){t.DATE="date",t.MOST_SALES="most_sales"}(n.AnalyticsDayDataSortBy||(n.AnalyticsDayDataSortBy={}))}(jg)),jg}var Xg={},UA;function z1(){return UA||(UA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Store=void 0;const t=st();(function(e){e.schema={type:"object",properties:{id:{type:"string"},version:{type:"number"},owner:{type:"string"},description:{type:"string"},links:{type:"array",items:{type:"object",properties:{name:{type:"string"},url:{type:"string"}},required:["name","url"]}},images:{type:"array",items:{type:"object",properties:{name:{type:"string"},file:{type:"string"}},required:["name","file"]}}},required:["id","version","owner","description","links","images"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.Store||(n.Store={}))}(Xg)),Xg}var Yg={},kA;function G1(){return kA||(kA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.GenderFilterOption=n.WearableGender=void 0;const t=st();(function(e){e.MALE="male",e.FEMALE="female"})(n.WearableGender||(n.WearableGender={})),function(e){e.MALE="male",e.FEMALE="female",e.UNISEX="unisex"}(n.GenderFilterOption||(n.GenderFilterOption={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.WearableGender||(n.WearableGender={}))}(Yg)),Yg}var Kg={},zA;function W1(){return zA||(zA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.World=n.isInsideWorldLimits=n.getWorld=void 0;const t=st();function e(){return{validWorldRanges:[{xMin:-150,yMin:-150,xMax:150,yMax:150},{xMin:62,yMin:151,xMax:162,yMax:158},{xMin:151,yMin:144,xMax:162,yMax:150},{xMin:151,yMin:59,xMax:163,yMax:143}]}}n.getWorld=e;function i(r,o){const a=e().validWorldRanges;for(const s of a)if(r>=s.xMin&&r<=s.xMax&&o>=s.yMin&&o<=s.yMax)return!0;return!1}n.isInsideWorldLimits=i,function(r){r.schema={type:"object",required:["validWorldRanges"],properties:{validWorldRanges:{type:"array",default:[{xMin:-150,yMin:-150,xMax:150,yMax:150}],items:{type:"object",required:["xMin","yMin","xMax","yMax"],properties:{xMin:{type:"integer"},yMin:{type:"integer"},xMax:{type:"integer"},yMax:{type:"integer"}}}}},additionalProperties:!1},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.World||(n.World={}))}(Kg)),Kg}var qg={},GA;function H1(){return GA||(GA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Bid=n.BidSortBy=void 0;const t=st(),e=Ro(),i=Eb(),r=Ao();(function(o){o.RECENTLY_OFFERED="recently_offered",o.RECENTLY_UPDATED="recently_updated",o.MOST_EXPENSIVE="most_expensive"})(n.BidSortBy||(n.BidSortBy={})),function(o){const a={properties:{id:{type:"string"},bidder:{type:"string"},seller:{type:"string"},price:{type:"string"},fingerprint:{type:"string"},status:i.ListingStatus.schema,contractAddress:{type:"string"},network:r.Network.schema,chainId:e.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"}},required:["id","bidder","seller","price","fingerprint","status","contractAddress","network","chainId","expiresAt","createdAt","updatedAt"]};o.schema={type:"object",required:[],oneOf:[{properties:Object.assign(Object.assign({},a.properties),{tradeId:{type:"string"},tokenId:{type:"string"}}),required:[...a.required,"tradeId","tokenId"]},{type:"object",properties:Object.assign(Object.assign({},a.properties),{tradeId:{type:"string"},itemId:{type:"string"}}),required:[...a.required,"tradeId","itemId"]},{type:"object",properties:Object.assign(Object.assign({},a.properties),{bidAddress:{type:"string"},blockchainId:{type:"string"},blockNumber:{type:"string"},tokenId:{type:"string"}}),required:[...a.required,"bidAddress","blockchainId","blockNumber","tokenId"]}]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Bid||(n.Bid={}))}(qg)),qg}var Qg={},WA;function j1(){return WA||(WA=1,Object.defineProperty(Qg,"__esModule",{value:!0})),Qg}var $g={},HA;function X1(){return HA||(HA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.TradeAssetDirection=n.TradeAssetType=n.TradeType=void 0,function(t){t.BID="bid",t.PUBLIC_NFT_ORDER="public_nft_order",t.PUBLIC_ITEM_ORDER="public_item_order"}(n.TradeType||(n.TradeType={})),function(t){t[t.ERC20=1]="ERC20",t[t.USD_PEGGED_MANA=2]="USD_PEGGED_MANA",t[t.ERC721=3]="ERC721",t[t.COLLECTION_ITEM=4]="COLLECTION_ITEM"}(n.TradeAssetType||(n.TradeAssetType={})),function(t){t.SENT="sent",t.RECEIVED="received"}(n.TradeAssetDirection||(n.TradeAssetDirection={}))}($g)),$g}var Bs={},Zg={},jA;function Y1(){return jA||(jA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewCamera=void 0;const t=st();(function(e){e.STATIC="static",e.INTERACTIVE="interactive"})(n.PreviewCamera||(n.PreviewCamera={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewCamera||(n.PreviewCamera={}))}(Zg)),Zg}var Jg={},XA;function K1(){return XA||(XA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewUnityMode=void 0,function(t){t.AUTH="authentication",t.BUILDER="builder",t.MARKETPLACE="marketplace",t.PROFILE="profile",t.CONFIG="configurator"}(n.PreviewUnityMode||(n.PreviewUnityMode={}))}(Jg)),Jg}var ev={},YA;function q1(){return YA||(YA=1,Object.defineProperty(ev,"__esModule",{value:!0})),ev}var tv={},KA;function Q1(){return KA||(KA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewEmoteEventType=void 0;const t=st();(function(e){e.ANIMATION_PLAY="animation_play",e.ANIMATION_PAUSE="animation_pause",e.ANIMATION_LOOP="animation_loop",e.ANIMATION_END="animation_end",e.ANIMATION_PLAYING="animation_playing"})(n.PreviewEmoteEventType||(n.PreviewEmoteEventType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewEmoteEventType||(n.PreviewEmoteEventType={}))}(tv)),tv}var iv={},qA;function $1(){return qA||(qA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewEmote=void 0;const t=st();(function(e){e.IDLE="idle",e.WALK="walk",e.RUN="run",e.JUMP="jump",e.CLAP="clap",e.DAB="dab",e.DANCE="dance",e.FASHION="fashion",e.FASHION_2="fashion-2",e.FASHION_3="fashion-3",e.FASHION_4="fashion-4",e.LOVE="love",e.MONEY="money",e.FIST_PUMP="fist-pump",e.HEAD_EXPLODE="head-explode",e.WAVE="wave"})(n.PreviewEmote||(n.PreviewEmote={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewEmote||(n.PreviewEmote={}))}(iv)),iv}var rv={},QA;function Z1(){return QA||(QA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.sendMessage=n.PreviewRenderer=n.PreviewMessageType=void 0;const t=st();(function(i){i.READY="ready",i.LOAD="load",i.ERROR="error",i.UPDATE="update",i.CONTROLLER_REQUEST="controller_request",i.CONTROLLER_RESPONSE="controller_response",i.EMOTE_EVENT="emote_event"})(n.PreviewMessageType||(n.PreviewMessageType={})),function(i){i.BABYLON="babylon",i.UNITY="unity"}(n.PreviewRenderer||(n.PreviewRenderer={})),function(i){i.schema={type:"string",enum:Object.values(i)},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.PreviewMessageType||(n.PreviewMessageType={}));const e=(i,r,o,a="*")=>{const s={type:r,payload:o};i.postMessage(s,a)};n.sendMessage=e}(rv)),rv}var nv={},$A;function J1(){return $A||($A=1,Object.defineProperty(nv,"__esModule",{value:!0})),nv}var ov={},ZA;function eF(){return ZA||(ZA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewProjection=void 0;const t=st();(function(e){e.ORTHOGRAPHIC="orthographic",e.PERSPECTIVE="perspective"})(n.PreviewProjection||(n.PreviewProjection={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewProjection||(n.PreviewProjection={}))}(ov)),ov}var av={},JA;function tF(){return JA||(JA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewType=void 0;const t=st();(function(e){e.TEXTURE="texture",e.WEARABLE="wearable",e.AVATAR="avatar"})(n.PreviewType||(n.PreviewType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewType||(n.PreviewType={}))}(av)),av}var sv={},eR;function iF(){return eR||(eR=1,Object.defineProperty(sv,"__esModule",{value:!0})),sv}var lv={},tR;function rF(){return tR||(tR=1,Object.defineProperty(lv,"__esModule",{value:!0})),lv}var uv={},iR;function nF(){return iR||(iR=1,Object.defineProperty(uv,"__esModule",{value:!0})),uv}var fv={},rR;function oF(){return rR||(rR=1,Object.defineProperty(fv,"__esModule",{value:!0})),fv}var cv={},nR;function aF(){return nR||(nR=1,Object.defineProperty(cv,"__esModule",{value:!0})),cv}var hv={},oR;function sF(){return oR||(oR=1,Object.defineProperty(hv,"__esModule",{value:!0})),hv}var dv={},aR;function lF(){return aR||(aR=1,Object.defineProperty(dv,"__esModule",{value:!0})),dv}var pv={},sR;function uF(){return sR||(sR=1,Object.defineProperty(pv,"__esModule",{value:!0})),pv}var lR;function fF(){return lR||(lR=1,function(n){var t=Bs&&Bs.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Bs&&Bs.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(Y1(),n),e(K1(),n),e(q1(),n),e(Q1(),n),e($1(),n),e(Z1(),n),e(J1(),n),e(eF(),n),e(tF(),n),e(iF(),n),e(rF(),n),e(nF(),n),e(oF(),n),e(aF(),n),e(sF(),n),e(lF(),n),e(uF(),n)}(Bs)),Bs}var Vs={},Ju={},uR;function cF(){if(uR)return Ju;uR=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.isSysLink=void 0;const n=t=>t!==null&&typeof t=="object"&&"sys"in t&&"id"in t.sys;return Ju.isSysLink=n,Ju}var ef={},fR;function hF(){if(fR)return ef;fR=1,Object.defineProperty(ef,"__esModule",{value:!0}),ef.ContentfulLocale=void 0;var n;return function(t){t.enUS="en-US",t.es="es",t.zh="zh"}(n||(n={})),ef.ContentfulLocale=n,ef}var _v={},cR;function dF(){return cR||(cR=1,Object.defineProperty(_v,"__esModule",{value:!0})),_v}var hR;function pF(){return hR||(hR=1,function(n){var t=Vs&&Vs.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Vs&&Vs.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(cF(),n),e(hF(),n),e(dF(),n)}(Vs)),Vs}var dR;function _F(){return dR||(dR=1,function(n){var t=Fs&&Fs.__createBinding||(Object.create?function(V,B,z,J){J===void 0&&(J=z);var X=Object.getOwnPropertyDescriptor(B,z);(!X||("get"in X?!B.__esModule:X.writable||X.configurable))&&(X={enumerable:!0,get:function(){return B[z]}}),Object.defineProperty(V,J,X)}:function(V,B,z,J){J===void 0&&(J=z),V[J]=B[z]}),e=Fs&&Fs.__exportStar||function(V,B){for(var z in V)z!=="default"&&!Object.prototype.hasOwnProperty.call(B,z)&&t(B,V,z)};Object.defineProperty(n,"__esModule",{value:!0}),n.isInsideWorldLimits=n.getWorld=n.World=n.GenderFilterOption=n.WearableGender=n.Store=n.AnalyticsDayDataSortBy=n.PeriodCreation=n.RentalListingCreation=n.RentalsListingsSortBy=n.RentalsListingsFilterByCategory=n.RentalsListingSortDirection=n.RentalStatus=n.SaleSortBy=n.Sale=n.SaleType=n.Rarity=n.ProviderType=n.OrderSortBy=n.Order=n.CatalogSortDirection=n.CatalogSortBy=n.NFTSortBy=n.NFT=n.NFTCategory=n.Network=n.MintSortBy=n.Mint=n.MetaTransaction=n.ListingStatus=n.ItemSortBy=n.Item=n.ContractSortBy=n.Contract=n.CollectionSortBy=n.Collection=n.getChainId=n.ChainName=n.getURNProtocol=n.getChainName=n.ChainId=n.AccountSortBy=n.Account=void 0;var i=M1();Object.defineProperty(n,"Account",{enumerable:!0,get:function(){return i.Account}}),Object.defineProperty(n,"AccountSortBy",{enumerable:!0,get:function(){return i.AccountSortBy}});var r=Ro();Object.defineProperty(n,"ChainId",{enumerable:!0,get:function(){return r.ChainId}}),Object.defineProperty(n,"getChainName",{enumerable:!0,get:function(){return r.getChainName}}),Object.defineProperty(n,"getURNProtocol",{enumerable:!0,get:function(){return r.getURNProtocol}});var o=UM();Object.defineProperty(n,"ChainName",{enumerable:!0,get:function(){return o.ChainName}}),Object.defineProperty(n,"getChainId",{enumerable:!0,get:function(){return o.getChainId}});var a=x1();Object.defineProperty(n,"Collection",{enumerable:!0,get:function(){return a.Collection}}),Object.defineProperty(n,"CollectionSortBy",{enumerable:!0,get:function(){return a.CollectionSortBy}});var s=I1();Object.defineProperty(n,"Contract",{enumerable:!0,get:function(){return s.Contract}}),Object.defineProperty(n,"ContractSortBy",{enumerable:!0,get:function(){return s.ContractSortBy}});var l=D1();Object.defineProperty(n,"Item",{enumerable:!0,get:function(){return l.Item}}),Object.defineProperty(n,"ItemSortBy",{enumerable:!0,get:function(){return l.ItemSortBy}});var u=Eb();Object.defineProperty(n,"ListingStatus",{enumerable:!0,get:function(){return u.ListingStatus}});var f=w1();Object.defineProperty(n,"MetaTransaction",{enumerable:!0,get:function(){return f.MetaTransaction}});var c=L1();Object.defineProperty(n,"Mint",{enumerable:!0,get:function(){return c.Mint}}),Object.defineProperty(n,"MintSortBy",{enumerable:!0,get:function(){return c.MintSortBy}});var h=Ao();Object.defineProperty(n,"Network",{enumerable:!0,get:function(){return h.Network}});var p=np();Object.defineProperty(n,"NFTCategory",{enumerable:!0,get:function(){return p.NFTCategory}});var _=kM();Object.defineProperty(n,"NFT",{enumerable:!0,get:function(){return _.NFT}}),Object.defineProperty(n,"NFTSortBy",{enumerable:!0,get:function(){return _.NFTSortBy}});var g=N1();Object.defineProperty(n,"CatalogSortBy",{enumerable:!0,get:function(){return g.CatalogSortBy}}),Object.defineProperty(n,"CatalogSortDirection",{enumerable:!0,get:function(){return g.CatalogSortDirection}});var v=F1();Object.defineProperty(n,"Order",{enumerable:!0,get:function(){return v.Order}}),Object.defineProperty(n,"OrderSortBy",{enumerable:!0,get:function(){return v.OrderSortBy}});var E=B1();Object.defineProperty(n,"ProviderType",{enumerable:!0,get:function(){return E.ProviderType}});var T=ip();Object.defineProperty(n,"Rarity",{enumerable:!0,get:function(){return T.Rarity}});var S=zM();Object.defineProperty(n,"SaleType",{enumerable:!0,get:function(){return S.SaleType}});var C=V1();Object.defineProperty(n,"Sale",{enumerable:!0,get:function(){return C.Sale}}),Object.defineProperty(n,"SaleSortBy",{enumerable:!0,get:function(){return C.SaleSortBy}});var O=U1();Object.defineProperty(n,"RentalStatus",{enumerable:!0,get:function(){return O.RentalStatus}}),Object.defineProperty(n,"RentalsListingSortDirection",{enumerable:!0,get:function(){return O.RentalsListingSortDirection}}),Object.defineProperty(n,"RentalsListingsFilterByCategory",{enumerable:!0,get:function(){return O.RentalsListingsFilterByCategory}}),Object.defineProperty(n,"RentalsListingsSortBy",{enumerable:!0,get:function(){return O.RentalsListingsSortBy}}),Object.defineProperty(n,"RentalListingCreation",{enumerable:!0,get:function(){return O.RentalListingCreation}}),Object.defineProperty(n,"PeriodCreation",{enumerable:!0,get:function(){return O.PeriodCreation}});var A=k1();Object.defineProperty(n,"AnalyticsDayDataSortBy",{enumerable:!0,get:function(){return A.AnalyticsDayDataSortBy}});var M=z1();Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return M.Store}});var D=G1();Object.defineProperty(n,"WearableGender",{enumerable:!0,get:function(){return D.WearableGender}}),Object.defineProperty(n,"GenderFilterOption",{enumerable:!0,get:function(){return D.GenderFilterOption}});var U=W1();Object.defineProperty(n,"World",{enumerable:!0,get:function(){return U.World}}),Object.defineProperty(n,"getWorld",{enumerable:!0,get:function(){return U.getWorld}}),Object.defineProperty(n,"isInsideWorldLimits",{enumerable:!0,get:function(){return U.isInsideWorldLimits}}),e(H1(),n),e(j1(),n),e(X1(),n),e(fF(),n),e(pF(),n)}(Fs)),Fs}var mv={},pR;function mF(){return pR||(pR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.LinkerAuthorization=void 0;const t=st();(function(e){e.schema={type:"object",properties:{name:{type:"string"},desc:{type:"string"},startDate:{type:"string",nullable:!0},endDate:{type:"string",nullable:!0},contactInfo:{type:"object",properties:{name:{type:"string"}},required:["name"]},onlyDev:{type:"boolean",nullable:!0},addresses:{type:"array",items:{type:"string"},minItems:1},plots:{type:"array",items:{type:"string"},minItems:1}},required:["name","desc","contactInfo","addresses","plots"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.LinkerAuthorization||(n.LinkerAuthorization={}))}(mv)),mv}var Us={},gv={},tf={},_R;function GM(){if(_R)return tf;_R=1,Object.defineProperty(tf,"__esModule",{value:!0}),tf.isInExceptionBlock=void 0;function n(r,o){return r>=62&&r<=150&&o>=151&&o<=158}function t(r,o){return r>=151&&r<=162&&o>=144&&o<=158}function e(r,o){return r>=151&&r<=163&&o>=59&&o<=143}function i(r,o){return n(r,o)||t(r,o)||e(r,o)}return tf.isInExceptionBlock=i,tf}var mR;function gF(){return mR||(mR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Parcel=n.PARCEL_LIMITS=void 0;const t=st(),e=GM();n.PARCEL_LIMITS={minX:-150,maxX:150,minY:-150,maxY:150},function(i){i._isInLimits={keyword:"_isInLimits",validate:function(p,_){return!_||typeof _.x!="number"||typeof _.y!="number"?!1:s(_)||(0,e.isInExceptionBlock)(_.x,_.y)},errors:!1},i.schema={type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"}},_isInLimits:!0,additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema,[i._isInLimits]);function r({x:h,y:p}){return`${h},${p}`}i.parcelToString=r;function o(h){const p=h.match(/^(-?\d+),(-?\d+)$/);if(!p)return null;const[,_,g]=p,v=parseInt(_,10),E=parseInt(g,10);return{x:v,y:E}}i.stringToParcel=o;function a(h){const p=o(h);return p?i.validate(p):!1}i.isParcelStringValid=a;function s(h){const{x:p,y:_}=h;return p>=n.PARCEL_LIMITS.minX&&p<=n.PARCEL_LIMITS.maxX&&_>=n.PARCEL_LIMITS.minY&&_<=n.PARCEL_LIMITS.maxY}i.isInStandardBounds=s;function l(h){return(0,e.isInExceptionBlock)(h.x,h.y)}i.isExceptionParcel=l;function u(h){return s(h)||l(h)}i.isInBounds=u;function f(h){return i.validate(h)}i.isValid=f;function c(h){const p=o(h);return p?i.validate(p):!1}i.isValidString=c}(n.Parcel||(n.Parcel={}))}(gv)),gv}var ks={},gR;function vF(){if(gR)return ks;gR=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.validateUrlInstance=ks.validateUrl=void 0;const n={allowLocalhost:!1,allowedPorts:[]};function t(p,_=2){let g=p;for(let v=0;v<_;v++)try{g=decodeURIComponent(g)}catch{break}return g.normalize("NFKC")}function e(p){return/[\u0000-\u001F\u007F-\u009F\u202A-\u202E\u2066-\u2069]/.test(p)}function i(p){return!!(p.username||p.password)}function r(p){return/\\/.test(p)}const o=["80","443"];function a(p,_){return!!p.port&&!_.includes(p.port)}function s(p){const _=p.toLowerCase();return!!(_==="localhost"||_.endsWith(".local")||/^(127\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|169\.254\.)/.test(_)||_==="::1"||_==="[::1]"||_.startsWith("fe80:")||_.startsWith("fc00:"))}function l(p){if(p.startsWith("//"))return null;try{return{url:new URL(p),wasRelative:!1}}catch{try{return{url:new URL(p,"https://example.com"),wasRelative:!0}}catch{return null}}}function u(p){const _=t(String(p).toLowerCase());return!(e(_)||r(_))}function f(p){return!(!p||p.includes("..")||p.includes("//")||e(p)||r(p))}function c(p,_={}){const g=Object.assign(Object.assign({},n),_),v=[...o,...g.allowedPorts];if(!p||p.length===0||p.length>4096||e(p)||r(p))return!1;const E=t(p);if(e(E)||r(E)||p.startsWith("//"))return!1;const T=l(p);if(!T)return!1;const{url:S,wasRelative:C}=T;if(S.protocol!=="http:"&&S.protocol!=="https:"&&S.protocol!==""||i(S)||r(p)||r(S.href)||!C&&(a(S,v)||!g.allowLocalhost&&S.hostname&&s(S.hostname))||!f(S.pathname)||S.pathname.length>2048)return!1;const O=Array.from(S.searchParams.entries());if(O.length>50||(S.search?S.search.startsWith("?")?S.search.length-1:S.search.length:0)>2048)return!1;for(const[M,D]of O)if(M.length===0||!u(M)||!u(D)||M.length>128||D.length>1024)return!1;return!(S.hash&&e(S.hash))}ks.validateUrl=c;function h(p,_={}){return c(p.toString(),_)}return ks.validateUrlInstance=h,ks}var vR;function yF(){return vR||(vR=1,function(n){var t=Us&&Us.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Us&&Us.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(gF(),n),e(GM(),n),e(vF(),n)}(Us)),Us}var yR;function bF(){return yR||(yR=1,function(n){var t=mo&&mo.__createBinding||(Object.create?function(a,s,l,u){u===void 0&&(u=l);var f=Object.getOwnPropertyDescriptor(s,l);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[l]}}),Object.defineProperty(a,u,f)}:function(a,s,l,u){u===void 0&&(u=l),a[u]=s[l]}),e=mo&&mo.__setModuleDefault||(Object.create?function(a,s){Object.defineProperty(a,"default",{enumerable:!0,value:s})}:function(a,s){a.default=s}),i=mo&&mo.__importStar||function(a){if(a&&a.__esModule)return a;var s={};if(a!=null)for(var l in a)l!=="default"&&Object.prototype.hasOwnProperty.call(a,l)&&t(s,a,l);return e(s,a),s},r=mo&&mo.__exportStar||function(a,s){for(var l in a)l!=="default"&&!Object.prototype.hasOwnProperty.call(s,l)&&t(s,a,l)};Object.defineProperty(n,"__esModule",{value:!0}),n.sdk=void 0;const o=i(O1());n.sdk=o,r(st(),n),r(_F(),n),r(bb(),n),r(Js(),n),r(mF(),n),r(ac(),n),r(LM(),n),r(VM(),n),r(yF(),n)}(mo)),mo}var Ce=bF();function WM(){const[n,t]=Ct.useState({width:void 0,height:void 0});return Ct.useEffect(()=>{function e(){t({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),n}var vv={},rf={},yv={},zs={},bR;function EF(){if(bR)return zs;bR=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.getEnvFromQueryParam=zs.getEnvFromTLD=void 0;const n=Tb();function t(i){const{host:r}=i;return r.endsWith(".org")||r.endsWith(".co")?n.Env.PRODUCTION:r.endsWith(".today")||r.endsWith(".net")?n.Env.STAGING:r.endsWith(".io")||r.endsWith(".zone")?n.Env.DEVELOPMENT:null}zs.getEnvFromTLD=t;function e(i){const r=new URLSearchParams(i.search),o=r.get("ENV")||r.get("env");if(o){const a=o.toLowerCase();if((0,n.isEnv)(a))return a}return null}return zs.getEnvFromQueryParam=e,zs}var ER;function Tb(){return ER||(ER=1,function(n){var t={};Object.defineProperty(n,"__esModule",{value:!0}),n.getEnv=n.getDefaultEnv=n.parseEnvVar=n.isEnv=n.getEnvList=n.Env=void 0;const e=EF();var i;(function(u){u.DEVELOPMENT="dev",u.STAGING="stg",u.PRODUCTION="prod"})(i=n.Env||(n.Env={}));function r(){return Object.values(i)}n.getEnvList=r;function o(u){return r().includes(u)}n.isEnv=o;function a(u){if(o(u))return u;throw new Error(`Invalid value for DCL_DEFAULT_ENV. Found "${u}", possible values are ${r().map(f=>`"${f}"`).join(", ")}.`)}n.parseEnvVar=a;function s(u={}){const{DCL_DEFAULT_ENV:f,REACT_APP_DCL_DEFAULT_ENV:c,VITE_DCL_DEFAULT_ENV:h,GATSBY_DCL_DEFAULT_ENV:p}=u;if(f&&c&&f!==c)throw new Error("You have defined both DCL_DEFAULT_ENV and REACT_APP_DCL_DEFAULT_ENV with different values");if(f&&h&&f!==h)throw new Error("You have defined both DCL_DEFAULT_ENV and VITE_DCL_DEFAULT_ENV with different values");if(f&&p&&f!==p)throw new Error("You have defined both DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");if(c&&p&&c!==p)throw new Error("You have defined both REACT_APP_DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");return f?a(f):c?a(c):h?a(h):p?a(p):i.PRODUCTION}n.getDefaultEnv=s;function l(u){if(typeof window<"u"){const c=(0,e.getEnvFromQueryParam)(window.location);if(c)return c;const h=(0,e.getEnvFromTLD)(window.location);if(h)return h}return s(typeof u>"u"&&typeof process=="object"&&typeof t=="object"?t:u)}n.getEnv=l}(yv)),yv}var TR;function TF(){if(TR)return rf;TR=1,Object.defineProperty(rf,"__esModule",{value:!0}),rf.createConfig=void 0;const n=Tb();function t(e,i){const r=(0,n.getEnv)(i==null?void 0:i.systemEnvVariables),o=e[r];return{get:(a,s="")=>{if(!o)throw new Error(`Could not find a config for env=${r}`);return a in o?o[a]:s},is:a=>r===a,getEnv:()=>r}}return rf.createConfig=t,rf}var SR;function SF(){return SR||(SR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getEnv=n.Env=n.createConfig=void 0;var t=TF();Object.defineProperty(n,"createConfig",{enumerable:!0,get:function(){return t.createConfig}});var e=Tb();Object.defineProperty(n,"Env",{enumerable:!0,get:function(){return e.Env}}),Object.defineProperty(n,"getEnv",{enumerable:!0,get:function(){return e.getEnv}})}(vv)),vv}var _d=SF();const CF="https://nft-api.decentraland.zone",PF="https://peer-ap1.decentraland.zone",AF="amoy",RF={NFT_SERVER_URL:CF,PEER_URL:PF,NETWORK:AF},OF="https://nft-api.decentraland.org",MF="https://peer.decentraland.org",xF="matic",IF={NFT_SERVER_URL:OF,PEER_URL:MF,NETWORK:xF},DF="https://nft-api.decentraland.org",wF="https://peer.decentraland.org",LF="matic",NF={NFT_SERVER_URL:DF,PEER_URL:wF,NETWORK:LF},Wf=_d.createConfig({[_d.Env.DEVELOPMENT]:RF,[_d.Env.STAGING]:IF,[_d.Env.PRODUCTION]:NF});async function FF(n){return new Promise(t=>setTimeout(t,n))}async function Jl(n,t={},e=3){try{const i=await fetch(n,t);if(!i.ok)throw new Error(await i.text());return i.json()}catch(i){if(e>0)return await FF(100),Jl(n,t,e-1);throw i}}class BF{async fetchItem(t,e,i){const{data:r}=await Jl(`${i}/v1/items?contractAddress=${t}&itemId=${e}`);if(r.length===0)throw new Error(`Item not found for contractAddress="${t}" itemId="${e}"`);return r[0]}async fetchNFT(t,e,i){const{data:r}=await Jl(`${i}/v1/nfts?contractAddress=${t}&tokenId=${e}`);if(r.length===0)throw new Error(`NFT not found for contractAddress="${t}" tokenId="${e}"`);return r[0].nft}}const VF=new BF;function Sb(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(r){r(e)}),(i=n.get("*"))&&i.slice().map(function(r){r(t,e)})}}}function ko(n){return!!n&&"emoteDataADR74"in n}class bo extends Error{constructor(){super("Invalid emote")}}function CR(){return{getLength(){throw new bo},isPlaying(){throw new bo},goTo(){throw new bo},play(){throw new bo},pause(){throw new bo},stop(){throw new bo},enableSound(){throw new bo},disableSound(){throw new bo},hasSound(){throw new bo},emote:null,isSocialEmote(){throw new bo},getSocialEmoteAnimations(){throw new bo},events:Sb()}}function UF(n,t){return n.find(e=>e.data.category===t)||null}function kF(){return[Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.MOUTH,Ce.WearableCategory.EYES]}function zF(){return[Ce.WearableCategory.HAIR,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET]}function GF(){return[Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.MOUTH,Ce.WearableCategory.EYES,Ce.WearableCategory.HAIR,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET]}function WF(n,t){switch(n){case Ce.WearableCategory.EYEBROWS:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:eyebrows_00":"urn:decentraland:off-chain:base-avatars:f_eyebrows_00";case Ce.WearableCategory.MOUTH:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:mouth_00":"urn:decentraland:off-chain:base-avatars:f_mouth_00";case Ce.WearableCategory.EYES:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:eyes_00":"urn:decentraland:off-chain:base-avatars:f_eyes_00";case Ce.WearableCategory.HAIR:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:casual_hair_01":"urn:decentraland:off-chain:base-avatars:standard_hair";case Ce.WearableCategory.UPPER_BODY:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:green_hoodie":"urn:decentraland:off-chain:base-avatars:f_sweater";case Ce.WearableCategory.LOWER_BODY:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:brown_pants":"urn:decentraland:off-chain:base-avatars:f_jeans";case Ce.WearableCategory.FEET:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:sneakers":"urn:decentraland:off-chain:base-avatars:bun_shoes";default:throw new Error(`There is no default wearable for category="${n}"`)}}function as(n){return!!n&&"data"in n&&!ko(n)}function HF(n){const t=[Ce.BodyShape.MALE,Ce.BodyShape.FEMALE];return t.find(e=>n.data.representations.some(i=>i.bodyShapes.includes(e)))||t[0]}function PR(n,t,e){return t.map(i=>({...i,contents:i.contents.map(r=>({key:r,url:`${e}/content/contents/${n.content.find(o=>o.file===r).hash}`}))}))}function jF(n,t){const e=n.metadata,i=`${t}/lambdas/collections/contents/${n.metadata.id}`;return"emoteDataADR74"in e?{...e,thumbnail:`${i}/thumbnail`,image:`${i}/image`,emoteDataADR74:{...e.emoteDataADR74,representations:PR(n,e.emoteDataADR74.representations,t)}}:{...e,thumbnail:`${i}/thumbnail`,image:`${i}/image`,data:{...e.data,representations:PR(n,e.data.representations,t)}}}class XF{async fetchEntities(t,e){return t.length===0?[]:await Jl(`${e}/content/entities/active`,{method:"post",body:JSON.stringify({pointers:t}),headers:{"Content-Type":"application/json"}})}async fetchItems(t,e){if(t.length===0)return[[],[]];const i=t.map(l=>l.toLowerCase()),o=(await this.fetchEntities(i,e)).map(l=>jF(l,e)),a=o.filter(as),s=o.filter(ko);return[a,s]}async fetchProfile(t,e){try{return await Jl(`${e}/lambdas/profiles/${t}`)}catch(i){return console.error("There was an error loading the profile",i),null}}async fetchProfileEntity(t,e){try{const i=await Jl(`${e}/content/contents/${t}`);if(i.type!=="profile")throw new Error("The content is not a profile");return i.metadata}catch(i){return console.error("There was an error loading the profile",i),null}}}const Cb=new XF;function YF(){const n={};return{memo:async(t,e,...i)=>(t in n||(n[t]=e(...i)),n[t]),reset:()=>{for(const t in n)delete n[t]}}}var Ji=function(){function n(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this._environmentTexture=null,this.postProcesses=new Array}return n.AddParser=function(t,e){this._BabylonFileParsers[t]=e},n.GetParser=function(t){return this._BabylonFileParsers[t]?this._BabylonFileParsers[t]:null},n.AddIndividualParser=function(t,e){this._IndividualBabylonFileParsers[t]=e},n.GetIndividualParser=function(t){return this._IndividualBabylonFileParsers[t]?this._IndividualBabylonFileParsers[t]:null},n.Parse=function(t,e,i,r){for(var o in this._BabylonFileParsers)this._BabylonFileParsers.hasOwnProperty(o)&&this._BabylonFileParsers[o](t,e,i,r)},Object.defineProperty(n.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(t){this._environmentTexture=t},enumerable:!1,configurable:!0}),n.prototype.getNodes=function(){var t=new Array;return t=t.concat(this.meshes),t=t.concat(this.lights),t=t.concat(this.cameras),t=t.concat(this.transformNodes),this.skeletons.forEach(function(e){return t=t.concat(e.bones)}),t},n._BabylonFileParsers={},n._IndividualBabylonFileParsers={},n}(),zl=function(){function n(){this.hoverCursor="",this.actions=new Array,this.isRecursive=!1}return Object.defineProperty(n,"HasTriggers",{get:function(){for(var t in n.Triggers)if(n.Triggers.hasOwnProperty(t))return!0;return!1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HasPickTriggers",{get:function(){for(var t in n.Triggers)if(n.Triggers.hasOwnProperty(t)){var e=parseInt(t);if(e>=1&&e<=7)return!0}return!1},enumerable:!1,configurable:!0}),n.HasSpecificTrigger=function(t){for(var e in n.Triggers)if(n.Triggers.hasOwnProperty(e)){var i=parseInt(e);if(i===t)return!0}return!1},n.Triggers={},n}(),KF=function(){function n(t,e,i,r){e===void 0&&(e=!1),this.initalize(t,e,i,r)}return n.prototype.initalize=function(t,e,i,r){return e===void 0&&(e=!1),this.mask=t,this.skipNextObservers=e,this.target=i,this.currentTarget=r,this},n}(),qF=function(){function n(t,e,i){i===void 0&&(i=null),this.callback=t,this.mask=e,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1}return n}(),aq=function(){function n(){}return n.prototype.dispose=function(){if(this._observers&&this._observables)for(var t=0;t<this._observers.length;t++)this._observables[t].remove(this._observers[t]);this._observers=null,this._observables=null},n.Watch=function(t,e,i,r){i===void 0&&(i=-1),r===void 0&&(r=null);var o=new n;o._observers=new Array,o._observables=t;for(var a=0,s=t;a<s.length;a++){var l=s[a],u=l.add(e,i,!1,r);u&&o._observers.push(u)}return o},n}(),ie=function(){function n(t){this._observers=new Array,this._eventState=new KF(0),t&&(this._onObserverAdded=t)}return Object.defineProperty(n.prototype,"observers",{get:function(){return this._observers},enumerable:!1,configurable:!0}),n.prototype.add=function(t,e,i,r,o){if(e===void 0&&(e=-1),i===void 0&&(i=!1),r===void 0&&(r=null),o===void 0&&(o=!1),!t)return null;var a=new qF(t,e,r);return a.unregisterOnNextCall=o,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),a},n.prototype.addOnce=function(t){return this.add(t,void 0,void 0,void 0,!0)},n.prototype.remove=function(t){if(!t)return!1;var e=this._observers.indexOf(t);return e!==-1?(this._deferUnregister(t),!0):!1},n.prototype.removeCallback=function(t,e){for(var i=0;i<this._observers.length;i++){var r=this._observers[i];if(!r._willBeUnregistered&&r.callback===t&&(!e||e===r.scope))return this._deferUnregister(r),!0}return!1},n.prototype._deferUnregister=function(t){var e=this;t.unregisterOnNextCall=!1,t._willBeUnregistered=!0,setTimeout(function(){e._remove(t)},0)},n.prototype._remove=function(t){if(!t)return!1;var e=this._observers.indexOf(t);return e!==-1?(this._observers.splice(e,1),!0):!1},n.prototype.makeObserverTopPriority=function(t){this._remove(t),this._observers.unshift(t)},n.prototype.makeObserverBottomPriority=function(t){this._remove(t),this._observers.push(t)},n.prototype.notifyObservers=function(t,e,i,r,o){if(e===void 0&&(e=-1),!this._observers.length)return!0;var a=this._eventState;a.mask=e,a.target=i,a.currentTarget=r,a.skipNextObservers=!1,a.lastReturnValue=t,a.userInfo=o;for(var s=0,l=this._observers;s<l.length;s++){var u=l[s];if(!u._willBeUnregistered&&(u.mask&e&&(u.scope?a.lastReturnValue=u.callback.apply(u.scope,[t,a]):a.lastReturnValue=u.callback(t,a),u.unregisterOnNextCall&&this._deferUnregister(u)),a.skipNextObservers))return!1}return!0},n.prototype.notifyObserversWithPromise=function(t,e,i,r,o){var a=this;e===void 0&&(e=-1);var s=Promise.resolve(t);if(!this._observers.length)return s;var l=this._eventState;return l.mask=e,l.target=i,l.currentTarget=r,l.skipNextObservers=!1,l.userInfo=o,this._observers.forEach(function(u){l.skipNextObservers||u._willBeUnregistered||u.mask&e&&(u.scope?s=s.then(function(f){return l.lastReturnValue=f,u.callback.apply(u.scope,[t,l])}):s=s.then(function(f){return l.lastReturnValue=f,u.callback(t,l)}),u.unregisterOnNextCall&&a._deferUnregister(u))}),s.then(function(){return t})},n.prototype.notifyObserver=function(t,e,i){i===void 0&&(i=-1);var r=this._eventState;r.mask=i,r.skipNextObservers=!1,t.callback(e,r)},n.prototype.hasObservers=function(){return this._observers.length>0},n.prototype.clear=function(){this._observers=new Array,this._onObserverAdded=null},n.prototype.clone=function(){var t=new n;return t._observers=this._observers.slice(0),t},n.prototype.hasSpecificMask=function(t){t===void 0&&(t=-1);for(var e=0,i=this._observers;e<i.length;e++){var r=i[e];if(r.mask&t||r.mask===t)return!0}return!1},n}(),Ue=function(){function n(){}return n.WithinEpsilon=function(t,e,i){i===void 0&&(i=1401298e-51);var r=t-e;return-i<=r&&r<=i},n.ToHex=function(t){var e=t.toString(16);return t<=15?("0"+e).toUpperCase():e.toUpperCase()},n.Sign=function(t){return t=+t,t===0||isNaN(t)?t:t>0?1:-1},n.Clamp=function(t,e,i){return e===void 0&&(e=0),i===void 0&&(i=1),Math.min(i,Math.max(e,t))},n.Log2=function(t){return Math.log(t)*Math.LOG2E},n.Repeat=function(t,e){return t-Math.floor(t/e)*e},n.Normalize=function(t,e,i){return(t-e)/(i-e)},n.Denormalize=function(t,e,i){return t*(i-e)+e},n.DeltaAngle=function(t,e){var i=n.Repeat(e-t,360);return i>180&&(i-=360),i},n.PingPong=function(t,e){var i=n.Repeat(t,e*2);return e-Math.abs(i-e)},n.SmoothStep=function(t,e,i){var r=n.Clamp(i);return r=-2*r*r*r+3*r*r,e*r+t*(1-r)},n.MoveTowards=function(t,e,i){var r=0;return Math.abs(e-t)<=i?r=e:r=t+n.Sign(e-t)*i,r},n.MoveTowardsAngle=function(t,e,i){var r=n.DeltaAngle(t,e),o=0;return-i<r&&r<i?o=e:(e=t+r,o=n.MoveTowards(t,e,i)),o},n.Lerp=function(t,e,i){return t+(e-t)*i},n.LerpAngle=function(t,e,i){var r=n.Repeat(e-t,360);return r>180&&(r-=360),t+r*n.Clamp(i)},n.InverseLerp=function(t,e,i){var r=0;return t!=e?r=n.Clamp((i-t)/(e-t)):r=0,r},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a;return t*l+i*u+e*f+r*c},n.RandomRange=function(t,e){return t===e?t:Math.random()*(e-t)+t},n.RangeToPercent=function(t,e,i){return(t-e)/(i-e)},n.PercentToRange=function(t,e,i){return(i-e)*t+e},n.NormalizeRadians=function(t){return t-=n.TwoPi*Math.floor((t+Math.PI)/n.TwoPi),t},n.TwoPi=Math.PI*2,n}(),Uo=1/2.2,Ea=2.2,Zt=.001,or=function(){function n(){}return n.BuildArray=function(t,e){for(var i=[],r=0;r<t;++r)i.push(e());return i},n}(),Ae=function(){function n(){}return n.GetClass=function(t){return this.RegisteredTypes&&this.RegisteredTypes[t]?this.RegisteredTypes[t]:null},n.RegisteredTypes={},n}(),Qa=function(){function n(){}return n.SetMatrixPrecision=function(t){if(n.MatrixTrackPrecisionChange=!1,t&&!n.MatrixUse64Bits&&n.MatrixTrackedMatrices)for(var e=0;e<n.MatrixTrackedMatrices.length;++e){var i=n.MatrixTrackedMatrices[e],r=i._m;i._m=new Array(16);for(var o=0;o<16;++o)i._m[o]=r[o]}n.MatrixUse64Bits=t,n.MatrixCurrentType=n.MatrixUse64Bits?Array:Float32Array,n.MatrixTrackedMatrices=null},n.MatrixUse64Bits=!1,n.MatrixTrackPrecisionChange=!0,n.MatrixCurrentType=Float32Array,n.MatrixTrackedMatrices=[],n}(),Ie=function(){function n(t,e){t===void 0&&(t=0),e===void 0&&(e=0),this.x=t,this.y=e}return n.prototype.toString=function(){return"{X: "+this.x+" Y: "+this.y+"}"},n.prototype.getClassName=function(){return"Vector2"},n.prototype.getHashCode=function(){var t=this.x|0;return t=t*397^(this.y|0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this},n.prototype.copyFromFloats=function(t,e){return this.x=t,this.y=e,this},n.prototype.set=function(t,e){return this.copyFromFloats(t,e)},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y)},n.prototype.addToRef=function(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,this},n.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this},n.prototype.addVector3=function(t){return new n(this.x+t.x,this.y+t.y)},n.prototype.subtract=function(t){return new n(this.x-t.x,this.y-t.y)},n.prototype.subtractToRef=function(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,this},n.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this},n.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this},n.prototype.multiply=function(t){return new n(this.x*t.x,this.y*t.y)},n.prototype.multiplyToRef=function(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,this},n.prototype.multiplyByFloats=function(t,e){return new n(this.x*t,this.y*e)},n.prototype.divide=function(t){return new n(this.x/t.x,this.y/t.y)},n.prototype.divideToRef=function(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,this},n.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},n.prototype.negate=function(){return new n(-this.x,-this.y)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this},n.prototype.negateToRef=function(t){return t.copyFromFloats(this.x*-1,this.y*-1)},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this},n.prototype.scale=function(t){var e=new n(0,0);return this.scaleToRef(t,e),e},n.prototype.scaleToRef=function(t,e){return e.x=this.x*t,e.y=this.y*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.x+=this.x*t,e.y+=this.y*t,this},n.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this.x,t.x,e)&&Ue.WithinEpsilon(this.y,t.y,e)},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y))},n.prototype.fract=function(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var t=this.length();return t===0?this:(this.x/=t,this.y/=t,this)},n.prototype.clone=function(){return new n(this.x,this.y)},n.Zero=function(){return new n(0,0)},n.One=function(){return new n(1,1)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1])},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1]},n.CatmullRom=function(t,e,i,r,o){var a=o*o,s=o*a,l=.5*(2*e.x+(-t.x+i.x)*o+(2*t.x-5*e.x+4*i.x-r.x)*a+(-t.x+3*e.x-3*i.x+r.x)*s),u=.5*(2*e.y+(-t.y+i.y)*o+(2*t.y-5*e.y+4*i.y-r.y)*a+(-t.y+3*e.y-3*i.y+r.y)*s);return new n(l,u)},n.Clamp=function(t,e,i){var r=t.x;r=r>i.x?i.x:r,r=r<e.x?e.x:r;var o=t.y;return o=o>i.y?i.y:o,o=o<e.y?e.y:o,new n(r,o)},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a,h=t.x*l+i.x*u+e.x*f+r.x*c,p=t.y*l+i.y*u+e.y*f+r.y*c;return new n(h,p)},n.Lerp=function(t,e,i){var r=t.x+(e.x-t.x)*i,o=t.y+(e.y-t.y)*i;return new n(r,o)},n.Dot=function(t,e){return t.x*e.x+t.y*e.y},n.Normalize=function(t){var e=t.clone();return e.normalize(),e},n.Minimize=function(t,e){var i=t.x<e.x?t.x:e.x,r=t.y<e.y?t.y:e.y;return new n(i,r)},n.Maximize=function(t,e){var i=t.x>e.x?t.x:e.x,r=t.y>e.y?t.y:e.y;return new n(i,r)},n.Transform=function(t,e){var i=n.Zero();return n.TransformToRef(t,e,i),i},n.TransformToRef=function(t,e,i){var r=e.m,o=t.x*r[0]+t.y*r[4]+r[12],a=t.x*r[1]+t.y*r[5]+r[13];i.x=o,i.y=a},n.PointInTriangle=function(t,e,i,r){var o=.5*(-i.y*r.x+e.y*(-i.x+r.x)+e.x*(i.y-r.y)+i.x*r.y),a=o<0?-1:1,s=(e.y*r.x-e.x*r.y+(r.y-e.y)*t.x+(e.x-r.x)*t.y)*a,l=(e.x*i.y-e.y*i.x+(e.y-i.y)*t.x+(i.x-e.x)*t.y)*a;return s>0&&l>0&&s+l<2*o*a},n.Distance=function(t,e){return Math.sqrt(n.DistanceSquared(t,e))},n.DistanceSquared=function(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r},n.Center=function(t,e){var i=t.add(e);return i.scaleInPlace(.5),i},n.DistanceOfPointFromSegment=function(t,e,i){var r=n.DistanceSquared(e,i);if(r===0)return n.Distance(t,e);var o=i.subtract(e),a=Math.max(0,Math.min(1,n.Dot(t.subtract(e),o)/r)),s=e.add(o.multiplyByFloats(a,a));return n.Distance(t,s)},n}(),y=function(){function n(t,e,i){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),this._isDirty=!0,this._x=t,this._y=e,this._z=i}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+"}"},n.prototype.getClassName=function(){return"Vector3"},n.prototype.getHashCode=function(){var t=this._x|0;return t=t*397^(this._y|0),t=t*397^(this._z|0),t},n.prototype.asArray=function(){var t=[];return this.toArray(t,0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.toQuaternion=function(){return Re.RotationYawPitchRoll(this._y,this._x,this._z)},n.prototype.addInPlace=function(t){return this.addInPlaceFromFloats(t._x,t._y,t._z)},n.prototype.addInPlaceFromFloats=function(t,e,i){return this.x+=t,this.y+=e,this.z+=i,this},n.prototype.add=function(t){return new n(this._x+t._x,this._y+t._y,this._z+t._z)},n.prototype.addToRef=function(t,e){return e.copyFromFloats(this._x+t._x,this._y+t._y,this._z+t._z)},n.prototype.subtractInPlace=function(t){return this.x-=t._x,this.y-=t._y,this.z-=t._z,this},n.prototype.subtract=function(t){return new n(this._x-t._x,this._y-t._y,this._z-t._z)},n.prototype.subtractToRef=function(t,e){return this.subtractFromFloatsToRef(t._x,t._y,t._z,e)},n.prototype.subtractFromFloats=function(t,e,i){return new n(this._x-t,this._y-e,this._z-i)},n.prototype.subtractFromFloatsToRef=function(t,e,i,r){return r.copyFromFloats(this._x-t,this._y-e,this._z-i)},n.prototype.negate=function(){return new n(-this._x,-this._y,-this._z)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.negateToRef=function(t){return t.copyFromFloats(this._x*-1,this._y*-1,this._z*-1)},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.scale=function(t){return new n(this._x*t,this._y*t,this._z*t)},n.prototype.scaleToRef=function(t,e){return e.copyFromFloats(this._x*t,this._y*t,this._z*t)},n.prototype.scaleAndAddToRef=function(t,e){return e.addInPlaceFromFloats(this._x*t,this._y*t,this._z*t)},n.prototype.projectOnPlane=function(t,e){var i=n.Zero();return this.projectOnPlaneToRef(t,e,i),i},n.prototype.projectOnPlaneToRef=function(t,e,i){var r=t.normal,o=t.d,a=Qt.Vector3[0];this.subtractToRef(e,a),a.normalize();var s=n.Dot(a,r),l=-(n.Dot(e,r)+o)/s,u=a.scaleInPlace(l);e.addToRef(u,i)},n.prototype.equals=function(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this._x,t._x,e)&&Ue.WithinEpsilon(this._y,t._y,e)&&Ue.WithinEpsilon(this._z,t._z,e)},n.prototype.equalsToFloats=function(t,e,i){return this._x===t&&this._y===e&&this._z===i},n.prototype.multiplyInPlace=function(t){return this.x*=t._x,this.y*=t._y,this.z*=t._z,this},n.prototype.multiply=function(t){return this.multiplyByFloats(t._x,t._y,t._z)},n.prototype.multiplyToRef=function(t,e){return e.copyFromFloats(this._x*t._x,this._y*t._y,this._z*t._z)},n.prototype.multiplyByFloats=function(t,e,i){return new n(this._x*t,this._y*e,this._z*i)},n.prototype.divide=function(t){return new n(this._x/t._x,this._y/t._y,this._z/t._z)},n.prototype.divideToRef=function(t,e){return e.copyFromFloats(this._x/t._x,this._y/t._y,this._z/t._z)},n.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},n.prototype.minimizeInPlace=function(t){return this.minimizeInPlaceFromFloats(t._x,t._y,t._z)},n.prototype.maximizeInPlace=function(t){return this.maximizeInPlaceFromFloats(t._x,t._y,t._z)},n.prototype.minimizeInPlaceFromFloats=function(t,e,i){return t<this._x&&(this.x=t),e<this._y&&(this.y=e),i<this._z&&(this.z=i),this},n.prototype.maximizeInPlaceFromFloats=function(t,e,i){return t>this._x&&(this.x=t),e>this._y&&(this.y=e),i>this._z&&(this.z=i),this},n.prototype.isNonUniformWithinEpsilon=function(t){var e=Math.abs(this._x),i=Math.abs(this._y);if(!Ue.WithinEpsilon(e,i,t))return!0;var r=Math.abs(this._z);return!Ue.WithinEpsilon(e,r,t)||!Ue.WithinEpsilon(i,r,t)},Object.defineProperty(n.prototype,"isNonUniform",{get:function(){var t=Math.abs(this._x),e=Math.abs(this._y);if(t!==e)return!0;var i=Math.abs(this._z);return t!==i},enumerable:!1,configurable:!0}),n.prototype.floor=function(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))},n.prototype.fract=function(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)},n.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z},n.prototype.normalize=function(){return this.normalizeFromLength(this.length())},n.prototype.reorderInPlace=function(t){var e=this;return t=t.toLowerCase(),t==="xyz"?this:(Qt.Vector3[0].copyFrom(this),["x","y","z"].forEach(function(i,r){e[i]=Qt.Vector3[0][t[r]]}),this)},n.prototype.rotateByQuaternionToRef=function(t,e){return t.toRotationMatrix(Qt.Matrix[0]),n.TransformCoordinatesToRef(this,Qt.Matrix[0],e),e},n.prototype.rotateByQuaternionAroundPointToRef=function(t,e,i){return this.subtractToRef(e,Qt.Vector3[0]),Qt.Vector3[0].rotateByQuaternionToRef(t,Qt.Vector3[0]),e.addToRef(Qt.Vector3[0],i),i},n.prototype.cross=function(t){return n.Cross(this,t)},n.prototype.normalizeFromLength=function(t){return t===0||t===1?this:this.scaleInPlace(1/t)},n.prototype.normalizeToNew=function(){var t=new n(0,0,0);return this.normalizeToRef(t),t},n.prototype.normalizeToRef=function(t){var e=this.length();return e===0||e===1?t.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/e,t)},n.prototype.clone=function(){return new n(this._x,this._y,this._z)},n.prototype.copyFrom=function(t){return this.copyFromFloats(t._x,t._y,t._z)},n.prototype.copyFromFloats=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},n.prototype.set=function(t,e,i){return this.copyFromFloats(t,e,i)},n.prototype.setAll=function(t){return this.x=this.y=this.z=t,this},n.GetClipFactor=function(t,e,i,r){var o=n.Dot(t,i)-r,a=n.Dot(e,i)-r,s=o/(o-a);return s},n.GetAngleBetweenVectors=function(t,e,i){var r=t.normalizeToRef(Qt.Vector3[1]),o=e.normalizeToRef(Qt.Vector3[2]),a=n.Dot(r,o),s=Qt.Vector3[3];return n.CrossToRef(r,o,s),n.Dot(s,i)>0?Math.acos(a):-Math.acos(a)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1],t[e+2])},n.FromFloatArray=function(t,e){return n.FromArray(t,e)},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1],i.z=t[e+2]},n.FromFloatArrayToRef=function(t,e,i){return n.FromArrayToRef(t,e,i)},n.FromFloatsToRef=function(t,e,i,r){r.copyFromFloats(t,e,i)},n.Zero=function(){return new n(0,0,0)},n.One=function(){return new n(1,1,1)},n.Up=function(){return new n(0,1,0)},Object.defineProperty(n,"UpReadOnly",{get:function(){return n._UpReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(n,"ZeroReadOnly",{get:function(){return n._ZeroReadOnly},enumerable:!1,configurable:!0}),n.Down=function(){return new n(0,-1,0)},n.Forward=function(t){return t===void 0&&(t=!1),new n(0,0,t?-1:1)},n.Backward=function(t){return t===void 0&&(t=!1),new n(0,0,t?1:-1)},n.Right=function(){return new n(1,0,0)},n.Left=function(){return new n(-1,0,0)},n.TransformCoordinates=function(t,e){var i=n.Zero();return n.TransformCoordinatesToRef(t,e,i),i},n.TransformCoordinatesToRef=function(t,e,i){n.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,i)},n.TransformCoordinatesFromFloatsToRef=function(t,e,i,r,o){var a=r.m,s=t*a[0]+e*a[4]+i*a[8]+a[12],l=t*a[1]+e*a[5]+i*a[9]+a[13],u=t*a[2]+e*a[6]+i*a[10]+a[14],f=1/(t*a[3]+e*a[7]+i*a[11]+a[15]);o.x=s*f,o.y=l*f,o.z=u*f},n.TransformNormal=function(t,e){var i=n.Zero();return n.TransformNormalToRef(t,e,i),i},n.TransformNormalToRef=function(t,e,i){this.TransformNormalFromFloatsToRef(t._x,t._y,t._z,e,i)},n.TransformNormalFromFloatsToRef=function(t,e,i,r,o){var a=r.m;o.x=t*a[0]+e*a[4]+i*a[8],o.y=t*a[1]+e*a[5]+i*a[9],o.z=t*a[2]+e*a[6]+i*a[10]},n.CatmullRom=function(t,e,i,r,o){var a=o*o,s=o*a,l=.5*(2*e._x+(-t._x+i._x)*o+(2*t._x-5*e._x+4*i._x-r._x)*a+(-t._x+3*e._x-3*i._x+r._x)*s),u=.5*(2*e._y+(-t._y+i._y)*o+(2*t._y-5*e._y+4*i._y-r._y)*a+(-t._y+3*e._y-3*i._y+r._y)*s),f=.5*(2*e._z+(-t._z+i._z)*o+(2*t._z-5*e._z+4*i._z-r._z)*a+(-t._z+3*e._z-3*i._z+r._z)*s);return new n(l,u,f)},n.Clamp=function(t,e,i){var r=new n;return n.ClampToRef(t,e,i,r),r},n.ClampToRef=function(t,e,i,r){var o=t._x;o=o>i._x?i._x:o,o=o<e._x?e._x:o;var a=t._y;a=a>i._y?i._y:a,a=a<e._y?e._y:a;var s=t._z;s=s>i._z?i._z:s,s=s<e._z?e._z:s,r.copyFromFloats(o,a,s)},n.CheckExtends=function(t,e,i){e.minimizeInPlace(t),i.maximizeInPlace(t)},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a,h=t._x*l+i._x*u+e._x*f+r._x*c,p=t._y*l+i._y*u+e._y*f+r._y*c,_=t._z*l+i._z*u+e._z*f+r._z*c;return new n(h,p,_)},n.Lerp=function(t,e,i){var r=new n(0,0,0);return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){r.x=t._x+(e._x-t._x)*i,r.y=t._y+(e._y-t._y)*i,r.z=t._z+(e._z-t._z)*i},n.Dot=function(t,e){return t._x*e._x+t._y*e._y+t._z*e._z},n.Cross=function(t,e){var i=n.Zero();return n.CrossToRef(t,e,i),i},n.CrossToRef=function(t,e,i){var r=t._y*e._z-t._z*e._y,o=t._z*e._x-t._x*e._z,a=t._x*e._y-t._y*e._x;i.copyFromFloats(r,o,a)},n.Normalize=function(t){var e=n.Zero();return n.NormalizeToRef(t,e),e},n.NormalizeToRef=function(t,e){t.normalizeToRef(e)},n.Project=function(t,e,i,r){var o=new n;return n.ProjectToRef(t,e,i,r,o),o},n.ProjectToRef=function(t,e,i,r,o){var a=r.width,s=r.height,l=r.x,u=r.y,f=Qt.Matrix[1];te.FromValuesToRef(a/2,0,0,0,0,-s/2,0,0,0,0,.5,0,l+a/2,s/2+u,.5,1,f);var c=Qt.Matrix[0];return e.multiplyToRef(i,c),c.multiplyToRef(f,c),n.TransformCoordinatesToRef(t,c,o),o},n._UnprojectFromInvertedMatrixToRef=function(t,e,i){n.TransformCoordinatesToRef(t,e,i);var r=e.m,o=t._x*r[3]+t._y*r[7]+t._z*r[11]+r[15];Ue.WithinEpsilon(o,1)&&i.scaleInPlace(1/o)},n.UnprojectFromTransform=function(t,e,i,r,o){var a=Qt.Matrix[0];r.multiplyToRef(o,a),a.invert(),t.x=t._x/e*2-1,t.y=-(t._y/i*2-1);var s=new n;return n._UnprojectFromInvertedMatrixToRef(t,a,s),s},n.Unproject=function(t,e,i,r,o,a){var s=n.Zero();return n.UnprojectToRef(t,e,i,r,o,a,s),s},n.UnprojectToRef=function(t,e,i,r,o,a,s){n.UnprojectFloatsToRef(t._x,t._y,t._z,e,i,r,o,a,s)},n.UnprojectFloatsToRef=function(t,e,i,r,o,a,s,l,u){var f=Qt.Matrix[0];a.multiplyToRef(s,f),f.multiplyToRef(l,f),f.invert();var c=Qt.Vector3[0];c.x=t/r*2-1,c.y=-(e/o*2-1),c.z=2*i-1,n._UnprojectFromInvertedMatrixToRef(c,f,u)},n.Minimize=function(t,e){var i=t.clone();return i.minimizeInPlace(e),i},n.Maximize=function(t,e){var i=t.clone();return i.maximizeInPlace(e),i},n.Distance=function(t,e){return Math.sqrt(n.DistanceSquared(t,e))},n.DistanceSquared=function(t,e){var i=t._x-e._x,r=t._y-e._y,o=t._z-e._z;return i*i+r*r+o*o},n.Center=function(t,e){var i=t.add(e);return i.scaleInPlace(.5),i},n.RotationFromAxis=function(t,e,i){var r=n.Zero();return n.RotationFromAxisToRef(t,e,i,r),r},n.RotationFromAxisToRef=function(t,e,i,r){var o=Qt.Quaternion[0];Re.RotationQuaternionFromAxisToRef(t,e,i,o),o.toEulerAnglesToRef(r)},n._UpReadOnly=n.Up(),n._ZeroReadOnly=n.Zero(),n}(),ni=function(){function n(t,e,i,r){this.x=t,this.y=e,this.z=i,this.w=r}return n.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+" Z:"+this.z+" W:"+this.w+"}"},n.prototype.getClassName=function(){return"Vector4"},n.prototype.getHashCode=function(){var t=this.x|0;return t=t*397^(this.y|0),t=t*397^(this.z|0),t=t*397^(this.w|0),t},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)},n.prototype.addToRef=function(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e.w=this.w+t.w,this},n.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},n.prototype.subtract=function(t){return new n(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)},n.prototype.subtractToRef=function(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z,e.w=this.w-t.w,this},n.prototype.subtractFromFloats=function(t,e,i,r){return new n(this.x-t,this.y-e,this.z-i,this.w-r)},n.prototype.subtractFromFloatsToRef=function(t,e,i,r,o){return o.x=this.x-t,o.y=this.y-e,o.z=this.z-i,o.w=this.w-r,this},n.prototype.negate=function(){return new n(-this.x,-this.y,-this.z,-this.w)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this},n.prototype.negateToRef=function(t){return t.copyFromFloats(this.x*-1,this.y*-1,this.z*-1,this.w*-1)},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.prototype.scale=function(t){return new n(this.x*t,this.y*t,this.z*t,this.w*t)},n.prototype.scaleToRef=function(t,e){return e.x=this.x*t,e.y=this.y*t,e.z=this.z*t,e.w=this.w*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.x+=this.x*t,e.y+=this.y*t,e.z+=this.z*t,e.w+=this.w*t,this},n.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this.x,t.x,e)&&Ue.WithinEpsilon(this.y,t.y,e)&&Ue.WithinEpsilon(this.z,t.z,e)&&Ue.WithinEpsilon(this.w,t.w,e)},n.prototype.equalsToFloats=function(t,e,i,r){return this.x===t&&this.y===e&&this.z===i&&this.w===r},n.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},n.prototype.multiply=function(t){return new n(this.x*t.x,this.y*t.y,this.z*t.z,this.w*t.w)},n.prototype.multiplyToRef=function(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,e.z=this.z*t.z,e.w=this.w*t.w,this},n.prototype.multiplyByFloats=function(t,e,i,r){return new n(this.x*t,this.y*e,this.z*i,this.w*r)},n.prototype.divide=function(t){return new n(this.x/t.x,this.y/t.y,this.z/t.z,this.w/t.w)},n.prototype.divideToRef=function(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,e.z=this.z/t.z,e.w=this.w/t.w,this},n.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},n.prototype.minimizeInPlace=function(t){return t.x<this.x&&(this.x=t.x),t.y<this.y&&(this.y=t.y),t.z<this.z&&(this.z=t.z),t.w<this.w&&(this.w=t.w),this},n.prototype.maximizeInPlace=function(t){return t.x>this.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},n.prototype.fract=function(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},n.prototype.normalize=function(){var t=this.length();return t===0?this:this.scaleInPlace(1/t)},n.prototype.toVector3=function(){return new y(this.x,this.y,this.z)},n.prototype.clone=function(){return new n(this.x,this.y,this.z,this.w)},n.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},n.prototype.copyFromFloats=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},n.prototype.set=function(t,e,i,r){return this.copyFromFloats(t,e,i,r)},n.prototype.setAll=function(t){return this.x=this.y=this.z=this.w=t,this},n.FromArray=function(t,e){return e||(e=0),new n(t[e],t[e+1],t[e+2],t[e+3])},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1],i.z=t[e+2],i.w=t[e+3]},n.FromFloatArrayToRef=function(t,e,i){n.FromArrayToRef(t,e,i)},n.FromFloatsToRef=function(t,e,i,r,o){o.x=t,o.y=e,o.z=i,o.w=r},n.Zero=function(){return new n(0,0,0,0)},n.One=function(){return new n(1,1,1,1)},n.Normalize=function(t){var e=n.Zero();return n.NormalizeToRef(t,e),e},n.NormalizeToRef=function(t,e){e.copyFrom(t),e.normalize()},n.Minimize=function(t,e){var i=t.clone();return i.minimizeInPlace(e),i},n.Maximize=function(t,e){var i=t.clone();return i.maximizeInPlace(e),i},n.Distance=function(t,e){return Math.sqrt(n.DistanceSquared(t,e))},n.DistanceSquared=function(t,e){var i=t.x-e.x,r=t.y-e.y,o=t.z-e.z,a=t.w-e.w;return i*i+r*r+o*o+a*a},n.Center=function(t,e){var i=t.add(e);return i.scaleInPlace(.5),i},n.TransformNormal=function(t,e){var i=n.Zero();return n.TransformNormalToRef(t,e,i),i},n.TransformNormalToRef=function(t,e,i){var r=e.m,o=t.x*r[0]+t.y*r[4]+t.z*r[8],a=t.x*r[1]+t.y*r[5]+t.z*r[9],s=t.x*r[2]+t.y*r[6]+t.z*r[10];i.x=o,i.y=a,i.z=s,i.w=t.w},n.TransformNormalFromFloatsToRef=function(t,e,i,r,o,a){var s=o.m;a.x=t*s[0]+e*s[4]+i*s[8],a.y=t*s[1]+e*s[5]+i*s[9],a.z=t*s[2]+e*s[6]+i*s[10],a.w=r},n.FromVector3=function(t,e){return e===void 0&&(e=0),new n(t._x,t._y,t._z,e)},n}(),Re=function(){function n(t,e,i,r){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),r===void 0&&(r=1),this._isDirty=!0,this._x=t,this._y=e,this._z=i,this._w=r}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"w",{get:function(){return this._w},set:function(t){this._w=t,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+" W:"+this._w+"}"},n.prototype.getClassName=function(){return"Quaternion"},n.prototype.getHashCode=function(){var t=this._x|0;return t=t*397^(this._y|0),t=t*397^(this._z|0),t=t*397^(this._w|0),t},n.prototype.asArray=function(){return[this._x,this._y,this._z,this._w]},n.prototype.equals=function(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z&&this._w===t._w},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this._x,t._x,e)&&Ue.WithinEpsilon(this._y,t._y,e)&&Ue.WithinEpsilon(this._z,t._z,e)&&Ue.WithinEpsilon(this._w,t._w,e)},n.prototype.clone=function(){return new n(this._x,this._y,this._z,this._w)},n.prototype.copyFrom=function(t){return this.x=t._x,this.y=t._y,this.z=t._z,this.w=t._w,this},n.prototype.copyFromFloats=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},n.prototype.set=function(t,e,i,r){return this.copyFromFloats(t,e,i,r)},n.prototype.add=function(t){return new n(this._x+t._x,this._y+t._y,this._z+t._z,this._w+t._w)},n.prototype.addInPlace=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this._w+=t._w,this},n.prototype.subtract=function(t){return new n(this._x-t._x,this._y-t._y,this._z-t._z,this._w-t._w)},n.prototype.scale=function(t){return new n(this._x*t,this._y*t,this._z*t,this._w*t)},n.prototype.scaleToRef=function(t,e){return e.x=this._x*t,e.y=this._y*t,e.z=this._z*t,e.w=this._w*t,this},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.x+=this._x*t,e.y+=this._y*t,e.z+=this._z*t,e.w+=this._w*t,this},n.prototype.multiply=function(t){var e=new n(0,0,0,1);return this.multiplyToRef(t,e),e},n.prototype.multiplyToRef=function(t,e){var i=this._x*t._w+this._y*t._z-this._z*t._y+this._w*t._x,r=-this._x*t._z+this._y*t._w+this._z*t._x+this._w*t._y,o=this._x*t._y-this._y*t._x+this._z*t._w+this._w*t._z,a=-this._x*t._x-this._y*t._y-this._z*t._z+this._w*t._w;return e.copyFromFloats(i,r,o,a),this},n.prototype.multiplyInPlace=function(t){return this.multiplyToRef(t,this),this},n.prototype.conjugateToRef=function(t){return t.copyFromFloats(-this._x,-this._y,-this._z,this._w),this},n.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.conjugate=function(){var t=new n(-this._x,-this._y,-this._z,this._w);return t},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},n.prototype.normalize=function(){var t=this.length();if(t===0)return this;var e=1/t;return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},n.prototype.toEulerAngles=function(t){var e=y.Zero();return this.toEulerAnglesToRef(e),e},n.prototype.toEulerAnglesToRef=function(t){var e=this._z,i=this._x,r=this._y,o=this._w,a=o*o,s=e*e,l=i*i,u=r*r,f=r*e-i*o,c=.4999999;return f<-c?(t.y=2*Math.atan2(r,o),t.x=Math.PI/2,t.z=0):f>c?(t.y=2*Math.atan2(r,o),t.x=-Math.PI/2,t.z=0):(t.z=Math.atan2(2*(i*r+e*o),-s-l+u+a),t.x=Math.asin(-2*(e*r-i*o)),t.y=Math.atan2(2*(e*i+r*o),s-l-u+a)),this},n.prototype.toRotationMatrix=function(t){return te.FromQuaternionToRef(this,t),this},n.prototype.fromRotationMatrix=function(t){return n.FromRotationMatrixToRef(t,this),this},n.FromRotationMatrix=function(t){var e=new n;return n.FromRotationMatrixToRef(t,e),e},n.FromRotationMatrixToRef=function(t,e){var i=t.m,r=i[0],o=i[4],a=i[8],s=i[1],l=i[5],u=i[9],f=i[2],c=i[6],h=i[10],p=r+l+h,_;p>0?(_=.5/Math.sqrt(p+1),e.w=.25/_,e.x=(c-u)*_,e.y=(a-f)*_,e.z=(s-o)*_):r>l&&r>h?(_=2*Math.sqrt(1+r-l-h),e.w=(c-u)/_,e.x=.25*_,e.y=(o+s)/_,e.z=(a+f)/_):l>h?(_=2*Math.sqrt(1+l-r-h),e.w=(a-f)/_,e.x=(o+s)/_,e.y=.25*_,e.z=(u+c)/_):(_=2*Math.sqrt(1+h-r-l),e.w=(s-o)/_,e.x=(a+f)/_,e.y=(u+c)/_,e.z=.25*_)},n.Dot=function(t,e){return t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w},n.AreClose=function(t,e){var i=n.Dot(t,e);return i>=0},n.Zero=function(){return new n(0,0,0,0)},n.Inverse=function(t){return new n(-t._x,-t._y,-t._z,t._w)},n.InverseToRef=function(t,e){return e.set(-t._x,-t._y,-t._z,t._w),e},n.Identity=function(){return new n(0,0,0,1)},n.IsIdentity=function(t){return t&&t._x===0&&t._y===0&&t._z===0&&t._w===1},n.RotationAxis=function(t,e){return n.RotationAxisToRef(t,e,new n)},n.RotationAxisToRef=function(t,e,i){var r=Math.sin(e/2);return t.normalize(),i.w=Math.cos(e/2),i.x=t._x*r,i.y=t._y*r,i.z=t._z*r,i},n.FromArray=function(t,e){return e||(e=0),new n(t[e],t[e+1],t[e+2],t[e+3])},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1],i.z=t[e+2],i.w=t[e+3]},n.FromEulerAngles=function(t,e,i){var r=new n;return n.RotationYawPitchRollToRef(e,t,i,r),r},n.FromEulerAnglesToRef=function(t,e,i,r){return n.RotationYawPitchRollToRef(e,t,i,r),r},n.FromEulerVector=function(t){var e=new n;return n.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e},n.FromEulerVectorToRef=function(t,e){return n.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e},n.RotationYawPitchRoll=function(t,e,i){var r=new n;return n.RotationYawPitchRollToRef(t,e,i,r),r},n.RotationYawPitchRollToRef=function(t,e,i,r){var o=i*.5,a=e*.5,s=t*.5,l=Math.sin(o),u=Math.cos(o),f=Math.sin(a),c=Math.cos(a),h=Math.sin(s),p=Math.cos(s);r.x=p*f*u+h*c*l,r.y=h*c*u-p*f*l,r.z=p*c*l-h*f*u,r.w=p*c*u+h*f*l},n.RotationAlphaBetaGamma=function(t,e,i){var r=new n;return n.RotationAlphaBetaGammaToRef(t,e,i,r),r},n.RotationAlphaBetaGammaToRef=function(t,e,i,r){var o=(i+t)*.5,a=(i-t)*.5,s=e*.5;r.x=Math.cos(a)*Math.sin(s),r.y=Math.sin(a)*Math.sin(s),r.z=Math.sin(o)*Math.cos(s),r.w=Math.cos(o)*Math.cos(s)},n.RotationQuaternionFromAxis=function(t,e,i){var r=new n(0,0,0,0);return n.RotationQuaternionFromAxisToRef(t,e,i,r),r},n.RotationQuaternionFromAxisToRef=function(t,e,i,r){var o=Qt.Matrix[0];te.FromXYZAxesToRef(t.normalize(),e.normalize(),i.normalize(),o),n.FromRotationMatrixToRef(o,r)},n.Slerp=function(t,e,i){var r=n.Identity();return n.SlerpToRef(t,e,i,r),r},n.SlerpToRef=function(t,e,i,r){var o,a,s=t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w,l=!1;if(s<0&&(l=!0,s=-s),s>.999999)a=1-i,o=l?-i:i;else{var u=Math.acos(s),f=1/Math.sin(u);a=Math.sin((1-i)*u)*f,o=l?-Math.sin(i*u)*f:Math.sin(i*u)*f}r.x=a*t._x+o*e._x,r.y=a*t._y+o*e._y,r.z=a*t._z+o*e._z,r.w=a*t._w+o*e._w},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a,h=t._x*l+i._x*u+e._x*f+r._x*c,p=t._y*l+i._y*u+e._y*f+r._y*c,_=t._z*l+i._z*u+e._z*f+r._z*c,g=t._w*l+i._w*u+e._w*f+r._w*c;return new n(h,p,_,g)},n}(),te=function(){function n(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,Qa.MatrixTrackPrecisionChange&&Qa.MatrixTrackedMatrices.push(this),this._m=new Qa.MatrixCurrentType(16),this._updateIdentityStatus(!1)}return Object.defineProperty(n,"Use64Bits",{get:function(){return Qa.MatrixUse64Bits},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"m",{get:function(){return this._m},enumerable:!1,configurable:!0}),n.prototype._markAsUpdated=function(){this.updateFlag=n._updateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},n.prototype._updateIdentityStatus=function(t,e,i,r){e===void 0&&(e=!1),i===void 0&&(i=!1),r===void 0&&(r=!0),this.updateFlag=n._updateFlagSeed++,this._isIdentity=t,this._isIdentity3x2=t||i,this._isIdentityDirty=this._isIdentity?!1:e,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:r},n.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var t=this._m;this._isIdentity=t[0]===1&&t[1]===0&&t[2]===0&&t[3]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[7]===0&&t[8]===0&&t[9]===0&&t[10]===1&&t[11]===0&&t[12]===0&&t[13]===0&&t[14]===0&&t[15]===1}return this._isIdentity},n.prototype.isIdentityAs3x2=function(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2},n.prototype.determinant=function(){if(this._isIdentity===!0)return 1;var t=this._m,e=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],f=t[8],c=t[9],h=t[10],p=t[11],_=t[12],g=t[13],v=t[14],E=t[15],T=h*E-v*p,S=c*E-g*p,C=c*v-g*h,O=f*E-_*p,A=f*v-h*_,M=f*g-_*c,D=+(s*T-l*S+u*C),U=-(a*T-l*O+u*A),V=+(a*S-s*O+u*M),B=-(a*C-s*A+l*M);return e*D+i*U+r*V+o*B},n.prototype.toArray=function(){return this._m},n.prototype.asArray=function(){return this._m},n.prototype.invert=function(){return this.invertToRef(this),this},n.prototype.reset=function(){return n.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},n.prototype.add=function(t){var e=new n;return this.addToRef(t,e),e},n.prototype.addToRef=function(t,e){for(var i=this._m,r=e._m,o=t.m,a=0;a<16;a++)r[a]=i[a]+o[a];return e._markAsUpdated(),this},n.prototype.addToSelf=function(t){for(var e=this._m,i=t.m,r=0;r<16;r++)e[r]+=i[r];return this._markAsUpdated(),this},n.prototype.invertToRef=function(t){if(this._isIdentity===!0)return n.IdentityToRef(t),this;var e=this._m,i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=e[9],p=e[10],_=e[11],g=e[12],v=e[13],E=e[14],T=e[15],S=p*T-E*_,C=h*T-v*_,O=h*E-v*p,A=c*T-g*_,M=c*E-p*g,D=c*v-g*h,U=+(l*S-u*C+f*O),V=-(s*S-u*A+f*M),B=+(s*C-l*A+f*D),z=-(s*O-l*M+u*D),J=i*U+r*V+o*B+a*z;if(J===0)return t.copyFrom(this),this;var X=1/J,re=u*T-E*f,ae=l*T-v*f,se=l*E-v*u,H=s*T-g*f,Z=s*E-g*u,q=s*v-g*l,N=u*_-p*f,W=l*_-h*f,$=l*p-h*u,L=s*_-c*f,G=s*p-c*u,Y=s*h-c*l,Q=-(r*S-o*C+a*O),fe=+(i*S-o*A+a*M),Se=-(i*C-r*A+a*D),ee=+(i*O-r*M+o*D),pe=+(r*re-o*ae+a*se),Pe=-(i*re-o*H+a*Z),xe=+(i*ae-r*H+a*q),We=-(i*se-r*Z+o*q),je=-(r*N-o*W+a*$),Xe=+(i*N-o*L+a*G),ft=-(i*W-r*L+a*Y),we=+(i*$-r*G+o*Y);return n.FromValuesToRef(U*X,Q*X,pe*X,je*X,V*X,fe*X,Pe*X,Xe*X,B*X,Se*X,xe*X,ft*X,z*X,ee*X,We*X,we*X,t),this},n.prototype.addAtIndex=function(t,e){return this._m[t]+=e,this._markAsUpdated(),this},n.prototype.multiplyAtIndex=function(t,e){return this._m[t]*=e,this._markAsUpdated(),this},n.prototype.setTranslationFromFloats=function(t,e,i){return this._m[12]=t,this._m[13]=e,this._m[14]=i,this._markAsUpdated(),this},n.prototype.addTranslationFromFloats=function(t,e,i){return this._m[12]+=t,this._m[13]+=e,this._m[14]+=i,this._markAsUpdated(),this},n.prototype.setTranslation=function(t){return this.setTranslationFromFloats(t._x,t._y,t._z)},n.prototype.getTranslation=function(){return new y(this._m[12],this._m[13],this._m[14])},n.prototype.getTranslationToRef=function(t){return t.x=this._m[12],t.y=this._m[13],t.z=this._m[14],this},n.prototype.removeRotationAndScaling=function(){var t=this.m;return n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(t[12]===0&&t[13]===0&&t[14]===0&&t[15]===1),this},n.prototype.multiply=function(t){var e=new n;return this.multiplyToRef(t,e),e},n.prototype.copyFrom=function(t){t.copyToArray(this._m);var e=t;return this._updateIdentityStatus(e._isIdentity,e._isIdentityDirty,e._isIdentity3x2,e._isIdentity3x2Dirty),this},n.prototype.copyToArray=function(t,e){e===void 0&&(e=0);var i=this._m;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],this},n.prototype.multiplyToRef=function(t,e){return this._isIdentity?(e.copyFrom(t),this):t._isIdentity?(e.copyFrom(this),this):(this.multiplyToArray(t,e._m,0),e._markAsUpdated(),this)},n.prototype.multiplyToArray=function(t,e,i){var r=this._m,o=t.m,a=r[0],s=r[1],l=r[2],u=r[3],f=r[4],c=r[5],h=r[6],p=r[7],_=r[8],g=r[9],v=r[10],E=r[11],T=r[12],S=r[13],C=r[14],O=r[15],A=o[0],M=o[1],D=o[2],U=o[3],V=o[4],B=o[5],z=o[6],J=o[7],X=o[8],re=o[9],ae=o[10],se=o[11],H=o[12],Z=o[13],q=o[14],N=o[15];return e[i]=a*A+s*V+l*X+u*H,e[i+1]=a*M+s*B+l*re+u*Z,e[i+2]=a*D+s*z+l*ae+u*q,e[i+3]=a*U+s*J+l*se+u*N,e[i+4]=f*A+c*V+h*X+p*H,e[i+5]=f*M+c*B+h*re+p*Z,e[i+6]=f*D+c*z+h*ae+p*q,e[i+7]=f*U+c*J+h*se+p*N,e[i+8]=_*A+g*V+v*X+E*H,e[i+9]=_*M+g*B+v*re+E*Z,e[i+10]=_*D+g*z+v*ae+E*q,e[i+11]=_*U+g*J+v*se+E*N,e[i+12]=T*A+S*V+C*X+O*H,e[i+13]=T*M+S*B+C*re+O*Z,e[i+14]=T*D+S*z+C*ae+O*q,e[i+15]=T*U+S*J+C*se+O*N,this},n.prototype.equals=function(t){var e=t;if(!e)return!1;if((this._isIdentity||e._isIdentity)&&!this._isIdentityDirty&&!e._isIdentityDirty)return this._isIdentity&&e._isIdentity;var i=this.m,r=e.m;return i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]&&i[4]===r[4]&&i[5]===r[5]&&i[6]===r[6]&&i[7]===r[7]&&i[8]===r[8]&&i[9]===r[9]&&i[10]===r[10]&&i[11]===r[11]&&i[12]===r[12]&&i[13]===r[13]&&i[14]===r[14]&&i[15]===r[15]},n.prototype.clone=function(){var t=new n;return t.copyFrom(this),t},n.prototype.getClassName=function(){return"Matrix"},n.prototype.getHashCode=function(){for(var t=this._m[0]|0,e=1;e<16;e++)t=t*397^(this._m[e]|0);return t},n.prototype.decompose=function(t,e,i){if(this._isIdentity)return i&&i.setAll(0),t&&t.setAll(1),e&&e.copyFromFloats(0,0,0,1),!0;var r=this._m;if(i&&i.copyFromFloats(r[12],r[13],r[14]),t=t||Qt.Vector3[0],t.x=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),t.y=Math.sqrt(r[4]*r[4]+r[5]*r[5]+r[6]*r[6]),t.z=Math.sqrt(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),this.determinant()<=0&&(t.y*=-1),t._x===0||t._y===0||t._z===0)return e&&e.copyFromFloats(0,0,0,1),!1;if(e){var o=1/t._x,a=1/t._y,s=1/t._z;n.FromValuesToRef(r[0]*o,r[1]*o,r[2]*o,0,r[4]*a,r[5]*a,r[6]*a,0,r[8]*s,r[9]*s,r[10]*s,0,0,0,0,1,Qt.Matrix[0]),Re.FromRotationMatrixToRef(Qt.Matrix[0],e)}return!0},n.prototype.getRow=function(t){if(t<0||t>3)return null;var e=t*4;return new ni(this._m[e+0],this._m[e+1],this._m[e+2],this._m[e+3])},n.prototype.setRow=function(t,e){return this.setRowFromFloats(t,e.x,e.y,e.z,e.w)},n.prototype.transpose=function(){return n.Transpose(this)},n.prototype.transposeToRef=function(t){return n.TransposeToRef(this,t),this},n.prototype.setRowFromFloats=function(t,e,i,r,o){if(t<0||t>3)return this;var a=t*4;return this._m[a+0]=e,this._m[a+1]=i,this._m[a+2]=r,this._m[a+3]=o,this._markAsUpdated(),this},n.prototype.scale=function(t){var e=new n;return this.scaleToRef(t,e),e},n.prototype.scaleToRef=function(t,e){for(var i=0;i<16;i++)e._m[i]=this._m[i]*t;return e._markAsUpdated(),this},n.prototype.scaleAndAddToRef=function(t,e){for(var i=0;i<16;i++)e._m[i]+=this._m[i]*t;return e._markAsUpdated(),this},n.prototype.toNormalMatrix=function(t){var e=Qt.Matrix[0];this.invertToRef(e),e.transposeToRef(t);var i=t._m;n.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,t)},n.prototype.getRotationMatrix=function(){var t=new n;return this.getRotationMatrixToRef(t),t},n.prototype.getRotationMatrixToRef=function(t){var e=Qt.Vector3[0];if(!this.decompose(e))return n.IdentityToRef(t),this;var i=this._m,r=1/e._x,o=1/e._y,a=1/e._z;return n.FromValuesToRef(i[0]*r,i[1]*r,i[2]*r,0,i[4]*o,i[5]*o,i[6]*o,0,i[8]*a,i[9]*a,i[10]*a,0,0,0,0,1,t),this},n.prototype.toggleModelMatrixHandInPlace=function(){var t=this._m;t[2]*=-1,t[6]*=-1,t[8]*=-1,t[9]*=-1,t[14]*=-1,this._markAsUpdated()},n.prototype.toggleProjectionMatrixHandInPlace=function(){var t=this._m;t[8]*=-1,t[9]*=-1,t[10]*=-1,t[11]*=-1,this._markAsUpdated()},n.FromArray=function(t,e){e===void 0&&(e=0);var i=new n;return n.FromArrayToRef(t,e,i),i},n.FromArrayToRef=function(t,e,i){for(var r=0;r<16;r++)i._m[r]=t[r+e];i._markAsUpdated()},n.FromFloat32ArrayToRefScaled=function(t,e,i,r){for(var o=0;o<16;o++)r._m[o]=t[o+e]*i;r._markAsUpdated()},Object.defineProperty(n,"IdentityReadOnly",{get:function(){return n._identityReadOnly},enumerable:!1,configurable:!0}),n.FromValuesToRef=function(t,e,i,r,o,a,s,l,u,f,c,h,p,_,g,v,E){var T=E._m;T[0]=t,T[1]=e,T[2]=i,T[3]=r,T[4]=o,T[5]=a,T[6]=s,T[7]=l,T[8]=u,T[9]=f,T[10]=c,T[11]=h,T[12]=p,T[13]=_,T[14]=g,T[15]=v,E._markAsUpdated()},n.FromValues=function(t,e,i,r,o,a,s,l,u,f,c,h,p,_,g,v){var E=new n,T=E._m;return T[0]=t,T[1]=e,T[2]=i,T[3]=r,T[4]=o,T[5]=a,T[6]=s,T[7]=l,T[8]=u,T[9]=f,T[10]=c,T[11]=h,T[12]=p,T[13]=_,T[14]=g,T[15]=v,E._markAsUpdated(),E},n.Compose=function(t,e,i){var r=new n;return n.ComposeToRef(t,e,i,r),r},n.ComposeToRef=function(t,e,i,r){var o=r._m,a=e._x,s=e._y,l=e._z,u=e._w,f=a+a,c=s+s,h=l+l,p=a*f,_=a*c,g=a*h,v=s*c,E=s*h,T=l*h,S=u*f,C=u*c,O=u*h,A=t._x,M=t._y,D=t._z;o[0]=(1-(v+T))*A,o[1]=(_+O)*A,o[2]=(g-C)*A,o[3]=0,o[4]=(_-O)*M,o[5]=(1-(p+T))*M,o[6]=(E+S)*M,o[7]=0,o[8]=(g+C)*D,o[9]=(E-S)*D,o[10]=(1-(p+v))*D,o[11]=0,o[12]=i._x,o[13]=i._y,o[14]=i._z,o[15]=1,r._markAsUpdated()},n.Identity=function(){var t=n.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t},n.IdentityToRef=function(t){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0)},n.Zero=function(){var t=n.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t},n.RotationX=function(t){var e=new n;return n.RotationXToRef(t,e),e},n.Invert=function(t){var e=new n;return t.invertToRef(e),e},n.RotationXToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);n.FromValuesToRef(1,0,0,0,0,r,i,0,0,-i,r,0,0,0,0,1,e),e._updateIdentityStatus(r===1&&i===0)},n.RotationY=function(t){var e=new n;return n.RotationYToRef(t,e),e},n.RotationYToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);n.FromValuesToRef(r,0,-i,0,0,1,0,0,i,0,r,0,0,0,0,1,e),e._updateIdentityStatus(r===1&&i===0)},n.RotationZ=function(t){var e=new n;return n.RotationZToRef(t,e),e},n.RotationZToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);n.FromValuesToRef(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(r===1&&i===0)},n.RotationAxis=function(t,e){var i=new n;return n.RotationAxisToRef(t,e,i),i},n.RotationAxisToRef=function(t,e,i){var r=Math.sin(-e),o=Math.cos(-e),a=1-o;t.normalize();var s=i._m;s[0]=t._x*t._x*a+o,s[1]=t._x*t._y*a-t._z*r,s[2]=t._x*t._z*a+t._y*r,s[3]=0,s[4]=t._y*t._x*a+t._z*r,s[5]=t._y*t._y*a+o,s[6]=t._y*t._z*a-t._x*r,s[7]=0,s[8]=t._z*t._x*a-t._y*r,s[9]=t._z*t._y*a+t._x*r,s[10]=t._z*t._z*a+o,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationAlignToRef=function(t,e,i){var r=y.Cross(e,t),o=y.Dot(e,t),a=1/(1+o),s=i._m;s[0]=r._x*r._x*a+o,s[1]=r._y*r._x*a-r._z,s[2]=r._z*r._x*a+r._y,s[3]=0,s[4]=r._x*r._y*a+r._z,s[5]=r._y*r._y*a+o,s[6]=r._z*r._y*a-r._x,s[7]=0,s[8]=r._x*r._z*a-r._y,s[9]=r._y*r._z*a+r._x,s[10]=r._z*r._z*a+o,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationYawPitchRoll=function(t,e,i){var r=new n;return n.RotationYawPitchRollToRef(t,e,i,r),r},n.RotationYawPitchRollToRef=function(t,e,i,r){Re.RotationYawPitchRollToRef(t,e,i,Qt.Quaternion[0]),Qt.Quaternion[0].toRotationMatrix(r)},n.Scaling=function(t,e,i){var r=new n;return n.ScalingToRef(t,e,i,r),r},n.ScalingToRef=function(t,e,i,r){n.FromValuesToRef(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1,r),r._updateIdentityStatus(t===1&&e===1&&i===1)},n.Translation=function(t,e,i){var r=new n;return n.TranslationToRef(t,e,i,r),r},n.TranslationToRef=function(t,e,i,r){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1,r),r._updateIdentityStatus(t===0&&e===0&&i===0)},n.Lerp=function(t,e,i){var r=new n;return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){for(var o=r._m,a=t.m,s=e.m,l=0;l<16;l++)o[l]=a[l]*(1-i)+s[l]*i;r._markAsUpdated()},n.DecomposeLerp=function(t,e,i){var r=new n;return n.DecomposeLerpToRef(t,e,i,r),r},n.DecomposeLerpToRef=function(t,e,i,r){var o=Qt.Vector3[0],a=Qt.Quaternion[0],s=Qt.Vector3[1];t.decompose(o,a,s);var l=Qt.Vector3[2],u=Qt.Quaternion[1],f=Qt.Vector3[3];e.decompose(l,u,f);var c=Qt.Vector3[4];y.LerpToRef(o,l,i,c);var h=Qt.Quaternion[2];Re.SlerpToRef(a,u,i,h);var p=Qt.Vector3[5];y.LerpToRef(s,f,i,p),n.ComposeToRef(c,h,p,r)},n.LookAtLH=function(t,e,i){var r=new n;return n.LookAtLHToRef(t,e,i,r),r},n.LookAtLHToRef=function(t,e,i,r){var o=Qt.Vector3[0],a=Qt.Vector3[1],s=Qt.Vector3[2];e.subtractToRef(t,s),s.normalize(),y.CrossToRef(i,s,o);var l=o.lengthSquared();l===0?o.x=1:o.normalizeFromLength(Math.sqrt(l)),y.CrossToRef(s,o,a),a.normalize();var u=-y.Dot(o,t),f=-y.Dot(a,t),c=-y.Dot(s,t);n.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,f,c,1,r)},n.LookAtRH=function(t,e,i){var r=new n;return n.LookAtRHToRef(t,e,i,r),r},n.LookAtRHToRef=function(t,e,i,r){var o=Qt.Vector3[0],a=Qt.Vector3[1],s=Qt.Vector3[2];t.subtractToRef(e,s),s.normalize(),y.CrossToRef(i,s,o);var l=o.lengthSquared();l===0?o.x=1:o.normalizeFromLength(Math.sqrt(l)),y.CrossToRef(s,o,a),a.normalize();var u=-y.Dot(o,t),f=-y.Dot(a,t),c=-y.Dot(s,t);n.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,f,c,1,r)},n.OrthoLH=function(t,e,i,r){var o=new n;return n.OrthoLHToRef(t,e,i,r,o),o},n.OrthoLHToRef=function(t,e,i,r,o){var a=i,s=r,l=2/t,u=2/e,f=2/(s-a),c=-(s+a)/(s-a);n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,f,0,0,0,c,1,o),o._updateIdentityStatus(l===1&&u===1&&f===1&&c===0)},n.OrthoOffCenterLH=function(t,e,i,r,o,a){var s=new n;return n.OrthoOffCenterLHToRef(t,e,i,r,o,a,s),s},n.OrthoOffCenterLHToRef=function(t,e,i,r,o,a,s){var l=o,u=a,f=2/(e-t),c=2/(r-i),h=2/(u-l),p=-(u+l)/(u-l),_=(t+e)/(t-e),g=(r+i)/(i-r);n.FromValuesToRef(f,0,0,0,0,c,0,0,0,0,h,0,_,g,p,1,s),s._markAsUpdated()},n.OrthoOffCenterRH=function(t,e,i,r,o,a){var s=new n;return n.OrthoOffCenterRHToRef(t,e,i,r,o,a,s),s},n.OrthoOffCenterRHToRef=function(t,e,i,r,o,a,s){n.OrthoOffCenterLHToRef(t,e,i,r,o,a,s),s._m[10]*=-1},n.PerspectiveLH=function(t,e,i,r){var o=new n,a=i,s=r,l=2*a/t,u=2*a/e,f=(s+a)/(s-a),c=-2*s*a/(s-a);return n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,f,1,0,0,c,0,o),o._updateIdentityStatus(!1),o},n.PerspectiveFovLH=function(t,e,i,r){var o=new n;return n.PerspectiveFovLHToRef(t,e,i,r,o),o},n.PerspectiveFovLHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=i,l=r,u=1/Math.tan(t*.5),f=a?u/e:u,c=a?u:u*e,h=(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(f,0,0,0,0,c,0,0,0,0,h,1,0,0,p,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovReverseLHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=1/Math.tan(t*.5),l=a?s/e:s,u=a?s:s*e;n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,-i,1,0,0,1,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovRH=function(t,e,i,r){var o=new n;return n.PerspectiveFovRHToRef(t,e,i,r,o),o},n.PerspectiveFovRHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=i,l=r,u=1/Math.tan(t*.5),f=a?u/e:u,c=a?u:u*e,h=-(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(f,0,0,0,0,c,0,0,0,0,h,-1,0,0,p,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovReverseRHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=1/Math.tan(t*.5),l=a?s/e:s,u=a?s:s*e;n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,-i,-1,0,0,-1,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovWebVRToRef=function(t,e,i,r,o){o===void 0&&(o=!1);var a=o?-1:1,s=Math.tan(t.upDegrees*Math.PI/180),l=Math.tan(t.downDegrees*Math.PI/180),u=Math.tan(t.leftDegrees*Math.PI/180),f=Math.tan(t.rightDegrees*Math.PI/180),c=2/(u+f),h=2/(s+l),p=r._m;p[0]=c,p[1]=p[2]=p[3]=p[4]=0,p[5]=h,p[6]=p[7]=0,p[8]=(u-f)*c*.5,p[9]=-((s-l)*h*.5),p[10]=-i/(e-i),p[11]=1*a,p[12]=p[13]=p[15]=0,p[14]=-(2*i*e)/(i-e),r._markAsUpdated()},n.GetFinalMatrix=function(t,e,i,r,o,a){var s=t.width,l=t.height,u=t.x,f=t.y,c=n.FromValues(s/2,0,0,0,0,-l/2,0,0,0,0,a-o,0,u+s/2,l/2+f,o,1),h=Qt.Matrix[0];return e.multiplyToRef(i,h),h.multiplyToRef(r,h),h.multiply(c)},n.GetAsMatrix2x2=function(t){var e=t.m,i=[e[0],e[1],e[4],e[5]];return Qa.MatrixUse64Bits?i:new Float32Array(i)},n.GetAsMatrix3x3=function(t){var e=t.m,i=[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]];return Qa.MatrixUse64Bits?i:new Float32Array(i)},n.Transpose=function(t){var e=new n;return n.TransposeToRef(t,e),e},n.TransposeToRef=function(t,e){var i=e._m,r=t.m;i[0]=r[0],i[1]=r[4],i[2]=r[8],i[3]=r[12],i[4]=r[1],i[5]=r[5],i[6]=r[9],i[7]=r[13],i[8]=r[2],i[9]=r[6],i[10]=r[10],i[11]=r[14],i[12]=r[3],i[13]=r[7],i[14]=r[11],i[15]=r[15],e._updateIdentityStatus(t._isIdentity,t._isIdentityDirty)},n.Reflection=function(t){var e=new n;return n.ReflectionToRef(t,e),e},n.ReflectionToRef=function(t,e){t.normalize();var i=t.normal.x,r=t.normal.y,o=t.normal.z,a=-2*i,s=-2*r,l=-2*o;n.FromValuesToRef(a*i+1,s*i,l*i,0,a*r,s*r+1,l*r,0,a*o,s*o,l*o+1,0,a*t.d,s*t.d,l*t.d,1,e)},n.FromXYZAxesToRef=function(t,e,i,r){n.FromValuesToRef(t._x,t._y,t._z,0,e._x,e._y,e._z,0,i._x,i._y,i._z,0,0,0,0,1,r)},n.FromQuaternionToRef=function(t,e){var i=t._x*t._x,r=t._y*t._y,o=t._z*t._z,a=t._x*t._y,s=t._z*t._w,l=t._z*t._x,u=t._y*t._w,f=t._y*t._z,c=t._x*t._w;e._m[0]=1-2*(r+o),e._m[1]=2*(a+s),e._m[2]=2*(l-u),e._m[3]=0,e._m[4]=2*(a-s),e._m[5]=1-2*(o+i),e._m[6]=2*(f+c),e._m[7]=0,e._m[8]=2*(l+u),e._m[9]=2*(f-c),e._m[10]=1-2*(r+i),e._m[11]=0,e._m[12]=0,e._m[13]=0,e._m[14]=0,e._m[15]=1,e._markAsUpdated()},n._updateFlagSeed=0,n._identityReadOnly=n.Identity(),n}(),Qt=function(){function n(){}return n.Vector3=or.BuildArray(6,y.Zero),n.Matrix=or.BuildArray(2,te.Identity),n.Quaternion=or.BuildArray(3,Re.Zero),n}(),me=function(){function n(){}return n.Vector2=or.BuildArray(3,Ie.Zero),n.Vector3=or.BuildArray(13,y.Zero),n.Vector4=or.BuildArray(3,ni.Zero),n.Quaternion=or.BuildArray(2,Re.Zero),n.Matrix=or.BuildArray(8,te.Identity),n}();Ae.RegisteredTypes["BABYLON.Vector2"]=Ie;Ae.RegisteredTypes["BABYLON.Vector3"]=y;Ae.RegisteredTypes["BABYLON.Vector4"]=ni;Ae.RegisteredTypes["BABYLON.Matrix"]=te;var _e=function(){function n(t,e,i){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),this.r=t,this.g=e,this.b=i}return n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},n.prototype.getClassName=function(){return"Color3"},n.prototype.getHashCode=function(){var t=this.r*255|0;return t=t*397^(this.g*255|0),t=t*397^(this.b*255|0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.toColor4=function(t){return t===void 0&&(t=1),new Je(this.r,this.g,this.b,t)},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.toLuminance=function(){return this.r*.3+this.g*.59+this.b*.11},n.prototype.multiply=function(t){return new n(this.r*t.r,this.g*t.g,this.b*t.b)},n.prototype.multiplyToRef=function(t,e){return e.r=this.r*t.r,e.g=this.g*t.g,e.b=this.b*t.b,this},n.prototype.equals=function(t){return t&&this.r===t.r&&this.g===t.g&&this.b===t.b},n.prototype.equalsFloats=function(t,e,i){return this.r===t&&this.g===e&&this.b===i},n.prototype.scale=function(t){return new n(this.r*t,this.g*t,this.b*t)},n.prototype.scaleToRef=function(t,e){return e.r=this.r*t,e.g=this.g*t,e.b=this.b*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.r+=this.r*t,e.g+=this.g*t,e.b+=this.b*t,this},n.prototype.clampToRef=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=1),i.r=Ue.Clamp(this.r,t,e),i.g=Ue.Clamp(this.g,t,e),i.b=Ue.Clamp(this.b,t,e),this},n.prototype.add=function(t){return new n(this.r+t.r,this.g+t.g,this.b+t.b)},n.prototype.addToRef=function(t,e){return e.r=this.r+t.r,e.g=this.g+t.g,e.b=this.b+t.b,this},n.prototype.subtract=function(t){return new n(this.r-t.r,this.g-t.g,this.b-t.b)},n.prototype.subtractToRef=function(t,e){return e.r=this.r-t.r,e.g=this.g-t.g,e.b=this.b-t.b,this},n.prototype.clone=function(){return new n(this.r,this.g,this.b)},n.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},n.prototype.copyFromFloats=function(t,e,i){return this.r=t,this.g=e,this.b=i,this},n.prototype.set=function(t,e,i){return this.copyFromFloats(t,e,i)},n.prototype.toHexString=function(){var t=this.r*255|0,e=this.g*255|0,i=this.b*255|0;return"#"+Ue.ToHex(t)+Ue.ToHex(e)+Ue.ToHex(i)},n.prototype.toLinearSpace=function(){var t=new n;return this.toLinearSpaceToRef(t),t},n.prototype.toHSV=function(){var t=new n;return this.toHSVToRef(t),t},n.prototype.toHSVToRef=function(t){var e=this.r,i=this.g,r=this.b,o=Math.max(e,i,r),a=Math.min(e,i,r),s=0,l=0,u=o,f=o-a;o!==0&&(l=f/o),o!=a&&(o==e?(s=(i-r)/f,i<r&&(s+=6)):o==i?s=(r-e)/f+2:o==r&&(s=(e-i)/f+4),s*=60),t.r=s,t.g=l,t.b=u},n.prototype.toLinearSpaceToRef=function(t){return t.r=Math.pow(this.r,Ea),t.g=Math.pow(this.g,Ea),t.b=Math.pow(this.b,Ea),this},n.prototype.toGammaSpace=function(){var t=new n;return this.toGammaSpaceToRef(t),t},n.prototype.toGammaSpaceToRef=function(t){return t.r=Math.pow(this.r,Uo),t.g=Math.pow(this.g,Uo),t.b=Math.pow(this.b,Uo),this},n.HSVtoRGBToRef=function(t,e,i,r){var o=i*e,a=t/60,s=o*(1-Math.abs(a%2-1)),l=0,u=0,f=0;a>=0&&a<=1?(l=o,u=s):a>=1&&a<=2?(l=s,u=o):a>=2&&a<=3?(u=o,f=s):a>=3&&a<=4?(u=s,f=o):a>=4&&a<=5?(l=s,f=o):a>=5&&a<=6&&(l=o,f=s);var c=i-o;r.set(l+c,u+c,f+c)},n.FromHexString=function(t){if(t.substring(0,1)!=="#"||t.length!==7)return new n(0,0,0);var e=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16);return n.FromInts(e,i,r)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1],t[e+2])},n.FromArrayToRef=function(t,e,i){e===void 0&&(e=0),i.r=t[e],i.g=t[e+1],i.b=t[e+2]},n.FromInts=function(t,e,i){return new n(t/255,e/255,i/255)},n.Lerp=function(t,e,i){var r=new n(0,0,0);return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i},n.Red=function(){return new n(1,0,0)},n.Green=function(){return new n(0,1,0)},n.Blue=function(){return new n(0,0,1)},n.Black=function(){return new n(0,0,0)},Object.defineProperty(n,"BlackReadOnly",{get:function(){return n._BlackReadOnly},enumerable:!1,configurable:!0}),n.White=function(){return new n(1,1,1)},n.Purple=function(){return new n(.5,0,.5)},n.Magenta=function(){return new n(1,0,1)},n.Yellow=function(){return new n(1,1,0)},n.Gray=function(){return new n(.5,.5,.5)},n.Teal=function(){return new n(0,1,1)},n.Random=function(){return new n(Math.random(),Math.random(),Math.random())},n._BlackReadOnly=n.Black(),n}(),Je=function(){function n(t,e,i,r){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),r===void 0&&(r=1),this.r=t,this.g=e,this.b=i,this.a=r}return n.prototype.addInPlace=function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a,this},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.equals=function(t){return t&&this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a},n.prototype.add=function(t){return new n(this.r+t.r,this.g+t.g,this.b+t.b,this.a+t.a)},n.prototype.subtract=function(t){return new n(this.r-t.r,this.g-t.g,this.b-t.b,this.a-t.a)},n.prototype.subtractToRef=function(t,e){return e.r=this.r-t.r,e.g=this.g-t.g,e.b=this.b-t.b,e.a=this.a-t.a,this},n.prototype.scale=function(t){return new n(this.r*t,this.g*t,this.b*t,this.a*t)},n.prototype.scaleToRef=function(t,e){return e.r=this.r*t,e.g=this.g*t,e.b=this.b*t,e.a=this.a*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.r+=this.r*t,e.g+=this.g*t,e.b+=this.b*t,e.a+=this.a*t,this},n.prototype.clampToRef=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=1),i.r=Ue.Clamp(this.r,t,e),i.g=Ue.Clamp(this.g,t,e),i.b=Ue.Clamp(this.b,t,e),i.a=Ue.Clamp(this.a,t,e),this},n.prototype.multiply=function(t){return new n(this.r*t.r,this.g*t.g,this.b*t.b,this.a*t.a)},n.prototype.multiplyToRef=function(t,e){return e.r=this.r*t.r,e.g=this.g*t.g,e.b=this.b*t.b,e.a=this.a*t.a,e},n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},n.prototype.getClassName=function(){return"Color4"},n.prototype.getHashCode=function(){var t=this.r*255|0;return t=t*397^(this.g*255|0),t=t*397^(this.b*255|0),t=t*397^(this.a*255|0),t},n.prototype.clone=function(){return new n(this.r,this.g,this.b,this.a)},n.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},n.prototype.copyFromFloats=function(t,e,i,r){return this.r=t,this.g=e,this.b=i,this.a=r,this},n.prototype.set=function(t,e,i,r){return this.copyFromFloats(t,e,i,r)},n.prototype.toHexString=function(t){t===void 0&&(t=!1);var e=this.r*255|0,i=this.g*255|0,r=this.b*255|0;if(t)return"#"+Ue.ToHex(e)+Ue.ToHex(i)+Ue.ToHex(r);var o=this.a*255|0;return"#"+Ue.ToHex(e)+Ue.ToHex(i)+Ue.ToHex(r)+Ue.ToHex(o)},n.prototype.toLinearSpace=function(){var t=new n;return this.toLinearSpaceToRef(t),t},n.prototype.toLinearSpaceToRef=function(t){return t.r=Math.pow(this.r,Ea),t.g=Math.pow(this.g,Ea),t.b=Math.pow(this.b,Ea),t.a=this.a,this},n.prototype.toGammaSpace=function(){var t=new n;return this.toGammaSpaceToRef(t),t},n.prototype.toGammaSpaceToRef=function(t){return t.r=Math.pow(this.r,Uo),t.g=Math.pow(this.g,Uo),t.b=Math.pow(this.b,Uo),t.a=this.a,this},n.FromHexString=function(t){if(t.substring(0,1)!=="#"||t.length!==9)return new n(0,0,0,0);var e=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16),o=parseInt(t.substring(7,9),16);return n.FromInts(e,i,r,o)},n.Lerp=function(t,e,i){var r=new n(0,0,0,0);return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i,r.a=t.a+(e.a-t.a)*i},n.FromColor3=function(t,e){return e===void 0&&(e=1),new n(t.r,t.g,t.b,e)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1],t[e+2],t[e+3])},n.FromArrayToRef=function(t,e,i){e===void 0&&(e=0),i.r=t[e],i.g=t[e+1],i.b=t[e+2],i.a=t[e+3]},n.FromInts=function(t,e,i,r){return new n(t/255,e/255,i/255,r/255)},n.CheckColors4=function(t,e){if(t.length===e*3){for(var i=[],r=0;r<t.length;r+=3){var o=r/3*4;i[o]=t[r],i[o+1]=t[r+1],i[o+2]=t[r+2],i[o+3]=1}return i}return t},n}(),qt=function(){function n(){}return n.Color3=or.BuildArray(3,_e.Black),n.Color4=or.BuildArray(3,function(){return new Je(0,0,0,0)}),n}();Ae.RegisteredTypes["BABYLON.Color3"]=_e;Ae.RegisteredTypes["BABYLON.Color4"]=Je;var di=function(){function n(t,e){this.triggerOptions=t,this.onBeforeExecuteObservable=new ie,t.parameter?(this.trigger=t.trigger,this._triggerParameter=t.parameter):t.trigger?this.trigger=t.trigger:this.trigger=t,this._nextActiveAction=this,this._condition=e}return n.prototype._prepare=function(){},n.prototype.getTriggerParameter=function(){return this._triggerParameter},n.prototype._executeCurrent=function(t){if(this._nextActiveAction._condition){var e=this._nextActiveAction._condition,i=this._actionManager.getScene().getRenderId();if(e._evaluationId===i){if(!e._currentResult)return}else{if(e._evaluationId=i,!e.isValid()){e._currentResult=!1;return}e._currentResult=!0}}this.onBeforeExecuteObservable.notifyObservers(this),this._nextActiveAction.execute(t),this.skipToNextActiveAction()},n.prototype.execute=function(t){},n.prototype.skipToNextActiveAction=function(){this._nextActiveAction._child?(this._nextActiveAction._child._actionManager||(this._nextActiveAction._child._actionManager=this._actionManager),this._nextActiveAction=this._nextActiveAction._child):this._nextActiveAction=this},n.prototype.then=function(t){return this._child=t,t._actionManager=this._actionManager,t._prepare(),t},n.prototype._getProperty=function(t){return this._actionManager._getProperty(t)},n.prototype._getEffectiveTarget=function(t,e){return this._actionManager._getEffectiveTarget(t,e)},n.prototype.serialize=function(t){},n.prototype._serialize=function(t,e){var i={type:1,children:[],name:t.name,properties:t.properties||[]};if(this._child&&this._child.serialize(i),this._condition){var r=this._condition.serialize();return r.children.push(i),e&&e.children.push(r),r}return e&&e.children.push(i),i},n._SerializeValueAsString=function(t){return typeof t=="number"?t.toString():typeof t=="boolean"?t?"true":"false":t instanceof Ie?t.x+", "+t.y:t instanceof y?t.x+", "+t.y+", "+t.z:t instanceof _e?t.r+", "+t.g+", "+t.b:t instanceof Je?t.r+", "+t.g+", "+t.b+", "+t.a:t},n._GetTargetProperty=function(t){return{name:"target",targetType:t._isMesh?"MeshProperties":t._isLight?"LightProperties":t._isCamera?"CameraProperties":"SceneProperties",value:t._isScene?"Scene":t.name}},n}();Ae.RegisteredTypes["BABYLON.Action"]=di;var Wi=function(){function n(t,e,i,r,o,a){this.source=t,this.pointerX=e,this.pointerY=i,this.meshUnderPointer=r,this.sourceEvent=o,this.additionalData=a}return n.CreateNew=function(t,e,i){var r=t.getScene();return new n(t,r.pointerX,r.pointerY,r.meshUnderPointer||t,e,i)},n.CreateNewFromSprite=function(t,e,i,r){return new n(t,e.pointerX,e.pointerY,e.meshUnderPointer,i,r)},n.CreateNewFromScene=function(t,e){return new n(null,t.pointerX,t.pointerY,t.meshUnderPointer,e)},n.CreateNewFromPrimitive=function(t,e,i,r){return new n(t,e.x,e.y,null,i,r)},n}();/*! *****************************************************************************
|
|
51
|
+
deps: ${f}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:n.error,code(l){const[u,f]=o(l);a(l,u),s(l,f)}};function o({schema:l}){const u={},f={};for(const c in l){if(c==="__proto__")continue;const h=Array.isArray(l[c])?u:f;h[c]=l[c]}return[u,f]}function a(l,u=l.schema){const{gen:f,data:c,it:h}=l;if(Object.keys(u).length===0)return;const p=f.let("missing");for(const _ in u){const g=u[_];if(g.length===0)continue;const v=(0,i.propertyInData)(f,c,_,h.opts.ownProperties);l.setParams({property:_,depsCount:g.length,deps:g.join(", ")}),h.allErrors?f.if(v,()=>{for(const E of g)(0,i.checkReportMissingProp)(l,E)}):(f.if((0,t._)`${v} && (${(0,i.checkMissingProp)(l,g,p)})`),(0,i.reportMissingProp)(l,p),f.else())}}n.validatePropertyDeps=a;function s(l,u=l.schema){const{gen:f,data:c,keyword:h,it:p}=l,_=f.name("valid");for(const g in u)(0,e.alwaysValidSchema)(p,u[g])||(f.if((0,i.propertyInData)(f,c,g,p.opts.ownProperties),()=>{const v=l.subschema({keyword:h,schemaProp:g},_);l.mergeValidEvaluated(v,_)},()=>f.var(_,!0)),l.ok(_))}n.validateSchemaDeps=s,n.default=r}(gm)),gm}var zh={},RS;function UL(){if(RS)return zh;RS=1,Object.defineProperty(zh,"__esModule",{value:!0});const n=Xt(),t=gi(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:r})=>(0,n._)`{propertyName: ${r.propertyName}}`},code(r){const{gen:o,schema:a,data:s,it:l}=r;if((0,t.alwaysValidSchema)(l,a))return;const u=o.name("valid");o.forIn("key",s,f=>{r.setParams({propertyName:f}),r.subschema({keyword:"propertyNames",data:f,dataTypes:["string"],propertyName:f,compositeRule:!0},u),o.if((0,n.not)(u),()=>{r.error(!0),l.allErrors||o.break()})}),r.ok(u)}};return zh.default=i,zh}var Gh={},OS;function dM(){if(OS)return Gh;OS=1,Object.defineProperty(Gh,"__esModule",{value:!0});const n=Po(),t=Xt(),e=Aa(),i=gi(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:s,schema:l,parentSchema:u,data:f,errsCount:c,it:h}=a;if(!c)throw new Error("ajv implementation error");const{allErrors:p,opts:_}=h;if(h.props=!0,_.removeAdditional!=="all"&&(0,i.alwaysValidSchema)(h,l))return;const g=(0,n.allSchemaProperties)(u.properties),v=(0,n.allSchemaProperties)(u.patternProperties);E(),a.ok((0,t._)`${c} === ${e.default.errors}`);function E(){s.forIn("key",f,A=>{!g.length&&!v.length?C(A):s.if(T(A),()=>C(A))})}function T(A){let M;if(g.length>8){const D=(0,i.schemaRefOrVal)(h,u.properties,"properties");M=(0,n.isOwnProperty)(s,D,A)}else g.length?M=(0,t.or)(...g.map(D=>(0,t._)`${A} === ${D}`)):M=t.nil;return v.length&&(M=(0,t.or)(M,...v.map(D=>(0,t._)`${(0,n.usePattern)(a,D)}.test(${A})`))),(0,t.not)(M)}function S(A){s.code((0,t._)`delete ${f}[${A}]`)}function C(A){if(_.removeAdditional==="all"||_.removeAdditional&&l===!1){S(A);return}if(l===!1){a.setParams({additionalProperty:A}),a.error(),p||s.break();return}if(typeof l=="object"&&!(0,i.alwaysValidSchema)(h,l)){const M=s.name("valid");_.removeAdditional==="failing"?(O(A,M,!1),s.if((0,t.not)(M),()=>{a.reset(),S(A)})):(O(A,M),p||s.if((0,t.not)(M),()=>s.break()))}}function O(A,M,D){const U={keyword:"additionalProperties",dataProp:A,dataPropType:i.Type.Str};D===!1&&Object.assign(U,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(U,M)}}};return Gh.default=o,Gh}var Wh={},MS;function kL(){if(MS)return Wh;MS=1,Object.defineProperty(Wh,"__esModule",{value:!0});const n=oc(),t=Po(),e=gi(),i=dM(),r={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:a,schema:s,parentSchema:l,data:u,it:f}=o;f.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&i.default.code(new n.KeywordCxt(f,i.default,"additionalProperties"));const c=(0,t.allSchemaProperties)(s);for(const v of c)f.definedProperties.add(v);f.opts.unevaluated&&c.length&&f.props!==!0&&(f.props=e.mergeEvaluated.props(a,(0,e.toHash)(c),f.props));const h=c.filter(v=>!(0,e.alwaysValidSchema)(f,s[v]));if(h.length===0)return;const p=a.name("valid");for(const v of h)_(v)?g(v):(a.if((0,t.propertyInData)(a,u,v,f.opts.ownProperties)),g(v),f.allErrors||a.else().var(p,!0),a.endIf()),o.it.definedProperties.add(v),o.ok(p);function _(v){return f.opts.useDefaults&&!f.compositeRule&&s[v].default!==void 0}function g(v){o.subschema({keyword:"properties",schemaProp:v,dataProp:v},p)}}};return Wh.default=r,Wh}var Hh={},xS;function zL(){if(xS)return Hh;xS=1,Object.defineProperty(Hh,"__esModule",{value:!0});const n=Po(),t=Xt(),e=gi(),i=gi(),r={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:a,schema:s,data:l,parentSchema:u,it:f}=o,{opts:c}=f,h=(0,n.allSchemaProperties)(s),p=h.filter(C=>(0,e.alwaysValidSchema)(f,s[C]));if(h.length===0||p.length===h.length&&(!f.opts.unevaluated||f.props===!0))return;const _=c.strictSchema&&!c.allowMatchingProperties&&u.properties,g=a.name("valid");f.props!==!0&&!(f.props instanceof t.Name)&&(f.props=(0,i.evaluatedPropsToName)(a,f.props));const{props:v}=f;E();function E(){for(const C of h)_&&T(C),f.allErrors?S(C):(a.var(g,!0),S(C),a.if(g))}function T(C){for(const O in _)new RegExp(C).test(O)&&(0,e.checkStrictMode)(f,`property ${O} matches pattern ${C} (use allowMatchingProperties)`)}function S(C){a.forIn("key",l,O=>{a.if((0,t._)`${(0,n.usePattern)(o,C)}.test(${O})`,()=>{const A=p.includes(C);A||o.subschema({keyword:"patternProperties",schemaProp:C,dataProp:O,dataPropType:i.Type.Str},g),f.opts.unevaluated&&v!==!0?a.assign((0,t._)`${v}[${O}]`,!0):!A&&!f.allErrors&&a.if((0,t.not)(g),()=>a.break())})})}}};return Hh.default=r,Hh}var jh={},IS;function GL(){if(IS)return jh;IS=1,Object.defineProperty(jh,"__esModule",{value:!0});const n=gi(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:i,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r)){e.fail();return}const a=i.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};return jh.default=t,jh}var Xh={},DS;function WL(){if(DS)return Xh;DS=1,Object.defineProperty(Xh,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Po().validateUnion,error:{message:"must match a schema in anyOf"}};return Xh.default=t,Xh}var Yh={},wS;function HL(){if(wS)return Yh;wS=1,Object.defineProperty(Yh,"__esModule",{value:!0});const n=Xt(),t=gi(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:r})=>(0,n._)`{passingSchemas: ${r.passing}}`},code(r){const{gen:o,schema:a,parentSchema:s,it:l}=r;if(!Array.isArray(a))throw new Error("ajv implementation error");if(l.opts.discriminator&&s.discriminator)return;const u=a,f=o.let("valid",!1),c=o.let("passing",null),h=o.name("_valid");r.setParams({passing:c}),o.block(p),r.result(f,()=>r.reset(),()=>r.error(!0));function p(){u.forEach((_,g)=>{let v;(0,t.alwaysValidSchema)(l,_)?o.var(h,!0):v=r.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},h),g>0&&o.if((0,n._)`${h} && ${f}`).assign(f,!1).assign(c,(0,n._)`[${c}, ${g}]`).else(),o.if(h,()=>{o.assign(f,!0),o.assign(c,g),v&&r.mergeEvaluated(v,n.Name)})})}}};return Yh.default=i,Yh}var Kh={},LS;function jL(){if(LS)return Kh;LS=1,Object.defineProperty(Kh,"__esModule",{value:!0});const n=gi(),t={keyword:"allOf",schemaType:"array",code(e){const{gen:i,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const a=i.name("valid");r.forEach((s,l)=>{if((0,n.alwaysValidSchema)(o,s))return;const u=e.subschema({keyword:"allOf",schemaProp:l},a);e.ok(a),e.mergeEvaluated(u)})}};return Kh.default=t,Kh}var qh={},NS;function XL(){if(NS)return qh;NS=1,Object.defineProperty(qh,"__esModule",{value:!0});const n=Xt(),t=gi(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,n.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,n._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:a,parentSchema:s,it:l}=o;s.then===void 0&&s.else===void 0&&(0,t.checkStrictMode)(l,'"if" without "then" and "else" is ignored');const u=r(l,"then"),f=r(l,"else");if(!u&&!f)return;const c=a.let("valid",!0),h=a.name("_valid");if(p(),o.reset(),u&&f){const g=a.let("ifClause");o.setParams({ifClause:g}),a.if(h,_("then",g),_("else",g))}else u?a.if(h,_("then")):a.if((0,n.not)(h),_("else"));o.pass(c,()=>o.error(!0));function p(){const g=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);o.mergeEvaluated(g)}function _(g,v){return()=>{const E=o.subschema({keyword:g},h);a.assign(c,h),o.mergeValidEvaluated(E,c),v?a.assign(v,(0,n._)`${g}`):o.setParams({ifClause:g})}}}};function r(o,a){const s=o.schema[a];return s!==void 0&&!(0,t.alwaysValidSchema)(o,s)}return qh.default=i,qh}var Qh={},FS;function YL(){if(FS)return Qh;FS=1,Object.defineProperty(Qh,"__esModule",{value:!0});const n=gi(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:i,it:r}){i.if===void 0&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};return Qh.default=t,Qh}var BS;function KL(){if(BS)return Bh;BS=1,Object.defineProperty(Bh,"__esModule",{value:!0});const n=cM(),t=NL(),e=hM(),i=FL(),r=BL(),o=VL(),a=UL(),s=dM(),l=kL(),u=zL(),f=GL(),c=WL(),h=HL(),p=jL(),_=XL(),g=YL();function v(E=!1){const T=[f.default,c.default,h.default,p.default,_.default,g.default,a.default,s.default,o.default,l.default,u.default];return E?T.push(t.default,i.default):T.push(n.default,e.default),T.push(r.default),T}return Bh.default=v,Bh}var $h={},Zh={},VS;function qL(){if(VS)return Zh;VS=1,Object.defineProperty(Zh,"__esModule",{value:!0});const n=Xt(),e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,n.str)`must match format "${i}"`,params:({schemaCode:i})=>(0,n._)`{format: ${i}}`},code(i,r){const{gen:o,data:a,$data:s,schema:l,schemaCode:u,it:f}=i,{opts:c,errSchemaPath:h,schemaEnv:p,self:_}=f;if(!c.validateFormats)return;s?g():v();function g(){const E=o.scopeValue("formats",{ref:_.formats,code:c.code.formats}),T=o.const("fDef",(0,n._)`${E}[${u}]`),S=o.let("fType"),C=o.let("format");o.if((0,n._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`,()=>o.assign(S,(0,n._)`${T}.type || "string"`).assign(C,(0,n._)`${T}.validate`),()=>o.assign(S,(0,n._)`"string"`).assign(C,T)),i.fail$data((0,n.or)(O(),A()));function O(){return c.strictSchema===!1?n.nil:(0,n._)`${u} && !${C}`}function A(){const M=p.$async?(0,n._)`(${T}.async ? await ${C}(${a}) : ${C}(${a}))`:(0,n._)`${C}(${a})`,D=(0,n._)`(typeof ${C} == "function" ? ${M} : ${C}.test(${a}))`;return(0,n._)`${C} && ${C} !== true && ${S} === ${r} && !${D}`}}function v(){const E=_.formats[l];if(!E){O();return}if(E===!0)return;const[T,S,C]=A(E);T===r&&i.pass(M());function O(){if(c.strictSchema===!1){_.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${l}" ignored in schema at path "${h}"`}}function A(D){const U=D instanceof RegExp?(0,n.regexpCode)(D):c.code.formats?(0,n._)`${c.code.formats}${(0,n.getProperty)(l)}`:void 0,V=o.scopeValue("formats",{key:l,ref:D,code:U});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,n._)`${V}.validate`]:["string",D,V]}function M(){if(typeof E=="object"&&!(E instanceof RegExp)&&E.async){if(!p.$async)throw new Error("async format in sync schema");return(0,n._)`await ${C}(${a})`}return typeof S=="function"?(0,n._)`${C}(${a})`:(0,n._)`${C}.test(${a})`}}}};return Zh.default=e,Zh}var US;function QL(){if(US)return $h;US=1,Object.defineProperty($h,"__esModule",{value:!0});const t=[qL().default];return $h.default=t,$h}var As={},kS;function $L(){return kS||(kS=1,Object.defineProperty(As,"__esModule",{value:!0}),As.contentVocabulary=As.metadataVocabulary=void 0,As.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],As.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),As}var zS;function ZL(){if(zS)return Eh;zS=1,Object.defineProperty(Eh,"__esModule",{value:!0});const n=TL(),t=LL(),e=KL(),i=QL(),r=$L(),o=[n.default,t.default,(0,e.default)(),i.default,r.metadataVocabulary,r.contentVocabulary];return Eh.default=o,Eh}var Jh={},vm={},GS;function JL(){return GS||(GS=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(n.DiscrError||(n.DiscrError={}))}(vm)),vm}var WS;function eN(){if(WS)return Jh;WS=1,Object.defineProperty(Jh,"__esModule",{value:!0});const n=Xt(),t=JL(),e=cb(),i=gi(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:s}})=>a===t.DiscrError.Tag?`tag "${s}" must be string`:`value of tag "${s}" must be in oneOf`,params:({params:{discrError:a,tag:s,tagName:l}})=>(0,n._)`{error: ${a}, tag: ${l}, tagValue: ${s}}`},code(a){const{gen:s,data:l,schema:u,parentSchema:f,it:c}=a,{oneOf:h}=f;if(!c.opts.discriminator)throw new Error("discriminator: requires discriminator option");const p=u.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const _=s.let("valid",!1),g=s.const("tag",(0,n._)`${l}${(0,n.getProperty)(p)}`);s.if((0,n._)`typeof ${g} == "string"`,()=>v(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:g,tagName:p})),a.ok(_);function v(){const S=T();s.if(!1);for(const C in S)s.elseIf((0,n._)`${g} === ${C}`),s.assign(_,E(S[C]));s.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:g,tagName:p}),s.endIf()}function E(S){const C=s.name("valid"),O=a.subschema({keyword:"oneOf",schemaProp:S},C);return a.mergeEvaluated(O,n.Name),C}function T(){var S;const C={},O=M(f);let A=!0;for(let V=0;V<h.length;V++){let B=h[V];B!=null&&B.$ref&&!(0,i.schemaHasRulesButRef)(B,c.self.RULES)&&(B=e.resolveRef.call(c.self,c.schemaEnv.root,c.baseId,B==null?void 0:B.$ref),B instanceof e.SchemaEnv&&(B=B.schema));const z=(S=B==null?void 0:B.properties)===null||S===void 0?void 0:S[p];if(typeof z!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);A=A&&(O||M(B)),D(z,V)}if(!A)throw new Error(`discriminator: "${p}" must be required`);return C;function M({required:V}){return Array.isArray(V)&&V.includes(p)}function D(V,B){if(V.const)U(V.const,B);else if(V.enum)for(const z of V.enum)U(z,B);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function U(V,B){if(typeof V!="string"||V in C)throw new Error(`discriminator: "${p}" values must be unique strings`);C[V]=B}}}};return Jh.default=o,Jh}const tN="http://json-schema.org/draft-07/schema#",iN="http://json-schema.org/draft-07/schema#",rN="Core schema meta-schema",nN={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},oN=["object","boolean"],aN={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},sN={$schema:tN,$id:iN,title:rN,definitions:nN,type:oN,properties:aN,default:!0};var HS;function pM(){return HS||(HS=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const e=yL(),i=ZL(),r=eN(),o=sN,a=["/properties"],s="http://json-schema.org/draft-07/schema";class l extends e.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const h=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(h,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}n.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=oc();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Xt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}(mh,mh.exports)),mh.exports}var hf={exports:{}},df={exports:{}},pf={exports:{}},ed={exports:{}},jS;function lN(){return jS||(jS=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=["undefined","string","number","object","function","boolean","symbol"];function r(){return{keyword:"typeof",schemaType:["string","array"],code(o){const{data:a,schema:s,schemaValue:l}=o;o.fail(typeof s=="string"?(0,e._)`typeof ${a} != ${s}`:(0,e._)`${l}.indexOf(typeof ${a}) < 0`)},metaSchema:{anyOf:[{type:"string",enum:i},{type:"array",items:{type:"string",enum:i}}]}}}t.default=r,n.exports=r}(ed,ed.exports)),ed.exports}var XS=pf.exports,YS;function uN(){return YS||(YS=1,function(n,t){var e=XS&&XS.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(lN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(pf,pf.exports)),pf.exports}var _f={exports:{}},td={exports:{}},KS;function fN(){return KS||(KS=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e={Object,Array,Function,Number,String,Date,RegExp};typeof Buffer<"u"&&(e.Buffer=Buffer),typeof Promise<"u"&&(e.Promise=Promise);const i=Object.assign(r,{CONSTRUCTORS:e});function r(){return{keyword:"instanceof",schemaType:["string","array"],compile(a){if(typeof a=="string"){const s=o(a);return l=>l instanceof s}if(Array.isArray(a)){const s=a.map(o);return l=>{for(const u of s)if(l instanceof u)return!0;return!1}}throw new Error("ajv implementation error")},metaSchema:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}}function o(a){const s=e[a];if(s)return s;throw new Error(`invalid "instanceof" keyword value ${a}`)}t.default=i,n.exports=i}(td,td.exports)),td.exports}var qS=_f.exports,QS;function cN(){return QS||(QS=1,function(n,t){var e=qS&&qS.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(fN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(_f,_f.exports)),_f.exports}var mf={exports:{}},gf={exports:{}},id={},$S;function _M(){if($S)return id;$S=1,Object.defineProperty(id,"__esModule",{value:!0});function n(t){return()=>({keyword:t,type:"number",schemaType:"array",macro:function([i,r]){return e(i,r),t==="range"?{minimum:i,maximum:r}:{exclusiveMinimum:i,exclusiveMaximum:r}},metaSchema:{type:"array",minItems:2,maxItems:2,items:{type:"number"}}});function e(i,r){if(i>r||t==="exclusiveRange"&&i===r)throw new Error("There are no numbers in range")}}return id.default=n,id}var ZS=gf.exports,JS;function hN(){return JS||(JS=1,function(n,t){var e=ZS&&ZS.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(_M()).default)("range");t.default=r,n.exports=r}(gf,gf.exports)),gf.exports}var eC=mf.exports,tC;function dN(){return tC||(tC=1,function(n,t){var e=eC&&eC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(hN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(mf,mf.exports)),mf.exports}var vf={exports:{}},yf={exports:{}},iC=yf.exports,rC;function pN(){return rC||(rC=1,function(n,t){var e=iC&&iC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(_M()).default)("exclusiveRange");t.default=r,n.exports=r}(yf,yf.exports)),yf.exports}var nC=vf.exports,oC;function _N(){return oC||(oC=1,function(n,t){var e=nC&&nC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(pN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(vf,vf.exports)),vf.exports}var bf={exports:{}},rd={exports:{}},Rs={},aC;function tp(){if(aC)return Rs;aC=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.usePattern=Rs.metaSchemaRef=void 0;const n=Xt(),t="http://json-schema.org/schema";function e({defaultMeta:r}={}){return r===!1?{}:{$ref:r||t}}Rs.metaSchemaRef=e;function i({gen:r,it:{opts:o}},a,s=o.unicodeRegExp?"u":""){const l=new RegExp(a,s);return r.scopeValue("pattern",{key:l.toString(),ref:l,code:(0,n._)`new RegExp(${a}, ${s})`})}return Rs.usePattern=i,Rs}var sC;function mN(){return sC||(sC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=tp(),r={type:"object",properties:{pattern:{type:"string"},flags:{type:"string",nullable:!0}},required:["pattern"],additionalProperties:!1},o=/^\/(.*)\/([gimuy]*)$/;function a(){return{keyword:"regexp",type:"string",schemaType:["string","object"],code(s){const{data:l,schema:u}=s,f=c(u);s.pass((0,e._)`${f}.test(${l})`);function c(h){if(typeof h=="object")return(0,i.usePattern)(s,h.pattern,h.flags);const p=o.exec(h);if(p)return(0,i.usePattern)(s,p[1],p[2]);throw new Error("cannot parse string into RegExp")}},metaSchema:{anyOf:[{type:"string"},r]}}}t.default=a,n.exports=a}(rd,rd.exports)),rd.exports}var lC=bf.exports,uC;function gN(){return uC||(uC=1,function(n,t){var e=lC&&lC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(mN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(bf,bf.exports)),bf.exports}var Ef={exports:{}},nd={exports:{}},fC;function vN(){return fC||(fC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i={trimStart:l=>l.trimStart(),trimEnd:l=>l.trimEnd(),trimLeft:l=>l.trimStart(),trimRight:l=>l.trimEnd(),trim:l=>l.trim(),toLowerCase:l=>l.toLowerCase(),toUpperCase:l=>l.toUpperCase(),toEnumCase:(l,u)=>(u==null?void 0:u.hash[s(l)])||l},r=Object.assign(o,{transform:i});function o(){return{keyword:"transform",schemaType:"array",before:"enum",code(l){const{gen:u,data:f,schema:c,parentSchema:h,it:p}=l,{parentData:_,parentDataProperty:g}=p,v=c;if(!v.length)return;let E;if(v.includes("toEnumCase")){const S=a(h);E=u.scopeValue("obj",{ref:S,code:(0,e.stringify)(S)})}u.if((0,e._)`typeof ${f} == "string" && ${_} !== undefined`,()=>{u.assign(f,T(v.slice())),u.assign((0,e._)`${_}[${g}]`,f)});function T(S){if(!S.length)return f;const C=S.pop();if(!(C in i))throw new Error(`transform: unknown transformation ${C}`);const O=u.scopeValue("func",{ref:i[C],code:(0,e._)`require("ajv-keywords/dist/definitions/transform").transform${(0,e.getProperty)(C)}`}),A=T(S);return E&&C==="toEnumCase"?(0,e._)`${O}(${A}, ${E})`:(0,e._)`${O}(${A})`}},metaSchema:{type:"array",items:{type:"string",enum:Object.keys(i)}}}}function a(l){const u={hash:{}};if(!l.enum)throw new Error('transform: "toEnumCase" requires "enum"');for(const f of l.enum){if(typeof f!="string")continue;const c=s(f);if(u.hash[c])throw new Error('transform: "toEnumCase" requires all lowercased "enum" values to be unique');u.hash[c]=f}return u}function s(l){return l.toLowerCase()}t.default=r,n.exports=r}(nd,nd.exports)),nd.exports}var cC=Ef.exports,hC;function yN(){return hC||(hC=1,function(n,t){var e=cC&&cC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(vN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Ef,Ef.exports)),Ef.exports}var Tf={exports:{}},od={exports:{}},dC;function bN(){return dC||(dC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Jd(),i=["number","integer","string","boolean","null"];function r(){return{keyword:"uniqueItemProperties",type:"array",schemaType:"array",compile(a,s){const l=o(a,s);return u=>{if(u.length<=1)return!0;for(let f=0;f<a.length;f++){const c=a[f];if(l[f]){const h={};for(const p of u){if(!p||typeof p!="object")continue;let _=p[c];if(!(_&&typeof _=="object")){if(typeof _=="string"&&(_='"'+_),h[_])return!1;h[_]=!0}}}else for(let h=u.length;h--;){const p=u[h];if(!(!p||typeof p!="object"))for(let _=h;_--;){const g=u[_];if(g&&typeof g=="object"&&e(p[c],g[c]))return!1}}}return!0}},metaSchema:{type:"array",items:{type:"string"}}}}t.default=r;function o(a,s){return a.map(l=>{var u,f,c;const h=(c=(f=(u=s.items)===null||u===void 0?void 0:u.properties)===null||f===void 0?void 0:f[l])===null||c===void 0?void 0:c.type;return Array.isArray(h)?!h.includes("object")&&!h.includes("array"):i.includes(h)})}n.exports=r}(od,od.exports)),od.exports}var pC=Tf.exports,_C;function EN(){return _C||(_C=1,function(n,t){var e=pC&&pC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(bN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Tf,Tf.exports)),Tf.exports}var Sf={exports:{}},ad={exports:{}},mC;function TN(){return mC||(mC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});function e(){return{keyword:"allRequired",type:"object",schemaType:"boolean",macro(i,r){if(!i)return!0;const o=Object.keys(r.properties);return o.length===0?!0:{required:o}},dependencies:["properties"]}}t.default=e,n.exports=e}(ad,ad.exports)),ad.exports}var gC=Sf.exports,vC;function SN(){return vC||(vC=1,function(n,t){var e=gC&&gC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(TN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Sf,Sf.exports)),Sf.exports}var Cf={exports:{}},Pf={exports:{}},sd={},yC;function mM(){if(yC)return sd;yC=1,Object.defineProperty(sd,"__esModule",{value:!0});function n(t){return()=>({keyword:t,type:"object",schemaType:"array",macro(e){return e.length===0?!0:e.length===1?{required:e}:{[t==="anyRequired"?"anyOf":"oneOf"]:e.map(r=>({required:[r]}))}},metaSchema:{type:"array",items:{type:"string"}}})}return sd.default=n,sd}var bC=Pf.exports,EC;function CN(){return EC||(EC=1,function(n,t){var e=bC&&bC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(mM()).default)("anyRequired");t.default=r,n.exports=r}(Pf,Pf.exports)),Pf.exports}var TC=Cf.exports,SC;function PN(){return SC||(SC=1,function(n,t){var e=TC&&TC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(CN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Cf,Cf.exports)),Cf.exports}var Af={exports:{}},Rf={exports:{}},CC=Rf.exports,PC;function AN(){return PC||(PC=1,function(n,t){var e=CC&&CC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const r=(0,e(mM()).default)("oneRequired");t.default=r,n.exports=r}(Rf,Rf.exports)),Rf.exports}var AC=Af.exports,RC;function RN(){return RC||(RC=1,function(n,t){var e=AC&&AC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(AN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Af,Af.exports)),Af.exports}var Of={exports:{}},ld={exports:{}},OC;function ON(){return OC||(OC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=tp(),r={message:({params:{missingPattern:a}})=>(0,e.str)`should have property matching pattern '${a}'`,params:({params:{missingPattern:a}})=>(0,e._)`{missingPattern: ${a}}`};function o(){return{keyword:"patternRequired",type:"object",schemaType:"array",error:r,code(a){const{gen:s,schema:l,data:u}=a;if(l.length===0)return;const f=s.let("valid",!0);for(const h of l)c(h);function c(h){const p=s.let("matched",!1);s.forIn("key",u,_=>{s.assign(p,(0,e._)`${(0,i.usePattern)(a,h)}.test(${_})`),s.if(p,()=>s.break())}),a.setParams({missingPattern:h}),s.assign(f,(0,e.and)(f,p)),a.pass(f)}},metaSchema:{type:"array",items:{type:"string",format:"regex"},uniqueItems:!0}}}t.default=o,n.exports=o}(ld,ld.exports)),ld.exports}var MC=Of.exports,xC;function MN(){return xC||(xC=1,function(n,t){var e=MC&&MC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(ON()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Of,Of.exports)),Of.exports}var Mf={exports:{}},ud={exports:{}},IC;function xN(){return IC||(IC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});function e(){return{keyword:"prohibited",type:"object",schemaType:"array",macro:function(i){return i.length===0?!0:i.length===1?{not:{required:i}}:{not:{anyOf:i.map(r=>({required:[r]}))}}},metaSchema:{type:"array",items:{type:"string"}}}}t.default=e,n.exports=e}(ud,ud.exports)),ud.exports}var DC=Mf.exports,wC;function IN(){return wC||(wC=1,function(n,t){var e=DC&&DC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(xN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Mf,Mf.exports)),Mf.exports}var xf={exports:{}},fd={exports:{}},LC;function DN(){return LC||(LC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=tp();function i(a){return{keyword:"deepProperties",type:"object",schemaType:"object",macro:function(s){const l=[];for(const u in s)l.push(r(u,s[u]));return{allOf:l}},metaSchema:{type:"object",propertyNames:{type:"string",format:"json-pointer"},additionalProperties:(0,e.metaSchemaRef)(a)}}}t.default=i;function r(a,s){const l=a.split("/"),u={};let f=u;for(let c=1;c<l.length;c++){let h=l[c];const p=c===l.length-1;h=o(h);const _=f.properties={};let g;if(/[0-9]+/.test(h)){let v=+h;for(g=f.items=[],f.type=["object","array"];v--;)g.push({})}else f.type="object";f=p?s:{},_[h]=f,g&&g.push(f)}return u}function o(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}n.exports=i}(fd,fd.exports)),fd.exports}var NC=xf.exports,FC;function wN(){return FC||(FC=1,function(n,t){var e=NC&&NC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(DN()),r=(o,a)=>o.addKeyword((0,i.default)(a));t.default=r,n.exports=r}(xf,xf.exports)),xf.exports}var If={exports:{}},cd={exports:{}},BC;function LN(){return BC||(BC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt();function i(){return{keyword:"deepRequired",type:"object",schemaType:"array",code(o){const{schema:a,data:s}=o,l=a.map(f=>(0,e._)`(${u(f)}) === undefined`);o.fail((0,e.or)(...l));function u(f){if(f==="")throw new Error("empty JSON pointer not allowed");const c=f.split("/");let h=s;const p=c.map((_,g)=>g?h=(0,e._)`${h}${(0,e.getProperty)(r(_))}`:h);return(0,e.and)(...p)}},metaSchema:{type:"array",items:{type:"string",format:"json-pointer"}}}}t.default=i;function r(o){return o.replace(/~1/g,"/").replace(/~0/g,"~")}n.exports=i}(cd,cd.exports)),cd.exports}var VC=If.exports,UC;function NN(){return UC||(UC=1,function(n,t){var e=VC&&VC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(LN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(If,If.exports)),If.exports}var Df={exports:{}},hd={exports:{}},kC;function FN(){return kC||(kC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e={},i={timestamp:()=>()=>Date.now(),datetime:()=>()=>new Date().toISOString(),date:()=>()=>new Date().toISOString().slice(0,10),time:()=>()=>new Date().toISOString().slice(11),random:()=>()=>Math.random(),randomint:f=>{var c;const h=(c=f==null?void 0:f.max)!==null&&c!==void 0?c:2;return()=>Math.floor(Math.random()*h)},seq:f=>{var c;const h=(c=f==null?void 0:f.name)!==null&&c!==void 0?c:"";return e[h]||(e[h]=0),()=>e[h]++}},r=Object.assign(o,{DEFAULTS:i});function o(){return{keyword:"dynamicDefaults",type:"object",schemaType:["string","object"],modifying:!0,valid:!0,compile(f,c,h){if(!h.opts.useDefaults||h.compositeRule)return()=>!0;const p={};for(const g in f)p[g]=a(f[g]);const _=h.opts.useDefaults==="empty";return g=>{for(const v in f)(g[v]===void 0||_&&(g[v]===null||g[v]===""))&&(g[v]=p[v]());return!0}},metaSchema:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"object",additionalProperties:!1,required:["func","args"],properties:{func:{type:"string"},args:{type:"object"}}}]}}}}function a(f){return typeof f=="object"?s(f):l(f)}function s({func:f,args:c}){const h=i[f];return u(f,h),h(c)}function l(f=""){const c=i[f];return u(f,c),c()}function u(f,c){if(!c)throw new Error(`invalid "dynamicDefaults" keyword property value: ${f}`)}t.default=r,n.exports=r}(hd,hd.exports)),hd.exports}var zC=Df.exports,GC;function BN(){return GC||(GC=1,function(n,t){var e=zC&&zC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(FN()),r=o=>o.addKeyword((0,i.default)());t.default=r,n.exports=r}(Df,Df.exports)),Df.exports}var wf={exports:{}},dd={exports:{}},WC;function VN(){return WC||(WC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=Xt(),i=tp(),r={message:({params:{schemaProp:a}})=>a?(0,e.str)`should match case "${a}" schema`:(0,e.str)`should match default case schema`,params:({params:{schemaProp:a}})=>a?(0,e._)`{failingCase: ${a}}`:(0,e._)`{failingDefault: true}`};function o(a){const s=(0,i.metaSchemaRef)(a);return[{keyword:"select",schemaType:["string","number","boolean","null"],$data:!0,error:r,dependencies:["selectCases"],code(l){const{gen:u,schemaCode:f,parentSchema:c}=l;l.block$data(e.nil,()=>{const h=u.let("valid",!0),p=u.name("_valid"),_=u.const("value",(0,e._)`${f} === null ? "null" : ${f}`);u.if(!1);for(const g in c.selectCases){l.setParams({schemaProp:g}),u.elseIf((0,e._)`"" + ${_} == ${g}`);const v=l.subschema({keyword:"selectCases",schemaProp:g},p);l.mergeEvaluated(v,e.Name),u.assign(h,p)}if(u.else(),c.selectDefault!==void 0){l.setParams({schemaProp:void 0});const g=l.subschema({keyword:"selectDefault"},p);l.mergeEvaluated(g,e.Name),u.assign(h,p)}u.endIf(),l.pass(h)})}},{keyword:"selectCases",dependencies:["select"],metaSchema:{type:"object",additionalProperties:s}},{keyword:"selectDefault",dependencies:["select","selectCases"],metaSchema:s}]}t.default=o,n.exports=o}(dd,dd.exports)),dd.exports}var HC=wf.exports,jC;function UN(){return jC||(jC=1,function(n,t){var e=HC&&HC.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(VN()),r=(o,a)=>((0,i.default)(a).forEach(s=>o.addKeyword(s)),o);t.default=r,n.exports=r}(wf,wf.exports)),wf.exports}var XC=df.exports,YC;function kN(){return YC||(YC=1,function(n,t){var e=XC&&XC.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(uN()),r=e(cN()),o=e(dN()),a=e(_N()),s=e(gN()),l=e(yN()),u=e(EN()),f=e(SN()),c=e(PN()),h=e(RN()),p=e(MN()),_=e(IN()),g=e(wN()),v=e(NN()),E=e(BN()),T=e(UN()),S={typeof:i.default,instanceof:r.default,range:o.default,exclusiveRange:a.default,regexp:s.default,transform:l.default,uniqueItemProperties:u.default,allRequired:f.default,anyRequired:c.default,oneRequired:h.default,patternRequired:p.default,prohibited:_.default,deepProperties:g.default,deepRequired:v.default,dynamicDefaults:E.default,select:T.default};t.default=S,n.exports=S}(df,df.exports)),df.exports}var KC=hf.exports,qC;function zN(){return qC||(qC=1,function(n,t){var e=KC&&KC.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(t,"__esModule",{value:!0});const i=e(kN()),r=(a,s)=>{if(Array.isArray(s)){for(const l of s)o(l)(a);return a}if(s)return o(s)(a),a;for(s in i.default)o(s)(a);return a};r.get=o;function o(a){const s=i.default[a];if(!s)throw new Error("Unknown keyword "+a);return s}t.default=r,n.exports=r,n.exports.default=r}(hf,hf.exports)),hf.exports}var pd={exports:{}},QC;function GN(){return QC||(QC=1,function(n,t){Object.defineProperty(t,"__esModule",{value:!0});const e=pM(),i=Xt(),r=Gf(),o=oc(),a=nc(),s=Aa(),l="errorMessage",u=new e.Name("emUsed"),f={required:"missingProperty",dependencies:"property",dependentRequired:"property"},c=/\$\{[^}]+\}/,h=/\$\{([^}]+)\}/g,p=/^""\s*\+\s*|\s*\+\s*""$/g;function _(v){return{keyword:l,schemaType:["string","object"],post:!0,code(E){const{gen:T,data:S,schema:C,schemaValue:O,it:A}=E;if(A.createErrors===!1)return;const M=C,D=i.strConcat(s.default.instancePath,A.errorPath);T.if(e._`${s.default.errors} > 0`,()=>{if(typeof M=="object"){const[$,L]=V(M);L&&B(L),$&&z($),J(U(M))}const W=typeof M=="string"?M:M._;W&&X(W),v.keepErrors||re()});function U({properties:W,items:$}){const L={};if(W){L.props={};for(const G in W)L.props[G]=[]}if($){L.items={};for(let G=0;G<$.length;G++)L.items[G]=[]}return L}function V(W){let $,L;for(const G in W){if(G==="properties"||G==="items")continue;const Y=W[G];if(typeof Y=="object"){$||($={});const Q=$[G]={};for(const fe in Y)Q[fe]=[]}else L||(L={}),L[G]=[]}return[$,L]}function B(W){const $=T.const("emErrors",e.stringify(W)),L=T.const("templates",Z(W,C));T.forOf("err",s.default.vErrors,fe=>T.if(ae(fe,$),()=>T.code(e._`${$}[${fe}.keyword].push(${fe})`).assign(e._`${fe}.${u}`,!0)));const{singleError:G}=v;if(G){const fe=T.let("message",e._`""`),Se=T.let("paramsErrors",e._`[]`);Y(ee=>{T.if(fe,()=>T.code(e._`${fe} += ${typeof G=="string"?G:";"}`)),T.code(e._`${fe} += ${Q(ee)}`),T.assign(Se,e._`${Se}.concat(${$}[${ee}])`)}),a.reportError(E,{message:fe,params:e._`{errors: ${Se}}`})}else Y(fe=>a.reportError(E,{message:Q(fe),params:e._`{errors: ${$}[${fe}]}`}));function Y(fe){T.forIn("key",$,Se=>T.if(e._`${$}[${Se}].length`,()=>fe(Se)))}function Q(fe){return e._`${fe} in ${L} ? ${L}[${fe}]() : ${O}[${fe}]`}}function z(W){const $=T.const("emErrors",e.stringify(W)),L=[];for(const Se in W)L.push([Se,Z(W[Se],C[Se])]);const G=T.const("templates",T.object(...L)),Y=T.scopeValue("obj",{ref:f,code:e.stringify(f)}),Q=T.let("emPropParams"),fe=T.let("emParamsErrors");T.forOf("err",s.default.vErrors,Se=>T.if(ae(Se,$),()=>{T.assign(Q,e._`${Y}[${Se}.keyword]`),T.assign(fe,e._`${$}[${Se}.keyword][${Se}.params[${Q}]]`),T.if(fe,()=>T.code(e._`${fe}.push(${Se})`).assign(e._`${Se}.${u}`,!0))})),T.forIn("key",$,Se=>T.forIn("keyProp",e._`${$}[${Se}]`,ee=>{T.assign(fe,e._`${$}[${Se}][${ee}]`),T.if(e._`${fe}.length`,()=>{const pe=T.const("tmpl",e._`${G}[${Se}] && ${G}[${Se}][${ee}]`);a.reportError(E,{message:e._`${pe} ? ${pe}() : ${O}[${Se}][${ee}]`,params:e._`{errors: ${fe}}`})})}))}function J(W){const{props:$,items:L}=W;if(!$&&!L)return;const G=e._`typeof ${S} == "object"`,Y=e._`Array.isArray(${S})`,Q=T.let("emErrors");let fe,Se;const ee=T.let("templates");$&&L?(fe=T.let("emChildKwd"),T.if(G),T.if(Y,()=>{pe(L,C.items),T.assign(fe,e.str`items`)},()=>{pe($,C.properties),T.assign(fe,e.str`properties`)}),Se=e._`[${fe}]`):L?(T.if(Y),pe(L,C.items),Se=e._`.items`):$&&(T.if(i.and(G,i.not(Y))),pe($,C.properties),Se=e._`.properties`),T.forOf("err",s.default.vErrors,Pe=>se(Pe,Q,xe=>T.code(e._`${Q}[${xe}].push(${Pe})`).assign(e._`${Pe}.${u}`,!0))),T.forIn("key",Q,Pe=>T.if(e._`${Q}[${Pe}].length`,()=>{a.reportError(E,{message:e._`${Pe} in ${ee} ? ${ee}[${Pe}]() : ${O}${Se}[${Pe}]`,params:e._`{errors: ${Q}[${Pe}]}`}),T.assign(e._`${s.default.vErrors}[${s.default.errors}-1].instancePath`,e._`${D} + "/" + ${Pe}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),T.endIf();function pe(Pe,xe){T.assign(Q,e.stringify(Pe)),T.assign(ee,Z(Pe,xe))}}function X(W){const $=T.const("emErrs",e._`[]`);T.forOf("err",s.default.vErrors,L=>T.if(H(L),()=>T.code(e._`${$}.push(${L})`).assign(e._`${L}.${u}`,!0))),T.if(e._`${$}.length`,()=>a.reportError(E,{message:q(W),params:e._`{errors: ${$}}`}))}function re(){const W=T.const("emErrs",e._`[]`);T.forOf("err",s.default.vErrors,$=>T.if(e._`!${$}.${u}`,()=>T.code(e._`${W}.push(${$})`))),T.assign(s.default.vErrors,W).assign(s.default.errors,e._`${W}.length`)}function ae(W,$){return i.and(e._`${W}.keyword !== ${l}`,e._`!${W}.${u}`,e._`${W}.instancePath === ${D}`,e._`${W}.keyword in ${$}`,e._`${W}.schemaPath.indexOf(${A.errSchemaPath}) === 0`,e._`/^\\/[^\\/]*$/.test(${W}.schemaPath.slice(${A.errSchemaPath.length}))`)}function se(W,$,L){T.if(i.and(e._`${W}.keyword !== ${l}`,e._`!${W}.${u}`,e._`${W}.instancePath.indexOf(${D}) === 0`),()=>{const G=T.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:e._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),Y=T.const("emMatches",e._`${G}.exec(${W}.instancePath.slice(${D}.length))`),Q=T.const("emChild",e._`${Y} && ${Y}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);T.if(e._`${Q} !== undefined && ${Q} in ${$}`,()=>L(Q))})}function H(W){return i.and(e._`${W}.keyword !== ${l}`,e._`!${W}.${u}`,i.or(e._`${W}.instancePath === ${D}`,i.and(e._`${W}.instancePath.indexOf(${D}) === 0`,e._`${W}.instancePath[${D}.length] === "/"`)),e._`${W}.schemaPath.indexOf(${A.errSchemaPath}) === 0`,e._`${W}.schemaPath[${A.errSchemaPath}.length] === "/"`)}function Z(W,$){const L=[];for(const G in W){const Y=$[G];c.test(Y)&&L.push([G,N(Y)])}return T.object(...L)}function q(W){return c.test(W)?new r._Code(r.safeStringify(W).replace(h,($,L)=>`" + JSON.stringify(${o.getData(L,A)}) + "`).replace(p,"")):e.stringify(W)}function N(W){return e._`function(){return ${q(W)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const g=(v,E={})=>{if(!v.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(v.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return v.addKeyword(_(E))};t.default=g,n.exports=g,n.exports.default=g}(pd,pd.exports)),pd.exports}var $C;function st(){if($C)return go;$C=1;var n=go&&go.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(go,"__esModule",{value:!0}),go.validateType=go.generateLazyValidator=go.Ajv=void 0;const t=n(pM());go.Ajv=t.default;const e=n(zN()),i=n(GN());function r(a,s){let l=null;const u=(f,c)=>{if(!l){const h=new t.default({$data:!0,allErrors:!0});(0,e.default)(h),(0,i.default)(h,{singleError:!0}),s==null||s.forEach(p=>h.addKeyword(p)),l=h.compile(a),Object.defineProperty(u,"errors",{get(){return l==null?void 0:l.errors}})}return l(f,c)};return u}go.generateLazyValidator=r;function o(a,s){return a.validate(s)}return go.validateType=o,go}var ZC;function WN(){return ZC||(ZC=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SceneUpdate=n.SCENE_UPDATE=void 0;const t=st();n.SCENE_UPDATE="SCENE_UPDATE",function(e){e.schema={type:"object",properties:{type:{type:"string",enum:[n.SCENE_UPDATE]},payload:{type:"object",properties:{sceneId:{type:"string"},sceneType:{type:"string"}},additionalProperties:!1,required:["sceneId","sceneType"]}},required:["payload","type"]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.SceneUpdate||(n.SceneUpdate={}))}(sm)),sm}var ym={},JC;function HN(){return JC||(JC=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Update=n.UPDATE=void 0;const t=st();n.UPDATE="update",function(e){e.schema={type:"object",properties:{type:{type:"string",enum:[n.UPDATE]}},required:["type"]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Update||(n.Update={}))}(ym)),ym}var eP;function jN(){return eP||(eP=1,function(n){var t=Ss&&Ss.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ss&&Ss.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(WN(),n),e(HN(),n)}(Ss)),Ss}var Os={},bm={},tP;function XN(){return tP||(tP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProjectType=void 0;const t=st();(function(e){e.SCENE="scene",e.SMART_ITEM="smart-item",e.PORTABLE_EXPERIENCE="portable-experience",e.LIBRARY="library"})(n.ProjectType||(n.ProjectType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.ProjectType||(n.ProjectType={}))}(bm)),bm}var Em={},Tm={},iP;function ip(){return iP||(iP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Rarity=void 0;const t=st();(function(e){e.UNIQUE="unique",e.MYTHIC="mythic",e.EXOTIC="exotic",e.LEGENDARY="legendary",e.EPIC="epic",e.RARE="rare",e.UNCOMMON="uncommon",e.COMMON="common"})(n.Rarity||(n.Rarity={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema);const i={[e.UNIQUE]:1,[e.MYTHIC]:10,[e.EXOTIC]:50,[e.LEGENDARY]:100,[e.EPIC]:1e3,[e.RARE]:5e3,[e.UNCOMMON]:1e4,[e.COMMON]:1e5},r={[e.UNIQUE]:"#FFE617",[e.MYTHIC]:"#FB7DE3",[e.EXOTIC]:"#E4FFB8",[e.LEGENDARY]:"#A657ED",[e.EPIC]:"#6397F2",[e.RARE]:"#3AD682",[e.UNCOMMON]:"#FF8563",[e.COMMON]:"#D4E0E0"},o={[e.UNIQUE]:"#FFB626",[e.MYTHIC]:"#FF63E1",[e.EXOTIC]:"#CAFF73",[e.LEGENDARY]:"#842DDA",[e.EPIC]:"#3D85E6",[e.RARE]:"#36CF75",[e.UNCOMMON]:"#ED6D4F",[e.COMMON]:"#ABC1C1"};function a(f){return i[f]}e.getMaxSupply=a;function s(f){return o[f]}e.getColor=s;function l(){return[e.UNIQUE,e.MYTHIC,e.EXOTIC,e.LEGENDARY,e.EPIC,e.RARE,e.UNCOMMON,e.COMMON]}e.getRarities=l;function u(f){return[r[f],o[f]]}e.getGradient=u}(n.Rarity||(n.Rarity={}))}(Tm)),Tm}var Sm={},rP;function Zs(){return rP||(rP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WearableCategory=void 0;const t=st();(function(e){e.EYEBROWS="eyebrows",e.EYES="eyes",e.FACIAL_HAIR="facial_hair",e.HAIR="hair",e.BODY_SHAPE="body_shape",e.MOUTH="mouth",e.UPPER_BODY="upper_body",e.LOWER_BODY="lower_body",e.FEET="feet",e.EARRING="earring",e.EYEWEAR="eyewear",e.HAT="hat",e.HELMET="helmet",e.MASK="mask",e.TIARA="tiara",e.TOP_HEAD="top_head",e.SKIN="skin",e.HANDS_WEAR="hands_wear"})(n.WearableCategory||(n.WearableCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.WearableCategory||(n.WearableCategory={}))}(Sm)),Sm}var Cm={},Pm={},nP;function db(){return nP||(nP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.BodyShape=void 0;const t=st();(function(e){e.MALE="urn:decentraland:off-chain:base-avatars:BaseMale",e.FEMALE="urn:decentraland:off-chain:base-avatars:BaseFemale"})(n.BodyShape||(n.BodyShape={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.BodyShape||(n.BodyShape={}))}(Pm)),Pm}var Am={},Rm={},oP;function gM(){return oP||(oP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.BodyPartCategory=void 0;const t=st();(function(e){e.HEAD="head",e.HANDS="hands"})(n.BodyPartCategory||(n.BodyPartCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.BodyPartCategory||(n.BodyPartCategory={}))}(Rm)),Rm}var aP;function pb(){return aP||(aP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.HideableWearableCategory=void 0;const t=Zs(),e=st(),i=gM();(function(r){r.schema={oneOf:[Object.assign({},t.WearableCategory.schema),Object.assign({},i.BodyPartCategory.schema)]},r.validate=(0,e.generateLazyValidator)(r.schema)})(n.HideableWearableCategory||(n.HideableWearableCategory={}))}(Am)),Am}var sP;function _b(){return sP||(sP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WearableRepresentation=void 0;const t=st(),e=db(),i=pb();(function(r){r.schema={type:"object",properties:{bodyShapes:{type:"array",items:e.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}}},overrideHides:{type:"array",items:i.HideableWearableCategory.schema},overrideReplaces:{type:"array",items:i.HideableWearableCategory.schema}},required:["bodyShapes","mainFile","contents","overrideHides","overrideReplaces"]},r.validate=(0,t.generateLazyValidator)(r.schema)})(n.WearableRepresentation||(n.WearableRepresentation={}))}(Cm)),Cm}var Ms={},xs={},Om={},Mm={},lP;function Js(){return lP||(lP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.IPFSv1=n.IPFSv2=n.EthAddress=n.Color3=void 0;const t=st();(function(e){e.schema={type:"object",required:["r","g","b"],properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}}};const i=(0,t.generateLazyValidator)(e.schema);e.validate=r=>i(r)})(n.Color3||(n.Color3={})),function(e){e.schema={type:"string",pattern:"^0x[a-fA-F0-9]{40}$"};const i=new RegExp(e.schema.pattern);e.validate=r=>i.test(r)}(n.EthAddress||(n.EthAddress={})),function(e){e.schema={type:"string",pattern:"^(ba)[a-zA-Z0-9]{57}$"};const i=new RegExp(e.schema.pattern);e.validate=r=>i.test(r)}(n.IPFSv2||(n.IPFSv2={})),function(e){e.schema={type:"string",pattern:"^(Qm)[a-zA-Z0-9]{44}$"};const i=new RegExp(e.schema.pattern);e.validate=r=>i.test(r)}(n.IPFSv1||(n.IPFSv1={}))}(Mm)),Mm}var uP;function vM(){return uP||(uP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Avatar=n.Link=n.LinkUrl=n.AvatarInfo=n.Snapshots=void 0;const t=Zs(),e=Js(),i=st();var r;(function(l){l.schema={type:"object",required:["face256","body"],properties:{face256:e.IPFSv2.schema,body:e.IPFSv2.schema}},l.validate=(0,i.generateLazyValidator)(l.schema)})(r=n.Snapshots||(n.Snapshots={}));var o;(function(l){l.schema={type:"object",required:["bodyShape","eyes","hair","skin"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:e.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:e.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:e.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:t.WearableCategory.schema},emotes:{type:"array",items:{type:"object",properties:{slot:{type:"number"},urn:{type:"string"}},required:["slot","urn"]},nullable:!0},snapshots:Object.assign(Object.assign({},r.schema),{nullable:!0})},additionalProperties:!0},l.validate=(0,i.generateLazyValidator)(l.schema)})(o=n.AvatarInfo||(n.AvatarInfo={}));var a;(function(l){l.schema={type:"string",maxLength:2083,pattern:"^(?:https?):\\/\\/[^\\s/$.?#].[^\\s]*$"};const u=new RegExp(l.schema.pattern,"i");l.validate=f=>u.test(f)})(a=n.LinkUrl||(n.LinkUrl={}));var s;(function(l){l.schema={type:"object",required:["title","url"],properties:{title:{type:"string"},url:a.schema}}})(s=n.Link||(n.Link={})),function(l){l.schema={type:"object",required:["name","description","ethAddress","version","tutorialStep","avatar","hasClaimedName"],properties:{userId:{type:"string"},name:{type:"string"},description:{type:"string"},links:{type:"array",maxItems:5,items:s.schema,nullable:!0},country:{nullable:!0,type:"string"},employmentStatus:{nullable:!0,type:"string"},gender:{nullable:!0,type:"string"},pronouns:{nullable:!0,type:"string"},relationshipStatus:{nullable:!0,type:"string"},sexualOrientation:{nullable:!0,type:"string"},language:{nullable:!0,type:"string"},profession:{nullable:!0,type:"string"},birthdate:{nullable:!0,type:"number"},realName:{nullable:!0,type:"string"},hobbies:{nullable:!0,type:"string"},ethAddress:e.EthAddress.schema,version:{type:"number"},tutorialStep:{type:"number"},email:{type:"string",nullable:!0},blocked:{type:"array",items:{type:"string"},nullable:!0},muted:{type:"array",items:{type:"string"},nullable:!0},interests:{type:"array",items:{type:"string"},nullable:!0},hasClaimedName:{type:"boolean"},hasConnectedWeb3:{type:"boolean",nullable:!0},avatar:o.schema},additionalProperties:!0},l.validate=(0,i.generateLazyValidator)(l.schema)}(n.Avatar||(n.Avatar={}))}(Om)),Om}var xm={},fP;function YN(){return fP||(fP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Profile=void 0;const t=st(),e=vM();(function(i){i.schema={type:"object",required:["avatars"],properties:{avatars:{type:"array",items:e.Avatar.schema}},additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.Profile||(n.Profile={}))}(xm)),xm}var cP;function KN(){return cP||(cP=1,function(n){var t=xs&&xs.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=xs&&xs.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(vM(),n),e(YN(),n)}(xs)),xs}var Im={},Dm={},hP;function yM(){return hP||(hP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.FeatureToggles=n.portableExperiencesToggles=n.toggles=void 0;const t=st();n.toggles=["enabled","disabled"],n.portableExperiencesToggles=[...n.toggles,"hideUi"],function(e){e.schema={type:"object",properties:{voiceChat:{type:"string",enum:n.toggles,nullable:!0},portableExperiences:{type:"string",enum:n.portableExperiencesToggles,nullable:!0,errorMessage:`valid options are ${n.portableExperiencesToggles.join(", ")}`}},errorMessage:`valid options are ${n.toggles.join(", ")}`,required:[]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.FeatureToggles||(n.FeatureToggles={}))}(Dm)),Dm}var wm={},dP;function bM(){return dP||(dP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WorldConfiguration=void 0;const t=st();(function(e){e.schema={type:"object",properties:{name:{type:"string",nullable:!0},skybox:{type:"number",nullable:!0},minimapVisible:{type:"boolean",nullable:!0},miniMapConfig:{type:"object",nullable:!0,properties:{visible:{type:"boolean",nullable:!0},dataImage:{type:"string",nullable:!0},estateImage:{type:"string",nullable:!0}}},skyboxConfig:{type:"object",nullable:!0,properties:{fixedTime:{type:"number",nullable:!0},textures:{type:"array",nullable:!0,items:{type:"string"},oneOf:[{minItems:0,maxItems:0},{minItems:1,maxItems:1},{minItems:6,maxItems:6}],errorMessage:"customSkybox must be an array of 0, 1 or 6 strings"}}},fixedAdapter:{type:"string",nullable:!0},placesConfig:{type:"object",nullable:!0,properties:{optOut:{type:"boolean",nullable:!0}}}},required:[]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.WorldConfiguration||(n.WorldConfiguration={}))}(wm)),wm}var Lm={},pP;function EM(){return pP||(pP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SceneParcels=void 0;const t=st();(function(e){e.schema={description:'Describes a scene, a set of parcels whose content is treated as the same entity. A list of parcels is listed, for which one of them is considered the "base" for positioning purposes.',type:"object",properties:{base:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},parcels:{type:"array",items:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},minItems:1}},additionalProperties:!0,required:["base","parcels"]},e.schemaValidator=(0,t.generateLazyValidator)(e.schema),e.validate=i=>e.schemaValidator(i)&&i.parcels.includes(i.base)})(n.SceneParcels||(n.SceneParcels={}))}(Lm)),Lm}var Nm={},$u={},_P;function mb(){return _P||(_P=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.displayableProperties=void 0,$u.displayableProperties={menuBarIcon:{description:"Name of the file used as icon for the MenuBar",type:"string",nullable:!0}}),$u}var Fm={},mP;function TM(){return mP||(mP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Source=void 0;const t=st();(function(e){e.schema={type:"object",properties:{version:{type:"number",nullable:!0},origin:{type:"string"},projectId:{type:"string"},point:{type:"object",properties:{x:{type:"integer"},y:{type:"integer"}},nullable:!0,required:["x","y"]},rotation:{type:"string",enum:["north","east","south","west"],nullable:!0},layout:{type:"object",properties:{rows:{type:"integer"},cols:{type:"integer"}},nullable:!0,required:["rows","cols"]},isEmpty:{type:"boolean",nullable:!0}},additionalProperties:!0,required:["origin","projectId"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.Source||(n.Source={}))}(Fm)),Fm}var Bm={},gP;function SM(){return gP||(gP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SpawnPoint=void 0;const t=st();(function(e){e.schema={type:"object",properties:{name:{type:"string",nullable:!0},position:{type:"object",oneOf:[{$ref:"#single-position"},{$ref:"#multi-position"}],required:["x","y","z"]},default:{type:"boolean",nullable:!0},cameraTarget:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],nullable:!0}},required:["position"],definitions:{"single-position":{$id:"#single-position",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"]},"multi-position":{$id:"#multi-position",type:"object",properties:{x:{type:"array",items:{type:"number"},minItems:1},y:{type:"array",items:{type:"number"},minItems:1},z:{type:"array",items:{type:"number"},minItems:1}},required:["x","y","z"]}}},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.SpawnPoint||(n.SpawnPoint={}))}(Bm)),Bm}var vP;function qN(){return vP||(vP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Scene=n.RequiredPermission=void 0;const t=st(),e=mb(),i=yM(),r=EM(),o=TM(),a=SM(),s=bM();var l;(function(u){u.ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE="ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE",u.ALLOW_TO_TRIGGER_AVATAR_EMOTE="ALLOW_TO_TRIGGER_AVATAR_EMOTE",u.ALLOW_MEDIA_HOSTNAMES="ALLOW_MEDIA_HOSTNAMES",u.USE_WEB3_API="USE_WEB3_API",u.USE_FETCH="USE_FETCH",u.USE_WEBSOCKET="USE_WEBSOCKET",u.OPEN_EXTERNAL_LINK="OPEN_EXTERNAL_LINK"})(l=n.RequiredPermission||(n.RequiredPermission={})),function(u){u.schema={type:"object",properties:Object.assign(Object.assign({isPortableExperience:{description:"Define the current scene as a Portable Experience",type:"boolean",nullable:!0},main:{description:"File that contains the entry point of the scene's code",type:"string",minLength:1},scene:r.SceneParcels.schema},e.displayableProperties),{display:{description:"Information related to how should this land be displayed apart from the normal rendering of the scene",type:"object",properties:{title:{description:"A name so other users can identify what the contents of this land should be",type:"string",nullable:!0},favicon:{description:"DEPRECATED. Allow the land owner to set up a favicon to this land",type:"string",nullable:!0},description:{description:"A description that will be shown on client's nav map when the scene is selected",type:"string",nullable:!0},navmapThumbnail:{type:"string",nullable:!0}},nullable:!0,required:[]},owner:{type:"string",nullable:!0},contact:{description:"Describe different ways of contacting the land owner",type:"object",properties:{name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},im:{type:"string",nullable:!0},url:{type:"string",nullable:!0}},nullable:!0,required:[]},tags:{type:"array",items:{type:"string",minLength:1},nullable:!0},source:Object.assign(Object.assign({},o.Source.schema),{nullable:!0}),spawnPoints:{type:"array",items:a.SpawnPoint.schema,nullable:!0},requiredPermissions:{type:"array",items:{type:"string",enum:Object.values(l)},uniqueItems:!0,nullable:!0},featureToggles:Object.assign(Object.assign({},i.FeatureToggles.schema),{nullable:!0}),worldConfiguration:Object.assign(Object.assign({},s.WorldConfiguration.schema),{nullable:!0}),allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!0}}),additionalProperties:!0,required:["main","scene"],dependencies:{requiredPermissions:{if:{properties:{requiredPermissions:{type:"array",contains:{const:l.ALLOW_MEDIA_HOSTNAMES}}}},then:{properties:{allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!1,minItems:1}},required:["allowedMediaHostnames"]},else:{properties:{allowedMediaHostnames:{type:["null","array"],nullable:!0,maxItems:0}}}}}},u.validate=(0,t.generateLazyValidator)(u.schema)}(n.Scene||(n.Scene={}))}(Nm)),Nm}var yP;function QN(){return yP||(yP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SpawnPoint=n.Source=n.RequiredPermission=n.Scene=n.SceneParcels=n.WorldConfiguration=n.FeatureToggles=void 0;var t=yM();Object.defineProperty(n,"FeatureToggles",{enumerable:!0,get:function(){return t.FeatureToggles}});var e=bM();Object.defineProperty(n,"WorldConfiguration",{enumerable:!0,get:function(){return e.WorldConfiguration}});var i=EM();Object.defineProperty(n,"SceneParcels",{enumerable:!0,get:function(){return i.SceneParcels}});var r=qN();Object.defineProperty(n,"Scene",{enumerable:!0,get:function(){return r.Scene}}),Object.defineProperty(n,"RequiredPermission",{enumerable:!0,get:function(){return r.RequiredPermission}});var o=TM();Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return o.Source}});var a=SM();Object.defineProperty(n,"SpawnPoint",{enumerable:!0,get:function(){return a.SpawnPoint}})}(Im)),Im}var Is={},Vm={},Um={},bP;function CM(){return bP||(bP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Locale=void 0;const t=st();(function(e){e.EN="en",e.ES="es"})(n.Locale||(n.Locale={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Locale||(n.Locale={}))}(Um)),Um}var EP;function PM(){return EP||(EP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.I18N=void 0;const t=st(),e=CM();(function(i){i.schema={type:"object",properties:{code:e.Locale.schema,text:{type:"string"}},additionalProperties:!0,required:["code","text"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.I18N||(n.I18N={}))}(Vm)),Vm}var km={},TP;function AM(){return TP||(TP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Metrics=void 0;const t=st();(function(e){e.schema={type:"object",properties:{triangles:{type:"number"},materials:{type:"number"},textures:{type:"number"},meshes:{type:"number"},bodies:{type:"number"},entities:{type:"number"}},required:["triangles","materials","textures","meshes","bodies","entities"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.Metrics||(n.Metrics={}))}(km)),km}var zm={},SP;function gb(){return SP||(SP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isStandard=n.standardProperties=void 0;const t=ip(),e=st();n.standardProperties={collectionAddress:{type:"string",nullable:!1},rarity:t.Rarity.schema};const i={type:"object",properties:Object.assign({},n.standardProperties),required:["collectionAddress","rarity"]},r=(0,e.generateLazyValidator)(i);function o(a){return r(a)}n.isStandard=o}(zm)),zm}var Gm={},Ds={},Wm={},CP;function $N(){return CP||(CP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.MerkleProof=void 0;const t=st();(function(e){e.schema={type:"object",properties:{proof:{type:"array",items:{type:"string"}},index:{type:"number"},hashingKeys:{type:"array",items:{type:"string"}},entityHash:{type:"string"}},required:["entityHash","hashingKeys","index","proof"],additionalProperties:!0},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.MerkleProof||(n.MerkleProof={}))}(Wm)),Wm}var PP;function RM(){return PP||(PP=1,function(n){var t=Ds&&Ds.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ds&&Ds.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e($N(),n)}(Ds)),Ds}var Hm={},AP;function vb(){return AP||(AP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createMappingsHelper=n.AddMappingError=n.Mappings=n.Mapping=n.MultipleMapping=n.RangeMapping=n.AnyMapping=n.SingleMapping=n.ContractNetwork=n.MappingType=void 0;const t=st();var e;(function(c){c.SINGLE="single",c.ANY="any",c.MULTIPLE="multiple",c.RANGE="range"})(e=n.MappingType||(n.MappingType={}));var i;(function(c){c.MAINNET="mainnet",c.MATIC="matic",c.SEPOLIA="sepolia",c.AMOY="amoy"})(i=n.ContractNetwork||(n.ContractNetwork={}));var r;(function(c){c.schema={type:"object",properties:{type:{type:"string",const:e.SINGLE},id:{type:"string",pattern:"^[0-9]+$"}},required:["type","id"],additionalProperties:!1},c.validate=(0,t.generateLazyValidator)(c.schema)})(r=n.SingleMapping||(n.SingleMapping={}));var o;(function(c){c.schema={type:"object",properties:{type:{type:"string",const:e.ANY}},required:["type"],additionalProperties:!1},c.validate=(0,t.generateLazyValidator)(c.schema)})(o=n.AnyMapping||(n.AnyMapping={}));var a;(function(c){c._fromLessThanOrEqualTo={keyword:"_fromLessThanOrEqualTo",validate:function(p,_){if(!_||!_.from||!_.to)return!1;let{to:g,from:v}=_;return(typeof v!="bigint"||typeof g!="bigint")&&(v=BigInt(v),g=BigInt(g)),v<=g},errors:!1},c.schema={type:"object",properties:{type:{type:"string",const:e.RANGE},from:{type:"string",pattern:"^[0-9]+$"},to:{type:"string",pattern:"^[0-9]+$"}},required:["type","from","to"],additionalProperties:!1,_fromLessThanOrEqualTo:!0},c.validate=(0,t.generateLazyValidator)(c.schema,[c._fromLessThanOrEqualTo])})(a=n.RangeMapping||(n.RangeMapping={}));var s;(function(c){c.schema={type:"object",properties:{type:{type:"string",const:e.MULTIPLE},ids:{type:"array",items:{type:"string",pattern:"^[0-9]+$"},minItems:1,uniqueItems:!0}},required:["type","ids"],additionalProperties:!1},c.validate=(0,t.generateLazyValidator)(c.schema)})(s=n.MultipleMapping||(n.MultipleMapping={}));var l;(function(c){c.schema={type:"object",properties:{type:{type:"string",enum:Object.values(e)}},required:["type"],oneOf:[r.schema,o.schema,a.schema,s.schema]},c.validate=(0,t.generateLazyValidator)(c.schema,[a._fromLessThanOrEqualTo])})(l=n.Mapping||(n.Mapping={})),function(c){c._isMappingsValid={keyword:"_isMappingsValid",validate:function(p,_){try{f(_)}catch{return!1}return!0},errors:!1},c.innerSchema={type:"object",patternProperties:{"^0x[0-9a-fA-F]{40}$":{type:"array",items:l.schema}},minProperties:1,required:[],additionalProperties:!1};const h=Object.values(i).reduce((p,_)=>(p[_]=c.innerSchema,p),{});c.schema={type:"object",properties:h,minProperties:1,additionalProperties:!1,_isMappingsValid:!0},c.validate=(0,t.generateLazyValidator)(c.schema,[a._fromLessThanOrEqualTo,c._isMappingsValid])}(n.Mappings||(n.Mappings={}));class u extends Error{constructor(h,p,_){super(h),this.existingMapping=p,this.conflictingMapping=_}}n.AddMappingError=u;function f(c={}){const h={};for(const[O,A]of Object.entries(c)){h[O]={};for(const[M,D]of Object.entries(A))for(const U of D)S(O,M,U)}function p(){return JSON.parse(JSON.stringify(h))}function _(O,A,M){const D=BigInt(O);return D>=BigInt(A)&&D<=BigInt(M)}function g(O,A){switch(A.type){case e.SINGLE:return O.id===A.id;case e.MULTIPLE:return A.ids.includes(O.id);case e.RANGE:return _(O.id,A.from,A.to);default:return!1}}function v(O,A){switch(A.type){case e.SINGLE:return O.ids.includes(A.id);case e.MULTIPLE:return O.ids.some(M=>A.ids.includes(M));case e.RANGE:return O.ids.some(M=>_(M,A.from,A.to));default:return!1}}function E(O,A){switch(A.type){case e.SINGLE:return _(A.id,O.from,O.to);case e.MULTIPLE:return A.ids.some(M=>_(M,O.from,O.to));case e.RANGE:return BigInt(O.from)<=BigInt(A.to)&&BigInt(O.to)>=BigInt(A.from)}}function T(O,A){if(O.type===e.ANY||A.type===e.ANY)return!0;switch(O.type){case e.SINGLE:return g(O,A);case e.MULTIPLE:return v(O,A);case e.RANGE:return E(O,A)}}function S(O,A,M){var D,U;const V=A.toLowerCase();h[O]=(D=h[O])!==null&&D!==void 0?D:{},h[O][V]=(U=h[O][V])!==null&&U!==void 0?U:[];for(const B of h[O][V])if(T(B,M))throw new u(`Cannot add mapping to contract ${V} on network ${O} because it overlaps with existing mapping`,B,M);h[O][V].push(M)}function C(O,A,M){var D;return!((D=h[O])===null||D===void 0)&&D[A]?h[O][A].some(U=>{switch(U.type){case e.SINGLE:return U.id===M;case e.ANY:return!0;case e.MULTIPLE:return U.ids.includes(M);case e.RANGE:return BigInt(M)>=BigInt(U.from)&&BigInt(M)<=BigInt(U.to)}}):!1}return{addMapping:S,getMappings:p,includesNft:C}}n.createMappingsHelper=f}(Hm)),Hm}var RP;function yb(){return RP||(RP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.isThirdParty=n.schema=void 0;const t=st(),e=RM(),i=vb();n.schema={type:"object",properties:{merkleProof:e.MerkleProof.schema,content:{type:"object",nullable:!1,additionalProperties:{type:"string"},required:[]},mappings:Object.assign({nullable:!0},i.Mappings.schema)},required:["merkleProof","content"],_containsHashingKeys:!0};const r={keyword:"_containsHashingKeys",validate:function(s,l){var u;const f=l;return!((u=f==null?void 0:f.merkleProof)===null||u===void 0)&&u.hashingKeys?f.merkleProof.hashingKeys.every(c=>f.hasOwnProperty(c)):!1},errors:!1},o=(0,t.generateLazyValidator)(n.schema,[r,i.RangeMapping._fromLessThanOrEqualTo,i.Mappings._isMappingsValid]);function a(s){return o(s)}n.isThirdParty=a}(Gm)),Gm}var jm={},Xm={},yo={},OP;function OM(){if(OP)return yo;OP=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.isBaseEmote=yo.isBaseAvatar=yo.requiredBaseItemProps=yo.baseItemProperties=void 0;const n=PM(),t=AM(),e=mb();yo.baseItemProperties=Object.assign(Object.assign({},e.displayableProperties),{id:{type:"string"},name:{type:"string"},description:{type:"string"},i18n:{type:"array",items:n.I18N.schema,minItems:1,uniqueItemProperties:["code"],errorMessage:'${0#} array should not have duplicates for "code"'},thumbnail:{type:"string"},image:{type:"string"},metrics:Object.assign(Object.assign({},t.Metrics.schema),{nullable:!0})}),yo.requiredBaseItemProps=["id","name","description","i18n","thumbnail","image"];function i(o){if(!o||!o.id)return!1;const a=o.id.split(":"),s=a[1]==="decentraland",l=a[3]==="base-avatars";return a.length===5&&s&&l}yo.isBaseAvatar=i;function r(o){if(!o||!o.id)return!1;const a=o.id.split(":");return a.length===5&&a[1]==="decentraland"&&a[3]==="base-emotes"}return yo.isBaseEmote=r,yo}var MP;function ZN(){return MP||(MP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Wearable=void 0;const t=st(),e=Zs(),i=_b(),r=OM(),o=gb(),a=yb(),s=pb(),l=vb();(function(u){u.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},r.baseItemProperties),o.standardProperties),a.schema.properties.thirdPartyProps),{data:{type:"object",properties:{replaces:{type:"array",items:s.HideableWearableCategory.schema},hides:{type:"array",items:s.HideableWearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:i.WearableRepresentation.schema,minItems:1},category:e.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:s.HideableWearableCategory.schema},blockVrmExport:{type:"boolean",nullable:!0},outlineCompatible:{type:"boolean",nullable:!0}},required:["replaces","hides","tags","representations","category"]}}),additionalProperties:!0,required:[],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity","mappings"],_isBaseAvatar:!0},{required:[...r.requiredBaseItemProps,"data","collectionAddress","rarity"],prohibited:["merkleProof","content","mappings"]},{required:[...r.requiredBaseItemProps,"data","merkleProof","content"],prohibited:["collectionAddress","rarity"],_isThirdParty:!0}],errorMessage:{oneOf:"either standard XOR thirdparty properties conditions must be met"}};const f={keyword:"_isThirdParty",validate:(h,p)=>!h||(0,a.isThirdParty)(p),errors:!1},c={keyword:"_isBaseAvatar",validate:(h,p)=>!h||(0,r.isBaseAvatar)(p),errors:!1};u.validate=(0,t.generateLazyValidator)(u.schema,[f,c,l.RangeMapping._fromLessThanOrEqualTo,l.Mappings._isMappingsValid])})(n.Wearable||(n.Wearable={}))}(Xm)),Xm}var xP;function JN(){return xP||(xP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.HideableWearableCategory=n.BodyPartCategory=n.WearableCategory=n.Wearable=n.WearableRepresentation=void 0;var t=_b();Object.defineProperty(n,"WearableRepresentation",{enumerable:!0,get:function(){return t.WearableRepresentation}});var e=ZN();Object.defineProperty(n,"Wearable",{enumerable:!0,get:function(){return e.Wearable}});var i=Zs();Object.defineProperty(n,"WearableCategory",{enumerable:!0,get:function(){return i.WearableCategory}});var r=gM();Object.defineProperty(n,"BodyPartCategory",{enumerable:!0,get:function(){return r.BodyPartCategory}});var o=pb();Object.defineProperty(n,"HideableWearableCategory",{enumerable:!0,get:function(){return o.HideableWearableCategory}})}(jm)),jm}var Ym={},Km={},qm={},Qm={},IP;function MM(){return IP||(IP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteCategory=void 0;const t=st();(function(e){e.DANCE="dance",e.STUNT="stunt",e.GREETINGS="greetings",e.FUN="fun",e.POSES="poses",e.REACTIONS="reactions",e.HORROR="horror",e.MISCELLANEOUS="miscellaneous"})(n.EmoteCategory||(n.EmoteCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.EmoteCategory||(n.EmoteCategory={}))}(Qm)),Qm}var $m={},DP;function xM(){return DP||(DP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteRepresentationADR74=void 0;const t=st(),e=db();(function(i){i.schema={type:"object",properties:{bodyShapes:{type:"array",items:e.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}},errorMessage:{contains:"contents should contain mainFile: ${1/mainFile}"}}},required:["bodyShapes","mainFile","contents"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.EmoteRepresentationADR74||(n.EmoteRepresentationADR74={}))}($m)),$m}var Zm={},wP;function IM(){return wP||(wP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.OutcomeGroup=n.StartAnimation=n.EmoteClip=n.ArmatureId=void 0;const t=st();var e;(function(r){r.Armature="Armature",r.Armature_Prop="Armature_Prop",r.Armature_Other="Armature_Other"})(e=n.ArmatureId||(n.ArmatureId={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,t.generateLazyValidator)(r.schema)}(e=n.ArmatureId||(n.ArmatureId={}));var i;(function(r){r.schema={type:"object",properties:{animation:{type:"string",minLength:1,errorMessage:"animation must be a non-empty string (GLB clip name)"}},required:["animation"],additionalProperties:!1,errorMessage:{required:{animation:"animation is required (GLB clip name)"}}},r.validate=(0,t.generateLazyValidator)(r.schema)})(i=n.EmoteClip||(n.EmoteClip={})),function(r){r.schema={type:"object",properties:{loop:{type:"boolean",errorMessage:"startAnimation.loop must be a boolean"},[e.Armature]:Object.assign(Object.assign({},i.schema),{errorMessage:"startAnimation.Armature is required and must contain valid animation data"}),[e.Armature_Prop]:Object.assign(Object.assign({},i.schema),{nullable:!0,errorMessage:"startAnimation.Armature_Prop must contain valid animation data when provided"}),audio:{type:"string",nullable:!0,errorMessage:"audio must be a string (audio clip filename) when provided"}},required:["loop",e.Armature],additionalProperties:!1,errorMessage:{required:{loop:"startAnimation.loop is required",[e.Armature]:"startAnimation.Armature is required"}}},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.StartAnimation||(n.StartAnimation={})),function(r){r.schema={type:"object",properties:{title:{type:"string",minLength:1,errorMessage:"outcome.title must be a non-empty string"},loop:{type:"boolean",errorMessage:"outcome.loop must be a boolean"},clips:{type:"object",properties:Object.values(e).reduce((o,a)=>(o[a]=Object.assign(Object.assign({},i.schema),{nullable:!0,errorMessage:`outcome.clips.${a} must contain valid animation data when provided`}),o),{}),additionalProperties:!0,minProperties:1,errorMessage:"outcome.clips must contain at least one armature animation"},audio:{type:"string",nullable:!0,errorMessage:"audio must be a string (audio clip filename) when provided"}},required:["title","loop","clips"],additionalProperties:!1,errorMessage:{required:{title:"outcome.title is required",loop:"outcome.loop is required",clips:"outcome.clips is required"}}},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.OutcomeGroup||(n.OutcomeGroup={}))}(Zm)),Zm}var LP;function DM(){return LP||(LP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteDataADR74=void 0;const t=MM(),e=st(),i=xM(),r=IM();(function(o){o.schema={type:"object",properties:{tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:i.EmoteRepresentationADR74.schema,minItems:1},category:t.EmoteCategory.schema,loop:{type:"boolean"},startAnimation:Object.assign(Object.assign({},r.StartAnimation.schema),{nullable:!0}),randomizeOutcomes:{type:"boolean",nullable:!0},outcomes:{type:"array",items:r.OutcomeGroup.schema,minItems:1,maxItems:3,nullable:!0}},required:["category","tags","representations","loop"],dependencies:{startAnimation:["randomizeOutcomes","outcomes"],randomizeOutcomes:["startAnimation","outcomes"],outcomes:["startAnimation","randomizeOutcomes"]},additionalProperties:!0},o.validate=(0,e.generateLazyValidator)(o.schema)})(n.EmoteDataADR74||(n.EmoteDataADR74={}))}(qm)),qm}var NP;function e1(){return NP||(NP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Emote=void 0;const t=wM(),e=st(),i=OM(),r=gb(),o=yb(),a=DM();(function(s){s.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},i.baseItemProperties),r.standardProperties),o.schema.properties),{emoteDataADR74:a.EmoteDataADR74.schema}),additionalProperties:!0,required:[...i.requiredBaseItemProps],oneOf:[{required:["emoteDataADR74"],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity"],_isBaseEmote:!0},{required:["collectionAddress","rarity"],prohibited:["merkleProof","content"],errorMessage:"standard properties conditions are not met"},{required:["merkleProof","content","id","name","description","i18n","image","thumbnail","emoteDataADR74"],_isThirdParty:!0,prohibited:["collectionAddress","rarity"],errorMessage:"thirdparty properties conditions are not met"}],errorMessage:{oneOf:"emote should have either standard or thirdparty properties"}}],errorMessage:{oneOf:'emote should have "emoteDataADR74" and match its schema'}};const l={keyword:"_isThirdParty",validate:(f,c)=>!f||(0,t.isThirdParty)(c),errors:!1},u={keyword:"_isBaseEmote",validate:(f,c)=>!f||(0,i.isBaseEmote)(c),errors:!1};s.validate=(0,e.generateLazyValidator)(s.schema,[l,u,t.RangeMapping._fromLessThanOrEqualTo,t.Mappings._isMappingsValid])})(n.Emote||(n.Emote={}))}(Km)),Km}var Jm={},FP;function t1(){return FP||(FP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmotePlayMode=void 0;const t=st();(function(e){e.SIMPLE="simple",e.LOOP="loop"})(n.EmotePlayMode||(n.EmotePlayMode={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.EmotePlayMode||(n.EmotePlayMode={}))}(Jm)),Jm}var eg={},BP;function i1(){return BP||(BP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteOutcomeType=void 0;const t=st();(function(e){e.SIMPLE_OUTCOME="so",e.MULTIPLE_OUTCOME="mo",e.RANDOM_OUTCOME="ro"})(n.EmoteOutcomeType||(n.EmoteOutcomeType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.EmoteOutcomeType||(n.EmoteOutcomeType={}))}(eg)),eg}var VP;function r1(){return VP||(VP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EmoteOutcomeType=n.EmotePlayMode=n.EmoteCategory=n.StartAnimation=n.OutcomeGroup=n.EmoteClip=n.ArmatureId=n.EmoteDataADR74=n.EmoteRepresentationADR74=n.Emote=void 0;var t=e1();Object.defineProperty(n,"Emote",{enumerable:!0,get:function(){return t.Emote}});var e=xM();Object.defineProperty(n,"EmoteRepresentationADR74",{enumerable:!0,get:function(){return e.EmoteRepresentationADR74}});var i=DM();Object.defineProperty(n,"EmoteDataADR74",{enumerable:!0,get:function(){return i.EmoteDataADR74}});var r=IM();Object.defineProperty(n,"ArmatureId",{enumerable:!0,get:function(){return r.ArmatureId}}),Object.defineProperty(n,"EmoteClip",{enumerable:!0,get:function(){return r.EmoteClip}}),Object.defineProperty(n,"OutcomeGroup",{enumerable:!0,get:function(){return r.OutcomeGroup}}),Object.defineProperty(n,"StartAnimation",{enumerable:!0,get:function(){return r.StartAnimation}});var o=MM();Object.defineProperty(n,"EmoteCategory",{enumerable:!0,get:function(){return o.EmoteCategory}});var a=t1();Object.defineProperty(n,"EmotePlayMode",{enumerable:!0,get:function(){return a.EmotePlayMode}});var s=i1();Object.defineProperty(n,"EmoteOutcomeType",{enumerable:!0,get:function(){return s.EmoteOutcomeType}})}(Ym)),Ym}var UP;function wM(){return UP||(UP=1,function(n){var t=Is&&Is.__createBinding||(Object.create?function(u,f,c,h){h===void 0&&(h=c);var p=Object.getOwnPropertyDescriptor(f,c);(!p||("get"in p?!f.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return f[c]}}),Object.defineProperty(u,h,p)}:function(u,f,c,h){h===void 0&&(h=c),u[h]=f[c]}),e=Is&&Is.__exportStar||function(u,f){for(var c in u)c!=="default"&&!Object.prototype.hasOwnProperty.call(f,c)&&t(f,u,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.isThirdParty=n.isStandard=n.BodyShape=n.Metrics=n.Locale=n.I18N=void 0;var i=PM();Object.defineProperty(n,"I18N",{enumerable:!0,get:function(){return i.I18N}});var r=CM();Object.defineProperty(n,"Locale",{enumerable:!0,get:function(){return r.Locale}});var o=AM();Object.defineProperty(n,"Metrics",{enumerable:!0,get:function(){return o.Metrics}});var a=db();Object.defineProperty(n,"BodyShape",{enumerable:!0,get:function(){return a.BodyShape}});var s=gb();Object.defineProperty(n,"isStandard",{enumerable:!0,get:function(){return s.isStandard}});var l=yb();Object.defineProperty(n,"isThirdParty",{enumerable:!0,get:function(){return l.isThirdParty}}),e(vb(),n),e(JN(),n),e(r1(),n)}(Is)),Is}var tg={},ig={},kP;function ac(){return kP||(kP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.AuthChain=n.AuthLink=n.AuthLinkType=void 0;const t=st();var e;(function(r){r.SIGNER="SIGNER",r.ECDSA_PERSONAL_EPHEMERAL="ECDSA_EPHEMERAL",r.ECDSA_PERSONAL_SIGNED_ENTITY="ECDSA_SIGNED_ENTITY",r.ECDSA_EIP_1654_EPHEMERAL="ECDSA_EIP_1654_EPHEMERAL",r.ECDSA_EIP_1654_SIGNED_ENTITY="ECDSA_EIP_1654_SIGNED_ENTITY"})(e=n.AuthLinkType||(n.AuthLinkType={}));var i;(function(r){r.schema={type:"object",properties:{type:{type:"string",enum:Object.values(e)},payload:{type:"string"},signature:{type:"string",nullable:!0}},required:["payload","type"],if:{properties:{type:{not:{const:e.SIGNER}}}},then:{required:["signature"]},else:{oneOf:[{properties:{signature:{type:"string",const:""}},required:["signature"]},{properties:{signature:{type:"null"}}}]}},r.validate=(0,t.generateLazyValidator)(r.schema)})(i=n.AuthLink||(n.AuthLink={})),function(r){r.schema={type:"array",items:i.schema,minItems:1},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.AuthChain||(n.AuthChain={}))}(ig)),ig}var zP;function n1(){return zP||(zP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PointerChangesSyncDeployment=n.SnapshotSyncDeployment=void 0;const t=Js(),e=ac(),i=st();(function(r){r.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:e.AuthChain.schema,entityTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:t.IPFSv1.schema}},{properties:{entityId:t.IPFSv2.schema}}],required:["entityId","entityType","pointers","entityTimestamp","authChain"]},r.validate=(0,i.generateLazyValidator)(r.schema)})(n.SnapshotSyncDeployment||(n.SnapshotSyncDeployment={})),function(r){r.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:e.AuthChain.schema,entityTimestamp:{type:"number",minimum:0},localTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:t.IPFSv1.schema}},{properties:{entityId:t.IPFSv2.schema}}],required:["entityId","entityType","pointers","localTimestamp","entityTimestamp","authChain"]},r.validate=(0,i.generateLazyValidator)(r.schema)}(n.PointerChangesSyncDeployment||(n.PointerChangesSyncDeployment={}))}(tg)),tg}var rg={},ng={},GP;function LM(){return GP||(GP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ContentMapping=void 0;const t=Js(),e=st();(function(i){i.schema={type:"object",properties:{file:{type:"string",minLength:1},hash:{type:"string",oneOf:[t.IPFSv1.schema,t.IPFSv2.schema]}},required:["file","hash"]},i.validate=(0,e.generateLazyValidator)(i.schema)})(n.ContentMapping||(n.ContentMapping={}))}(ng)),ng}var WP;function NM(){return WP||(WP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Entity=n.EntityType=void 0;const t=Js(),e=LM(),i=st();(function(r){r.SCENE="scene",r.PROFILE="profile",r.WEARABLE="wearable",r.STORE="store",r.EMOTE="emote",r.OUTFITS="outfits"})(n.EntityType||(n.EntityType={})),function(r){r.schema={type:"object",properties:{version:{type:"string",enum:["v3"]},id:{type:"string",oneOf:[t.IPFSv1.schema,t.IPFSv2.schema]},type:{type:"string"},pointers:{type:"array",items:{type:"string",minLength:1}},timestamp:{type:"number",minimum:0},content:{type:"array",items:e.ContentMapping.schema},metadata:{type:"object",nullable:!0}},required:["version","id","type","pointers","timestamp","content"]},r.validate=(0,i.generateLazyValidator)(r.schema)}(n.Entity||(n.Entity={}))}(rg)),rg}var og={},HP;function o1(){return HP||(HP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DeploymentWithAuthChain=void 0;const t=ac(),e=st();(function(i){i.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},localTimestamp:{type:"number",minimum:0},authChain:t.AuthChain.schema},required:["entityId","entityType","pointers","localTimestamp","authChain"]},i.validate=(0,e.generateLazyValidator)(i.schema)})(n.DeploymentWithAuthChain||(n.DeploymentWithAuthChain={}))}(og)),og}var ws={},ag={},jP;function a1(){return jP||(jP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Outfits=n.Outfit=void 0;const t=Zs(),e=Js(),i=st();var r;(function(o){o.schema={type:"object",required:["bodyShape","eyes","hair","skin","wearables"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:e.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:e.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:e.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:t.WearableCategory.schema}},additionalProperties:!0},o.validate=(0,i.generateLazyValidator)(o.schema)})(r=n.Outfit||(n.Outfit={})),function(o){o.schema={type:"object",required:["outfits","namesForExtraSlots"],properties:{outfits:{type:"array",items:{type:"object",required:["slot","outfit"],properties:{slot:{type:"number"},outfit:r.schema}}},namesForExtraSlots:{type:"array",uniqueItems:!0,items:{type:"string"}}},additionalProperties:!0},o.validate=(0,i.generateLazyValidator)(o.schema)}(n.Outfits||(n.Outfits={}))}(ag)),ag}var XP;function s1(){return XP||(XP=1,function(n){var t=ws&&ws.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=ws&&ws.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(a1(),n)}(ws)),ws}var Ls={},sg={},YP;function FM(){return YP||(YP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.NotificationType=void 0,function(t){t.BADGE_GRANTED="badge_granted",t.BID_ACCEPTED="bid_accepted",t.BID_RECEIVED="bid_received",t.EVENTS_STARTED="events_started",t.EVENTS_STARTS_SOON="events_starts_soon",t.EVENT_CREATED="event_created",t.GOVERNANCE_ANNOUNCEMENT="governance_announcement",t.GOVERNANCE_AUTHORED_PROPOSAL_FINISHED="governance_authored_proposal_finished",t.GOVERNANCE_COAUTHOR_REQUESTED="governance_coauthor_requested",t.GOVERNANCE_CLIFF_ENDED="governance_cliff_ended",t.GOVERNANCE_NEW_COMMENT_ON_PROJECT_UPDATE="governance_new_comment_on_project_update",t.GOVERNANCE_NEW_COMMENT_ON_PROPOSAL="governance_new_comment_on_proposal",t.GOVERNANCE_PROPOSAL_ENACTED="governance_proposal_enacted",t.GOVERNANCE_VOTING_ENDED_VOTER="governance_voting_ended_voter",t.GOVERNANCE_PITCH_PASSED="governance_pitch_passed",t.GOVERNANCE_TENDER_PASSED="governance_tender_passed",t.GOVERNANCE_WHALE_VOTE="governance_whale_vote",t.GOVERNANCE_VOTED_ON_BEHALF="governance_voted_on_behalf",t.ITEM_SOLD="item_sold",t.ITEM_PUBLISHED="item_published",t.LAND_RENTAL_ENDED="rental_ended",t.LAND_RENTED="rental_started",t.REWARD_ASSIGNED="reward_assignment",t.REWARD_CAMPAIGN_OUT_OF_FUNDS="reward_campaign_out_of_funds",t.REWARD_CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED="reward_campaign_gas_price_higher_than_expected",t.REWARD_CAMPAIGN_OUT_OF_STOCK="reward_campaign_out_of_stock",t.REWARD_DELAYED="reward_delayed",t.REWARD_IN_PROGRESS="reward_in_progress",t.ROYALTIES_EARNED="royalties_earned",t.SOCIAL_SERVICE_FRIENDSHIP_REQUEST="social_service_friendship_request",t.SOCIAL_SERVICE_FRIENDSHIP_ACCEPTED="social_service_friendship_accepted",t.WORLDS_ACCESS_RESTORED="worlds_access_restored",t.WORLDS_ACCESS_RESTRICTED="worlds_access_restricted",t.WORLDS_MISSING_RESOURCES="worlds_missing_resources",t.WORLDS_PERMISSION_GRANTED="worlds_permission_granted",t.WORLDS_PERMISSION_REVOKED="worlds_permission_revoked",t.CREDITS_GOAL_COMPLETED="credits_goal_completed",t.CREDITS_ON_DEMAND_GRANTED="credits_on_demand_granted",t.STREAMING_KEY_RESET="streaming_key_reset",t.STREAMING_KEY_REVOKE="streaming_key_revoke",t.STREAMING_KEY_EXPIRED="streaming_key_expired",t.STREAMING_TIME_EXCEEDED="streaming_time_exceeded",t.STREAMING_PLACE_UPDATED="streaming_place_updated",t.CREDITS_REMINDER_COMPLETE_GOALS="credits_reminder_complete_goals",t.CREDITS_REMINDER_CLAIM_CREDITS="credits_reminder_claim_credits",t.CREDITS_REMINDER_USAGE="credits_reminder_usage",t.CREDITS_REMINDER_USAGE_24_HOURS="credits_reminder_usage_24_hours",t.CREDITS_REMINDER_DO_NOT_MISS_OUT="credits_reminder_do_not_miss_out",t.CREDITS_NEW_SEASON_REMINDER="credits_new_season_reminder",t.REFERRAL_INVITED_USERS_ACCEPTED="referral_invited_users_accepted",t.REFERRAL_NEW_TIER_REACHED="referral_new_tier_reached",t.COMMUNITY_DELETED="community_deleted",t.COMMUNITY_DELETED_CONTENT_VIOLATION="community_deleted_content_violation",t.COMMUNITY_RENAMED="community_renamed",t.COMMUNITY_MEMBER_BANNED="community_member_banned",t.COMMUNITY_MEMBER_REMOVED="community_member_removed",t.COMMUNITY_REQUEST_TO_JOIN_RECEIVED="community_request_to_join_received",t.COMMUNITY_REQUEST_TO_JOIN_ACCEPTED="community_request_to_join_accepted",t.COMMUNITY_INVITE_RECEIVED="community_invite_received",t.COMMUNITY_OWNERSHIP_TRANSFERRED="community_ownership_transferred",t.COMMUNITY_POST_ADDED="community_post_added",t.USER_BANNED_FROM_SCENE="user_banned_from_scene",t.USER_UNBANNED_FROM_SCENE="user_unbanned_from_scene"}(n.NotificationType||(n.NotificationType={}))}(sg)),sg}var lg={},ug={},KP;function BM(){return KP||(KP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SubscriptionDetails=void 0;const t=st(),e=FM(),i={type:"object",required:["email","in_app"],properties:{email:{type:"boolean"},in_app:{type:"boolean"}}},r=Object.values(e.NotificationType).reduce((o,a)=>(o[a]=i,o),{});(function(o){o.schema={type:"object",required:["ignore_all_email","ignore_all_in_app","message_type"],properties:{ignore_all_email:{type:"boolean"},ignore_all_in_app:{type:"boolean"},message_type:{type:"object",required:Object.values(e.NotificationType),additionalProperties:!1,properties:r}}},o.validate=(0,t.generateLazyValidator)(o.schema)})(n.SubscriptionDetails||(n.SubscriptionDetails={}))}(ug)),ug}var fg={},qP;function VM(){return qP||(qP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Email=void 0,function(t){t.schema={type:"string",pattern:"^[\\w\\-\\.]+@([\\w-]+\\.)+[\\w-]{2,}$"};const e=new RegExp(t.schema.pattern);t.validate=i=>e.test(i)}(n.Email||(n.Email={}))}(fg)),fg}var QP;function l1(){return QP||(QP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Subscription=void 0;const t=st(),e=BM(),i=Js(),r=VM();(function(o){o.schema={type:"object",required:["address","details"],properties:{address:i.EthAddress.schema,email:Object.assign(Object.assign({},r.Email.schema),{nullable:!0}),details:e.SubscriptionDetails.schema}},o.validate=(0,t.generateLazyValidator)(o.schema)})(n.Subscription||(n.Subscription={}))}(lg)),lg}var $P;function u1(){return $P||($P=1,function(n){var t=Ls&&Ls.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ls&&Ls.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(FM(),n),e(l1(),n),e(BM(),n)}(Ls)),Ls}var Ns={},cg={},ZP;function Ln(){return ZP||(ZP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Events=void 0,function(t){(function(e){e.BLOCKCHAIN="blockchain",e.CATALYST_DEPLOYMENT="catalyst-deployment",e.WORLD="world",e.CLIENT="client",e.WEB="web",e.MARKETPLACE="marketplace",e.REWARDS="rewards",e.BADGE="badge",e.ASSET_BUNDLE="asset-bundle",e.SOCIAL_SERVICE="social-service",e.CREDITS_SERVICE="credits-service",e.STREAMING="streaming",e.COMMS="comms",e.REFERRAL="referral",e.COMMUNITY="community",e.CAMERA="camera",e.EVENT="event",e.GOVERNANCE="governance"})(t.Type||(t.Type={})),function(e){(function(i){i.BID_ACCEPTED="bid-accepted",i.ITEM_SOLD="item-sold",i.RENTAL_ENDED="land-rental-ended",i.RENTAL_STARTED="land-rental-started",i.ROYALTIES_EARNED="royalties-earned",i.COLLECTION_CREATED="collection-created",i.ITEM_PUBLISHED="item-published"})(e.Blockchain||(e.Blockchain={})),function(i){i.BID_RECEIVED="bid-received"}(e.Marketplace||(e.Marketplace={})),function(i){i.SCENE="scene",i.PROFILE="profile",i.WEARABLE="wearable",i.STORE="store",i.EMOTE="emote",i.OUTFITS="outfits"}(e.CatalystDeployment||(e.CatalystDeployment={})),function(i){i.DEPLOYMENT="deployment",i.WORLDS_PERMISSION_GRANTED="worlds_permission_granted",i.WORLDS_PERMISSION_REVOKED="worlds_permission_revoked",i.WORLDS_ACCESS_RESTORED="worlds_access_restored",i.WORLDS_ACCESS_RESTRICTED="worlds_access_restricted",i.WORLDS_MISSING_RESOURCES="worlds_missing_resources"}(e.Worlds||(e.Worlds={})),function(i){i.LOGGED_IN="logged-in",i.LOGGED_IN_CACHED="logged-in-cached",i.MOVE_TO_PARCEL="move-to-parcel",i.USED_EMOTE="used-emote",i.PASSPORT_OPENED="passport-opened",i.WALKED_DISTANCE="walked-distance",i.VERTICAL_HEIGHT_REACHED="vertical-height-reached"}(e.Client||(e.Client={})),function(i){i.AUTH_IDENTIFY="auth-identify"}(e.Web||(e.Web={})),function(i){i.REWARD_IN_PROGRESS="reward-in-progress",i.REWARD_ASSIGNED="reward-assigned",i.CAMPAIGN_OUT_OF_FUNDS="campaign-out-of-funds",i.CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED="campaign-gas-price-higher-than-expected",i.CAMPAIGN_OUT_OF_STOCK="campaign-out-of-stock",i.REWARD_DELAYED="reward-delayed"}(e.Rewards||(e.Rewards={})),function(i){i.GRANTED="badge-granted"}(e.Badge||(e.Badge={})),function(i){i.CONVERTED="converted",i.MANUALLY_QUEUED="manually-queued"}(e.AssetBundle||(e.AssetBundle={})),function(i){i.FRIENDSHIP_REQUEST="friendship-request",i.FRIENDSHIP_ACCEPTED="friendship-accepted"}(e.SocialService||(e.SocialService={})),function(i){i.CREDITS_GOAL_COMPLETED="credits-goal-completed",i.COMPLETE_GOALS_REMINDER="complete-goals-reminder",i.CLAIM_CREDITS_REMINDER="claim-credits-reminder",i.DO_NOT_MISS_OUT_REMINDER="do-not-miss-out-reminder",i.USAGE_REMINDER="usage-reminder",i.USAGE_24_HOURS_REMINDER="usage-24-hours-reminder",i.ON_DEMAND_CREDITS_GRANTED="on-demand-credits-granted",i.NEW_SEASON_REMINDER="new-season-reminder"}(e.CreditsService||(e.CreditsService={})),function(i){i.STREAMING_KEY_RESET="streaming-key-reset",i.STREAMING_KEY_REVOKE="streaming-key-revoke",i.STREAMING_KEY_EXPIRED="streaming-key-expired",i.STREAMING_TIME_EXCEEDED="streaming-time-exceeded",i.STREAMING_PLACE_UPDATED="streaming-place-updated",i.COMMUNITY_STREAMING_ENDED="community-streaming-ended"}(e.Streaming||(e.Streaming={})),function(i){i.USER_JOINED_ROOM="user-joined-room",i.USER_LEFT_ROOM="user-left-room",i.USER_BANNED_FROM_SCENE="user-banned-from-scene",i.USER_UNBANNED_FROM_SCENE="user-unbanned-from-scene"}(e.Comms||(e.Comms={})),function(i){i.REFERRAL_INVITED_USERS_ACCEPTED="referral-invited-users-accepted",i.REFERRAL_NEW_TIER_REACHED="referral-new-tier-reached"}(e.Referral||(e.Referral={})),function(i){i.DELETED="community-deleted",i.DELETED_CONTENT_VIOLATION="community-deleted-content-violation",i.RENAMED="community-renamed",i.MEMBER_BANNED="community-member-banned",i.MEMBER_REMOVED="community-member-removed",i.REQUEST_TO_JOIN_RECEIVED="community-request-to-join-received",i.REQUEST_TO_JOIN_ACCEPTED="community-request-to-join-accepted",i.INVITE_RECEIVED="community-invite-received",i.OWNERSHIP_TRANSFERRED="community-ownership-transferred",i.POST_ADDED="community-post-added"}(e.Community||(e.Community={})),function(i){i.PHOTO_TAKEN="photo-taken",i.PHOTO_PRIVACY_CHANGED="photo-privacy-changed"}(e.Camera||(e.Camera={})),function(i){i.EVENT_CREATED="event-created",i.EVENT_STARTS_SOON="event-starts-soon",i.EVENT_STARTED="event-started",i.EVENT_ENDED="event-ended"}(e.Event||(e.Event={})),function(i){i.PROPOSAL_ENACTED="governance_proposal_enacted",i.COAUTHOR_REQUESTED="governance_coauthor_requested",i.PITCH_PASSED="governance_pitch_passed",i.TENDER_PASSED="governance_tender_passed",i.AUTHORED_PROPOSAL_FINISHED="governance_authored_proposal_finished",i.VOTING_ENDED_VOTER="governance_voting_ended_voter",i.NEW_COMMENT_ON_PROPOSAL="governance_new_comment_on_proposal",i.NEW_COMMENT_ON_PROJECT_UPDATED="governance_new_comment_on_project_update",i.WHALE_VOTE="governance_whale_vote",i.VOTED_ON_BEHALF="governance_voted_on_behalf",i.CLIFF_ENDED="governance_cliff_ended"}(e.Governance||(e.Governance={}))}(t.SubType||(t.SubType={}))}(n.Events||(n.Events={}))}(cg)),cg}var hg={},JP;function f1(){return JP||(JP=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CollectionCreatedEvent=n.RoyaltiesEarnedEvent=n.RentalStartedEvent=n.RentalEndedEvent=n.ItemPublishedEvent=n.ItemSoldEvent=n.BidAcceptedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.BID_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},price:{type:"string"},title:{type:"string"},description:{type:"string"},network:{type:"string"}},required:["address","image","seller","category","link","price","title","network"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.BidAcceptedEvent||(n.BidAcceptedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.ITEM_SOLD},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},buyer:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},tokenId:{type:"string"},network:{type:"string"},title:{type:"string"},description:{type:"string"}},required:["address","image","seller","category","link","network","title","description"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.ItemSoldEvent||(n.ItemSoldEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.ITEM_PUBLISHED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creator:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},itemId:{type:"string"},network:{type:"string"},urn:{type:"string"}},required:["creator","category","itemId","network","urn"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.ItemPublishedEvent||(n.ItemPublishedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.RENTAL_ENDED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},contract:{type:"string"},land:{type:"string",nullable:!0},lessor:{type:"string"},tenant:{type:"string"},operator:{type:"string"},startedAt:{type:"string"},endedAt:{type:"string"},tokenId:{type:"string"},link:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","contract","lessor","tenant","operator","startedAt","endedAt","tokenId","link","title"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.RentalEndedEvent||(n.RentalEndedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.RENTAL_STARTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},contract:{type:"string"},land:{type:"string",nullable:!0},lessor:{type:"string"},tenant:{type:"string"},operator:{type:"string"},startedAt:{type:"string"},endedAt:{type:"string"},tokenId:{type:"string"},link:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","contract","lessor","tenant","operator","startedAt","endedAt","tokenId","link","title"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.RentalStartedEvent||(n.RentalStartedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.ROYALTIES_EARNED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},royaltiesCut:{type:"string"},royaltiesCollector:{type:"string"},network:{type:"string"},title:{type:"string"},description:{type:"string",nullable:!0}},required:["address","image","category","link","royaltiesCut","royaltiesCollector","network","title"]}},required:["type","subType","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.RoyaltiesEarnedEvent||(n.RoyaltiesEarnedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BLOCKCHAIN},subType:{type:"string",const:e.Events.SubType.Blockchain.COLLECTION_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creator:{type:"string"},name:{type:"string"}},required:["creator","name"]}},required:["type","subType","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CollectionCreatedEvent||(n.CollectionCreatedEvent={}))}(hg)),hg}var dg={},eA;function c1(){return eA||(eA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CatalystDeploymentEvent=void 0;const t=ac(),e=st(),i=NM(),r=Ln();(function(o){o.schema={type:"object",properties:{type:{type:"string",const:r.Events.Type.CATALYST_DEPLOYMENT},subType:{type:"string",enum:Object.values(r.Events.SubType.CatalystDeployment)},key:{type:"string"},timestamp:{type:"number",minimum:1},entity:i.Entity.schema,authChain:t.AuthChain.schema},required:["type","subType","entity","authChain","key","timestamp"],additionalProperties:!1},o.validate=(0,e.generateLazyValidator)(o.schema)})(n.CatalystDeploymentEvent||(n.CatalystDeploymentEvent={}))}(dg)),dg}var pg={},tA;function h1(){return tA||(tA=1,Object.defineProperty(pg,"__esModule",{value:!0})),pg}var _g={},iA;function d1(){return iA||(iA=1,Object.defineProperty(_g,"__esModule",{value:!0})),_g}var mg={},rA;function p1(){return rA||(rA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.BidReceivedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.MARKETPLACE},subType:{type:"string",const:e.Events.SubType.Marketplace.BID_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},image:{type:"string"},seller:{type:"string"},category:{type:"string"},rarity:{type:"string",nullable:!0},link:{type:"string"},nftName:{type:"string",nullable:!0},price:{type:"string"},title:{type:"string"},description:{type:"string"},network:{type:"string"}},required:["address","image","seller","category","link","price","title","network"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.BidReceivedEvent||(n.BidReceivedEvent={}))}(mg)),mg}var gg={},Zu={},nA;function rp(){if(nA)return Zu;nA=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.createEventSchema=void 0;function n(t,e,i){return{type:"object",properties:{type:{type:"string",const:t},subType:{type:"string",const:e},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:i},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1}}return Zu.createEventSchema=n,Zu}var oA;function _1(){return oA||(oA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.RewardDelayedEvent=n.CampaignOutOfStockEvent=n.CampaignGasPriceHigherThanExpectedEvent=n.CampaignOutOfFundsEvent=n.RewardAssignedEvent=n.RewardInProgressEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{title:{type:"string"},description:{type:"string"},link:{type:"string",nullable:!0},beneficiary:{type:"string"},tokenName:{type:"string"},tokenImage:{type:"string"},tokenRarity:{type:"string",nullable:!0},tokenCategory:{type:"string",nullable:!0}},required:["title","description","beneficiary","tokenName","tokenImage"],additionalProperties:!1},o={type:"object",properties:{title:{type:"string"},description:{type:"string"},link:{type:"string",nullable:!0},owner:{type:"string"},campaignId:{type:"string"},campaignName:{type:"string"}},required:["title","description","owner","campaignId","campaignName"],additionalProperties:!1};(function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.REWARD_IN_PROGRESS,r),a.validate=(0,t.generateLazyValidator)(a.schema)})(n.RewardInProgressEvent||(n.RewardInProgressEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.REWARD_ASSIGNED,r),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.RewardAssignedEvent||(n.RewardAssignedEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.CAMPAIGN_OUT_OF_FUNDS,o),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.CampaignOutOfFundsEvent||(n.CampaignOutOfFundsEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED,o),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.CampaignGasPriceHigherThanExpectedEvent||(n.CampaignGasPriceHigherThanExpectedEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.CAMPAIGN_OUT_OF_STOCK,o),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.CampaignOutOfStockEvent||(n.CampaignOutOfStockEvent={})),function(a){a.schema=(0,i.createEventSchema)(e.Events.Type.REWARDS,e.Events.SubType.Rewards.REWARD_DELAYED,r),a.validate=(0,t.generateLazyValidator)(a.schema)}(n.RewardDelayedEvent||(n.RewardDelayedEvent={}))}(gg)),gg}var vg={},aA;function m1(){return aA||(aA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CreditsClaimReminderEvent=n.CreditsDoNotMissOutReminderEvent=n.CreditsUsage24HoursReminderEvent=n.CreditsNewSeasonReminderEvent=n.CreditsUsageReminderEvent=n.CreditsCompleteGoalsReminderEvent=n.CreditsGoalCompletedEvent=n.CreditsOnDemandEvent=n.FriendshipAcceptedEvent=n.FriendshipRequestEvent=n.AssetBundleConversionManuallyQueuedEvent=n.AssetBundleConversionFinishedEvent=n.BadgeGrantedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.BADGE},subType:{type:"string",const:e.Events.SubType.Badge.GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{badgeId:{type:"string"},badgeTierName:{type:"string",nullable:!0},badgeName:{type:"string"},badgeImageUrl:{type:"string"},address:{type:"string"}},required:["badgeId","badgeName","badgeImageUrl","address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.BadgeGrantedEvent||(n.BadgeGrantedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.ASSET_BUNDLE},subType:{type:"string",const:e.Events.SubType.AssetBundle.CONVERTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{entityId:{type:"string"},platform:{type:"string",enum:["windows","mac","webgl"]},statusCode:{type:"number"},isLods:{type:"boolean"},isWorld:{type:"boolean"},version:{type:"string"}},required:["entityId","platform","statusCode","isLods","isWorld","version"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.AssetBundleConversionFinishedEvent||(n.AssetBundleConversionFinishedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.ASSET_BUNDLE},subType:{type:"string",const:e.Events.SubType.AssetBundle.MANUALLY_QUEUED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{entityId:{type:"string"},platform:{type:"string",enum:["windows","mac","webgl"]},isLods:{type:"boolean"},isPriority:{type:"boolean"},version:{type:"string"}},required:["entityId","platform","isLods"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.AssetBundleConversionManuallyQueuedEvent||(n.AssetBundleConversionManuallyQueuedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.SOCIAL_SERVICE},subType:{type:"string",const:e.Events.SubType.SocialService.FRIENDSHIP_REQUEST},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{requestId:{type:"string"},sender:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},receiver:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},message:{type:"string",nullable:!0}},required:["requestId","sender","receiver"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.FriendshipRequestEvent||(n.FriendshipRequestEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.SOCIAL_SERVICE},subType:{type:"string",const:e.Events.SubType.SocialService.FRIENDSHIP_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{requestId:{type:"string"},sender:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]},receiver:{type:"object",properties:{address:{type:"string"},name:{type:"string"},profileImageUrl:{type:"string"},hasClaimedName:{type:"boolean"}},required:["address","name","profileImageUrl","hasClaimedName"]}},required:["requestId","sender","receiver"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.FriendshipAcceptedEvent||(n.FriendshipAcceptedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.ON_DEMAND_CREDITS_GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{creditsGranted:{type:"number",minimum:1},address:{type:"string"},granterAddress:{type:"string"}},required:["creditsGranted","address","granterAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsOnDemandEvent||(n.CreditsOnDemandEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.CREDITS_GOAL_COMPLETED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{goalId:{type:"string"},creditsObtained:{type:"number",minimum:0},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1},address:{type:"string"}},required:["goalId","creditsObtained","seasonId","weekNumber","address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsGoalCompletedEvent||(n.CreditsGoalCompletedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.COMPLETE_GOALS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1},pendingGoalIds:{type:"array",items:{type:"string"},minItems:1}},required:["address","seasonId","weekNumber","pendingGoalIds"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsCompleteGoalsReminderEvent||(n.CreditsCompleteGoalsReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.USAGE_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},creditsAmount:{type:"number",minimum:1},expirationDate:{type:"string"},expirationDay:{type:"string"}},required:["address","creditsAmount","expirationDate","expirationDay"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsUsageReminderEvent||(n.CreditsUsageReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.NEW_SEASON_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{addresses:{type:"array",items:{type:"string"}},seasonName:{type:"string"},startDate:{type:"string"},endDate:{type:"string"}},required:["addresses","seasonName","startDate","endDate"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsNewSeasonReminderEvent||(n.CreditsNewSeasonReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.USAGE_24_HOURS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},creditsAmount:{type:"number",minimum:1},expirationDate:{type:"string"}},required:["address","creditsAmount","expirationDate"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsUsage24HoursReminderEvent||(n.CreditsUsage24HoursReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.DO_NOT_MISS_OUT_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"}},required:["address"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsDoNotMissOutReminderEvent||(n.CreditsDoNotMissOutReminderEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CREDITS_SERVICE},subType:{type:"string",const:e.Events.SubType.CreditsService.CLAIM_CREDITS_REMINDER},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{address:{type:"string"},seasonId:{type:"number",minimum:1},weekNumber:{type:"number",minimum:1}},required:["address","seasonId","weekNumber"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!0},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CreditsClaimReminderEvent||(n.CreditsClaimReminderEvent={}))}(vg)),vg}var yg={},sA;function g1(){return sA||(sA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CommunityStreamingEndedEvent=n.StreamingPlaceUpdatedEvent=n.StreamingTimeExceededEvent=n.StreamingKeyExpiredEvent=n.StreamingKeyRevokeEvent=n.StreamingKeyResetEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{title:{type:"string"},description:{type:"string"},position:{type:"string"},worldName:{type:"string",nullable:!0},isWorld:{type:"boolean"},url:{type:"string"},address:{type:"string"},image:{type:"string"}},required:["position","isWorld","url","title","description","address","image"],additionalProperties:!1};(function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_KEY_RESET,r),o.validate=(0,t.generateLazyValidator)(o.schema)})(n.StreamingKeyResetEvent||(n.StreamingKeyResetEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_KEY_REVOKE,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingKeyRevokeEvent||(n.StreamingKeyRevokeEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_KEY_EXPIRED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingKeyExpiredEvent||(n.StreamingKeyExpiredEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_TIME_EXCEEDED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingTimeExceededEvent||(n.StreamingTimeExceededEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.STREAMING_PLACE_UPDATED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.StreamingPlaceUpdatedEvent||(n.StreamingPlaceUpdatedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.STREAMING,e.Events.SubType.Streaming.COMMUNITY_STREAMING_ENDED,{type:"object",properties:{communityId:{type:"string"},totalParticipants:{type:"number"}},required:["communityId","totalParticipants"],additionalProperties:!1}),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.CommunityStreamingEndedEvent||(n.CommunityStreamingEndedEvent={}))}(yg)),yg}var bg={},lA;function v1(){return lA||(lA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.UserUnbannedFromSceneEvent=n.UserBannedFromSceneEvent=n.UserLeftRoomEvent=n.UserJoinedRoomEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_JOINED_ROOM},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{parcel:{type:"string"},sceneId:{type:"string"},userAddress:{type:"string"},realmName:{type:"string"},isWorld:{type:"boolean"}},required:["parcel","sceneId","userAddress","realmName","isWorld"]}},required:["type","subType","key","timestamp","metadata"]},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.UserJoinedRoomEvent||(n.UserJoinedRoomEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_LEFT_ROOM},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{isWorld:{type:"boolean"},sceneId:{type:"string",nullable:!0},userAddress:{type:"string"},realmName:{type:"string"}},required:["isWorld","userAddress","realmName"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.UserLeftRoomEvent||(n.UserLeftRoomEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_BANNED_FROM_SCENE},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{placeTitle:{type:"string"},userAddress:{type:"string"}},required:["placeTitle","userAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.UserBannedFromSceneEvent||(n.UserBannedFromSceneEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMS},subType:{type:"string",const:e.Events.SubType.Comms.USER_UNBANNED_FROM_SCENE},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{placeTitle:{type:"string"},userAddress:{type:"string"}},required:["placeTitle","userAddress"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.UserUnbannedFromSceneEvent||(n.UserUnbannedFromSceneEvent={}))}(bg)),bg}var Eg={},uA;function y1(){return uA||(uA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ReferralNewTierReachedEvent=n.ReferralInvitedUsersAcceptedEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{title:{type:"string"},description:{type:"string"},address:{type:"string"},tier:{type:"number",minimum:1},url:{type:"string"},image:{type:"string"},invitedUserAddress:{type:"string"},invitedUsers:{type:"number",minimum:1},rarity:{type:"string",nullable:!0}},required:["address","tier","url","title","description","image","invitedUserAddress"],additionalProperties:!1};(function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.REFERRAL,e.Events.SubType.Referral.REFERRAL_INVITED_USERS_ACCEPTED,r),o.validate=(0,t.generateLazyValidator)(o.schema)})(n.ReferralInvitedUsersAcceptedEvent||(n.ReferralInvitedUsersAcceptedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.REFERRAL,e.Events.SubType.Referral.REFERRAL_NEW_TIER_REACHED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.ReferralNewTierReachedEvent||(n.ReferralNewTierReachedEvent={}))}(Eg)),Eg}var Tg={},fA;function b1(){return fA||(fA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CommunityOwnershipTransferredEvent=n.CommunityPostAddedEvent=n.CommunityInviteReceivedEvent=n.CommunityRequestToJoinAcceptedEvent=n.CommunityRequestToJoinReceivedEvent=n.CommunityMemberRemovedEvent=n.CommunityMemberBannedEvent=n.CommunityRenamedEvent=n.CommunityDeletedContentViolationEvent=n.CommunityDeletedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.DELETED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddresses:{type:"array",items:{type:"string"}},thumbnailUrl:{type:"string"}},required:["id","name","memberAddresses","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.CommunityDeletedEvent||(n.CommunityDeletedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.DELETED_CONTENT_VIOLATION},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},ownerAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","ownerAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityDeletedContentViolationEvent||(n.CommunityDeletedContentViolationEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.RENAMED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},oldName:{type:"string"},newName:{type:"string"},memberAddresses:{type:"array",items:{type:"string"}},thumbnailUrl:{type:"string"}},required:["id","oldName","newName","memberAddresses","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityRenamedEvent||(n.CommunityRenamedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.MEMBER_BANNED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityMemberBannedEvent||(n.CommunityMemberBannedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.MEMBER_REMOVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{id:{type:"string"},name:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["id","name","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityMemberRemovedEvent||(n.CommunityMemberRemovedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.REQUEST_TO_JOIN_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},memberName:{type:"string"},thumbnailUrl:{type:"string"},addressesToNotify:{type:"array",items:{type:"string"}}},required:["communityId","communityName","memberAddress","memberName","thumbnailUrl","addressesToNotify"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityRequestToJoinReceivedEvent||(n.CommunityRequestToJoinReceivedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.REQUEST_TO_JOIN_ACCEPTED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityRequestToJoinAcceptedEvent||(n.CommunityRequestToJoinAcceptedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.INVITE_RECEIVED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},memberAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","memberAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityInviteReceivedEvent||(n.CommunityInviteReceivedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.POST_ADDED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},thumbnailUrl:{type:"string"},postId:{type:"string"},authorAddress:{type:"string"},addressesToNotify:{type:"array",items:{type:"string"}}},required:["addressesToNotify","communityId","communityName","thumbnailUrl","postId","authorAddress"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityPostAddedEvent||(n.CommunityPostAddedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.COMMUNITY},subType:{type:"string",const:e.Events.SubType.Community.OWNERSHIP_TRANSFERRED},key:{type:"string"},timestamp:{type:"number",minimum:1},metadata:{type:"object",properties:{communityId:{type:"string"},communityName:{type:"string"},oldOwnerAddress:{type:"string"},newOwnerAddress:{type:"string"},thumbnailUrl:{type:"string"}},required:["communityId","communityName","oldOwnerAddress","newOwnerAddress","thumbnailUrl"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.CommunityOwnershipTransferredEvent||(n.CommunityOwnershipTransferredEvent={}))}(Tg)),Tg}var Sg={},cA;function E1(){return cA||(cA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PhotoTakenEvent=n.PhotoPrivacyChangedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CAMERA},subType:{type:"string",const:e.Events.SubType.Camera.PHOTO_PRIVACY_CHANGED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{userAddress:{type:"string"},photoId:{type:"string"},isPublic:{type:"boolean"}},required:["userAddress","photoId","isPublic"]}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.PhotoPrivacyChangedEvent||(n.PhotoPrivacyChangedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.CAMERA},subType:{type:"string",const:e.Events.SubType.Camera.PHOTO_TAKEN},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{sceneId:{type:"string"},userAddress:{type:"string"},realm:{type:"string"},photoId:{type:"string"},isPublic:{type:"boolean"},users:{type:"array",items:{type:"object",properties:{address:{type:"string"},isEmoting:{type:"boolean"}},required:["address","isEmoting"],additionalProperties:!1}},placeId:{type:"string",nullable:!0}},required:["userAddress","realm","photoId","isPublic","users"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.PhotoTakenEvent||(n.PhotoTakenEvent={}))}(Sg)),Sg}var Cg={},hA;function T1(){return hA||(hA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EventEndedEvent=n.EventCreatedEvent=n.EventStartsSoonEvent=n.EventStartedEvent=void 0;const t=st(),e=Ln();(function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_STARTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},link:{type:"string"},communityThumbnail:{type:"string",nullable:!0},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image","link"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)})(n.EventStartedEvent||(n.EventStartedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_STARTS_SOON},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},link:{type:"string"},startsAt:{type:"string"},endsAt:{type:"string"},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image","link","startsAt","endsAt"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.EventStartsSoonEvent||(n.EventStartsSoonEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_CREATED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{name:{type:"string"},image:{type:"string"},communityId:{type:"string"},communityName:{type:"string"},communityThumbnail:{type:"string",nullable:!0},title:{type:"string"},description:{type:"string"},attendee:{type:"string"}},required:["name","image"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.EventCreatedEvent||(n.EventCreatedEvent={})),function(i){i.schema={type:"object",properties:{type:{type:"string",const:e.Events.Type.EVENT},subType:{type:"string",const:e.Events.SubType.Event.EVENT_ENDED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{communityId:{type:"string",nullable:!0},totalAttendees:{type:"number"}},required:["totalAttendees"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.EventEndedEvent||(n.EventEndedEvent={}))}(Cg)),Cg}var Pg={},dA;function S1(){return dA||(dA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.GovernanceCliffEndedEvent=n.GovernanceVotedOnBehalfEvent=n.GovernanceWhaleVoteEvent=n.GovernanceNewCommentOnProjectUpdatedEvent=n.GovernanceNewCommentOnProposalEvent=n.GovernanceVotingEndedVoterEvent=n.GovernanceAuthoredProposalFinishedEvent=n.GovernanceTenderPassedEvent=n.GovernancePitchPassedEvent=n.GovernanceCoauthorRequestedEvent=n.GovernanceProposalEnactedEvent=void 0;const t=st(),e=Ln(),i=rp(),r={type:"object",properties:{proposalId:{type:"string"},proposalTitle:{type:"string"},title:{type:"string"},description:{type:"string"},link:{type:"string"},address:{type:"string"}},required:["proposalId","proposalTitle","title","description","link","address"],additionalProperties:!1};(function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.PROPOSAL_ENACTED,r),o.validate=(0,t.generateLazyValidator)(o.schema)})(n.GovernanceProposalEnactedEvent||(n.GovernanceProposalEnactedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.COAUTHOR_REQUESTED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceCoauthorRequestedEvent||(n.GovernanceCoauthorRequestedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.PITCH_PASSED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernancePitchPassedEvent||(n.GovernancePitchPassedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.TENDER_PASSED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceTenderPassedEvent||(n.GovernanceTenderPassedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.AUTHORED_PROPOSAL_FINISHED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceAuthoredProposalFinishedEvent||(n.GovernanceAuthoredProposalFinishedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.VOTING_ENDED_VOTER,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceVotingEndedVoterEvent||(n.GovernanceVotingEndedVoterEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.NEW_COMMENT_ON_PROPOSAL,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceNewCommentOnProposalEvent||(n.GovernanceNewCommentOnProposalEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.NEW_COMMENT_ON_PROJECT_UPDATED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceNewCommentOnProjectUpdatedEvent||(n.GovernanceNewCommentOnProjectUpdatedEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.WHALE_VOTE,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceWhaleVoteEvent||(n.GovernanceWhaleVoteEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.VOTED_ON_BEHALF,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceVotedOnBehalfEvent||(n.GovernanceVotedOnBehalfEvent={})),function(o){o.schema=(0,i.createEventSchema)(e.Events.Type.GOVERNANCE,e.Events.SubType.Governance.CLIFF_ENDED,r),o.validate=(0,t.generateLazyValidator)(o.schema)}(n.GovernanceCliffEndedEvent||(n.GovernanceCliffEndedEvent={}))}(Pg)),Pg}var Ag={},pA;function C1(){return pA||(pA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WorldsMissingResourcesEvent=n.WorldsAccessRestrictedEvent=n.WorldsPermissionGrantedEvent=n.WorldsPermissionRevokedEvent=n.WorldsAccessRestoredEvent=n.WorldDeploymentEvent=void 0;const t=ac(),e=st(),i=Ln();(function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.DEPLOYMENT},key:{type:"string"},timestamp:{type:"number",minimum:0},entity:{type:"object",properties:{entityId:{type:"string"},authChain:t.AuthChain.schema},additionalProperties:!0,required:["entityId","authChain"]},contentServerUrls:{type:"array",items:{type:"string"},nullable:!0},force:{type:"boolean",nullable:!0},animation:{type:"string",nullable:!0},lods:{type:"array",items:{type:"string"},nullable:!0}},required:["type","subType","key","timestamp","entity"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)})(n.WorldDeploymentEvent||(n.WorldDeploymentEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_ACCESS_RESTORED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},url:{type:"string"},attendee:{type:"string"}},required:["title","description","url","attendee"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsAccessRestoredEvent||(n.WorldsAccessRestoredEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_PERMISSION_REVOKED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},world:{type:"string"},permissions:{type:"array",items:{type:"string"}},url:{type:"string"},address:{type:"string"}},required:["title","description","world","permissions","url","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsPermissionRevokedEvent||(n.WorldsPermissionRevokedEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_PERMISSION_GRANTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},world:{type:"string"},permissions:{type:"array",items:{type:"string"}},url:{type:"string"},address:{type:"string"}},required:["title","description","world","permissions","url","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsPermissionGrantedEvent||(n.WorldsPermissionGrantedEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_ACCESS_RESTRICTED},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},when:{type:"number"},address:{type:"string"}},required:["title","description","when","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsAccessRestrictedEvent||(n.WorldsAccessRestrictedEvent={})),function(r){r.schema={type:"object",properties:{type:{type:"string",const:i.Events.Type.WORLD},subType:{type:"string",const:i.Events.SubType.Worlds.WORLDS_MISSING_RESOURCES},key:{type:"string"},timestamp:{type:"number",minimum:0},metadata:{type:"object",properties:{title:{type:"string"},description:{type:"string"},url:{type:"string"},when:{type:"number"},address:{type:"string"}},required:["title","description","url","when","address"],additionalProperties:!1}},required:["type","subType","key","timestamp","metadata"],additionalProperties:!1},r.validate=(0,e.generateLazyValidator)(r.schema)}(n.WorldsMissingResourcesEvent||(n.WorldsMissingResourcesEvent={}))}(Ag)),Ag}var _A;function P1(){return _A||(_A=1,function(n){var t=Ns&&Ns.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ns&&Ns.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(Ln(),n),e(f1(),n),e(c1(),n),e(h1(),n),e(d1(),n),e(p1(),n),e(_1(),n),e(m1(),n),e(g1(),n),e(v1(),n),e(y1(),n),e(b1(),n),e(E1(),n),e(T1(),n),e(S1(),n),e(C1(),n)}(Ns)),Ns}var mA;function bb(){return mA||(mA=1,function(n){var t=Ms&&Ms.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ms&&Ms.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(KN(),n),e(QN(),n),e(wM(),n),e(mb(),n),e(RM(),n),e(n1(),n),e(NM(),n),e(o1(),n),e(s1(),n),e(u1(),n),e(P1(),n)}(Ms)),Ms}var gA;function A1(){return gA||(gA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WearableJson=void 0;const t=ip(),e=Zs(),i=_b(),r=st(),o=bb();(function(a){a.schema={type:"object",properties:{description:{type:"string"},rarity:Object.assign(Object.assign({},t.Rarity.schema),{nullable:!0}),name:{type:"string"},data:{type:"object",properties:{replaces:{type:"array",items:e.WearableCategory.schema},hides:{type:"array",items:e.WearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:i.WearableRepresentation.schema,minItems:1},category:e.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:o.HideableWearableCategory.schema},blockVrmExport:{type:"boolean",nullable:!0},outlineCompatible:{type:"boolean",nullable:!0}},required:["replaces","hides","tags","representations","category"]}},additionalProperties:!0,required:["description","name","data"]},a.validate=(0,r.generateLazyValidator)(a.schema)})(n.WearableJson||(n.WearableJson={}))}(Em)),Em}var vA;function R1(){return vA||(vA=1,function(n){var t=Os&&Os.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Os&&Os.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(XN(),n),e(A1(),n)}(Os)),Os}var yA;function O1(){return yA||(yA=1,function(n){var t=Ts&&Ts.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Ts&&Ts.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(jN(),n),e(R1(),n)}(Ts)),Ts}var Fs={},Rg={},bA;function M1(){return bA||(bA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Account=n.AccountSortBy=void 0;const t=st();(function(e){e.MOST_SALES="most_sales",e.MOST_PURCHASES="most_purchases",e.MOST_SPENT="most_spent",e.MOST_EARNED="most_earned",e.MOST_ROYALTIES="most_royalties",e.MOST_COLLECTIONS="most_collections"})(n.AccountSortBy||(n.AccountSortBy={})),function(e){e.schema={type:"object",properties:{id:{type:"string"},address:{type:"string"},sales:{type:"integer"},purchases:{type:"integer"},spent:{type:"string"},earned:{type:"string"},royalties:{type:"string"},collections:{type:"number"}},required:["id","address","sales","purchases","spent","earned","royalties","collections"]},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Account||(n.Account={}))}(Rg)),Rg}var Og={},Mg={},EA;function UM(){return EA||(EA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getChainId=n.ChainName=void 0;const t=st(),e=Ro();var i;(function(o){o.ETHEREUM_MAINNET="Ethereum Mainnet",o.ETHEREUM_ROPSTEN="Ropsten",o.ETHEREUM_RINKEBY="Rinkeby",o.ETHEREUM_GOERLI="Goerli",o.ETHEREUM_KOVAN="Kovan",o.ETHEREUM_SEPOLIA="Sepolia",o.MATIC_MAINNET="Polygon",o.MATIC_MUMBAI="Mumbai",o.MATIC_AMOY="Amoy",o.AVALANCHE_MAINNET="Avalanche",o.BINANCE_MAINNET="Binance Smart Chain",o.ARBITRUM_MAINNET="Arbitrum",o.OPTIMISM_MAINNET="Optimism",o.FANTOM_MAINNET="Fantom"})(i=n.ChainName||(n.ChainName={}));function r(o){switch(o){case i.ETHEREUM_MAINNET:return e.ChainId.ETHEREUM_MAINNET;case i.ETHEREUM_ROPSTEN:return e.ChainId.ETHEREUM_ROPSTEN;case i.ETHEREUM_RINKEBY:return e.ChainId.ETHEREUM_RINKEBY;case i.ETHEREUM_GOERLI:return e.ChainId.ETHEREUM_GOERLI;case i.ETHEREUM_KOVAN:return e.ChainId.ETHEREUM_KOVAN;case i.ETHEREUM_SEPOLIA:return e.ChainId.ETHEREUM_SEPOLIA;case i.MATIC_MAINNET:return e.ChainId.MATIC_MAINNET;case i.MATIC_MUMBAI:return e.ChainId.MATIC_MUMBAI;case i.MATIC_AMOY:return e.ChainId.MATIC_AMOY;case i.AVALANCHE_MAINNET:return e.ChainId.AVALANCHE_MAINNET;case i.BINANCE_MAINNET:return e.ChainId.BSC_MAINNET;case i.ARBITRUM_MAINNET:return e.ChainId.ARBITRUM_MAINNET;case i.OPTIMISM_MAINNET:return e.ChainId.OPTIMISM_MAINNET;case i.FANTOM_MAINNET:return e.ChainId.FANTOM_MAINNET;default:return null}}n.getChainId=r,function(o){o.schema={type:"string",enum:Object.values(o)},o.validate=(0,t.generateLazyValidator)(o.schema)}(i=n.ChainName||(n.ChainName={}))}(Mg)),Mg}var xg={},TA;function Ao(){return TA||(TA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Network=void 0;const t=st();(function(e){e.ETHEREUM="ETHEREUM",e.MATIC="MATIC",e.AVALANCHE="AVALANCHE",e.BSC="BINANCE SMART CHAIN",e.OPTIMISM="OPTIMISM",e.ARBITRUM="ARBITRUM",e.FANTOM="FANTOM"})(n.Network||(n.Network={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.Network||(n.Network={}))}(xg)),xg}var SA;function Ro(){return SA||(SA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getNetwork=n.getNetworkMapping=n.getURNProtocol=n.getChainName=n.ChainId=void 0;const t=st(),e=UM(),i=Ao();var r;(function(u){u[u.ETHEREUM_MAINNET=1]="ETHEREUM_MAINNET",u[u.ETHEREUM_ROPSTEN=3]="ETHEREUM_ROPSTEN",u[u.ETHEREUM_RINKEBY=4]="ETHEREUM_RINKEBY",u[u.ETHEREUM_GOERLI=5]="ETHEREUM_GOERLI",u[u.ETHEREUM_KOVAN=42]="ETHEREUM_KOVAN",u[u.ETHEREUM_SEPOLIA=11155111]="ETHEREUM_SEPOLIA",u[u.MATIC_MAINNET=137]="MATIC_MAINNET",u[u.MATIC_MUMBAI=80001]="MATIC_MUMBAI",u[u.MATIC_AMOY=80002]="MATIC_AMOY",u[u.BSC_MAINNET=56]="BSC_MAINNET",u[u.OPTIMISM_MAINNET=10]="OPTIMISM_MAINNET",u[u.ARBITRUM_MAINNET=42161]="ARBITRUM_MAINNET",u[u.FANTOM_MAINNET=250]="FANTOM_MAINNET",u[u.AVALANCHE_MAINNET=43114]="AVALANCHE_MAINNET"})(r=n.ChainId||(n.ChainId={}));function o(u){switch(u){case r.ETHEREUM_MAINNET:return e.ChainName.ETHEREUM_MAINNET;case r.ETHEREUM_ROPSTEN:return e.ChainName.ETHEREUM_ROPSTEN;case r.ETHEREUM_RINKEBY:return e.ChainName.ETHEREUM_RINKEBY;case r.ETHEREUM_GOERLI:return e.ChainName.ETHEREUM_GOERLI;case r.ETHEREUM_KOVAN:return e.ChainName.ETHEREUM_KOVAN;case r.ETHEREUM_SEPOLIA:return e.ChainName.ETHEREUM_SEPOLIA;case r.MATIC_MAINNET:return e.ChainName.MATIC_MAINNET;case r.MATIC_MUMBAI:return e.ChainName.MATIC_MUMBAI;case r.MATIC_AMOY:return e.ChainName.MATIC_AMOY;case r.BSC_MAINNET:return e.ChainName.BINANCE_MAINNET;case r.ARBITRUM_MAINNET:return e.ChainName.ARBITRUM_MAINNET;case r.OPTIMISM_MAINNET:return e.ChainName.OPTIMISM_MAINNET;case r.FANTOM_MAINNET:return e.ChainName.FANTOM_MAINNET;case r.AVALANCHE_MAINNET:return e.ChainName.AVALANCHE_MAINNET;default:return null}}n.getChainName=o;function a(u){switch(u){case r.ETHEREUM_MAINNET:return"ethereum";case r.ETHEREUM_ROPSTEN:return"ropsten";case r.ETHEREUM_RINKEBY:return"rinkeby";case r.ETHEREUM_GOERLI:return"goerli";case r.ETHEREUM_KOVAN:return"kovan";case r.ETHEREUM_SEPOLIA:return"sepolia";case r.MATIC_MAINNET:return"matic";case r.MATIC_MUMBAI:return"mumbai";case r.MATIC_AMOY:return"amoy";default:return""}}n.getURNProtocol=a;function s(u){const f={[i.Network.BSC]:r.BSC_MAINNET,[i.Network.OPTIMISM]:r.OPTIMISM_MAINNET,[i.Network.ARBITRUM]:r.ARBITRUM_MAINNET,[i.Network.FANTOM]:r.FANTOM_MAINNET,[i.Network.AVALANCHE]:r.AVALANCHE_MAINNET};switch(u){case r.ETHEREUM_MAINNET:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_MAINNET,[i.Network.MATIC]:r.MATIC_MAINNET},f);case r.ETHEREUM_ROPSTEN:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_ROPSTEN,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_RINKEBY:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_RINKEBY,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_GOERLI:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_GOERLI,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_KOVAN:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_KOVAN,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.ETHEREUM_SEPOLIA:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_SEPOLIA,[i.Network.MATIC]:r.MATIC_AMOY},f);case r.MATIC_MAINNET:return Object.assign({[i.Network.ETHEREUM]:r.MATIC_MAINNET,[i.Network.MATIC]:r.MATIC_MAINNET},f);case r.MATIC_MUMBAI:return Object.assign({[i.Network.ETHEREUM]:r.MATIC_MUMBAI,[i.Network.MATIC]:r.MATIC_MUMBAI},f);case r.MATIC_AMOY:return Object.assign({[i.Network.ETHEREUM]:r.MATIC_AMOY,[i.Network.MATIC]:r.MATIC_AMOY},f);default:return Object.assign({[i.Network.ETHEREUM]:r.ETHEREUM_MAINNET,[i.Network.MATIC]:r.MATIC_MAINNET},f)}}n.getNetworkMapping=s;function l(u){switch(u){case r.ETHEREUM_MAINNET:case r.ETHEREUM_ROPSTEN:case r.ETHEREUM_GOERLI:case r.ETHEREUM_KOVAN:case r.ETHEREUM_RINKEBY:case r.ETHEREUM_SEPOLIA:return i.Network.ETHEREUM;case r.MATIC_MAINNET:case r.MATIC_MUMBAI:case r.MATIC_AMOY:return i.Network.MATIC;case r.BSC_MAINNET:return i.Network.BSC;case r.OPTIMISM_MAINNET:return i.Network.OPTIMISM;case r.ARBITRUM_MAINNET:return i.Network.ARBITRUM;case r.FANTOM_MAINNET:return i.Network.FANTOM;case r.AVALANCHE_MAINNET:return i.Network.AVALANCHE}}n.getNetwork=l,function(u){u.schema={type:"number",enum:Object.values(u)},u.validate=(0,t.generateLazyValidator)(u.schema)}(r=n.ChainId||(n.ChainId={}))}(Og)),Og}var Ig={},CA;function x1(){return CA||(CA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Collection=n.CollectionSortBy=void 0;const t=st(),e=Ro(),i=Ao();(function(r){r.NEWEST="newest",r.NAME="name",r.RECENTLY_REVIEWED="recently_reviewed",r.RECENTLY_LISTED="recently_listed",r.SIZE="size"})(n.CollectionSortBy||(n.CollectionSortBy={})),function(r){r.schema={type:"object",properties:{urn:{type:"string"},creator:{type:"string"},name:{type:"string"},contractAddress:{type:"string"},size:{type:"integer"},isOnSale:{type:"boolean"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},network:i.Network.schema,chainId:e.ChainId.schema,firstListedAt:{type:"integer",nullable:!0}},required:["urn","creator","name","contractAddress","isOnSale","size","createdAt","updatedAt","reviewedAt","network","chainId"]},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.Collection||(n.Collection={}))}(Ig)),Ig}var Dg={},wg={},PA;function np(){return PA||(PA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.NFTCategory=void 0;const t=st();(function(e){e.PARCEL="parcel",e.ESTATE="estate",e.WEARABLE="wearable",e.ENS="ens",e.EMOTE="emote"})(n.NFTCategory||(n.NFTCategory={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.NFTCategory||(n.NFTCategory={}))}(wg)),wg}var AA;function I1(){return AA||(AA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Contract=n.ContractSortBy=void 0;const t=st(),e=Ro(),i=Ao(),r=np();(function(o){o.NAME="name"})(n.ContractSortBy||(n.ContractSortBy={})),function(o){o.schema={type:"object",properties:{name:{type:"string"},address:{type:"string"},category:r.NFTCategory.schema,network:i.Network.schema,chainId:e.ChainId.schema},required:["name","address","category","network","chainId"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Contract||(n.Contract={}))}(Dg)),Dg}var Lg={},Ng={},RA;function kM(){return RA||(RA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.NFT=n.NFTSortBy=void 0;const t=st(),e=Ro(),i=bb(),r=Ao(),o=np(),a=ip(),s=Zs();(function(l){l.NAME="name",l.NEWEST="newest",l.RECENTLY_LISTED="recently_listed",l.RECENTLY_SOLD="recently_sold",l.CHEAPEST="cheapest",l.RENTAL_LISTING_DATE="rental_listing_date",l.RENTAL_DATE="rented_date",l.MAX_RENTAL_PRICE="max_rental_price",l.MIN_RENTAL_PRICE="min_rental_price"})(n.NFTSortBy||(n.NFTSortBy={})),function(l){l.schema={type:"object",properties:{id:{type:"string"},tokenId:{type:"string"},contractAddress:{type:"string"},activeOrderId:{type:"string",nullable:!0},utility:{type:"string",nullable:!0},openRentalId:{type:"string",nullable:!0},owner:{type:"string"},name:{type:"string"},image:{type:"string"},url:{type:"string"},data:{type:"object",nullable:!1,properties:{parcel:{type:"object",properties:{description:{type:["string"],nullable:!0},x:{type:"string"},y:{type:"string"},estate:{type:"object",properties:{tokenId:{type:"string"},name:{type:"string"}},required:["tokenId","name"],nullable:!0}},required:["description","x","y","estate"],nullable:!0},estate:{type:"object",properties:{description:{type:["string"],nullable:!0},size:{type:"integer"},parcels:{type:"array",items:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"]}}},required:["description","size","parcels"],nullable:!0},wearable:{type:"object",properties:{bodyShapes:{type:"array",items:i.BodyShape.schema},category:s.WearableCategory.schema,description:{type:"string"},rarity:a.Rarity.schema,isSmart:{type:"boolean"}},required:["bodyShapes","category","description","rarity","isSmart"],nullable:!0},ens:{type:"object",properties:{subdomain:{type:"string"}},required:["subdomain"],nullable:!0},emote:{type:"object",properties:{bodyShapes:{type:"array",items:i.BodyShape.schema},category:i.EmoteCategory.schema,description:{type:"string"},rarity:a.Rarity.schema,loop:{type:"boolean"},hasSound:{type:"boolean"},hasGeometry:{type:"boolean"},outcomeType:{type:"string",nullable:!0}},required:["bodyShapes","category","description","rarity","loop"],nullable:!0}},required:[]},issuedId:{type:"string",nullable:!0},itemId:{type:"string",nullable:!0},category:o.NFTCategory.schema,network:r.Network.schema,chainId:e.ChainId.schema,createdAt:{type:"integer"},updatedAt:{type:"integer"},soldAt:{type:"integer"},urn:{type:"string",nullable:!0}},required:["id","tokenId","contractAddress","activeOrderId","openRentalId","owner","name","image","url","data","issuedId","itemId","category","network","chainId","createdAt","updatedAt","soldAt"]},l.validate=(0,t.generateLazyValidator)(l.schema)}(n.NFT||(n.NFT={}))}(Ng)),Ng}var OA;function D1(){return OA||(OA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Item=n.ItemSortBy=void 0;const t=st(),e=Ro(),i=Ao(),r=kM(),o=np();(function(a){a.NAME="name",a.NEWEST="newest",a.RECENTLY_REVIEWED="recently_reviewed",a.RECENTLY_SOLD="recently_sold",a.RECENTLY_LISTED="recently_listed",a.CHEAPEST="cheapest"})(n.ItemSortBy||(n.ItemSortBy={})),function(a){a.schema={type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail:{type:"string"},url:{type:"string"},category:o.NFTCategory.schema,contractAddress:{type:"string"},itemId:{type:"string"},rarity:{type:"string"},price:{type:"string"},available:{type:"integer"},isOnSale:{type:"boolean"},creator:{type:"string"},beneficiary:{type:"string",nullable:!0},tradeId:{type:"string",nullable:!0},tradeContractAddress:{type:"string",nullable:!0},data:r.NFT.schema.properties.data,network:i.Network.schema,chainId:e.ChainId.schema,urn:{type:"string"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},soldAt:{type:"integer"},firstListedAt:{type:"integer",nullable:!0},picks:{type:"object",properties:{pickedByUser:{type:"boolean",nullable:!0},count:{type:"integer"}},required:["count"],nullable:!0},minPrice:{type:"string",nullable:!0},utility:{type:"string",nullable:!0},minListingPrice:{type:"string",nullable:!0},maxListingPrice:{type:"string",nullable:!0},listings:{type:"integer",nullable:!0},owners:{type:"integer",nullable:!0},tradeExpiresAt:{type:"integer",nullable:!0}},required:["id","name","thumbnail","url","category","contractAddress","itemId","rarity","price","available","isOnSale","creator","data","network","chainId","createdAt","updatedAt","soldAt"]},a.validate=(0,t.generateLazyValidator)(a.schema)}(n.Item||(n.Item={}))}(Lg)),Lg}var Fg={},MA;function Eb(){return MA||(MA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ListingStatus=void 0;const t=st();(function(e){e.OPEN="open",e.SOLD="sold",e.CANCELLED="cancelled"})(n.ListingStatus||(n.ListingStatus={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.ListingStatus||(n.ListingStatus={}))}(Fg)),Fg}var Bg={},xA;function w1(){return xA||(xA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.MetaTransaction=void 0;const t=st();(function(e){e.schema={type:"object",properties:{from:{type:"string"},params:{type:"array",items:[{type:"string"},{type:"string"}],additionalItems:!1,minItems:2}},additionalProperties:!1,required:["from","params"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.MetaTransaction||(n.MetaTransaction={}))}(Bg)),Bg}var Vg={},IA;function L1(){return IA||(IA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Mint=n.MintSortBy=void 0;const t=st(),e=Ro(),i=Ao();(function(r){r.RECENTLY_MINTED="recently_minted",r.MOST_EXPENSIVE="most_expensive"})(n.MintSortBy||(n.MintSortBy={})),function(r){r.schema={type:"object",properties:{id:{type:"string"},creator:{type:"string"},beneficiary:{type:"string"},minter:{type:"string"},price:{type:"string",nullable:!0},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},issuedId:{type:"string"},timestamp:{type:"integer"},network:i.Network.schema,chainId:e.ChainId.schema},required:["id","creator","beneficiary","minter","itemId","tokenId","issuedId","contractAddress","price","timestamp","network","chainId"]},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.Mint||(n.Mint={}))}(Vg)),Vg}var Ug={},DA;function N1(){return DA||(DA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CatalogSortDirection=n.CatalogSortBy=void 0,function(t){t.NEWEST="newest",t.RECENTLY_SOLD="recently_sold",t.CHEAPEST="cheapest",t.MOST_EXPENSIVE="most_expensive",t.RECENTLY_LISTED="recently_listed"}(n.CatalogSortBy||(n.CatalogSortBy={})),function(t){t.ASC="asc",t.DESC="desc"}(n.CatalogSortDirection||(n.CatalogSortDirection={}))}(Ug)),Ug}var kg={},wA;function F1(){return wA||(wA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Order=n.OrderSortBy=void 0;const t=st(),e=Ro(),i=Eb(),r=Ao();(function(o){o.RECENTLY_LISTED="recently_listed",o.RECENTLY_UPDATED="recently_updated",o.CHEAPEST="cheapest",o.ISSUED_ID_ASC="issued_id_asc",o.ISSUED_ID_DESC="issued_id_desc",o.OLDEST="oldest"})(n.OrderSortBy||(n.OrderSortBy={})),function(o){o.schema={type:"object",properties:{id:{type:"string"},marketplaceAddress:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},owner:{type:"string"},buyer:{type:["string"],nullable:!0},price:{type:"string"},status:i.ListingStatus.schema,network:r.Network.schema,chainId:e.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"},issuedId:{type:"string"},tradeId:{type:"string",nullable:!0}},required:["id","marketplaceAddress","contractAddress","tokenId","owner","buyer","price","status","network","chainId","expiresAt","createdAt","updatedAt"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Order||(n.Order={}))}(kg)),kg}var zg={},LA;function B1(){return LA||(LA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProviderType=void 0;const t=st();(function(e){e.INJECTED="injected",e.MAGIC="magic",e.MAGIC_TEST="magic_test",e.FORTMATIC="formatic",e.NETWORK="network",e.WALLET_CONNECT="wallet_connect",e.WALLET_CONNECT_V2="wallet_connect_v2",e.WALLET_LINK="wallet_link",e.METAMASK_MOBILE="metamask_mobile",e.AUTH_SERVER="auth_server"})(n.ProviderType||(n.ProviderType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.ProviderType||(n.ProviderType={}))}(zg)),zg}var Gg={},NA;function zM(){return NA||(NA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SaleType=void 0;const t=st();(function(e){e.ORDER="order",e.BID="bid",e.MINT="mint"})(n.SaleType||(n.SaleType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.SaleType||(n.SaleType={}))}(Gg)),Gg}var Wg={},FA;function V1(){return FA||(FA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Sale=n.SaleSortBy=void 0;const t=st(),e=Ro(),i=zM(),r=Ao();(function(o){o.RECENTLY_SOLD="recently_sold",o.MOST_EXPENSIVE="most_expensive"})(n.SaleSortBy||(n.SaleSortBy={})),function(o){o.schema={type:"object",properties:{id:{type:"string"},type:i.SaleType.schema,buyer:{type:"string"},seller:{type:"string"},price:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},txHash:{type:"string"},timestamp:{type:"integer"},network:r.Network.schema,chainId:e.ChainId.schema},required:["id","buyer","seller","itemId","tokenId","price","contractAddress","timestamp","txHash","network","chainId"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Sale||(n.Sale={}))}(Wg)),Wg}var Hg={},BA;function U1(){return BA||(BA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.RentalListingCreation=n.PeriodCreation=n.RentalsListingsSortBy=n.RentalsListingsFilterByCategory=n.RentalsListingSortDirection=n.RentalStatus=void 0;const t=st(),e=Ro(),i=Ao();(function(o){o.OPEN="open",o.CANCELLED="cancelled",o.EXECUTED="executed",o.CLAIMED="claimed"})(n.RentalStatus||(n.RentalStatus={})),function(o){o.ASC="asc",o.DESC="desc"}(n.RentalsListingSortDirection||(n.RentalsListingSortDirection={})),function(o){o.PARCEL="parcel",o.ESTATE="estate"}(n.RentalsListingsFilterByCategory||(n.RentalsListingsFilterByCategory={})),function(o){o.LAND_CREATION_DATE="land_creation_date",o.RENTAL_LISTING_DATE="rental_listing_date",o.RENTAL_DATE="rented_date",o.NAME="name",o.MAX_RENTAL_PRICE="max_rental_price",o.MIN_RENTAL_PRICE="min_rental_price"}(n.RentalsListingsSortBy||(n.RentalsListingsSortBy={}));var r;(function(o){o.schema={type:"object",properties:{minDays:{type:"integer",minimum:0,maximum:2147483647},maxDays:{type:"integer",minimum:0,maximum:2147483647},pricePerDay:{type:"string",pattern:"^[0-9]+$"}},additionalProperties:!1,required:["minDays","maxDays","pricePerDay"]},o.validate=(0,t.generateLazyValidator)(o.schema)})(r=n.PeriodCreation||(n.PeriodCreation={})),function(o){o.schema={type:"object",properties:{network:i.Network.schema,chainId:e.ChainId.schema,expiration:{type:"number",minimum:0},signature:{type:"string",minLength:1},tokenId:{type:"string",minLength:1},nonces:{type:"array",minItems:3,maxItems:3,items:{minLength:1,type:"string",pattern:"^[0-9]+$"}},contractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},rentalContractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},periods:{type:"array",minItems:1,maxItems:100,uniqueItems:!0,items:r.schema},target:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"}},additionalProperties:!1,required:["network","chainId","expiration","signature","nonces","tokenId","contractAddress","rentalContractAddress","periods","target"]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.RentalListingCreation||(n.RentalListingCreation={}))}(Hg)),Hg}var jg={},VA;function k1(){return VA||(VA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.AnalyticsDayDataSortBy=void 0,function(t){t.DATE="date",t.MOST_SALES="most_sales"}(n.AnalyticsDayDataSortBy||(n.AnalyticsDayDataSortBy={}))}(jg)),jg}var Xg={},UA;function z1(){return UA||(UA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Store=void 0;const t=st();(function(e){e.schema={type:"object",properties:{id:{type:"string"},version:{type:"number"},owner:{type:"string"},description:{type:"string"},links:{type:"array",items:{type:"object",properties:{name:{type:"string"},url:{type:"string"}},required:["name","url"]}},images:{type:"array",items:{type:"object",properties:{name:{type:"string"},file:{type:"string"}},required:["name","file"]}}},required:["id","version","owner","description","links","images"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.Store||(n.Store={}))}(Xg)),Xg}var Yg={},kA;function G1(){return kA||(kA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.GenderFilterOption=n.WearableGender=void 0;const t=st();(function(e){e.MALE="male",e.FEMALE="female"})(n.WearableGender||(n.WearableGender={})),function(e){e.MALE="male",e.FEMALE="female",e.UNISEX="unisex"}(n.GenderFilterOption||(n.GenderFilterOption={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.WearableGender||(n.WearableGender={}))}(Yg)),Yg}var Kg={},zA;function W1(){return zA||(zA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.World=n.isInsideWorldLimits=n.getWorld=void 0;const t=st();function e(){return{validWorldRanges:[{xMin:-150,yMin:-150,xMax:150,yMax:150},{xMin:62,yMin:151,xMax:162,yMax:158},{xMin:151,yMin:144,xMax:162,yMax:150},{xMin:151,yMin:59,xMax:163,yMax:143}]}}n.getWorld=e;function i(r,o){const a=e().validWorldRanges;for(const s of a)if(r>=s.xMin&&r<=s.xMax&&o>=s.yMin&&o<=s.yMax)return!0;return!1}n.isInsideWorldLimits=i,function(r){r.schema={type:"object",required:["validWorldRanges"],properties:{validWorldRanges:{type:"array",default:[{xMin:-150,yMin:-150,xMax:150,yMax:150}],items:{type:"object",required:["xMin","yMin","xMax","yMax"],properties:{xMin:{type:"integer"},yMin:{type:"integer"},xMax:{type:"integer"},yMax:{type:"integer"}}}}},additionalProperties:!1},r.validate=(0,t.generateLazyValidator)(r.schema)}(n.World||(n.World={}))}(Kg)),Kg}var qg={},GA;function H1(){return GA||(GA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Bid=n.BidSortBy=void 0;const t=st(),e=Ro(),i=Eb(),r=Ao();(function(o){o.RECENTLY_OFFERED="recently_offered",o.RECENTLY_UPDATED="recently_updated",o.MOST_EXPENSIVE="most_expensive"})(n.BidSortBy||(n.BidSortBy={})),function(o){const a={properties:{id:{type:"string"},bidder:{type:"string"},seller:{type:"string"},price:{type:"string"},fingerprint:{type:"string"},status:i.ListingStatus.schema,contractAddress:{type:"string"},network:r.Network.schema,chainId:e.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"}},required:["id","bidder","seller","price","fingerprint","status","contractAddress","network","chainId","expiresAt","createdAt","updatedAt"]};o.schema={type:"object",required:[],oneOf:[{properties:Object.assign(Object.assign({},a.properties),{tradeId:{type:"string"},tokenId:{type:"string"}}),required:[...a.required,"tradeId","tokenId"]},{type:"object",properties:Object.assign(Object.assign({},a.properties),{tradeId:{type:"string"},itemId:{type:"string"}}),required:[...a.required,"tradeId","itemId"]},{type:"object",properties:Object.assign(Object.assign({},a.properties),{bidAddress:{type:"string"},blockchainId:{type:"string"},blockNumber:{type:"string"},tokenId:{type:"string"}}),required:[...a.required,"bidAddress","blockchainId","blockNumber","tokenId"]}]},o.validate=(0,t.generateLazyValidator)(o.schema)}(n.Bid||(n.Bid={}))}(qg)),qg}var Qg={},WA;function j1(){return WA||(WA=1,Object.defineProperty(Qg,"__esModule",{value:!0})),Qg}var $g={},HA;function X1(){return HA||(HA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.TradeAssetDirection=n.TradeAssetType=n.TradeType=void 0,function(t){t.BID="bid",t.PUBLIC_NFT_ORDER="public_nft_order",t.PUBLIC_ITEM_ORDER="public_item_order"}(n.TradeType||(n.TradeType={})),function(t){t[t.ERC20=1]="ERC20",t[t.USD_PEGGED_MANA=2]="USD_PEGGED_MANA",t[t.ERC721=3]="ERC721",t[t.COLLECTION_ITEM=4]="COLLECTION_ITEM"}(n.TradeAssetType||(n.TradeAssetType={})),function(t){t.SENT="sent",t.RECEIVED="received"}(n.TradeAssetDirection||(n.TradeAssetDirection={}))}($g)),$g}var Bs={},Zg={},jA;function Y1(){return jA||(jA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewCamera=void 0;const t=st();(function(e){e.STATIC="static",e.INTERACTIVE="interactive"})(n.PreviewCamera||(n.PreviewCamera={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewCamera||(n.PreviewCamera={}))}(Zg)),Zg}var Jg={},XA;function K1(){return XA||(XA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewUnityMode=void 0,function(t){t.AUTH="authentication",t.BUILDER="builder",t.MARKETPLACE="marketplace",t.PROFILE="profile",t.CONFIG="configurator"}(n.PreviewUnityMode||(n.PreviewUnityMode={}))}(Jg)),Jg}var ev={},YA;function q1(){return YA||(YA=1,Object.defineProperty(ev,"__esModule",{value:!0})),ev}var tv={},KA;function Q1(){return KA||(KA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewEmoteEventType=void 0;const t=st();(function(e){e.ANIMATION_PLAY="animation_play",e.ANIMATION_PAUSE="animation_pause",e.ANIMATION_LOOP="animation_loop",e.ANIMATION_END="animation_end",e.ANIMATION_PLAYING="animation_playing"})(n.PreviewEmoteEventType||(n.PreviewEmoteEventType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewEmoteEventType||(n.PreviewEmoteEventType={}))}(tv)),tv}var iv={},qA;function $1(){return qA||(qA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewEmote=void 0;const t=st();(function(e){e.IDLE="idle",e.WALK="walk",e.RUN="run",e.JUMP="jump",e.CLAP="clap",e.DAB="dab",e.DANCE="dance",e.FASHION="fashion",e.FASHION_2="fashion-2",e.FASHION_3="fashion-3",e.FASHION_4="fashion-4",e.LOVE="love",e.MONEY="money",e.FIST_PUMP="fist-pump",e.HEAD_EXPLODE="head-explode",e.WAVE="wave"})(n.PreviewEmote||(n.PreviewEmote={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewEmote||(n.PreviewEmote={}))}(iv)),iv}var rv={},QA;function Z1(){return QA||(QA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.sendMessage=n.PreviewRenderer=n.PreviewMessageType=void 0;const t=st();(function(i){i.READY="ready",i.LOAD="load",i.ERROR="error",i.UPDATE="update",i.CONTROLLER_REQUEST="controller_request",i.CONTROLLER_RESPONSE="controller_response",i.EMOTE_EVENT="emote_event"})(n.PreviewMessageType||(n.PreviewMessageType={})),function(i){i.BABYLON="babylon",i.UNITY="unity"}(n.PreviewRenderer||(n.PreviewRenderer={})),function(i){i.schema={type:"string",enum:Object.values(i)},i.validate=(0,t.generateLazyValidator)(i.schema)}(n.PreviewMessageType||(n.PreviewMessageType={}));const e=(i,r,o,a="*")=>{const s={type:r,payload:o};i.postMessage(s,a)};n.sendMessage=e}(rv)),rv}var nv={},$A;function J1(){return $A||($A=1,Object.defineProperty(nv,"__esModule",{value:!0})),nv}var ov={},ZA;function eF(){return ZA||(ZA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewProjection=void 0;const t=st();(function(e){e.ORTHOGRAPHIC="orthographic",e.PERSPECTIVE="perspective"})(n.PreviewProjection||(n.PreviewProjection={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewProjection||(n.PreviewProjection={}))}(ov)),ov}var av={},JA;function tF(){return JA||(JA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.PreviewType=void 0;const t=st();(function(e){e.TEXTURE="texture",e.WEARABLE="wearable",e.AVATAR="avatar"})(n.PreviewType||(n.PreviewType={})),function(e){e.schema={type:"string",enum:Object.values(e)},e.validate=(0,t.generateLazyValidator)(e.schema)}(n.PreviewType||(n.PreviewType={}))}(av)),av}var sv={},eR;function iF(){return eR||(eR=1,Object.defineProperty(sv,"__esModule",{value:!0})),sv}var lv={},tR;function rF(){return tR||(tR=1,Object.defineProperty(lv,"__esModule",{value:!0})),lv}var uv={},iR;function nF(){return iR||(iR=1,Object.defineProperty(uv,"__esModule",{value:!0})),uv}var fv={},rR;function oF(){return rR||(rR=1,Object.defineProperty(fv,"__esModule",{value:!0})),fv}var cv={},nR;function aF(){return nR||(nR=1,Object.defineProperty(cv,"__esModule",{value:!0})),cv}var hv={},oR;function sF(){return oR||(oR=1,Object.defineProperty(hv,"__esModule",{value:!0})),hv}var dv={},aR;function lF(){return aR||(aR=1,Object.defineProperty(dv,"__esModule",{value:!0})),dv}var pv={},sR;function uF(){return sR||(sR=1,Object.defineProperty(pv,"__esModule",{value:!0})),pv}var lR;function fF(){return lR||(lR=1,function(n){var t=Bs&&Bs.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Bs&&Bs.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(Y1(),n),e(K1(),n),e(q1(),n),e(Q1(),n),e($1(),n),e(Z1(),n),e(J1(),n),e(eF(),n),e(tF(),n),e(iF(),n),e(rF(),n),e(nF(),n),e(oF(),n),e(aF(),n),e(sF(),n),e(lF(),n),e(uF(),n)}(Bs)),Bs}var Vs={},Ju={},uR;function cF(){if(uR)return Ju;uR=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.isSysLink=void 0;const n=t=>t!==null&&typeof t=="object"&&"sys"in t&&"id"in t.sys;return Ju.isSysLink=n,Ju}var ef={},fR;function hF(){if(fR)return ef;fR=1,Object.defineProperty(ef,"__esModule",{value:!0}),ef.ContentfulLocale=void 0;var n;return function(t){t.enUS="en-US",t.es="es",t.zh="zh"}(n||(n={})),ef.ContentfulLocale=n,ef}var _v={},cR;function dF(){return cR||(cR=1,Object.defineProperty(_v,"__esModule",{value:!0})),_v}var hR;function pF(){return hR||(hR=1,function(n){var t=Vs&&Vs.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Vs&&Vs.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(cF(),n),e(hF(),n),e(dF(),n)}(Vs)),Vs}var dR;function _F(){return dR||(dR=1,function(n){var t=Fs&&Fs.__createBinding||(Object.create?function(V,B,z,J){J===void 0&&(J=z);var X=Object.getOwnPropertyDescriptor(B,z);(!X||("get"in X?!B.__esModule:X.writable||X.configurable))&&(X={enumerable:!0,get:function(){return B[z]}}),Object.defineProperty(V,J,X)}:function(V,B,z,J){J===void 0&&(J=z),V[J]=B[z]}),e=Fs&&Fs.__exportStar||function(V,B){for(var z in V)z!=="default"&&!Object.prototype.hasOwnProperty.call(B,z)&&t(B,V,z)};Object.defineProperty(n,"__esModule",{value:!0}),n.isInsideWorldLimits=n.getWorld=n.World=n.GenderFilterOption=n.WearableGender=n.Store=n.AnalyticsDayDataSortBy=n.PeriodCreation=n.RentalListingCreation=n.RentalsListingsSortBy=n.RentalsListingsFilterByCategory=n.RentalsListingSortDirection=n.RentalStatus=n.SaleSortBy=n.Sale=n.SaleType=n.Rarity=n.ProviderType=n.OrderSortBy=n.Order=n.CatalogSortDirection=n.CatalogSortBy=n.NFTSortBy=n.NFT=n.NFTCategory=n.Network=n.MintSortBy=n.Mint=n.MetaTransaction=n.ListingStatus=n.ItemSortBy=n.Item=n.ContractSortBy=n.Contract=n.CollectionSortBy=n.Collection=n.getChainId=n.ChainName=n.getURNProtocol=n.getChainName=n.ChainId=n.AccountSortBy=n.Account=void 0;var i=M1();Object.defineProperty(n,"Account",{enumerable:!0,get:function(){return i.Account}}),Object.defineProperty(n,"AccountSortBy",{enumerable:!0,get:function(){return i.AccountSortBy}});var r=Ro();Object.defineProperty(n,"ChainId",{enumerable:!0,get:function(){return r.ChainId}}),Object.defineProperty(n,"getChainName",{enumerable:!0,get:function(){return r.getChainName}}),Object.defineProperty(n,"getURNProtocol",{enumerable:!0,get:function(){return r.getURNProtocol}});var o=UM();Object.defineProperty(n,"ChainName",{enumerable:!0,get:function(){return o.ChainName}}),Object.defineProperty(n,"getChainId",{enumerable:!0,get:function(){return o.getChainId}});var a=x1();Object.defineProperty(n,"Collection",{enumerable:!0,get:function(){return a.Collection}}),Object.defineProperty(n,"CollectionSortBy",{enumerable:!0,get:function(){return a.CollectionSortBy}});var s=I1();Object.defineProperty(n,"Contract",{enumerable:!0,get:function(){return s.Contract}}),Object.defineProperty(n,"ContractSortBy",{enumerable:!0,get:function(){return s.ContractSortBy}});var l=D1();Object.defineProperty(n,"Item",{enumerable:!0,get:function(){return l.Item}}),Object.defineProperty(n,"ItemSortBy",{enumerable:!0,get:function(){return l.ItemSortBy}});var u=Eb();Object.defineProperty(n,"ListingStatus",{enumerable:!0,get:function(){return u.ListingStatus}});var f=w1();Object.defineProperty(n,"MetaTransaction",{enumerable:!0,get:function(){return f.MetaTransaction}});var c=L1();Object.defineProperty(n,"Mint",{enumerable:!0,get:function(){return c.Mint}}),Object.defineProperty(n,"MintSortBy",{enumerable:!0,get:function(){return c.MintSortBy}});var h=Ao();Object.defineProperty(n,"Network",{enumerable:!0,get:function(){return h.Network}});var p=np();Object.defineProperty(n,"NFTCategory",{enumerable:!0,get:function(){return p.NFTCategory}});var _=kM();Object.defineProperty(n,"NFT",{enumerable:!0,get:function(){return _.NFT}}),Object.defineProperty(n,"NFTSortBy",{enumerable:!0,get:function(){return _.NFTSortBy}});var g=N1();Object.defineProperty(n,"CatalogSortBy",{enumerable:!0,get:function(){return g.CatalogSortBy}}),Object.defineProperty(n,"CatalogSortDirection",{enumerable:!0,get:function(){return g.CatalogSortDirection}});var v=F1();Object.defineProperty(n,"Order",{enumerable:!0,get:function(){return v.Order}}),Object.defineProperty(n,"OrderSortBy",{enumerable:!0,get:function(){return v.OrderSortBy}});var E=B1();Object.defineProperty(n,"ProviderType",{enumerable:!0,get:function(){return E.ProviderType}});var T=ip();Object.defineProperty(n,"Rarity",{enumerable:!0,get:function(){return T.Rarity}});var S=zM();Object.defineProperty(n,"SaleType",{enumerable:!0,get:function(){return S.SaleType}});var C=V1();Object.defineProperty(n,"Sale",{enumerable:!0,get:function(){return C.Sale}}),Object.defineProperty(n,"SaleSortBy",{enumerable:!0,get:function(){return C.SaleSortBy}});var O=U1();Object.defineProperty(n,"RentalStatus",{enumerable:!0,get:function(){return O.RentalStatus}}),Object.defineProperty(n,"RentalsListingSortDirection",{enumerable:!0,get:function(){return O.RentalsListingSortDirection}}),Object.defineProperty(n,"RentalsListingsFilterByCategory",{enumerable:!0,get:function(){return O.RentalsListingsFilterByCategory}}),Object.defineProperty(n,"RentalsListingsSortBy",{enumerable:!0,get:function(){return O.RentalsListingsSortBy}}),Object.defineProperty(n,"RentalListingCreation",{enumerable:!0,get:function(){return O.RentalListingCreation}}),Object.defineProperty(n,"PeriodCreation",{enumerable:!0,get:function(){return O.PeriodCreation}});var A=k1();Object.defineProperty(n,"AnalyticsDayDataSortBy",{enumerable:!0,get:function(){return A.AnalyticsDayDataSortBy}});var M=z1();Object.defineProperty(n,"Store",{enumerable:!0,get:function(){return M.Store}});var D=G1();Object.defineProperty(n,"WearableGender",{enumerable:!0,get:function(){return D.WearableGender}}),Object.defineProperty(n,"GenderFilterOption",{enumerable:!0,get:function(){return D.GenderFilterOption}});var U=W1();Object.defineProperty(n,"World",{enumerable:!0,get:function(){return U.World}}),Object.defineProperty(n,"getWorld",{enumerable:!0,get:function(){return U.getWorld}}),Object.defineProperty(n,"isInsideWorldLimits",{enumerable:!0,get:function(){return U.isInsideWorldLimits}}),e(H1(),n),e(j1(),n),e(X1(),n),e(fF(),n),e(pF(),n)}(Fs)),Fs}var mv={},pR;function mF(){return pR||(pR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.LinkerAuthorization=void 0;const t=st();(function(e){e.schema={type:"object",properties:{name:{type:"string"},desc:{type:"string"},startDate:{type:"string",nullable:!0},endDate:{type:"string",nullable:!0},contactInfo:{type:"object",properties:{name:{type:"string"}},required:["name"]},onlyDev:{type:"boolean",nullable:!0},addresses:{type:"array",items:{type:"string"},minItems:1},plots:{type:"array",items:{type:"string"},minItems:1}},required:["name","desc","contactInfo","addresses","plots"]},e.validate=(0,t.generateLazyValidator)(e.schema)})(n.LinkerAuthorization||(n.LinkerAuthorization={}))}(mv)),mv}var Us={},gv={},tf={},_R;function GM(){if(_R)return tf;_R=1,Object.defineProperty(tf,"__esModule",{value:!0}),tf.isInExceptionBlock=void 0;function n(r,o){return r>=62&&r<=150&&o>=151&&o<=158}function t(r,o){return r>=151&&r<=162&&o>=144&&o<=158}function e(r,o){return r>=151&&r<=163&&o>=59&&o<=143}function i(r,o){return n(r,o)||t(r,o)||e(r,o)}return tf.isInExceptionBlock=i,tf}var mR;function gF(){return mR||(mR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Parcel=n.PARCEL_LIMITS=void 0;const t=st(),e=GM();n.PARCEL_LIMITS={minX:-150,maxX:150,minY:-150,maxY:150},function(i){i._isInLimits={keyword:"_isInLimits",validate:function(p,_){return!_||typeof _.x!="number"||typeof _.y!="number"?!1:s(_)||(0,e.isInExceptionBlock)(_.x,_.y)},errors:!1},i.schema={type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"}},_isInLimits:!0,additionalProperties:!1},i.validate=(0,t.generateLazyValidator)(i.schema,[i._isInLimits]);function r({x:h,y:p}){return`${h},${p}`}i.parcelToString=r;function o(h){const p=h.match(/^(-?\d+),(-?\d+)$/);if(!p)return null;const[,_,g]=p,v=parseInt(_,10),E=parseInt(g,10);return{x:v,y:E}}i.stringToParcel=o;function a(h){const p=o(h);return p?i.validate(p):!1}i.isParcelStringValid=a;function s(h){const{x:p,y:_}=h;return p>=n.PARCEL_LIMITS.minX&&p<=n.PARCEL_LIMITS.maxX&&_>=n.PARCEL_LIMITS.minY&&_<=n.PARCEL_LIMITS.maxY}i.isInStandardBounds=s;function l(h){return(0,e.isInExceptionBlock)(h.x,h.y)}i.isExceptionParcel=l;function u(h){return s(h)||l(h)}i.isInBounds=u;function f(h){return i.validate(h)}i.isValid=f;function c(h){const p=o(h);return p?i.validate(p):!1}i.isValidString=c}(n.Parcel||(n.Parcel={}))}(gv)),gv}var ks={},gR;function vF(){if(gR)return ks;gR=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.validateUrlInstance=ks.validateUrl=void 0;const n={allowLocalhost:!1,allowedPorts:[]};function t(p,_=2){let g=p;for(let v=0;v<_;v++)try{g=decodeURIComponent(g)}catch{break}return g.normalize("NFKC")}function e(p){return/[\u0000-\u001F\u007F-\u009F\u202A-\u202E\u2066-\u2069]/.test(p)}function i(p){return!!(p.username||p.password)}function r(p){return/\\/.test(p)}const o=["80","443"];function a(p,_){return!!p.port&&!_.includes(p.port)}function s(p){const _=p.toLowerCase();return!!(_==="localhost"||_.endsWith(".local")||/^(127\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|169\.254\.)/.test(_)||_==="::1"||_==="[::1]"||_.startsWith("fe80:")||_.startsWith("fc00:"))}function l(p){if(p.startsWith("//"))return null;try{return{url:new URL(p),wasRelative:!1}}catch{try{return{url:new URL(p,"https://example.com"),wasRelative:!0}}catch{return null}}}function u(p){const _=t(String(p).toLowerCase());return!(e(_)||r(_))}function f(p){return!(!p||p.includes("..")||p.includes("//")||e(p)||r(p))}function c(p,_={}){const g=Object.assign(Object.assign({},n),_),v=[...o,...g.allowedPorts];if(!p||p.length===0||p.length>4096||e(p)||r(p))return!1;const E=t(p);if(e(E)||r(E)||p.startsWith("//"))return!1;const T=l(p);if(!T)return!1;const{url:S,wasRelative:C}=T;if(S.protocol!=="http:"&&S.protocol!=="https:"&&S.protocol!==""||i(S)||r(p)||r(S.href)||!C&&(a(S,v)||!g.allowLocalhost&&S.hostname&&s(S.hostname))||!f(S.pathname)||S.pathname.length>2048)return!1;const O=Array.from(S.searchParams.entries());if(O.length>50||(S.search?S.search.startsWith("?")?S.search.length-1:S.search.length:0)>2048)return!1;for(const[M,D]of O)if(M.length===0||!u(M)||!u(D)||M.length>128||D.length>1024)return!1;return!(S.hash&&e(S.hash))}ks.validateUrl=c;function h(p,_={}){return c(p.toString(),_)}return ks.validateUrlInstance=h,ks}var vR;function yF(){return vR||(vR=1,function(n){var t=Us&&Us.__createBinding||(Object.create?function(i,r,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(r,o);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(i,a,s)}:function(i,r,o,a){a===void 0&&(a=o),i[a]=r[o]}),e=Us&&Us.__exportStar||function(i,r){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&t(r,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),e(gF(),n),e(GM(),n),e(vF(),n)}(Us)),Us}var yR;function bF(){return yR||(yR=1,function(n){var t=mo&&mo.__createBinding||(Object.create?function(a,s,l,u){u===void 0&&(u=l);var f=Object.getOwnPropertyDescriptor(s,l);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[l]}}),Object.defineProperty(a,u,f)}:function(a,s,l,u){u===void 0&&(u=l),a[u]=s[l]}),e=mo&&mo.__setModuleDefault||(Object.create?function(a,s){Object.defineProperty(a,"default",{enumerable:!0,value:s})}:function(a,s){a.default=s}),i=mo&&mo.__importStar||function(a){if(a&&a.__esModule)return a;var s={};if(a!=null)for(var l in a)l!=="default"&&Object.prototype.hasOwnProperty.call(a,l)&&t(s,a,l);return e(s,a),s},r=mo&&mo.__exportStar||function(a,s){for(var l in a)l!=="default"&&!Object.prototype.hasOwnProperty.call(s,l)&&t(s,a,l)};Object.defineProperty(n,"__esModule",{value:!0}),n.sdk=void 0;const o=i(O1());n.sdk=o,r(st(),n),r(_F(),n),r(bb(),n),r(Js(),n),r(mF(),n),r(ac(),n),r(LM(),n),r(VM(),n),r(yF(),n)}(mo)),mo}var Ce=bF();function WM(){const[n,t]=Ct.useState({width:void 0,height:void 0});return Ct.useEffect(()=>{function e(){t({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),n}var vv={},rf={},yv={},zs={},bR;function EF(){if(bR)return zs;bR=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.getEnvFromQueryParam=zs.getEnvFromTLD=void 0;const n=Tb();function t(i){const{host:r}=i;return r.endsWith(".org")||r.endsWith(".co")?n.Env.PRODUCTION:r.endsWith(".today")||r.endsWith(".net")?n.Env.STAGING:r.endsWith(".io")||r.endsWith(".zone")?n.Env.DEVELOPMENT:null}zs.getEnvFromTLD=t;function e(i){const r=new URLSearchParams(i.search),o=r.get("ENV")||r.get("env");if(o){const a=o.toLowerCase();if((0,n.isEnv)(a))return a}return null}return zs.getEnvFromQueryParam=e,zs}var ER;function Tb(){return ER||(ER=1,function(n){var t={};Object.defineProperty(n,"__esModule",{value:!0}),n.getEnv=n.getDefaultEnv=n.parseEnvVar=n.isEnv=n.getEnvList=n.Env=void 0;const e=EF();var i;(function(u){u.DEVELOPMENT="dev",u.STAGING="stg",u.PRODUCTION="prod"})(i=n.Env||(n.Env={}));function r(){return Object.values(i)}n.getEnvList=r;function o(u){return r().includes(u)}n.isEnv=o;function a(u){if(o(u))return u;throw new Error(`Invalid value for DCL_DEFAULT_ENV. Found "${u}", possible values are ${r().map(f=>`"${f}"`).join(", ")}.`)}n.parseEnvVar=a;function s(u={}){const{DCL_DEFAULT_ENV:f,REACT_APP_DCL_DEFAULT_ENV:c,VITE_DCL_DEFAULT_ENV:h,GATSBY_DCL_DEFAULT_ENV:p}=u;if(f&&c&&f!==c)throw new Error("You have defined both DCL_DEFAULT_ENV and REACT_APP_DCL_DEFAULT_ENV with different values");if(f&&h&&f!==h)throw new Error("You have defined both DCL_DEFAULT_ENV and VITE_DCL_DEFAULT_ENV with different values");if(f&&p&&f!==p)throw new Error("You have defined both DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");if(c&&p&&c!==p)throw new Error("You have defined both REACT_APP_DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");return f?a(f):c?a(c):h?a(h):p?a(p):i.PRODUCTION}n.getDefaultEnv=s;function l(u){if(typeof window<"u"){const c=(0,e.getEnvFromQueryParam)(window.location);if(c)return c;const h=(0,e.getEnvFromTLD)(window.location);if(h)return h}return s(typeof u>"u"&&typeof process=="object"&&typeof t=="object"?t:u)}n.getEnv=l}(yv)),yv}var TR;function TF(){if(TR)return rf;TR=1,Object.defineProperty(rf,"__esModule",{value:!0}),rf.createConfig=void 0;const n=Tb();function t(e,i){const r=(0,n.getEnv)(i==null?void 0:i.systemEnvVariables),o=e[r];return{get:(a,s="")=>{if(!o)throw new Error(`Could not find a config for env=${r}`);return a in o?o[a]:s},is:a=>r===a,getEnv:()=>r}}return rf.createConfig=t,rf}var SR;function SF(){return SR||(SR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getEnv=n.Env=n.createConfig=void 0;var t=TF();Object.defineProperty(n,"createConfig",{enumerable:!0,get:function(){return t.createConfig}});var e=Tb();Object.defineProperty(n,"Env",{enumerable:!0,get:function(){return e.Env}}),Object.defineProperty(n,"getEnv",{enumerable:!0,get:function(){return e.getEnv}})}(vv)),vv}var _d=SF();const CF="https://marketplace-api.decentraland.zone",PF="https://peer-ap1.decentraland.zone",AF="amoy",RF={MARKETPLACE_SERVER_URL:CF,PEER_URL:PF,NETWORK:AF},OF="https://marketplace-api.decentraland.org",MF="https://peer.decentraland.org",xF="matic",IF={MARKETPLACE_SERVER_URL:OF,PEER_URL:MF,NETWORK:xF},DF="https://marketplace-api.decentraland.org",wF="https://peer.decentraland.org",LF="matic",NF={MARKETPLACE_SERVER_URL:DF,PEER_URL:wF,NETWORK:LF},Wf=_d.createConfig({[_d.Env.DEVELOPMENT]:RF,[_d.Env.STAGING]:IF,[_d.Env.PRODUCTION]:NF});async function FF(n){return new Promise(t=>setTimeout(t,n))}async function Jl(n,t={},e=3){try{const i=await fetch(n,t);if(!i.ok)throw new Error(await i.text());return i.json()}catch(i){if(e>0)return await FF(100),Jl(n,t,e-1);throw i}}class BF{async fetchItem(t,e,i){const{data:r}=await Jl(`${i}/v1/items?contractAddress=${t}&itemId=${e}`);if(r.length===0)throw new Error(`Item not found for contractAddress="${t}" itemId="${e}"`);return r[0]}async fetchNFT(t,e,i){const{data:r}=await Jl(`${i}/v1/nfts?contractAddress=${t}&tokenId=${e}`);if(r.length===0)throw new Error(`NFT not found for contractAddress="${t}" tokenId="${e}"`);return r[0].nft}}const VF=new BF;function Sb(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(r){r(e)}),(i=n.get("*"))&&i.slice().map(function(r){r(t,e)})}}}function ko(n){return!!n&&"emoteDataADR74"in n}class bo extends Error{constructor(){super("Invalid emote")}}function CR(){return{getLength(){throw new bo},isPlaying(){throw new bo},goTo(){throw new bo},play(){throw new bo},pause(){throw new bo},stop(){throw new bo},enableSound(){throw new bo},disableSound(){throw new bo},hasSound(){throw new bo},emote:null,isSocialEmote(){throw new bo},getSocialEmoteAnimations(){throw new bo},events:Sb()}}function UF(n,t){return n.find(e=>e.data.category===t)||null}function kF(){return[Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.MOUTH,Ce.WearableCategory.EYES]}function zF(){return[Ce.WearableCategory.HAIR,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET]}function GF(){return[Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.MOUTH,Ce.WearableCategory.EYES,Ce.WearableCategory.HAIR,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET]}function WF(n,t){switch(n){case Ce.WearableCategory.EYEBROWS:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:eyebrows_00":"urn:decentraland:off-chain:base-avatars:f_eyebrows_00";case Ce.WearableCategory.MOUTH:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:mouth_00":"urn:decentraland:off-chain:base-avatars:f_mouth_00";case Ce.WearableCategory.EYES:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:eyes_00":"urn:decentraland:off-chain:base-avatars:f_eyes_00";case Ce.WearableCategory.HAIR:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:casual_hair_01":"urn:decentraland:off-chain:base-avatars:standard_hair";case Ce.WearableCategory.UPPER_BODY:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:green_hoodie":"urn:decentraland:off-chain:base-avatars:f_sweater";case Ce.WearableCategory.LOWER_BODY:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:brown_pants":"urn:decentraland:off-chain:base-avatars:f_jeans";case Ce.WearableCategory.FEET:return t===Ce.BodyShape.MALE?"urn:decentraland:off-chain:base-avatars:sneakers":"urn:decentraland:off-chain:base-avatars:bun_shoes";default:throw new Error(`There is no default wearable for category="${n}"`)}}function as(n){return!!n&&"data"in n&&!ko(n)}function HF(n){const t=[Ce.BodyShape.MALE,Ce.BodyShape.FEMALE];return t.find(e=>n.data.representations.some(i=>i.bodyShapes.includes(e)))||t[0]}function PR(n,t,e){return t.map(i=>({...i,contents:i.contents.map(r=>({key:r,url:`${e}/content/contents/${n.content.find(o=>o.file===r).hash}`}))}))}function jF(n,t){const e=n.metadata,i=`${t}/lambdas/collections/contents/${n.metadata.id}`;return"emoteDataADR74"in e?{...e,thumbnail:`${i}/thumbnail`,image:`${i}/image`,emoteDataADR74:{...e.emoteDataADR74,representations:PR(n,e.emoteDataADR74.representations,t)}}:{...e,thumbnail:`${i}/thumbnail`,image:`${i}/image`,data:{...e.data,representations:PR(n,e.data.representations,t)}}}class XF{async fetchEntities(t,e){return t.length===0?[]:await Jl(`${e}/content/entities/active`,{method:"post",body:JSON.stringify({pointers:t}),headers:{"Content-Type":"application/json"}})}async fetchItems(t,e){if(t.length===0)return[[],[]];const i=t.map(l=>l.toLowerCase()),o=(await this.fetchEntities(i,e)).map(l=>jF(l,e)),a=o.filter(as),s=o.filter(ko);return[a,s]}async fetchProfile(t,e){try{return await Jl(`${e}/lambdas/profiles/${t}`)}catch(i){return console.error("There was an error loading the profile",i),null}}async fetchProfileEntity(t,e){try{const i=await Jl(`${e}/content/contents/${t}`);if(i.type!=="profile")throw new Error("The content is not a profile");return i.metadata}catch(i){return console.error("There was an error loading the profile",i),null}}}const Cb=new XF;function YF(){const n={};return{memo:async(t,e,...i)=>(t in n||(n[t]=e(...i)),n[t]),reset:()=>{for(const t in n)delete n[t]}}}var Ji=function(){function n(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this._environmentTexture=null,this.postProcesses=new Array}return n.AddParser=function(t,e){this._BabylonFileParsers[t]=e},n.GetParser=function(t){return this._BabylonFileParsers[t]?this._BabylonFileParsers[t]:null},n.AddIndividualParser=function(t,e){this._IndividualBabylonFileParsers[t]=e},n.GetIndividualParser=function(t){return this._IndividualBabylonFileParsers[t]?this._IndividualBabylonFileParsers[t]:null},n.Parse=function(t,e,i,r){for(var o in this._BabylonFileParsers)this._BabylonFileParsers.hasOwnProperty(o)&&this._BabylonFileParsers[o](t,e,i,r)},Object.defineProperty(n.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(t){this._environmentTexture=t},enumerable:!1,configurable:!0}),n.prototype.getNodes=function(){var t=new Array;return t=t.concat(this.meshes),t=t.concat(this.lights),t=t.concat(this.cameras),t=t.concat(this.transformNodes),this.skeletons.forEach(function(e){return t=t.concat(e.bones)}),t},n._BabylonFileParsers={},n._IndividualBabylonFileParsers={},n}(),zl=function(){function n(){this.hoverCursor="",this.actions=new Array,this.isRecursive=!1}return Object.defineProperty(n,"HasTriggers",{get:function(){for(var t in n.Triggers)if(n.Triggers.hasOwnProperty(t))return!0;return!1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HasPickTriggers",{get:function(){for(var t in n.Triggers)if(n.Triggers.hasOwnProperty(t)){var e=parseInt(t);if(e>=1&&e<=7)return!0}return!1},enumerable:!1,configurable:!0}),n.HasSpecificTrigger=function(t){for(var e in n.Triggers)if(n.Triggers.hasOwnProperty(e)){var i=parseInt(e);if(i===t)return!0}return!1},n.Triggers={},n}(),KF=function(){function n(t,e,i,r){e===void 0&&(e=!1),this.initalize(t,e,i,r)}return n.prototype.initalize=function(t,e,i,r){return e===void 0&&(e=!1),this.mask=t,this.skipNextObservers=e,this.target=i,this.currentTarget=r,this},n}(),qF=function(){function n(t,e,i){i===void 0&&(i=null),this.callback=t,this.mask=e,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1}return n}(),aq=function(){function n(){}return n.prototype.dispose=function(){if(this._observers&&this._observables)for(var t=0;t<this._observers.length;t++)this._observables[t].remove(this._observers[t]);this._observers=null,this._observables=null},n.Watch=function(t,e,i,r){i===void 0&&(i=-1),r===void 0&&(r=null);var o=new n;o._observers=new Array,o._observables=t;for(var a=0,s=t;a<s.length;a++){var l=s[a],u=l.add(e,i,!1,r);u&&o._observers.push(u)}return o},n}(),ie=function(){function n(t){this._observers=new Array,this._eventState=new KF(0),t&&(this._onObserverAdded=t)}return Object.defineProperty(n.prototype,"observers",{get:function(){return this._observers},enumerable:!1,configurable:!0}),n.prototype.add=function(t,e,i,r,o){if(e===void 0&&(e=-1),i===void 0&&(i=!1),r===void 0&&(r=null),o===void 0&&(o=!1),!t)return null;var a=new qF(t,e,r);return a.unregisterOnNextCall=o,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),a},n.prototype.addOnce=function(t){return this.add(t,void 0,void 0,void 0,!0)},n.prototype.remove=function(t){if(!t)return!1;var e=this._observers.indexOf(t);return e!==-1?(this._deferUnregister(t),!0):!1},n.prototype.removeCallback=function(t,e){for(var i=0;i<this._observers.length;i++){var r=this._observers[i];if(!r._willBeUnregistered&&r.callback===t&&(!e||e===r.scope))return this._deferUnregister(r),!0}return!1},n.prototype._deferUnregister=function(t){var e=this;t.unregisterOnNextCall=!1,t._willBeUnregistered=!0,setTimeout(function(){e._remove(t)},0)},n.prototype._remove=function(t){if(!t)return!1;var e=this._observers.indexOf(t);return e!==-1?(this._observers.splice(e,1),!0):!1},n.prototype.makeObserverTopPriority=function(t){this._remove(t),this._observers.unshift(t)},n.prototype.makeObserverBottomPriority=function(t){this._remove(t),this._observers.push(t)},n.prototype.notifyObservers=function(t,e,i,r,o){if(e===void 0&&(e=-1),!this._observers.length)return!0;var a=this._eventState;a.mask=e,a.target=i,a.currentTarget=r,a.skipNextObservers=!1,a.lastReturnValue=t,a.userInfo=o;for(var s=0,l=this._observers;s<l.length;s++){var u=l[s];if(!u._willBeUnregistered&&(u.mask&e&&(u.scope?a.lastReturnValue=u.callback.apply(u.scope,[t,a]):a.lastReturnValue=u.callback(t,a),u.unregisterOnNextCall&&this._deferUnregister(u)),a.skipNextObservers))return!1}return!0},n.prototype.notifyObserversWithPromise=function(t,e,i,r,o){var a=this;e===void 0&&(e=-1);var s=Promise.resolve(t);if(!this._observers.length)return s;var l=this._eventState;return l.mask=e,l.target=i,l.currentTarget=r,l.skipNextObservers=!1,l.userInfo=o,this._observers.forEach(function(u){l.skipNextObservers||u._willBeUnregistered||u.mask&e&&(u.scope?s=s.then(function(f){return l.lastReturnValue=f,u.callback.apply(u.scope,[t,l])}):s=s.then(function(f){return l.lastReturnValue=f,u.callback(t,l)}),u.unregisterOnNextCall&&a._deferUnregister(u))}),s.then(function(){return t})},n.prototype.notifyObserver=function(t,e,i){i===void 0&&(i=-1);var r=this._eventState;r.mask=i,r.skipNextObservers=!1,t.callback(e,r)},n.prototype.hasObservers=function(){return this._observers.length>0},n.prototype.clear=function(){this._observers=new Array,this._onObserverAdded=null},n.prototype.clone=function(){var t=new n;return t._observers=this._observers.slice(0),t},n.prototype.hasSpecificMask=function(t){t===void 0&&(t=-1);for(var e=0,i=this._observers;e<i.length;e++){var r=i[e];if(r.mask&t||r.mask===t)return!0}return!1},n}(),Ue=function(){function n(){}return n.WithinEpsilon=function(t,e,i){i===void 0&&(i=1401298e-51);var r=t-e;return-i<=r&&r<=i},n.ToHex=function(t){var e=t.toString(16);return t<=15?("0"+e).toUpperCase():e.toUpperCase()},n.Sign=function(t){return t=+t,t===0||isNaN(t)?t:t>0?1:-1},n.Clamp=function(t,e,i){return e===void 0&&(e=0),i===void 0&&(i=1),Math.min(i,Math.max(e,t))},n.Log2=function(t){return Math.log(t)*Math.LOG2E},n.Repeat=function(t,e){return t-Math.floor(t/e)*e},n.Normalize=function(t,e,i){return(t-e)/(i-e)},n.Denormalize=function(t,e,i){return t*(i-e)+e},n.DeltaAngle=function(t,e){var i=n.Repeat(e-t,360);return i>180&&(i-=360),i},n.PingPong=function(t,e){var i=n.Repeat(t,e*2);return e-Math.abs(i-e)},n.SmoothStep=function(t,e,i){var r=n.Clamp(i);return r=-2*r*r*r+3*r*r,e*r+t*(1-r)},n.MoveTowards=function(t,e,i){var r=0;return Math.abs(e-t)<=i?r=e:r=t+n.Sign(e-t)*i,r},n.MoveTowardsAngle=function(t,e,i){var r=n.DeltaAngle(t,e),o=0;return-i<r&&r<i?o=e:(e=t+r,o=n.MoveTowards(t,e,i)),o},n.Lerp=function(t,e,i){return t+(e-t)*i},n.LerpAngle=function(t,e,i){var r=n.Repeat(e-t,360);return r>180&&(r-=360),t+r*n.Clamp(i)},n.InverseLerp=function(t,e,i){var r=0;return t!=e?r=n.Clamp((i-t)/(e-t)):r=0,r},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a;return t*l+i*u+e*f+r*c},n.RandomRange=function(t,e){return t===e?t:Math.random()*(e-t)+t},n.RangeToPercent=function(t,e,i){return(t-e)/(i-e)},n.PercentToRange=function(t,e,i){return(i-e)*t+e},n.NormalizeRadians=function(t){return t-=n.TwoPi*Math.floor((t+Math.PI)/n.TwoPi),t},n.TwoPi=Math.PI*2,n}(),Uo=1/2.2,Ea=2.2,Zt=.001,or=function(){function n(){}return n.BuildArray=function(t,e){for(var i=[],r=0;r<t;++r)i.push(e());return i},n}(),Ae=function(){function n(){}return n.GetClass=function(t){return this.RegisteredTypes&&this.RegisteredTypes[t]?this.RegisteredTypes[t]:null},n.RegisteredTypes={},n}(),Qa=function(){function n(){}return n.SetMatrixPrecision=function(t){if(n.MatrixTrackPrecisionChange=!1,t&&!n.MatrixUse64Bits&&n.MatrixTrackedMatrices)for(var e=0;e<n.MatrixTrackedMatrices.length;++e){var i=n.MatrixTrackedMatrices[e],r=i._m;i._m=new Array(16);for(var o=0;o<16;++o)i._m[o]=r[o]}n.MatrixUse64Bits=t,n.MatrixCurrentType=n.MatrixUse64Bits?Array:Float32Array,n.MatrixTrackedMatrices=null},n.MatrixUse64Bits=!1,n.MatrixTrackPrecisionChange=!0,n.MatrixCurrentType=Float32Array,n.MatrixTrackedMatrices=[],n}(),Ie=function(){function n(t,e){t===void 0&&(t=0),e===void 0&&(e=0),this.x=t,this.y=e}return n.prototype.toString=function(){return"{X: "+this.x+" Y: "+this.y+"}"},n.prototype.getClassName=function(){return"Vector2"},n.prototype.getHashCode=function(){var t=this.x|0;return t=t*397^(this.y|0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this},n.prototype.copyFromFloats=function(t,e){return this.x=t,this.y=e,this},n.prototype.set=function(t,e){return this.copyFromFloats(t,e)},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y)},n.prototype.addToRef=function(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,this},n.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this},n.prototype.addVector3=function(t){return new n(this.x+t.x,this.y+t.y)},n.prototype.subtract=function(t){return new n(this.x-t.x,this.y-t.y)},n.prototype.subtractToRef=function(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,this},n.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this},n.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this},n.prototype.multiply=function(t){return new n(this.x*t.x,this.y*t.y)},n.prototype.multiplyToRef=function(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,this},n.prototype.multiplyByFloats=function(t,e){return new n(this.x*t,this.y*e)},n.prototype.divide=function(t){return new n(this.x/t.x,this.y/t.y)},n.prototype.divideToRef=function(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,this},n.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},n.prototype.negate=function(){return new n(-this.x,-this.y)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this},n.prototype.negateToRef=function(t){return t.copyFromFloats(this.x*-1,this.y*-1)},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this},n.prototype.scale=function(t){var e=new n(0,0);return this.scaleToRef(t,e),e},n.prototype.scaleToRef=function(t,e){return e.x=this.x*t,e.y=this.y*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.x+=this.x*t,e.y+=this.y*t,this},n.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this.x,t.x,e)&&Ue.WithinEpsilon(this.y,t.y,e)},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y))},n.prototype.fract=function(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var t=this.length();return t===0?this:(this.x/=t,this.y/=t,this)},n.prototype.clone=function(){return new n(this.x,this.y)},n.Zero=function(){return new n(0,0)},n.One=function(){return new n(1,1)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1])},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1]},n.CatmullRom=function(t,e,i,r,o){var a=o*o,s=o*a,l=.5*(2*e.x+(-t.x+i.x)*o+(2*t.x-5*e.x+4*i.x-r.x)*a+(-t.x+3*e.x-3*i.x+r.x)*s),u=.5*(2*e.y+(-t.y+i.y)*o+(2*t.y-5*e.y+4*i.y-r.y)*a+(-t.y+3*e.y-3*i.y+r.y)*s);return new n(l,u)},n.Clamp=function(t,e,i){var r=t.x;r=r>i.x?i.x:r,r=r<e.x?e.x:r;var o=t.y;return o=o>i.y?i.y:o,o=o<e.y?e.y:o,new n(r,o)},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a,h=t.x*l+i.x*u+e.x*f+r.x*c,p=t.y*l+i.y*u+e.y*f+r.y*c;return new n(h,p)},n.Lerp=function(t,e,i){var r=t.x+(e.x-t.x)*i,o=t.y+(e.y-t.y)*i;return new n(r,o)},n.Dot=function(t,e){return t.x*e.x+t.y*e.y},n.Normalize=function(t){var e=t.clone();return e.normalize(),e},n.Minimize=function(t,e){var i=t.x<e.x?t.x:e.x,r=t.y<e.y?t.y:e.y;return new n(i,r)},n.Maximize=function(t,e){var i=t.x>e.x?t.x:e.x,r=t.y>e.y?t.y:e.y;return new n(i,r)},n.Transform=function(t,e){var i=n.Zero();return n.TransformToRef(t,e,i),i},n.TransformToRef=function(t,e,i){var r=e.m,o=t.x*r[0]+t.y*r[4]+r[12],a=t.x*r[1]+t.y*r[5]+r[13];i.x=o,i.y=a},n.PointInTriangle=function(t,e,i,r){var o=.5*(-i.y*r.x+e.y*(-i.x+r.x)+e.x*(i.y-r.y)+i.x*r.y),a=o<0?-1:1,s=(e.y*r.x-e.x*r.y+(r.y-e.y)*t.x+(e.x-r.x)*t.y)*a,l=(e.x*i.y-e.y*i.x+(e.y-i.y)*t.x+(i.x-e.x)*t.y)*a;return s>0&&l>0&&s+l<2*o*a},n.Distance=function(t,e){return Math.sqrt(n.DistanceSquared(t,e))},n.DistanceSquared=function(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r},n.Center=function(t,e){var i=t.add(e);return i.scaleInPlace(.5),i},n.DistanceOfPointFromSegment=function(t,e,i){var r=n.DistanceSquared(e,i);if(r===0)return n.Distance(t,e);var o=i.subtract(e),a=Math.max(0,Math.min(1,n.Dot(t.subtract(e),o)/r)),s=e.add(o.multiplyByFloats(a,a));return n.Distance(t,s)},n}(),y=function(){function n(t,e,i){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),this._isDirty=!0,this._x=t,this._y=e,this._z=i}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+"}"},n.prototype.getClassName=function(){return"Vector3"},n.prototype.getHashCode=function(){var t=this._x|0;return t=t*397^(this._y|0),t=t*397^(this._z|0),t},n.prototype.asArray=function(){var t=[];return this.toArray(t,0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.toQuaternion=function(){return Re.RotationYawPitchRoll(this._y,this._x,this._z)},n.prototype.addInPlace=function(t){return this.addInPlaceFromFloats(t._x,t._y,t._z)},n.prototype.addInPlaceFromFloats=function(t,e,i){return this.x+=t,this.y+=e,this.z+=i,this},n.prototype.add=function(t){return new n(this._x+t._x,this._y+t._y,this._z+t._z)},n.prototype.addToRef=function(t,e){return e.copyFromFloats(this._x+t._x,this._y+t._y,this._z+t._z)},n.prototype.subtractInPlace=function(t){return this.x-=t._x,this.y-=t._y,this.z-=t._z,this},n.prototype.subtract=function(t){return new n(this._x-t._x,this._y-t._y,this._z-t._z)},n.prototype.subtractToRef=function(t,e){return this.subtractFromFloatsToRef(t._x,t._y,t._z,e)},n.prototype.subtractFromFloats=function(t,e,i){return new n(this._x-t,this._y-e,this._z-i)},n.prototype.subtractFromFloatsToRef=function(t,e,i,r){return r.copyFromFloats(this._x-t,this._y-e,this._z-i)},n.prototype.negate=function(){return new n(-this._x,-this._y,-this._z)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.negateToRef=function(t){return t.copyFromFloats(this._x*-1,this._y*-1,this._z*-1)},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.prototype.scale=function(t){return new n(this._x*t,this._y*t,this._z*t)},n.prototype.scaleToRef=function(t,e){return e.copyFromFloats(this._x*t,this._y*t,this._z*t)},n.prototype.scaleAndAddToRef=function(t,e){return e.addInPlaceFromFloats(this._x*t,this._y*t,this._z*t)},n.prototype.projectOnPlane=function(t,e){var i=n.Zero();return this.projectOnPlaneToRef(t,e,i),i},n.prototype.projectOnPlaneToRef=function(t,e,i){var r=t.normal,o=t.d,a=Qt.Vector3[0];this.subtractToRef(e,a),a.normalize();var s=n.Dot(a,r),l=-(n.Dot(e,r)+o)/s,u=a.scaleInPlace(l);e.addToRef(u,i)},n.prototype.equals=function(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this._x,t._x,e)&&Ue.WithinEpsilon(this._y,t._y,e)&&Ue.WithinEpsilon(this._z,t._z,e)},n.prototype.equalsToFloats=function(t,e,i){return this._x===t&&this._y===e&&this._z===i},n.prototype.multiplyInPlace=function(t){return this.x*=t._x,this.y*=t._y,this.z*=t._z,this},n.prototype.multiply=function(t){return this.multiplyByFloats(t._x,t._y,t._z)},n.prototype.multiplyToRef=function(t,e){return e.copyFromFloats(this._x*t._x,this._y*t._y,this._z*t._z)},n.prototype.multiplyByFloats=function(t,e,i){return new n(this._x*t,this._y*e,this._z*i)},n.prototype.divide=function(t){return new n(this._x/t._x,this._y/t._y,this._z/t._z)},n.prototype.divideToRef=function(t,e){return e.copyFromFloats(this._x/t._x,this._y/t._y,this._z/t._z)},n.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},n.prototype.minimizeInPlace=function(t){return this.minimizeInPlaceFromFloats(t._x,t._y,t._z)},n.prototype.maximizeInPlace=function(t){return this.maximizeInPlaceFromFloats(t._x,t._y,t._z)},n.prototype.minimizeInPlaceFromFloats=function(t,e,i){return t<this._x&&(this.x=t),e<this._y&&(this.y=e),i<this._z&&(this.z=i),this},n.prototype.maximizeInPlaceFromFloats=function(t,e,i){return t>this._x&&(this.x=t),e>this._y&&(this.y=e),i>this._z&&(this.z=i),this},n.prototype.isNonUniformWithinEpsilon=function(t){var e=Math.abs(this._x),i=Math.abs(this._y);if(!Ue.WithinEpsilon(e,i,t))return!0;var r=Math.abs(this._z);return!Ue.WithinEpsilon(e,r,t)||!Ue.WithinEpsilon(i,r,t)},Object.defineProperty(n.prototype,"isNonUniform",{get:function(){var t=Math.abs(this._x),e=Math.abs(this._y);if(t!==e)return!0;var i=Math.abs(this._z);return t!==i},enumerable:!1,configurable:!0}),n.prototype.floor=function(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))},n.prototype.fract=function(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)},n.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z},n.prototype.normalize=function(){return this.normalizeFromLength(this.length())},n.prototype.reorderInPlace=function(t){var e=this;return t=t.toLowerCase(),t==="xyz"?this:(Qt.Vector3[0].copyFrom(this),["x","y","z"].forEach(function(i,r){e[i]=Qt.Vector3[0][t[r]]}),this)},n.prototype.rotateByQuaternionToRef=function(t,e){return t.toRotationMatrix(Qt.Matrix[0]),n.TransformCoordinatesToRef(this,Qt.Matrix[0],e),e},n.prototype.rotateByQuaternionAroundPointToRef=function(t,e,i){return this.subtractToRef(e,Qt.Vector3[0]),Qt.Vector3[0].rotateByQuaternionToRef(t,Qt.Vector3[0]),e.addToRef(Qt.Vector3[0],i),i},n.prototype.cross=function(t){return n.Cross(this,t)},n.prototype.normalizeFromLength=function(t){return t===0||t===1?this:this.scaleInPlace(1/t)},n.prototype.normalizeToNew=function(){var t=new n(0,0,0);return this.normalizeToRef(t),t},n.prototype.normalizeToRef=function(t){var e=this.length();return e===0||e===1?t.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/e,t)},n.prototype.clone=function(){return new n(this._x,this._y,this._z)},n.prototype.copyFrom=function(t){return this.copyFromFloats(t._x,t._y,t._z)},n.prototype.copyFromFloats=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},n.prototype.set=function(t,e,i){return this.copyFromFloats(t,e,i)},n.prototype.setAll=function(t){return this.x=this.y=this.z=t,this},n.GetClipFactor=function(t,e,i,r){var o=n.Dot(t,i)-r,a=n.Dot(e,i)-r,s=o/(o-a);return s},n.GetAngleBetweenVectors=function(t,e,i){var r=t.normalizeToRef(Qt.Vector3[1]),o=e.normalizeToRef(Qt.Vector3[2]),a=n.Dot(r,o),s=Qt.Vector3[3];return n.CrossToRef(r,o,s),n.Dot(s,i)>0?Math.acos(a):-Math.acos(a)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1],t[e+2])},n.FromFloatArray=function(t,e){return n.FromArray(t,e)},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1],i.z=t[e+2]},n.FromFloatArrayToRef=function(t,e,i){return n.FromArrayToRef(t,e,i)},n.FromFloatsToRef=function(t,e,i,r){r.copyFromFloats(t,e,i)},n.Zero=function(){return new n(0,0,0)},n.One=function(){return new n(1,1,1)},n.Up=function(){return new n(0,1,0)},Object.defineProperty(n,"UpReadOnly",{get:function(){return n._UpReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(n,"ZeroReadOnly",{get:function(){return n._ZeroReadOnly},enumerable:!1,configurable:!0}),n.Down=function(){return new n(0,-1,0)},n.Forward=function(t){return t===void 0&&(t=!1),new n(0,0,t?-1:1)},n.Backward=function(t){return t===void 0&&(t=!1),new n(0,0,t?1:-1)},n.Right=function(){return new n(1,0,0)},n.Left=function(){return new n(-1,0,0)},n.TransformCoordinates=function(t,e){var i=n.Zero();return n.TransformCoordinatesToRef(t,e,i),i},n.TransformCoordinatesToRef=function(t,e,i){n.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,i)},n.TransformCoordinatesFromFloatsToRef=function(t,e,i,r,o){var a=r.m,s=t*a[0]+e*a[4]+i*a[8]+a[12],l=t*a[1]+e*a[5]+i*a[9]+a[13],u=t*a[2]+e*a[6]+i*a[10]+a[14],f=1/(t*a[3]+e*a[7]+i*a[11]+a[15]);o.x=s*f,o.y=l*f,o.z=u*f},n.TransformNormal=function(t,e){var i=n.Zero();return n.TransformNormalToRef(t,e,i),i},n.TransformNormalToRef=function(t,e,i){this.TransformNormalFromFloatsToRef(t._x,t._y,t._z,e,i)},n.TransformNormalFromFloatsToRef=function(t,e,i,r,o){var a=r.m;o.x=t*a[0]+e*a[4]+i*a[8],o.y=t*a[1]+e*a[5]+i*a[9],o.z=t*a[2]+e*a[6]+i*a[10]},n.CatmullRom=function(t,e,i,r,o){var a=o*o,s=o*a,l=.5*(2*e._x+(-t._x+i._x)*o+(2*t._x-5*e._x+4*i._x-r._x)*a+(-t._x+3*e._x-3*i._x+r._x)*s),u=.5*(2*e._y+(-t._y+i._y)*o+(2*t._y-5*e._y+4*i._y-r._y)*a+(-t._y+3*e._y-3*i._y+r._y)*s),f=.5*(2*e._z+(-t._z+i._z)*o+(2*t._z-5*e._z+4*i._z-r._z)*a+(-t._z+3*e._z-3*i._z+r._z)*s);return new n(l,u,f)},n.Clamp=function(t,e,i){var r=new n;return n.ClampToRef(t,e,i,r),r},n.ClampToRef=function(t,e,i,r){var o=t._x;o=o>i._x?i._x:o,o=o<e._x?e._x:o;var a=t._y;a=a>i._y?i._y:a,a=a<e._y?e._y:a;var s=t._z;s=s>i._z?i._z:s,s=s<e._z?e._z:s,r.copyFromFloats(o,a,s)},n.CheckExtends=function(t,e,i){e.minimizeInPlace(t),i.maximizeInPlace(t)},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a,h=t._x*l+i._x*u+e._x*f+r._x*c,p=t._y*l+i._y*u+e._y*f+r._y*c,_=t._z*l+i._z*u+e._z*f+r._z*c;return new n(h,p,_)},n.Lerp=function(t,e,i){var r=new n(0,0,0);return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){r.x=t._x+(e._x-t._x)*i,r.y=t._y+(e._y-t._y)*i,r.z=t._z+(e._z-t._z)*i},n.Dot=function(t,e){return t._x*e._x+t._y*e._y+t._z*e._z},n.Cross=function(t,e){var i=n.Zero();return n.CrossToRef(t,e,i),i},n.CrossToRef=function(t,e,i){var r=t._y*e._z-t._z*e._y,o=t._z*e._x-t._x*e._z,a=t._x*e._y-t._y*e._x;i.copyFromFloats(r,o,a)},n.Normalize=function(t){var e=n.Zero();return n.NormalizeToRef(t,e),e},n.NormalizeToRef=function(t,e){t.normalizeToRef(e)},n.Project=function(t,e,i,r){var o=new n;return n.ProjectToRef(t,e,i,r,o),o},n.ProjectToRef=function(t,e,i,r,o){var a=r.width,s=r.height,l=r.x,u=r.y,f=Qt.Matrix[1];te.FromValuesToRef(a/2,0,0,0,0,-s/2,0,0,0,0,.5,0,l+a/2,s/2+u,.5,1,f);var c=Qt.Matrix[0];return e.multiplyToRef(i,c),c.multiplyToRef(f,c),n.TransformCoordinatesToRef(t,c,o),o},n._UnprojectFromInvertedMatrixToRef=function(t,e,i){n.TransformCoordinatesToRef(t,e,i);var r=e.m,o=t._x*r[3]+t._y*r[7]+t._z*r[11]+r[15];Ue.WithinEpsilon(o,1)&&i.scaleInPlace(1/o)},n.UnprojectFromTransform=function(t,e,i,r,o){var a=Qt.Matrix[0];r.multiplyToRef(o,a),a.invert(),t.x=t._x/e*2-1,t.y=-(t._y/i*2-1);var s=new n;return n._UnprojectFromInvertedMatrixToRef(t,a,s),s},n.Unproject=function(t,e,i,r,o,a){var s=n.Zero();return n.UnprojectToRef(t,e,i,r,o,a,s),s},n.UnprojectToRef=function(t,e,i,r,o,a,s){n.UnprojectFloatsToRef(t._x,t._y,t._z,e,i,r,o,a,s)},n.UnprojectFloatsToRef=function(t,e,i,r,o,a,s,l,u){var f=Qt.Matrix[0];a.multiplyToRef(s,f),f.multiplyToRef(l,f),f.invert();var c=Qt.Vector3[0];c.x=t/r*2-1,c.y=-(e/o*2-1),c.z=2*i-1,n._UnprojectFromInvertedMatrixToRef(c,f,u)},n.Minimize=function(t,e){var i=t.clone();return i.minimizeInPlace(e),i},n.Maximize=function(t,e){var i=t.clone();return i.maximizeInPlace(e),i},n.Distance=function(t,e){return Math.sqrt(n.DistanceSquared(t,e))},n.DistanceSquared=function(t,e){var i=t._x-e._x,r=t._y-e._y,o=t._z-e._z;return i*i+r*r+o*o},n.Center=function(t,e){var i=t.add(e);return i.scaleInPlace(.5),i},n.RotationFromAxis=function(t,e,i){var r=n.Zero();return n.RotationFromAxisToRef(t,e,i,r),r},n.RotationFromAxisToRef=function(t,e,i,r){var o=Qt.Quaternion[0];Re.RotationQuaternionFromAxisToRef(t,e,i,o),o.toEulerAnglesToRef(r)},n._UpReadOnly=n.Up(),n._ZeroReadOnly=n.Zero(),n}(),ni=function(){function n(t,e,i,r){this.x=t,this.y=e,this.z=i,this.w=r}return n.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+" Z:"+this.z+" W:"+this.w+"}"},n.prototype.getClassName=function(){return"Vector4"},n.prototype.getHashCode=function(){var t=this.x|0;return t=t*397^(this.y|0),t=t*397^(this.z|0),t=t*397^(this.w|0),t},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)},n.prototype.addToRef=function(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e.w=this.w+t.w,this},n.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},n.prototype.subtract=function(t){return new n(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)},n.prototype.subtractToRef=function(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z,e.w=this.w-t.w,this},n.prototype.subtractFromFloats=function(t,e,i,r){return new n(this.x-t,this.y-e,this.z-i,this.w-r)},n.prototype.subtractFromFloatsToRef=function(t,e,i,r,o){return o.x=this.x-t,o.y=this.y-e,o.z=this.z-i,o.w=this.w-r,this},n.prototype.negate=function(){return new n(-this.x,-this.y,-this.z,-this.w)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this},n.prototype.negateToRef=function(t){return t.copyFromFloats(this.x*-1,this.y*-1,this.z*-1,this.w*-1)},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.prototype.scale=function(t){return new n(this.x*t,this.y*t,this.z*t,this.w*t)},n.prototype.scaleToRef=function(t,e){return e.x=this.x*t,e.y=this.y*t,e.z=this.z*t,e.w=this.w*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.x+=this.x*t,e.y+=this.y*t,e.z+=this.z*t,e.w+=this.w*t,this},n.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this.x,t.x,e)&&Ue.WithinEpsilon(this.y,t.y,e)&&Ue.WithinEpsilon(this.z,t.z,e)&&Ue.WithinEpsilon(this.w,t.w,e)},n.prototype.equalsToFloats=function(t,e,i,r){return this.x===t&&this.y===e&&this.z===i&&this.w===r},n.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},n.prototype.multiply=function(t){return new n(this.x*t.x,this.y*t.y,this.z*t.z,this.w*t.w)},n.prototype.multiplyToRef=function(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,e.z=this.z*t.z,e.w=this.w*t.w,this},n.prototype.multiplyByFloats=function(t,e,i,r){return new n(this.x*t,this.y*e,this.z*i,this.w*r)},n.prototype.divide=function(t){return new n(this.x/t.x,this.y/t.y,this.z/t.z,this.w/t.w)},n.prototype.divideToRef=function(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,e.z=this.z/t.z,e.w=this.w/t.w,this},n.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},n.prototype.minimizeInPlace=function(t){return t.x<this.x&&(this.x=t.x),t.y<this.y&&(this.y=t.y),t.z<this.z&&(this.z=t.z),t.w<this.w&&(this.w=t.w),this},n.prototype.maximizeInPlace=function(t){return t.x>this.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},n.prototype.fract=function(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},n.prototype.normalize=function(){var t=this.length();return t===0?this:this.scaleInPlace(1/t)},n.prototype.toVector3=function(){return new y(this.x,this.y,this.z)},n.prototype.clone=function(){return new n(this.x,this.y,this.z,this.w)},n.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},n.prototype.copyFromFloats=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},n.prototype.set=function(t,e,i,r){return this.copyFromFloats(t,e,i,r)},n.prototype.setAll=function(t){return this.x=this.y=this.z=this.w=t,this},n.FromArray=function(t,e){return e||(e=0),new n(t[e],t[e+1],t[e+2],t[e+3])},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1],i.z=t[e+2],i.w=t[e+3]},n.FromFloatArrayToRef=function(t,e,i){n.FromArrayToRef(t,e,i)},n.FromFloatsToRef=function(t,e,i,r,o){o.x=t,o.y=e,o.z=i,o.w=r},n.Zero=function(){return new n(0,0,0,0)},n.One=function(){return new n(1,1,1,1)},n.Normalize=function(t){var e=n.Zero();return n.NormalizeToRef(t,e),e},n.NormalizeToRef=function(t,e){e.copyFrom(t),e.normalize()},n.Minimize=function(t,e){var i=t.clone();return i.minimizeInPlace(e),i},n.Maximize=function(t,e){var i=t.clone();return i.maximizeInPlace(e),i},n.Distance=function(t,e){return Math.sqrt(n.DistanceSquared(t,e))},n.DistanceSquared=function(t,e){var i=t.x-e.x,r=t.y-e.y,o=t.z-e.z,a=t.w-e.w;return i*i+r*r+o*o+a*a},n.Center=function(t,e){var i=t.add(e);return i.scaleInPlace(.5),i},n.TransformNormal=function(t,e){var i=n.Zero();return n.TransformNormalToRef(t,e,i),i},n.TransformNormalToRef=function(t,e,i){var r=e.m,o=t.x*r[0]+t.y*r[4]+t.z*r[8],a=t.x*r[1]+t.y*r[5]+t.z*r[9],s=t.x*r[2]+t.y*r[6]+t.z*r[10];i.x=o,i.y=a,i.z=s,i.w=t.w},n.TransformNormalFromFloatsToRef=function(t,e,i,r,o,a){var s=o.m;a.x=t*s[0]+e*s[4]+i*s[8],a.y=t*s[1]+e*s[5]+i*s[9],a.z=t*s[2]+e*s[6]+i*s[10],a.w=r},n.FromVector3=function(t,e){return e===void 0&&(e=0),new n(t._x,t._y,t._z,e)},n}(),Re=function(){function n(t,e,i,r){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),r===void 0&&(r=1),this._isDirty=!0,this._x=t,this._y=e,this._z=i,this._w=r}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"w",{get:function(){return this._w},set:function(t){this._w=t,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+" W:"+this._w+"}"},n.prototype.getClassName=function(){return"Quaternion"},n.prototype.getHashCode=function(){var t=this._x|0;return t=t*397^(this._y|0),t=t*397^(this._z|0),t=t*397^(this._w|0),t},n.prototype.asArray=function(){return[this._x,this._y,this._z,this._w]},n.prototype.equals=function(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z&&this._w===t._w},n.prototype.equalsWithEpsilon=function(t,e){return e===void 0&&(e=Zt),t&&Ue.WithinEpsilon(this._x,t._x,e)&&Ue.WithinEpsilon(this._y,t._y,e)&&Ue.WithinEpsilon(this._z,t._z,e)&&Ue.WithinEpsilon(this._w,t._w,e)},n.prototype.clone=function(){return new n(this._x,this._y,this._z,this._w)},n.prototype.copyFrom=function(t){return this.x=t._x,this.y=t._y,this.z=t._z,this.w=t._w,this},n.prototype.copyFromFloats=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},n.prototype.set=function(t,e,i,r){return this.copyFromFloats(t,e,i,r)},n.prototype.add=function(t){return new n(this._x+t._x,this._y+t._y,this._z+t._z,this._w+t._w)},n.prototype.addInPlace=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this._w+=t._w,this},n.prototype.subtract=function(t){return new n(this._x-t._x,this._y-t._y,this._z-t._z,this._w-t._w)},n.prototype.scale=function(t){return new n(this._x*t,this._y*t,this._z*t,this._w*t)},n.prototype.scaleToRef=function(t,e){return e.x=this._x*t,e.y=this._y*t,e.z=this._z*t,e.w=this._w*t,this},n.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.x+=this._x*t,e.y+=this._y*t,e.z+=this._z*t,e.w+=this._w*t,this},n.prototype.multiply=function(t){var e=new n(0,0,0,1);return this.multiplyToRef(t,e),e},n.prototype.multiplyToRef=function(t,e){var i=this._x*t._w+this._y*t._z-this._z*t._y+this._w*t._x,r=-this._x*t._z+this._y*t._w+this._z*t._x+this._w*t._y,o=this._x*t._y-this._y*t._x+this._z*t._w+this._w*t._z,a=-this._x*t._x-this._y*t._y-this._z*t._z+this._w*t._w;return e.copyFromFloats(i,r,o,a),this},n.prototype.multiplyInPlace=function(t){return this.multiplyToRef(t,this),this},n.prototype.conjugateToRef=function(t){return t.copyFromFloats(-this._x,-this._y,-this._z,this._w),this},n.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.conjugate=function(){var t=new n(-this._x,-this._y,-this._z,this._w);return t},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},n.prototype.normalize=function(){var t=this.length();if(t===0)return this;var e=1/t;return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},n.prototype.toEulerAngles=function(t){var e=y.Zero();return this.toEulerAnglesToRef(e),e},n.prototype.toEulerAnglesToRef=function(t){var e=this._z,i=this._x,r=this._y,o=this._w,a=o*o,s=e*e,l=i*i,u=r*r,f=r*e-i*o,c=.4999999;return f<-c?(t.y=2*Math.atan2(r,o),t.x=Math.PI/2,t.z=0):f>c?(t.y=2*Math.atan2(r,o),t.x=-Math.PI/2,t.z=0):(t.z=Math.atan2(2*(i*r+e*o),-s-l+u+a),t.x=Math.asin(-2*(e*r-i*o)),t.y=Math.atan2(2*(e*i+r*o),s-l-u+a)),this},n.prototype.toRotationMatrix=function(t){return te.FromQuaternionToRef(this,t),this},n.prototype.fromRotationMatrix=function(t){return n.FromRotationMatrixToRef(t,this),this},n.FromRotationMatrix=function(t){var e=new n;return n.FromRotationMatrixToRef(t,e),e},n.FromRotationMatrixToRef=function(t,e){var i=t.m,r=i[0],o=i[4],a=i[8],s=i[1],l=i[5],u=i[9],f=i[2],c=i[6],h=i[10],p=r+l+h,_;p>0?(_=.5/Math.sqrt(p+1),e.w=.25/_,e.x=(c-u)*_,e.y=(a-f)*_,e.z=(s-o)*_):r>l&&r>h?(_=2*Math.sqrt(1+r-l-h),e.w=(c-u)/_,e.x=.25*_,e.y=(o+s)/_,e.z=(a+f)/_):l>h?(_=2*Math.sqrt(1+l-r-h),e.w=(a-f)/_,e.x=(o+s)/_,e.y=.25*_,e.z=(u+c)/_):(_=2*Math.sqrt(1+h-r-l),e.w=(s-o)/_,e.x=(a+f)/_,e.y=(u+c)/_,e.z=.25*_)},n.Dot=function(t,e){return t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w},n.AreClose=function(t,e){var i=n.Dot(t,e);return i>=0},n.Zero=function(){return new n(0,0,0,0)},n.Inverse=function(t){return new n(-t._x,-t._y,-t._z,t._w)},n.InverseToRef=function(t,e){return e.set(-t._x,-t._y,-t._z,t._w),e},n.Identity=function(){return new n(0,0,0,1)},n.IsIdentity=function(t){return t&&t._x===0&&t._y===0&&t._z===0&&t._w===1},n.RotationAxis=function(t,e){return n.RotationAxisToRef(t,e,new n)},n.RotationAxisToRef=function(t,e,i){var r=Math.sin(e/2);return t.normalize(),i.w=Math.cos(e/2),i.x=t._x*r,i.y=t._y*r,i.z=t._z*r,i},n.FromArray=function(t,e){return e||(e=0),new n(t[e],t[e+1],t[e+2],t[e+3])},n.FromArrayToRef=function(t,e,i){i.x=t[e],i.y=t[e+1],i.z=t[e+2],i.w=t[e+3]},n.FromEulerAngles=function(t,e,i){var r=new n;return n.RotationYawPitchRollToRef(e,t,i,r),r},n.FromEulerAnglesToRef=function(t,e,i,r){return n.RotationYawPitchRollToRef(e,t,i,r),r},n.FromEulerVector=function(t){var e=new n;return n.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e},n.FromEulerVectorToRef=function(t,e){return n.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e},n.RotationYawPitchRoll=function(t,e,i){var r=new n;return n.RotationYawPitchRollToRef(t,e,i,r),r},n.RotationYawPitchRollToRef=function(t,e,i,r){var o=i*.5,a=e*.5,s=t*.5,l=Math.sin(o),u=Math.cos(o),f=Math.sin(a),c=Math.cos(a),h=Math.sin(s),p=Math.cos(s);r.x=p*f*u+h*c*l,r.y=h*c*u-p*f*l,r.z=p*c*l-h*f*u,r.w=p*c*u+h*f*l},n.RotationAlphaBetaGamma=function(t,e,i){var r=new n;return n.RotationAlphaBetaGammaToRef(t,e,i,r),r},n.RotationAlphaBetaGammaToRef=function(t,e,i,r){var o=(i+t)*.5,a=(i-t)*.5,s=e*.5;r.x=Math.cos(a)*Math.sin(s),r.y=Math.sin(a)*Math.sin(s),r.z=Math.sin(o)*Math.cos(s),r.w=Math.cos(o)*Math.cos(s)},n.RotationQuaternionFromAxis=function(t,e,i){var r=new n(0,0,0,0);return n.RotationQuaternionFromAxisToRef(t,e,i,r),r},n.RotationQuaternionFromAxisToRef=function(t,e,i,r){var o=Qt.Matrix[0];te.FromXYZAxesToRef(t.normalize(),e.normalize(),i.normalize(),o),n.FromRotationMatrixToRef(o,r)},n.Slerp=function(t,e,i){var r=n.Identity();return n.SlerpToRef(t,e,i,r),r},n.SlerpToRef=function(t,e,i,r){var o,a,s=t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w,l=!1;if(s<0&&(l=!0,s=-s),s>.999999)a=1-i,o=l?-i:i;else{var u=Math.acos(s),f=1/Math.sin(u);a=Math.sin((1-i)*u)*f,o=l?-Math.sin(i*u)*f:Math.sin(i*u)*f}r.x=a*t._x+o*e._x,r.y=a*t._y+o*e._y,r.z=a*t._z+o*e._z,r.w=a*t._w+o*e._w},n.Hermite=function(t,e,i,r,o){var a=o*o,s=o*a,l=2*s-3*a+1,u=-2*s+3*a,f=s-2*a+o,c=s-a,h=t._x*l+i._x*u+e._x*f+r._x*c,p=t._y*l+i._y*u+e._y*f+r._y*c,_=t._z*l+i._z*u+e._z*f+r._z*c,g=t._w*l+i._w*u+e._w*f+r._w*c;return new n(h,p,_,g)},n}(),te=function(){function n(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,Qa.MatrixTrackPrecisionChange&&Qa.MatrixTrackedMatrices.push(this),this._m=new Qa.MatrixCurrentType(16),this._updateIdentityStatus(!1)}return Object.defineProperty(n,"Use64Bits",{get:function(){return Qa.MatrixUse64Bits},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"m",{get:function(){return this._m},enumerable:!1,configurable:!0}),n.prototype._markAsUpdated=function(){this.updateFlag=n._updateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},n.prototype._updateIdentityStatus=function(t,e,i,r){e===void 0&&(e=!1),i===void 0&&(i=!1),r===void 0&&(r=!0),this.updateFlag=n._updateFlagSeed++,this._isIdentity=t,this._isIdentity3x2=t||i,this._isIdentityDirty=this._isIdentity?!1:e,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:r},n.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var t=this._m;this._isIdentity=t[0]===1&&t[1]===0&&t[2]===0&&t[3]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[7]===0&&t[8]===0&&t[9]===0&&t[10]===1&&t[11]===0&&t[12]===0&&t[13]===0&&t[14]===0&&t[15]===1}return this._isIdentity},n.prototype.isIdentityAs3x2=function(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2},n.prototype.determinant=function(){if(this._isIdentity===!0)return 1;var t=this._m,e=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],f=t[8],c=t[9],h=t[10],p=t[11],_=t[12],g=t[13],v=t[14],E=t[15],T=h*E-v*p,S=c*E-g*p,C=c*v-g*h,O=f*E-_*p,A=f*v-h*_,M=f*g-_*c,D=+(s*T-l*S+u*C),U=-(a*T-l*O+u*A),V=+(a*S-s*O+u*M),B=-(a*C-s*A+l*M);return e*D+i*U+r*V+o*B},n.prototype.toArray=function(){return this._m},n.prototype.asArray=function(){return this._m},n.prototype.invert=function(){return this.invertToRef(this),this},n.prototype.reset=function(){return n.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},n.prototype.add=function(t){var e=new n;return this.addToRef(t,e),e},n.prototype.addToRef=function(t,e){for(var i=this._m,r=e._m,o=t.m,a=0;a<16;a++)r[a]=i[a]+o[a];return e._markAsUpdated(),this},n.prototype.addToSelf=function(t){for(var e=this._m,i=t.m,r=0;r<16;r++)e[r]+=i[r];return this._markAsUpdated(),this},n.prototype.invertToRef=function(t){if(this._isIdentity===!0)return n.IdentityToRef(t),this;var e=this._m,i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=e[9],p=e[10],_=e[11],g=e[12],v=e[13],E=e[14],T=e[15],S=p*T-E*_,C=h*T-v*_,O=h*E-v*p,A=c*T-g*_,M=c*E-p*g,D=c*v-g*h,U=+(l*S-u*C+f*O),V=-(s*S-u*A+f*M),B=+(s*C-l*A+f*D),z=-(s*O-l*M+u*D),J=i*U+r*V+o*B+a*z;if(J===0)return t.copyFrom(this),this;var X=1/J,re=u*T-E*f,ae=l*T-v*f,se=l*E-v*u,H=s*T-g*f,Z=s*E-g*u,q=s*v-g*l,N=u*_-p*f,W=l*_-h*f,$=l*p-h*u,L=s*_-c*f,G=s*p-c*u,Y=s*h-c*l,Q=-(r*S-o*C+a*O),fe=+(i*S-o*A+a*M),Se=-(i*C-r*A+a*D),ee=+(i*O-r*M+o*D),pe=+(r*re-o*ae+a*se),Pe=-(i*re-o*H+a*Z),xe=+(i*ae-r*H+a*q),We=-(i*se-r*Z+o*q),je=-(r*N-o*W+a*$),Xe=+(i*N-o*L+a*G),ft=-(i*W-r*L+a*Y),we=+(i*$-r*G+o*Y);return n.FromValuesToRef(U*X,Q*X,pe*X,je*X,V*X,fe*X,Pe*X,Xe*X,B*X,Se*X,xe*X,ft*X,z*X,ee*X,We*X,we*X,t),this},n.prototype.addAtIndex=function(t,e){return this._m[t]+=e,this._markAsUpdated(),this},n.prototype.multiplyAtIndex=function(t,e){return this._m[t]*=e,this._markAsUpdated(),this},n.prototype.setTranslationFromFloats=function(t,e,i){return this._m[12]=t,this._m[13]=e,this._m[14]=i,this._markAsUpdated(),this},n.prototype.addTranslationFromFloats=function(t,e,i){return this._m[12]+=t,this._m[13]+=e,this._m[14]+=i,this._markAsUpdated(),this},n.prototype.setTranslation=function(t){return this.setTranslationFromFloats(t._x,t._y,t._z)},n.prototype.getTranslation=function(){return new y(this._m[12],this._m[13],this._m[14])},n.prototype.getTranslationToRef=function(t){return t.x=this._m[12],t.y=this._m[13],t.z=this._m[14],this},n.prototype.removeRotationAndScaling=function(){var t=this.m;return n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(t[12]===0&&t[13]===0&&t[14]===0&&t[15]===1),this},n.prototype.multiply=function(t){var e=new n;return this.multiplyToRef(t,e),e},n.prototype.copyFrom=function(t){t.copyToArray(this._m);var e=t;return this._updateIdentityStatus(e._isIdentity,e._isIdentityDirty,e._isIdentity3x2,e._isIdentity3x2Dirty),this},n.prototype.copyToArray=function(t,e){e===void 0&&(e=0);var i=this._m;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],this},n.prototype.multiplyToRef=function(t,e){return this._isIdentity?(e.copyFrom(t),this):t._isIdentity?(e.copyFrom(this),this):(this.multiplyToArray(t,e._m,0),e._markAsUpdated(),this)},n.prototype.multiplyToArray=function(t,e,i){var r=this._m,o=t.m,a=r[0],s=r[1],l=r[2],u=r[3],f=r[4],c=r[5],h=r[6],p=r[7],_=r[8],g=r[9],v=r[10],E=r[11],T=r[12],S=r[13],C=r[14],O=r[15],A=o[0],M=o[1],D=o[2],U=o[3],V=o[4],B=o[5],z=o[6],J=o[7],X=o[8],re=o[9],ae=o[10],se=o[11],H=o[12],Z=o[13],q=o[14],N=o[15];return e[i]=a*A+s*V+l*X+u*H,e[i+1]=a*M+s*B+l*re+u*Z,e[i+2]=a*D+s*z+l*ae+u*q,e[i+3]=a*U+s*J+l*se+u*N,e[i+4]=f*A+c*V+h*X+p*H,e[i+5]=f*M+c*B+h*re+p*Z,e[i+6]=f*D+c*z+h*ae+p*q,e[i+7]=f*U+c*J+h*se+p*N,e[i+8]=_*A+g*V+v*X+E*H,e[i+9]=_*M+g*B+v*re+E*Z,e[i+10]=_*D+g*z+v*ae+E*q,e[i+11]=_*U+g*J+v*se+E*N,e[i+12]=T*A+S*V+C*X+O*H,e[i+13]=T*M+S*B+C*re+O*Z,e[i+14]=T*D+S*z+C*ae+O*q,e[i+15]=T*U+S*J+C*se+O*N,this},n.prototype.equals=function(t){var e=t;if(!e)return!1;if((this._isIdentity||e._isIdentity)&&!this._isIdentityDirty&&!e._isIdentityDirty)return this._isIdentity&&e._isIdentity;var i=this.m,r=e.m;return i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]&&i[4]===r[4]&&i[5]===r[5]&&i[6]===r[6]&&i[7]===r[7]&&i[8]===r[8]&&i[9]===r[9]&&i[10]===r[10]&&i[11]===r[11]&&i[12]===r[12]&&i[13]===r[13]&&i[14]===r[14]&&i[15]===r[15]},n.prototype.clone=function(){var t=new n;return t.copyFrom(this),t},n.prototype.getClassName=function(){return"Matrix"},n.prototype.getHashCode=function(){for(var t=this._m[0]|0,e=1;e<16;e++)t=t*397^(this._m[e]|0);return t},n.prototype.decompose=function(t,e,i){if(this._isIdentity)return i&&i.setAll(0),t&&t.setAll(1),e&&e.copyFromFloats(0,0,0,1),!0;var r=this._m;if(i&&i.copyFromFloats(r[12],r[13],r[14]),t=t||Qt.Vector3[0],t.x=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),t.y=Math.sqrt(r[4]*r[4]+r[5]*r[5]+r[6]*r[6]),t.z=Math.sqrt(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),this.determinant()<=0&&(t.y*=-1),t._x===0||t._y===0||t._z===0)return e&&e.copyFromFloats(0,0,0,1),!1;if(e){var o=1/t._x,a=1/t._y,s=1/t._z;n.FromValuesToRef(r[0]*o,r[1]*o,r[2]*o,0,r[4]*a,r[5]*a,r[6]*a,0,r[8]*s,r[9]*s,r[10]*s,0,0,0,0,1,Qt.Matrix[0]),Re.FromRotationMatrixToRef(Qt.Matrix[0],e)}return!0},n.prototype.getRow=function(t){if(t<0||t>3)return null;var e=t*4;return new ni(this._m[e+0],this._m[e+1],this._m[e+2],this._m[e+3])},n.prototype.setRow=function(t,e){return this.setRowFromFloats(t,e.x,e.y,e.z,e.w)},n.prototype.transpose=function(){return n.Transpose(this)},n.prototype.transposeToRef=function(t){return n.TransposeToRef(this,t),this},n.prototype.setRowFromFloats=function(t,e,i,r,o){if(t<0||t>3)return this;var a=t*4;return this._m[a+0]=e,this._m[a+1]=i,this._m[a+2]=r,this._m[a+3]=o,this._markAsUpdated(),this},n.prototype.scale=function(t){var e=new n;return this.scaleToRef(t,e),e},n.prototype.scaleToRef=function(t,e){for(var i=0;i<16;i++)e._m[i]=this._m[i]*t;return e._markAsUpdated(),this},n.prototype.scaleAndAddToRef=function(t,e){for(var i=0;i<16;i++)e._m[i]+=this._m[i]*t;return e._markAsUpdated(),this},n.prototype.toNormalMatrix=function(t){var e=Qt.Matrix[0];this.invertToRef(e),e.transposeToRef(t);var i=t._m;n.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,t)},n.prototype.getRotationMatrix=function(){var t=new n;return this.getRotationMatrixToRef(t),t},n.prototype.getRotationMatrixToRef=function(t){var e=Qt.Vector3[0];if(!this.decompose(e))return n.IdentityToRef(t),this;var i=this._m,r=1/e._x,o=1/e._y,a=1/e._z;return n.FromValuesToRef(i[0]*r,i[1]*r,i[2]*r,0,i[4]*o,i[5]*o,i[6]*o,0,i[8]*a,i[9]*a,i[10]*a,0,0,0,0,1,t),this},n.prototype.toggleModelMatrixHandInPlace=function(){var t=this._m;t[2]*=-1,t[6]*=-1,t[8]*=-1,t[9]*=-1,t[14]*=-1,this._markAsUpdated()},n.prototype.toggleProjectionMatrixHandInPlace=function(){var t=this._m;t[8]*=-1,t[9]*=-1,t[10]*=-1,t[11]*=-1,this._markAsUpdated()},n.FromArray=function(t,e){e===void 0&&(e=0);var i=new n;return n.FromArrayToRef(t,e,i),i},n.FromArrayToRef=function(t,e,i){for(var r=0;r<16;r++)i._m[r]=t[r+e];i._markAsUpdated()},n.FromFloat32ArrayToRefScaled=function(t,e,i,r){for(var o=0;o<16;o++)r._m[o]=t[o+e]*i;r._markAsUpdated()},Object.defineProperty(n,"IdentityReadOnly",{get:function(){return n._identityReadOnly},enumerable:!1,configurable:!0}),n.FromValuesToRef=function(t,e,i,r,o,a,s,l,u,f,c,h,p,_,g,v,E){var T=E._m;T[0]=t,T[1]=e,T[2]=i,T[3]=r,T[4]=o,T[5]=a,T[6]=s,T[7]=l,T[8]=u,T[9]=f,T[10]=c,T[11]=h,T[12]=p,T[13]=_,T[14]=g,T[15]=v,E._markAsUpdated()},n.FromValues=function(t,e,i,r,o,a,s,l,u,f,c,h,p,_,g,v){var E=new n,T=E._m;return T[0]=t,T[1]=e,T[2]=i,T[3]=r,T[4]=o,T[5]=a,T[6]=s,T[7]=l,T[8]=u,T[9]=f,T[10]=c,T[11]=h,T[12]=p,T[13]=_,T[14]=g,T[15]=v,E._markAsUpdated(),E},n.Compose=function(t,e,i){var r=new n;return n.ComposeToRef(t,e,i,r),r},n.ComposeToRef=function(t,e,i,r){var o=r._m,a=e._x,s=e._y,l=e._z,u=e._w,f=a+a,c=s+s,h=l+l,p=a*f,_=a*c,g=a*h,v=s*c,E=s*h,T=l*h,S=u*f,C=u*c,O=u*h,A=t._x,M=t._y,D=t._z;o[0]=(1-(v+T))*A,o[1]=(_+O)*A,o[2]=(g-C)*A,o[3]=0,o[4]=(_-O)*M,o[5]=(1-(p+T))*M,o[6]=(E+S)*M,o[7]=0,o[8]=(g+C)*D,o[9]=(E-S)*D,o[10]=(1-(p+v))*D,o[11]=0,o[12]=i._x,o[13]=i._y,o[14]=i._z,o[15]=1,r._markAsUpdated()},n.Identity=function(){var t=n.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t},n.IdentityToRef=function(t){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0)},n.Zero=function(){var t=n.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t},n.RotationX=function(t){var e=new n;return n.RotationXToRef(t,e),e},n.Invert=function(t){var e=new n;return t.invertToRef(e),e},n.RotationXToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);n.FromValuesToRef(1,0,0,0,0,r,i,0,0,-i,r,0,0,0,0,1,e),e._updateIdentityStatus(r===1&&i===0)},n.RotationY=function(t){var e=new n;return n.RotationYToRef(t,e),e},n.RotationYToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);n.FromValuesToRef(r,0,-i,0,0,1,0,0,i,0,r,0,0,0,0,1,e),e._updateIdentityStatus(r===1&&i===0)},n.RotationZ=function(t){var e=new n;return n.RotationZToRef(t,e),e},n.RotationZToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);n.FromValuesToRef(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(r===1&&i===0)},n.RotationAxis=function(t,e){var i=new n;return n.RotationAxisToRef(t,e,i),i},n.RotationAxisToRef=function(t,e,i){var r=Math.sin(-e),o=Math.cos(-e),a=1-o;t.normalize();var s=i._m;s[0]=t._x*t._x*a+o,s[1]=t._x*t._y*a-t._z*r,s[2]=t._x*t._z*a+t._y*r,s[3]=0,s[4]=t._y*t._x*a+t._z*r,s[5]=t._y*t._y*a+o,s[6]=t._y*t._z*a-t._x*r,s[7]=0,s[8]=t._z*t._x*a-t._y*r,s[9]=t._z*t._y*a+t._x*r,s[10]=t._z*t._z*a+o,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationAlignToRef=function(t,e,i){var r=y.Cross(e,t),o=y.Dot(e,t),a=1/(1+o),s=i._m;s[0]=r._x*r._x*a+o,s[1]=r._y*r._x*a-r._z,s[2]=r._z*r._x*a+r._y,s[3]=0,s[4]=r._x*r._y*a+r._z,s[5]=r._y*r._y*a+o,s[6]=r._z*r._y*a-r._x,s[7]=0,s[8]=r._x*r._z*a-r._y,s[9]=r._y*r._z*a+r._x,s[10]=r._z*r._z*a+o,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationYawPitchRoll=function(t,e,i){var r=new n;return n.RotationYawPitchRollToRef(t,e,i,r),r},n.RotationYawPitchRollToRef=function(t,e,i,r){Re.RotationYawPitchRollToRef(t,e,i,Qt.Quaternion[0]),Qt.Quaternion[0].toRotationMatrix(r)},n.Scaling=function(t,e,i){var r=new n;return n.ScalingToRef(t,e,i,r),r},n.ScalingToRef=function(t,e,i,r){n.FromValuesToRef(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1,r),r._updateIdentityStatus(t===1&&e===1&&i===1)},n.Translation=function(t,e,i){var r=new n;return n.TranslationToRef(t,e,i,r),r},n.TranslationToRef=function(t,e,i,r){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1,r),r._updateIdentityStatus(t===0&&e===0&&i===0)},n.Lerp=function(t,e,i){var r=new n;return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){for(var o=r._m,a=t.m,s=e.m,l=0;l<16;l++)o[l]=a[l]*(1-i)+s[l]*i;r._markAsUpdated()},n.DecomposeLerp=function(t,e,i){var r=new n;return n.DecomposeLerpToRef(t,e,i,r),r},n.DecomposeLerpToRef=function(t,e,i,r){var o=Qt.Vector3[0],a=Qt.Quaternion[0],s=Qt.Vector3[1];t.decompose(o,a,s);var l=Qt.Vector3[2],u=Qt.Quaternion[1],f=Qt.Vector3[3];e.decompose(l,u,f);var c=Qt.Vector3[4];y.LerpToRef(o,l,i,c);var h=Qt.Quaternion[2];Re.SlerpToRef(a,u,i,h);var p=Qt.Vector3[5];y.LerpToRef(s,f,i,p),n.ComposeToRef(c,h,p,r)},n.LookAtLH=function(t,e,i){var r=new n;return n.LookAtLHToRef(t,e,i,r),r},n.LookAtLHToRef=function(t,e,i,r){var o=Qt.Vector3[0],a=Qt.Vector3[1],s=Qt.Vector3[2];e.subtractToRef(t,s),s.normalize(),y.CrossToRef(i,s,o);var l=o.lengthSquared();l===0?o.x=1:o.normalizeFromLength(Math.sqrt(l)),y.CrossToRef(s,o,a),a.normalize();var u=-y.Dot(o,t),f=-y.Dot(a,t),c=-y.Dot(s,t);n.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,f,c,1,r)},n.LookAtRH=function(t,e,i){var r=new n;return n.LookAtRHToRef(t,e,i,r),r},n.LookAtRHToRef=function(t,e,i,r){var o=Qt.Vector3[0],a=Qt.Vector3[1],s=Qt.Vector3[2];t.subtractToRef(e,s),s.normalize(),y.CrossToRef(i,s,o);var l=o.lengthSquared();l===0?o.x=1:o.normalizeFromLength(Math.sqrt(l)),y.CrossToRef(s,o,a),a.normalize();var u=-y.Dot(o,t),f=-y.Dot(a,t),c=-y.Dot(s,t);n.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,f,c,1,r)},n.OrthoLH=function(t,e,i,r){var o=new n;return n.OrthoLHToRef(t,e,i,r,o),o},n.OrthoLHToRef=function(t,e,i,r,o){var a=i,s=r,l=2/t,u=2/e,f=2/(s-a),c=-(s+a)/(s-a);n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,f,0,0,0,c,1,o),o._updateIdentityStatus(l===1&&u===1&&f===1&&c===0)},n.OrthoOffCenterLH=function(t,e,i,r,o,a){var s=new n;return n.OrthoOffCenterLHToRef(t,e,i,r,o,a,s),s},n.OrthoOffCenterLHToRef=function(t,e,i,r,o,a,s){var l=o,u=a,f=2/(e-t),c=2/(r-i),h=2/(u-l),p=-(u+l)/(u-l),_=(t+e)/(t-e),g=(r+i)/(i-r);n.FromValuesToRef(f,0,0,0,0,c,0,0,0,0,h,0,_,g,p,1,s),s._markAsUpdated()},n.OrthoOffCenterRH=function(t,e,i,r,o,a){var s=new n;return n.OrthoOffCenterRHToRef(t,e,i,r,o,a,s),s},n.OrthoOffCenterRHToRef=function(t,e,i,r,o,a,s){n.OrthoOffCenterLHToRef(t,e,i,r,o,a,s),s._m[10]*=-1},n.PerspectiveLH=function(t,e,i,r){var o=new n,a=i,s=r,l=2*a/t,u=2*a/e,f=(s+a)/(s-a),c=-2*s*a/(s-a);return n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,f,1,0,0,c,0,o),o._updateIdentityStatus(!1),o},n.PerspectiveFovLH=function(t,e,i,r){var o=new n;return n.PerspectiveFovLHToRef(t,e,i,r,o),o},n.PerspectiveFovLHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=i,l=r,u=1/Math.tan(t*.5),f=a?u/e:u,c=a?u:u*e,h=(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(f,0,0,0,0,c,0,0,0,0,h,1,0,0,p,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovReverseLHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=1/Math.tan(t*.5),l=a?s/e:s,u=a?s:s*e;n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,-i,1,0,0,1,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovRH=function(t,e,i,r){var o=new n;return n.PerspectiveFovRHToRef(t,e,i,r,o),o},n.PerspectiveFovRHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=i,l=r,u=1/Math.tan(t*.5),f=a?u/e:u,c=a?u:u*e,h=-(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(f,0,0,0,0,c,0,0,0,0,h,-1,0,0,p,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovReverseRHToRef=function(t,e,i,r,o,a){a===void 0&&(a=!0);var s=1/Math.tan(t*.5),l=a?s/e:s,u=a?s:s*e;n.FromValuesToRef(l,0,0,0,0,u,0,0,0,0,-i,-1,0,0,-1,0,o),o._updateIdentityStatus(!1)},n.PerspectiveFovWebVRToRef=function(t,e,i,r,o){o===void 0&&(o=!1);var a=o?-1:1,s=Math.tan(t.upDegrees*Math.PI/180),l=Math.tan(t.downDegrees*Math.PI/180),u=Math.tan(t.leftDegrees*Math.PI/180),f=Math.tan(t.rightDegrees*Math.PI/180),c=2/(u+f),h=2/(s+l),p=r._m;p[0]=c,p[1]=p[2]=p[3]=p[4]=0,p[5]=h,p[6]=p[7]=0,p[8]=(u-f)*c*.5,p[9]=-((s-l)*h*.5),p[10]=-i/(e-i),p[11]=1*a,p[12]=p[13]=p[15]=0,p[14]=-(2*i*e)/(i-e),r._markAsUpdated()},n.GetFinalMatrix=function(t,e,i,r,o,a){var s=t.width,l=t.height,u=t.x,f=t.y,c=n.FromValues(s/2,0,0,0,0,-l/2,0,0,0,0,a-o,0,u+s/2,l/2+f,o,1),h=Qt.Matrix[0];return e.multiplyToRef(i,h),h.multiplyToRef(r,h),h.multiply(c)},n.GetAsMatrix2x2=function(t){var e=t.m,i=[e[0],e[1],e[4],e[5]];return Qa.MatrixUse64Bits?i:new Float32Array(i)},n.GetAsMatrix3x3=function(t){var e=t.m,i=[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]];return Qa.MatrixUse64Bits?i:new Float32Array(i)},n.Transpose=function(t){var e=new n;return n.TransposeToRef(t,e),e},n.TransposeToRef=function(t,e){var i=e._m,r=t.m;i[0]=r[0],i[1]=r[4],i[2]=r[8],i[3]=r[12],i[4]=r[1],i[5]=r[5],i[6]=r[9],i[7]=r[13],i[8]=r[2],i[9]=r[6],i[10]=r[10],i[11]=r[14],i[12]=r[3],i[13]=r[7],i[14]=r[11],i[15]=r[15],e._updateIdentityStatus(t._isIdentity,t._isIdentityDirty)},n.Reflection=function(t){var e=new n;return n.ReflectionToRef(t,e),e},n.ReflectionToRef=function(t,e){t.normalize();var i=t.normal.x,r=t.normal.y,o=t.normal.z,a=-2*i,s=-2*r,l=-2*o;n.FromValuesToRef(a*i+1,s*i,l*i,0,a*r,s*r+1,l*r,0,a*o,s*o,l*o+1,0,a*t.d,s*t.d,l*t.d,1,e)},n.FromXYZAxesToRef=function(t,e,i,r){n.FromValuesToRef(t._x,t._y,t._z,0,e._x,e._y,e._z,0,i._x,i._y,i._z,0,0,0,0,1,r)},n.FromQuaternionToRef=function(t,e){var i=t._x*t._x,r=t._y*t._y,o=t._z*t._z,a=t._x*t._y,s=t._z*t._w,l=t._z*t._x,u=t._y*t._w,f=t._y*t._z,c=t._x*t._w;e._m[0]=1-2*(r+o),e._m[1]=2*(a+s),e._m[2]=2*(l-u),e._m[3]=0,e._m[4]=2*(a-s),e._m[5]=1-2*(o+i),e._m[6]=2*(f+c),e._m[7]=0,e._m[8]=2*(l+u),e._m[9]=2*(f-c),e._m[10]=1-2*(r+i),e._m[11]=0,e._m[12]=0,e._m[13]=0,e._m[14]=0,e._m[15]=1,e._markAsUpdated()},n._updateFlagSeed=0,n._identityReadOnly=n.Identity(),n}(),Qt=function(){function n(){}return n.Vector3=or.BuildArray(6,y.Zero),n.Matrix=or.BuildArray(2,te.Identity),n.Quaternion=or.BuildArray(3,Re.Zero),n}(),me=function(){function n(){}return n.Vector2=or.BuildArray(3,Ie.Zero),n.Vector3=or.BuildArray(13,y.Zero),n.Vector4=or.BuildArray(3,ni.Zero),n.Quaternion=or.BuildArray(2,Re.Zero),n.Matrix=or.BuildArray(8,te.Identity),n}();Ae.RegisteredTypes["BABYLON.Vector2"]=Ie;Ae.RegisteredTypes["BABYLON.Vector3"]=y;Ae.RegisteredTypes["BABYLON.Vector4"]=ni;Ae.RegisteredTypes["BABYLON.Matrix"]=te;var _e=function(){function n(t,e,i){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),this.r=t,this.g=e,this.b=i}return n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},n.prototype.getClassName=function(){return"Color3"},n.prototype.getHashCode=function(){var t=this.r*255|0;return t=t*397^(this.g*255|0),t=t*397^(this.b*255|0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.toColor4=function(t){return t===void 0&&(t=1),new Je(this.r,this.g,this.b,t)},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.toLuminance=function(){return this.r*.3+this.g*.59+this.b*.11},n.prototype.multiply=function(t){return new n(this.r*t.r,this.g*t.g,this.b*t.b)},n.prototype.multiplyToRef=function(t,e){return e.r=this.r*t.r,e.g=this.g*t.g,e.b=this.b*t.b,this},n.prototype.equals=function(t){return t&&this.r===t.r&&this.g===t.g&&this.b===t.b},n.prototype.equalsFloats=function(t,e,i){return this.r===t&&this.g===e&&this.b===i},n.prototype.scale=function(t){return new n(this.r*t,this.g*t,this.b*t)},n.prototype.scaleToRef=function(t,e){return e.r=this.r*t,e.g=this.g*t,e.b=this.b*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.r+=this.r*t,e.g+=this.g*t,e.b+=this.b*t,this},n.prototype.clampToRef=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=1),i.r=Ue.Clamp(this.r,t,e),i.g=Ue.Clamp(this.g,t,e),i.b=Ue.Clamp(this.b,t,e),this},n.prototype.add=function(t){return new n(this.r+t.r,this.g+t.g,this.b+t.b)},n.prototype.addToRef=function(t,e){return e.r=this.r+t.r,e.g=this.g+t.g,e.b=this.b+t.b,this},n.prototype.subtract=function(t){return new n(this.r-t.r,this.g-t.g,this.b-t.b)},n.prototype.subtractToRef=function(t,e){return e.r=this.r-t.r,e.g=this.g-t.g,e.b=this.b-t.b,this},n.prototype.clone=function(){return new n(this.r,this.g,this.b)},n.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},n.prototype.copyFromFloats=function(t,e,i){return this.r=t,this.g=e,this.b=i,this},n.prototype.set=function(t,e,i){return this.copyFromFloats(t,e,i)},n.prototype.toHexString=function(){var t=this.r*255|0,e=this.g*255|0,i=this.b*255|0;return"#"+Ue.ToHex(t)+Ue.ToHex(e)+Ue.ToHex(i)},n.prototype.toLinearSpace=function(){var t=new n;return this.toLinearSpaceToRef(t),t},n.prototype.toHSV=function(){var t=new n;return this.toHSVToRef(t),t},n.prototype.toHSVToRef=function(t){var e=this.r,i=this.g,r=this.b,o=Math.max(e,i,r),a=Math.min(e,i,r),s=0,l=0,u=o,f=o-a;o!==0&&(l=f/o),o!=a&&(o==e?(s=(i-r)/f,i<r&&(s+=6)):o==i?s=(r-e)/f+2:o==r&&(s=(e-i)/f+4),s*=60),t.r=s,t.g=l,t.b=u},n.prototype.toLinearSpaceToRef=function(t){return t.r=Math.pow(this.r,Ea),t.g=Math.pow(this.g,Ea),t.b=Math.pow(this.b,Ea),this},n.prototype.toGammaSpace=function(){var t=new n;return this.toGammaSpaceToRef(t),t},n.prototype.toGammaSpaceToRef=function(t){return t.r=Math.pow(this.r,Uo),t.g=Math.pow(this.g,Uo),t.b=Math.pow(this.b,Uo),this},n.HSVtoRGBToRef=function(t,e,i,r){var o=i*e,a=t/60,s=o*(1-Math.abs(a%2-1)),l=0,u=0,f=0;a>=0&&a<=1?(l=o,u=s):a>=1&&a<=2?(l=s,u=o):a>=2&&a<=3?(u=o,f=s):a>=3&&a<=4?(u=s,f=o):a>=4&&a<=5?(l=s,f=o):a>=5&&a<=6&&(l=o,f=s);var c=i-o;r.set(l+c,u+c,f+c)},n.FromHexString=function(t){if(t.substring(0,1)!=="#"||t.length!==7)return new n(0,0,0);var e=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16);return n.FromInts(e,i,r)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1],t[e+2])},n.FromArrayToRef=function(t,e,i){e===void 0&&(e=0),i.r=t[e],i.g=t[e+1],i.b=t[e+2]},n.FromInts=function(t,e,i){return new n(t/255,e/255,i/255)},n.Lerp=function(t,e,i){var r=new n(0,0,0);return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i},n.Red=function(){return new n(1,0,0)},n.Green=function(){return new n(0,1,0)},n.Blue=function(){return new n(0,0,1)},n.Black=function(){return new n(0,0,0)},Object.defineProperty(n,"BlackReadOnly",{get:function(){return n._BlackReadOnly},enumerable:!1,configurable:!0}),n.White=function(){return new n(1,1,1)},n.Purple=function(){return new n(.5,0,.5)},n.Magenta=function(){return new n(1,0,1)},n.Yellow=function(){return new n(1,1,0)},n.Gray=function(){return new n(.5,.5,.5)},n.Teal=function(){return new n(0,1,1)},n.Random=function(){return new n(Math.random(),Math.random(),Math.random())},n._BlackReadOnly=n.Black(),n}(),Je=function(){function n(t,e,i,r){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),r===void 0&&(r=1),this.r=t,this.g=e,this.b=i,this.a=r}return n.prototype.addInPlace=function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a,this},n.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},n.prototype.toArray=function(t,e){return e===void 0&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,this},n.prototype.fromArray=function(t,e){return e===void 0&&(e=0),n.FromArrayToRef(t,e,this),this},n.prototype.equals=function(t){return t&&this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a},n.prototype.add=function(t){return new n(this.r+t.r,this.g+t.g,this.b+t.b,this.a+t.a)},n.prototype.subtract=function(t){return new n(this.r-t.r,this.g-t.g,this.b-t.b,this.a-t.a)},n.prototype.subtractToRef=function(t,e){return e.r=this.r-t.r,e.g=this.g-t.g,e.b=this.b-t.b,e.a=this.a-t.a,this},n.prototype.scale=function(t){return new n(this.r*t,this.g*t,this.b*t,this.a*t)},n.prototype.scaleToRef=function(t,e){return e.r=this.r*t,e.g=this.g*t,e.b=this.b*t,e.a=this.a*t,this},n.prototype.scaleAndAddToRef=function(t,e){return e.r+=this.r*t,e.g+=this.g*t,e.b+=this.b*t,e.a+=this.a*t,this},n.prototype.clampToRef=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=1),i.r=Ue.Clamp(this.r,t,e),i.g=Ue.Clamp(this.g,t,e),i.b=Ue.Clamp(this.b,t,e),i.a=Ue.Clamp(this.a,t,e),this},n.prototype.multiply=function(t){return new n(this.r*t.r,this.g*t.g,this.b*t.b,this.a*t.a)},n.prototype.multiplyToRef=function(t,e){return e.r=this.r*t.r,e.g=this.g*t.g,e.b=this.b*t.b,e.a=this.a*t.a,e},n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},n.prototype.getClassName=function(){return"Color4"},n.prototype.getHashCode=function(){var t=this.r*255|0;return t=t*397^(this.g*255|0),t=t*397^(this.b*255|0),t=t*397^(this.a*255|0),t},n.prototype.clone=function(){return new n(this.r,this.g,this.b,this.a)},n.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},n.prototype.copyFromFloats=function(t,e,i,r){return this.r=t,this.g=e,this.b=i,this.a=r,this},n.prototype.set=function(t,e,i,r){return this.copyFromFloats(t,e,i,r)},n.prototype.toHexString=function(t){t===void 0&&(t=!1);var e=this.r*255|0,i=this.g*255|0,r=this.b*255|0;if(t)return"#"+Ue.ToHex(e)+Ue.ToHex(i)+Ue.ToHex(r);var o=this.a*255|0;return"#"+Ue.ToHex(e)+Ue.ToHex(i)+Ue.ToHex(r)+Ue.ToHex(o)},n.prototype.toLinearSpace=function(){var t=new n;return this.toLinearSpaceToRef(t),t},n.prototype.toLinearSpaceToRef=function(t){return t.r=Math.pow(this.r,Ea),t.g=Math.pow(this.g,Ea),t.b=Math.pow(this.b,Ea),t.a=this.a,this},n.prototype.toGammaSpace=function(){var t=new n;return this.toGammaSpaceToRef(t),t},n.prototype.toGammaSpaceToRef=function(t){return t.r=Math.pow(this.r,Uo),t.g=Math.pow(this.g,Uo),t.b=Math.pow(this.b,Uo),t.a=this.a,this},n.FromHexString=function(t){if(t.substring(0,1)!=="#"||t.length!==9)return new n(0,0,0,0);var e=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16),o=parseInt(t.substring(7,9),16);return n.FromInts(e,i,r,o)},n.Lerp=function(t,e,i){var r=new n(0,0,0,0);return n.LerpToRef(t,e,i,r),r},n.LerpToRef=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i,r.a=t.a+(e.a-t.a)*i},n.FromColor3=function(t,e){return e===void 0&&(e=1),new n(t.r,t.g,t.b,e)},n.FromArray=function(t,e){return e===void 0&&(e=0),new n(t[e],t[e+1],t[e+2],t[e+3])},n.FromArrayToRef=function(t,e,i){e===void 0&&(e=0),i.r=t[e],i.g=t[e+1],i.b=t[e+2],i.a=t[e+3]},n.FromInts=function(t,e,i,r){return new n(t/255,e/255,i/255,r/255)},n.CheckColors4=function(t,e){if(t.length===e*3){for(var i=[],r=0;r<t.length;r+=3){var o=r/3*4;i[o]=t[r],i[o+1]=t[r+1],i[o+2]=t[r+2],i[o+3]=1}return i}return t},n}(),qt=function(){function n(){}return n.Color3=or.BuildArray(3,_e.Black),n.Color4=or.BuildArray(3,function(){return new Je(0,0,0,0)}),n}();Ae.RegisteredTypes["BABYLON.Color3"]=_e;Ae.RegisteredTypes["BABYLON.Color4"]=Je;var di=function(){function n(t,e){this.triggerOptions=t,this.onBeforeExecuteObservable=new ie,t.parameter?(this.trigger=t.trigger,this._triggerParameter=t.parameter):t.trigger?this.trigger=t.trigger:this.trigger=t,this._nextActiveAction=this,this._condition=e}return n.prototype._prepare=function(){},n.prototype.getTriggerParameter=function(){return this._triggerParameter},n.prototype._executeCurrent=function(t){if(this._nextActiveAction._condition){var e=this._nextActiveAction._condition,i=this._actionManager.getScene().getRenderId();if(e._evaluationId===i){if(!e._currentResult)return}else{if(e._evaluationId=i,!e.isValid()){e._currentResult=!1;return}e._currentResult=!0}}this.onBeforeExecuteObservable.notifyObservers(this),this._nextActiveAction.execute(t),this.skipToNextActiveAction()},n.prototype.execute=function(t){},n.prototype.skipToNextActiveAction=function(){this._nextActiveAction._child?(this._nextActiveAction._child._actionManager||(this._nextActiveAction._child._actionManager=this._actionManager),this._nextActiveAction=this._nextActiveAction._child):this._nextActiveAction=this},n.prototype.then=function(t){return this._child=t,t._actionManager=this._actionManager,t._prepare(),t},n.prototype._getProperty=function(t){return this._actionManager._getProperty(t)},n.prototype._getEffectiveTarget=function(t,e){return this._actionManager._getEffectiveTarget(t,e)},n.prototype.serialize=function(t){},n.prototype._serialize=function(t,e){var i={type:1,children:[],name:t.name,properties:t.properties||[]};if(this._child&&this._child.serialize(i),this._condition){var r=this._condition.serialize();return r.children.push(i),e&&e.children.push(r),r}return e&&e.children.push(i),i},n._SerializeValueAsString=function(t){return typeof t=="number"?t.toString():typeof t=="boolean"?t?"true":"false":t instanceof Ie?t.x+", "+t.y:t instanceof y?t.x+", "+t.y+", "+t.z:t instanceof _e?t.r+", "+t.g+", "+t.b:t instanceof Je?t.r+", "+t.g+", "+t.b+", "+t.a:t},n._GetTargetProperty=function(t){return{name:"target",targetType:t._isMesh?"MeshProperties":t._isLight?"LightProperties":t._isCamera?"CameraProperties":"SceneProperties",value:t._isScene?"Scene":t.name}},n}();Ae.RegisteredTypes["BABYLON.Action"]=di;var Wi=function(){function n(t,e,i,r,o,a){this.source=t,this.pointerX=e,this.pointerY=i,this.meshUnderPointer=r,this.sourceEvent=o,this.additionalData=a}return n.CreateNew=function(t,e,i){var r=t.getScene();return new n(t,r.pointerX,r.pointerY,r.meshUnderPointer||t,e,i)},n.CreateNewFromSprite=function(t,e,i,r){return new n(t,e.pointerX,e.pointerY,e.meshUnderPointer,i,r)},n.CreateNewFromScene=function(t,e){return new n(null,t.pointerX,t.pointerY,t.meshUnderPointer,e)},n.CreateNewFromPrimitive=function(t,e,i,r){return new n(t,e.x,e.y,null,i,r)},n}();/*! *****************************************************************************
|
|
52
52
|
Copyright (c) Microsoft Corporation.
|
|
53
53
|
|
|
54
54
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -13293,7 +13293,7 @@ tUV=uv*stageSize;
|
|
|
13293
13293
|
gl_Position=worldViewProjection*p;
|
|
13294
13294
|
}`;ce.ShadersStore[s5]=l5;var A8=function(){function n(t,e,i,r,o){var a=this;this.name=t,this.sprites=[],this.atlasJSON=e,this.sprites=this.atlasJSON.frames,this.spriteSheet=i,this.options=r,r.stageSize=r.stageSize||new Ie(1,1),r.outputSize=r.outputSize||r.stageSize,r.outputPosition=r.outputPosition||y.Zero(),r.outputRotation=r.outputRotation||y.Zero(),r.layerCount=r.layerCount||1,r.maxAnimationFrames=r.maxAnimationFrames||0,r.baseTile=r.baseTile||0,r.flipU=r.flipU||!1,r.colorMultiply=r.colorMultiply||new y(1,1,1),this._scene=o,this._frameMap=this._createFrameBuffer(),this._tileMaps=new Array;for(var s=0;s<r.layerCount;s++)this._tileMaps.push(this._createTileBuffer(null,s));this._animationMap=this._createTileAnimationBuffer(null);var l=[];l.push("#define LAYERS "+r.layerCount),r.flipU&&l.push("#define FLIPU"),l.push("#define MAX_ANIMATION_FRAMES "+r.maxAnimationFrames+".0");var u=ce.ShadersStore.spriteMapPixelShader,f;if(this._scene.getEngine().webGLVersion===1){f="";for(var s=0;s<r.layerCount;s++)f+="if ("+s+" == i) { frameID = texture2D(tileMaps["+s+"], (tileID + 0.5) / stageSize, 0.).x; }"}else{f="switch(i) {";for(var s=0;s<r.layerCount;s++)f+="case "+s+" : frameID = texture(tileMaps["+s+"], (tileID + 0.5) / stageSize, 0.).x;",f+="break;";f+="}"}ce.ShadersStore["spriteMap"+this.name+"PixelShader"]=u.replace("#define LAYER_ID_SWITCH",f),this._material=new Ca("spriteMap:"+this.name,this._scene,{vertex:"spriteMap",fragment:"spriteMap"+this.name},{defines:l,attributes:["position","normal","uv"],uniforms:["worldViewProjection","time","stageSize","outputSize","spriteMapSize","spriteCount","time","colorMul","mousePosition","curTile","flipU"],samplers:["spriteSheet","frameMap","tileMaps","animationMap"],needAlphaBlending:!0}),this._time=0,this._material.setFloat("spriteCount",this.spriteCount),this._material.setVector2("stageSize",r.stageSize),this._material.setVector2("outputSize",r.outputSize),this._material.setTexture("spriteSheet",this.spriteSheet),this._material.setVector2("spriteMapSize",new Ie(1,1)),this._material.setVector3("colorMul",r.colorMultiply);var c=0,h=function(){if(a.spriteSheet&&a.spriteSheet.isReady()&&a.spriteSheet._texture){a._material.setVector2("spriteMapSize",new Ie(a.spriteSheet._texture.baseWidth||1,a.spriteSheet._texture.baseHeight||1));return}c<100&&setTimeout(function(){c++,h()},100)};h(),this._material.setVector3("colorMul",r.colorMultiply),this._material.setTexture("frameMap",this._frameMap),this._material.setTextureArray("tileMaps",this._tileMaps),this._material.setTexture("animationMap",this._animationMap),this._material.setFloat("time",this._time),this._output=ne.CreatePlane(t+":output",1,o,!0),this._output.scaling.x=r.outputSize.x,this._output.scaling.y=r.outputSize.y,this.position=r.outputPosition,this.rotation=r.outputRotation;var p=function(){a._time+=a._scene.getEngine().getDeltaTime(),a._material.setFloat("time",a._time)};this._scene.onBeforeRenderObservable.add(p),this._output.material=this._material}return Object.defineProperty(n.prototype,"spriteCount",{get:function(){return this.sprites.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._output.position},set:function(t){this._output.position=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rotation",{get:function(){return this._output.rotation},set:function(t){this._output.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"animationMap",{get:function(){return this._animationMap},set:function(t){var e=t._texture._bufferView,i=this._createTileAnimationBuffer(e);this._animationMap.dispose(),this._animationMap=i,this._material.setTexture("animationMap",this._animationMap)},enumerable:!1,configurable:!0}),n.prototype.getTileID=function(){var t=this.getMousePosition();return t.multiplyInPlace(this.options.stageSize||Ie.Zero()),t.x=Math.floor(t.x),t.y=Math.floor(t.y),t},n.prototype.getMousePosition=function(){var t=this._output,e=this._scene.pick(this._scene.pointerX,this._scene.pointerY,function(r){return r===t});if(!e||!e.hit||!e.getTextureCoordinates)return new Ie(-1,-1);var i=e.getTextureCoordinates();return i||new Ie(-1,-1)},n.prototype._createFrameBuffer=function(){for(var t=new Array,e=0;e<this.spriteCount;e++)t.push(0,0,0,0),t.push(0,0,0,0),t.push(0,0,0,0),t.push(0,0,0,0);for(var e=0;e<this.spriteCount;e++){var i=this.sprites[e].frame,r=this.sprites[e].spriteSourceSize,o=this.sprites[e].sourceSize,a=this.sprites[e].rotated?1:0,s=this.sprites[e].trimmed?1:0;t[e*4]=i.x,t[e*4+1]=i.y,t[e*4+2]=i.w,t[e*4+3]=i.h,t[e*4+this.spriteCount*4]=r.x,t[e*4+1+this.spriteCount*4]=r.y,t[e*4+3+this.spriteCount*4]=r.h,t[e*4+this.spriteCount*8]=o.w,t[e*4+1+this.spriteCount*8]=o.h,t[e*4+2+this.spriteCount*8]=a,t[e*4+3+this.spriteCount*8]=s}var l=new Float32Array(t),u=Bo.CreateRGBATexture(l,this.spriteCount,4,this._scene,!1,!1,he.NEAREST_NEAREST,Me.TEXTURETYPE_FLOAT);return u},n.prototype._createTileBuffer=function(t,e){e===void 0&&(e=0);var i=new Array,r=this.options.stageSize.y||0,o=this.options.stageSize.x||0;if(t)i=t;else{var a=this.options.baseTile;e!=0&&(a=0);for(var s=0;s<r;s++)for(var l=0;l<o*4;l+=4)i.push(a,0,0,0)}var u=new Float32Array(i),f=Bo.CreateRGBATexture(u,o,r,this._scene,!1,!1,he.NEAREST_NEAREST,Me.TEXTURETYPE_FLOAT);return f},n.prototype.changeTiles=function(t,e,i){t===void 0&&(t=0),i===void 0&&(i=0);var r;if(r=this._tileMaps[t]._texture._bufferView,r!==null){var o=new Array;e instanceof Ie?o.push(e):o=e;for(var a=this.options.stageSize.x||0,s=0;s<o.length;s++){var l=o[s];l.x=Math.floor(l.x),l.y=Math.floor(l.y);var u=l.x*4+l.y*(a*4);r[u]=i}var f=this._createTileBuffer(r);this._tileMaps[t].dispose(),this._tileMaps[t]=f,this._material.setTextureArray("tileMap",this._tileMaps)}},n.prototype._createTileAnimationBuffer=function(t){var e=new Array,i;if(t)i=t;else{for(var r=0;r<this.spriteCount;r++){e.push(0,0,0,0);for(var o=1;o<(this.options.maxAnimationFrames||4);)e.push(0,0,0,0),o++}i=new Float32Array(e)}var a=Bo.CreateRGBATexture(i,this.spriteCount,this.options.maxAnimationFrames||4,this._scene,!1,!1,he.NEAREST_NEAREST,Me.TEXTURETYPE_FLOAT);return a},n.prototype.addAnimationToTile=function(t,e,i,r,o){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),r===void 0&&(r=0),o===void 0&&(o=1);var a=this._animationMap._texture._bufferView,s=t*4+this.spriteCount*4*e;if(a){a[s]=i,a[s+1]=r,a[s+2]=o;var l=this._createTileAnimationBuffer(a);this._animationMap.dispose(),this._animationMap=l,this._material.setTexture("animationMap",this._animationMap)}},n.prototype.saveTileMaps=function(){for(var t="",e=0;e<this._tileMaps.length;e++)e>0&&(t+=`
|
|
13295
13295
|
\r`),t+=this._tileMaps[e]._texture._bufferView.toString();var i=document.createElement("a");i.href="data:octet/stream;charset=utf-8,"+encodeURI(t),i.target="_blank",i.download=this.name+".tilemaps",i.click(),i.remove()},n.prototype.loadTileMaps=function(t){var e=this,i=new XMLHttpRequest;i.open("GET",t);var r=this.options.layerCount||0;i.onload=function(){for(var o=i.response.split(`
|
|
13296
|
-
\r`),a=0;a<r;a++){var s=o[a].split(",").map(Number),l=e._createTileBuffer(s);e._tileMaps[a].dispose(),e._tileMaps[a]=l}e._material.setTextureArray("tileMap",e._tileMaps)},i.send()},n.prototype.dispose=function(){this._output.dispose(),this._material.dispose(),this._animationMap.dispose(),this._tileMaps.forEach(function(t){t.dispose()}),this._frameMap.dispose()},n}(),R8=function(n){j(t,n);function t(e,i,r,o,a,s,l){a===void 0&&(a=null),s===void 0&&(s=.01),l===void 0&&(l=he.TRILINEAR_SAMPLINGMODE);var u=n.call(this,e,i,r,64,o,s,l,!0,a)||this;return u.name=e,u}return t}(n5),ya;(function(n){n[n.INIT=0]="INIT",n[n.RUNNING=1]="RUNNING",n[n.DONE=2]="DONE",n[n.ERROR=3]="ERROR"})(ya||(ya={}));var Ra=function(){function n(t){this.name=t,this._isCompleted=!1,this._taskState=ya.INIT}return Object.defineProperty(n.prototype,"isCompleted",{get:function(){return this._isCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"taskState",{get:function(){return this._taskState},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"errorObject",{get:function(){return this._errorObject},enumerable:!1,configurable:!0}),n.prototype._setErrorObject=function(t,e){this._errorObject||(this._errorObject={message:t,exception:e})},n.prototype.run=function(t,e,i){var r=this;this._taskState=ya.RUNNING,this.runTask(t,function(){r.onDoneCallback(e,i)},function(o,a){r.onErrorCallback(i,o,a)})},n.prototype.runTask=function(t,e,i){throw new Error("runTask is not implemented")},n.prototype.reset=function(){this._taskState=ya.INIT},n.prototype.onErrorCallback=function(t,e,i){this._taskState=ya.ERROR,this._errorObject={message:e,exception:i},this.onError&&this.onError(this,e,i),t()},n.prototype.onDoneCallback=function(t,e){try{this._taskState=ya.DONE,this._isCompleted=!0,this.onSuccess&&this.onSuccess(this),t()}catch(i){this.onErrorCallback(e,"Task is done, error executing success callback(s)",i)}},n}(),u5=function(){function n(t,e,i){this.remainingCount=t,this.totalCount=e,this.task=i}return n}(),f5=function(n){j(t,n);function t(e,i,r,o){var a=n.call(this,e)||this;return a.name=e,a.meshesNames=i,a.rootUrl=r,a.sceneFilename=o,a}return t.prototype.runTask=function(e,i,r){var o=this;$t.LoadAssetContainer(this.rootUrl,this.sceneFilename,e,function(a){o.loadedContainer=a,o.loadedMeshes=a.meshes,o.loadedParticleSystems=a.particleSystems,o.loadedSkeletons=a.skeletons,o.loadedAnimationGroups=a.animationGroups,i()},null,function(a,s,l){r(s,l)})},t}(Ra),c5=function(n){j(t,n);function t(e,i,r,o){var a=n.call(this,e)||this;return a.name=e,a.meshesNames=i,a.rootUrl=r,a.sceneFilename=o,a}return t.prototype.runTask=function(e,i,r){var o=this;$t.ImportMesh(this.meshesNames,this.rootUrl,this.sceneFilename,e,function(a,s,l,u){o.loadedMeshes=a,o.loadedParticleSystems=s,o.loadedSkeletons=l,o.loadedAnimationGroups=u,i()},null,function(a,s,l){r(s,l)})},t}(Ra),h5=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.name=e,r.url=i,r}return t.prototype.runTask=function(e,i,r){var o=this;e._loadFile(this.url,function(a){o.text=a,i()},void 0,!1,!1,function(a,s){a&&r(a.status+" "+a.statusText,s)})},t}(Ra),LI=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.name=e,r.url=i,r}return t.prototype.runTask=function(e,i,r){var o=this;e._loadFile(this.url,function(a){o.data=a,i()},void 0,!0,!0,function(a,s){a&&r(a.status+" "+a.statusText,s)})},t}(Ra),d5=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.name=e,r.url=i,r}return t.prototype.runTask=function(e,i,r){var o=this,a=new Image;Ee.SetCorsBehavior(this.url,a),a.onload=function(){o.image=a,i()},a.onerror=function(s){r("Error loading image",s)},a.src=this.url},t}(Ra),Xb=function(n){j(t,n);function t(e,i,r,o,a){o===void 0&&(o=!0),a===void 0&&(a=he.TRILINEAR_SAMPLINGMODE);var s=n.call(this,e)||this;return s.name=e,s.url=i,s.noMipmap=r,s.invertY=o,s.samplingMode=a,s}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new he(this.url,e,this.noMipmap,this.invertY,this.samplingMode,o,a)},t}(Ra),p5=function(n){j(t,n);function t(e,i,r,o,a){var s=n.call(this,e)||this;return s.name=e,s.url=i,s.extensions=r,s.noMipmap=o,s.files=a,s}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new Yo(this.url,e,this.extensions,this.noMipmap,this.files,o,a)},t}(Ra),_5=function(n){j(t,n);function t(e,i,r,o,a,s,l){o===void 0&&(o=!1),a===void 0&&(a=!0),s===void 0&&(s=!1),l===void 0&&(l=!1);var u=n.call(this,e)||this;return u.name=e,u.url=i,u.size=r,u.noMipmap=o,u.generateHarmonics=a,u.gammaSpace=s,u.reserved=l,u}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new Ub(this.url,e,this.size,this.noMipmap,this.generateHarmonics,this.gammaSpace,this.reserved,o,a)},t}(Ra),m5=function(n){j(t,n);function t(e,i,r,o,a){o===void 0&&(o=!1),a===void 0&&(a=!0);var s=n.call(this,e)||this;return s.name=e,s.url=i,s.size=r,s.noMipmap=o,s.gammaSpace=a,s}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new qG(this.url,e,this.size,this.noMipmap,this.gammaSpace,o,a)},t}(Ra),O8=function(){function n(t){this._isLoading=!1,this._tasks=new Array,this._waitingTasksCount=0,this._totalTasksCount=0,this.onTaskSuccessObservable=new ie,this.onTaskErrorObservable=new ie,this.onTasksDoneObservable=new ie,this.onProgressObservable=new ie,this.useDefaultLoadingScreen=!0,this.autoHideLoadingUI=!0,this._scene=t}return n.prototype.addContainerTask=function(t,e,i,r){var o=new f5(t,e,i,r);return this._tasks.push(o),o},n.prototype.addMeshTask=function(t,e,i,r){var o=new c5(t,e,i,r);return this._tasks.push(o),o},n.prototype.addTextFileTask=function(t,e){var i=new h5(t,e);return this._tasks.push(i),i},n.prototype.addBinaryFileTask=function(t,e){var i=new LI(t,e);return this._tasks.push(i),i},n.prototype.addImageTask=function(t,e){var i=new d5(t,e);return this._tasks.push(i),i},n.prototype.addTextureTask=function(t,e,i,r,o){o===void 0&&(o=he.TRILINEAR_SAMPLINGMODE);var a=new Xb(t,e,i,r,o);return this._tasks.push(a),a},n.prototype.addCubeTextureTask=function(t,e,i,r,o){var a=new p5(t,e,i,r,o);return this._tasks.push(a),a},n.prototype.addHDRCubeTextureTask=function(t,e,i,r,o,a,s){r===void 0&&(r=!1),o===void 0&&(o=!0),a===void 0&&(a=!1),s===void 0&&(s=!1);var l=new _5(t,e,i,r,o,a,s);return this._tasks.push(l),l},n.prototype.addEquiRectangularCubeTextureAssetTask=function(t,e,i,r,o){r===void 0&&(r=!1),o===void 0&&(o=!0);var a=new m5(t,e,i,r,o);return this._tasks.push(a),a},n.prototype.removeTask=function(t){var e=this._tasks.indexOf(t);e>-1&&this._tasks.splice(e,1)},n.prototype._decreaseWaitingTasksCount=function(t){this._waitingTasksCount--;try{this.onProgress&&this.onProgress(this._waitingTasksCount,this._totalTasksCount,t),this.onProgressObservable.notifyObservers(new u5(this._waitingTasksCount,this._totalTasksCount,t))}catch(a){de.Error("Error running progress callbacks."),console.log(a)}if(this._waitingTasksCount===0){try{var e=this._tasks.slice();this.onFinish&&this.onFinish(e);for(var i=0,r=e;i<r.length;i++){var t=r[i];if(t.taskState===ya.DONE){var o=this._tasks.indexOf(t);o>-1&&this._tasks.splice(o,1)}}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(a){de.Error("Error running tasks-done callbacks."),console.log(a)}this._isLoading=!1,this.autoHideLoadingUI&&this._scene.getEngine().hideLoadingUI()}},n.prototype._runTask=function(t){var e=this,i=function(){try{e.onTaskSuccess&&e.onTaskSuccess(t),e.onTaskSuccessObservable.notifyObservers(t),e._decreaseWaitingTasksCount(t)}catch(o){r("Error executing task success callbacks",o)}},r=function(o,a){t._setErrorObject(o,a),e.onTaskError&&e.onTaskError(t),e.onTaskErrorObservable.notifyObservers(t),e._decreaseWaitingTasksCount(t)};t.run(this._scene,i,r)},n.prototype.reset=function(){return this._isLoading=!1,this._tasks=new Array,this},n.prototype.load=function(){if(this._isLoading)return this;if(this._isLoading=!0,this._waitingTasksCount=this._tasks.length,this._totalTasksCount=this._tasks.length,this._waitingTasksCount===0)return this._isLoading=!1,this.onFinish&&this.onFinish(this._tasks),this.onTasksDoneObservable.notifyObservers(this._tasks),this;this.useDefaultLoadingScreen&&this._scene.getEngine().displayLoadingUI();for(var t=0;t<this._tasks.length;t++){var e=this._tasks[t];e.taskState===ya.INIT&&this._runTask(e)}return this},n.prototype.loadAsync=function(){var t=this;return new Promise(function(e,i){if(t._isLoading){e();return}t.onTasksDoneObservable.addOnce(function(r){r&&r.length?i(r):e()}),t.load()})},n}(),Nf=function(){function n(){var t=this;this.promise=new Promise(function(e,i){t._resolve=e,t._reject=i})}return Object.defineProperty(n.prototype,"resolve",{get:function(){return this._resolve},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"reject",{get:function(){return this._reject},enumerable:!1,configurable:!0}),n}(),M8=function(){function n(t,e){this._meshesOrigins=[],this._toCenterVectors=[],this._scaledDirection=y.Zero(),this._newPosition=y.Zero(),this._centerPosition=y.Zero(),this._meshes=t.slice(),e?this._centerMesh=e:this._setCenterMesh();var i=this._meshes.indexOf(this._centerMesh);i>=0&&this._meshes.splice(i,1),this._centerPosition=this._centerMesh.getAbsolutePosition().clone();for(var r=0;r<this._meshes.length;r++)if(this._meshes[r]){var o=this._meshes[r];this._meshesOrigins[r]=o.getAbsolutePosition().clone(),this._toCenterVectors[r]=y.Zero(),o._boundingInfo&&this._centerMesh._boundingInfo&&o._boundingInfo.boundingBox.centerWorld.subtractToRef(this._centerMesh._boundingInfo.boundingBox.centerWorld,this._toCenterVectors[r])}}return n.prototype._setCenterMesh=function(){for(var t=y.Zero(),e=y.Zero(),i=Number.MAX_VALUE,r=0;r<this._meshes.length;r++)if(this._meshes[r]){var o=this._meshes[r],a=o.getBoundingInfo();a&&e.addInPlace(a.boundingBox.centerWorld)}t=e.scale(1/this._meshes.length);for(var r=0;r<this._meshes.length;r++)if(this._meshes[r]){var o=this._meshes[r],a=o.getBoundingInfo();if(a){var s=a.boundingBox.centerWorld.subtract(t).lengthSquared();s<i&&(this._centerMesh=o,i=s)}}},n.prototype.getClassName=function(){return"MeshExploder"},n.prototype.getMeshes=function(){var t=this._meshes.slice();return t.unshift(this._centerMesh),t},n.prototype.explode=function(t){t===void 0&&(t=1);for(var e=0;e<this._meshes.length;e++)this._meshes[e]&&this._meshesOrigins[e]&&this._toCenterVectors[e]&&(this._toCenterVectors[e].scaleToRef(t,this._scaledDirection),this._meshesOrigins[e].addToRef(this._scaledDirection,this._newPosition),this._meshes[e].setAbsolutePosition(this._newPosition));this._centerMesh.setAbsolutePosition(this._centerPosition)},n}(),x8=function(){function n(t,e,i,r,o,a,s,l,u){this.onProcessFileCallback=function(){return!0},this._engine=t,this._currentScene=e,this._sceneLoadedCallback=i,this._progressCallback=r,this._additionalRenderLoopLogicCallback=o,this._textureLoadingCallback=a,this._startingProcessingFilesCallback=s,this._onReloadCallback=l,this._errorCallback=u}return Object.defineProperty(n,"FilesToLoad",{get:function(){return Gl.FilesToLoad},enumerable:!1,configurable:!0}),n.prototype.monitorElementForDragNDrop=function(t){var e=this;t&&(this._elementToMonitor=t,this._dragEnterHandler=function(i){e.drag(i)},this._dragOverHandler=function(i){e.drag(i)},this._dropHandler=function(i){e.drop(i)},this._elementToMonitor.addEventListener("dragenter",this._dragEnterHandler,!1),this._elementToMonitor.addEventListener("dragover",this._dragOverHandler,!1),this._elementToMonitor.addEventListener("drop",this._dropHandler,!1))},Object.defineProperty(n.prototype,"filesToLoad",{get:function(){return this._filesToLoad},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){this._elementToMonitor&&(this._elementToMonitor.removeEventListener("dragenter",this._dragEnterHandler),this._elementToMonitor.removeEventListener("dragover",this._dragOverHandler),this._elementToMonitor.removeEventListener("drop",this._dropHandler))},n.prototype.renderFunction=function(){if(this._additionalRenderLoopLogicCallback&&this._additionalRenderLoopLogicCallback(),this._currentScene){if(this._textureLoadingCallback){var t=this._currentScene.getWaitingItemsCount();t>0&&this._textureLoadingCallback(t)}this._currentScene.render()}},n.prototype.drag=function(t){t.stopPropagation(),t.preventDefault()},n.prototype.drop=function(t){t.stopPropagation(),t.preventDefault(),this.loadFiles(t)},n.prototype._traverseFolder=function(t,e,i,r){var o=this,a=t.createReader(),s=t.fullPath.replace(/^\//,"").replace(/(.+?)\/?$/,"$1/");a.readEntries(function(l){i.count+=l.length;for(var u=0,f=l;u<f.length;u++){var c=f[u];c.isFile?c.file(function(h){h.correctName=s+h.name,e.push(h),--i.count===0&&r()}):c.isDirectory&&o._traverseFolder(c,e,i,r)}--i.count===0&&r()})},n.prototype._processFiles=function(t){for(var e=0;e<t.length;e++){var i=t[e].correctName.toLowerCase(),r=i.split(".").pop();this.onProcessFileCallback(t[e],i,r)&&($t.IsPluginForExtensionAvailable("."+r)&&(this._sceneFileToLoad=t[e]),n.FilesToLoad[i]=t[e])}},n.prototype.loadFiles=function(t){var e=this;if(t&&t.dataTransfer&&t.dataTransfer.files&&(this._filesToLoad=t.dataTransfer.files),t&&t.target&&t.target.files&&(this._filesToLoad=t.target.files),!(!this._filesToLoad||this._filesToLoad.length===0)&&(this._startingProcessingFilesCallback&&this._startingProcessingFilesCallback(this._filesToLoad),this._filesToLoad&&this._filesToLoad.length>0)){for(var i=new Array,r=[],o=t.dataTransfer?t.dataTransfer.items:null,a=0;a<this._filesToLoad.length;a++){var s=this._filesToLoad[a],l=s.name.toLowerCase(),u=void 0;if(s.correctName=l,o){var f=o[a];f.getAsEntry?u=f.getAsEntry():f.webkitGetAsEntry&&(u=f.webkitGetAsEntry())}u&&u.isDirectory?r.push(u):i.push(s)}if(r.length===0)this._processFiles(i),this._processReload();else for(var c={count:r.length},h=0,p=r;h<p.length;h++){var _=p[h];this._traverseFolder(_,i,c,function(){e._processFiles(i),c.count===0&&e._processReload()})}}},n.prototype._processReload=function(){this._onReloadCallback?this._onReloadCallback(this._sceneFileToLoad):this.reload()},n.prototype.reload=function(){var t=this;this._sceneFileToLoad?(this._currentScene&&(de.errorsCount>0&&de.ClearLogCache(),this._engine.stopRenderLoop()),$t.ShowLoadingScreen=!1,this._engine.displayLoadingUI(),$t.LoadAsync("file:",this._sceneFileToLoad,this._engine,function(e){t._progressCallback&&t._progressCallback(e)}).then(function(e){t._currentScene&&t._currentScene.dispose(),t._currentScene=e,t._sceneLoadedCallback&&t._sceneLoadedCallback(t._sceneFileToLoad,t._currentScene),t._currentScene.executeWhenReady(function(){t._engine.hideLoadingUI(),t._engine.runRenderLoop(function(){t.renderFunction()})})}).catch(function(e){t._engine.hideLoadingUI(),t._errorCallback&&t._errorCallback(t._sceneFileToLoad,t._currentScene,e.message)})):de.Error("Please provide a valid .babylon file.")},n}(),Oa=function(){function n(t){t===void 0&&(t=0),this.priority=t}return n.prototype.getDescription=function(){return""},n.prototype.apply=function(t,e){return!0},n}(),zv=function(n){j(t,n);function t(e,i,r){e===void 0&&(e=0),i===void 0&&(i=1024),r===void 0&&(r=.5);var o=n.call(this,e)||this;return o.priority=e,o.maximumSize=i,o.step=r,o}return t.prototype.getDescription=function(){return"Reducing render target texture size to "+this.maximumSize},t.prototype.apply=function(e,i){for(var r=!0,o=0;o<e.textures.length;o++){var a=e.textures[o];if(!(!a.canRescale||a.getContext)){var s=a.getSize(),l=Math.max(s.width,s.height);l>this.maximumSize&&(a.scale(this.step),r=!1)}}return r},t}(Oa),NO=function(n){j(t,n);function t(e,i,r){e===void 0&&(e=0),i===void 0&&(i=2),r===void 0&&(r=.25);var o=n.call(this,e)||this;return o.priority=e,o.maximumScale=i,o.step=r,o._currentScale=-1,o._directionOffset=1,o}return t.prototype.getDescription=function(){return"Setting hardware scaling level to "+this._currentScale},t.prototype.apply=function(e,i){return this._currentScale===-1&&(this._currentScale=e.getEngine().getHardwareScalingLevel(),this._currentScale>this.maximumScale&&(this._directionOffset=-1)),this._currentScale+=this._directionOffset*this.step,e.getEngine().setHardwareScalingLevel(this._currentScale),this._directionOffset===1?this._currentScale>=this.maximumScale:this._currentScale<=this.maximumScale},t}(Oa),Gv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning shadows on/off"},t.prototype.apply=function(e,i){return e.shadowsEnabled=i.isInImprovementMode,!0},t}(Oa),Wv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning post-processes on/off"},t.prototype.apply=function(e,i){return e.postProcessesEnabled=i.isInImprovementMode,!0},t}(Oa),Hv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning lens flares on/off"},t.prototype.apply=function(e,i){return e.lensFlaresEnabled=i.isInImprovementMode,!0},t}(Oa),g5=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return this.onGetDescription?this.onGetDescription():"Running user defined callback"},t.prototype.apply=function(e,i){return this.onApply?this.onApply(e,i):!0},t}(Oa),jv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning particles on/off"},t.prototype.apply=function(e,i){return e.particlesEnabled=i.isInImprovementMode,!0},t}(Oa),FO=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning render targets off"},t.prototype.apply=function(e,i){return e.renderTargetsEnabled=i.isInImprovementMode,!0},t}(Oa),Xv=function(n){j(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e._canBeMerged=function(i){if(!(i instanceof ne))return!1;var r=i;return!(r.isDisposed()||!r.isVisible||!r.isEnabled()||r.instances.length>0||r.skeleton||r.hasLODLevels)},e}return Object.defineProperty(t,"UpdateSelectionTree",{get:function(){return t._UpdateSelectionTree},set:function(e){t._UpdateSelectionTree=e},enumerable:!1,configurable:!0}),t.prototype.getDescription=function(){return"Merging similar meshes together"},t.prototype.apply=function(e,i,r){for(var o=e.meshes.slice(0),a=o.length,s=0;s<a;s++){var l=new Array,u=o[s];if(this._canBeMerged(u)){l.push(u);for(var f=s+1;f<a;f++){var c=o[f];this._canBeMerged(c)&&c.material===u.material&&c.checkCollisions===u.checkCollisions&&(l.push(c),a--,o.splice(f,1),f--)}l.length<2||ne.MergeMeshes(l,void 0,!0)}}var h=e;return h.createOrUpdateSelectionOctree&&(r!=null?r&&h.createOrUpdateSelectionOctree():t.UpdateSelectionTree&&h.createOrUpdateSelectionOctree()),!0},t._UpdateSelectionTree=!1,t}(Oa),BO=function(){function n(t,e){t===void 0&&(t=60),e===void 0&&(e=2e3),this.targetFrameRate=t,this.trackerDuration=e,this.optimizations=new Array}return n.prototype.addOptimization=function(t){return this.optimizations.push(t),this},n.prototype.addCustomOptimization=function(t,e,i){i===void 0&&(i=0);var r=new g5(i);return r.onApply=t,r.onGetDescription=e,this.optimizations.push(r),this},n.LowDegradationAllowed=function(t){var e=new n(t),i=0;return e.addOptimization(new Xv(i)),e.addOptimization(new Gv(i)),e.addOptimization(new Hv(i)),i++,e.addOptimization(new Wv(i)),e.addOptimization(new jv(i)),i++,e.addOptimization(new zv(i,1024)),e},n.ModerateDegradationAllowed=function(t){var e=new n(t),i=0;return e.addOptimization(new Xv(i)),e.addOptimization(new Gv(i)),e.addOptimization(new Hv(i)),i++,e.addOptimization(new Wv(i)),e.addOptimization(new jv(i)),i++,e.addOptimization(new zv(i,512)),i++,e.addOptimization(new FO(i)),i++,e.addOptimization(new NO(i,2)),e},n.HighDegradationAllowed=function(t){var e=new n(t),i=0;return e.addOptimization(new Xv(i)),e.addOptimization(new Gv(i)),e.addOptimization(new Hv(i)),i++,e.addOptimization(new Wv(i)),e.addOptimization(new jv(i)),i++,e.addOptimization(new zv(i,256)),i++,e.addOptimization(new FO(i)),i++,e.addOptimization(new NO(i,4)),e},n}(),I8=function(){function n(t,e,i,r){var o=this;if(i===void 0&&(i=!0),r===void 0&&(r=!1),this._isRunning=!1,this._currentPriorityLevel=0,this._targetFrameRate=60,this._trackerDuration=2e3,this._currentFrameRate=0,this._improvementMode=!1,this.onSuccessObservable=new ie,this.onNewOptimizationAppliedObservable=new ie,this.onFailureObservable=new ie,e?this._options=e:this._options=new BO,this._options.targetFrameRate&&(this._targetFrameRate=this._options.targetFrameRate),this._options.trackerDuration&&(this._trackerDuration=this._options.trackerDuration),i)for(var a=0,s=0,l=this._options.optimizations;s<l.length;s++){var u=l[s];u.priority=a++}this._improvementMode=r,this._scene=t||pt.LastCreatedScene,this._sceneDisposeObserver=this._scene.onDisposeObservable.add(function(){o._sceneDisposeObserver=null,o.dispose()})}return Object.defineProperty(n.prototype,"isInImprovementMode",{get:function(){return this._improvementMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentPriorityLevel",{get:function(){return this._currentPriorityLevel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentFrameRate",{get:function(){return this._currentFrameRate},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetFrameRate",{get:function(){return this._targetFrameRate},set:function(t){this._targetFrameRate=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"trackerDuration",{get:function(){return this._trackerDuration},set:function(t){this._trackerDuration=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"optimizations",{get:function(){return this._options.optimizations},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this._isRunning=!1},n.prototype.reset=function(){this._currentPriorityLevel=0},n.prototype.start=function(){var t=this;this._isRunning||(this._isRunning=!0,this._scene.executeWhenReady(function(){setTimeout(function(){t._checkCurrentState()},t._trackerDuration)}))},n.prototype._checkCurrentState=function(){var t=this;if(this._isRunning){var e=this._scene,i=this._options;if(this._currentFrameRate=Math.round(e.getEngine().getFps()),this._improvementMode&&this._currentFrameRate<=this._targetFrameRate||!this._improvementMode&&this._currentFrameRate>=this._targetFrameRate){this._isRunning=!1,this.onSuccessObservable.notifyObservers(this);return}for(var r=!0,o=!0,a=0;a<i.optimizations.length;a++){var s=i.optimizations[a];s.priority===this._currentPriorityLevel&&(o=!1,r=r&&s.apply(e,this),this.onNewOptimizationAppliedObservable.notifyObservers(s))}if(o){this._isRunning=!1,this.onFailureObservable.notifyObservers(this);return}r&&this._currentPriorityLevel++,e.executeWhenReady(function(){setTimeout(function(){t._checkCurrentState()},t._trackerDuration)})}},n.prototype.dispose=function(){this.stop(),this.onSuccessObservable.clear(),this.onFailureObservable.clear(),this.onNewOptimizationAppliedObservable.clear(),this._sceneDisposeObserver&&this._scene.onDisposeObservable.remove(this._sceneDisposeObserver)},n.OptimizeAsync=function(t,e,i,r){var o=new n(t,e||BO.ModerateDegradationAllowed(),!1);return i&&o.onSuccessObservable.add(function(){i()}),r&&o.onFailureObservable.add(function(){r()}),o.start(),o},n}(),$d=[],Yb=function(n,t){$d[n.id]||n.doNotSerialize||(t.vertexData.push(n.serializeVerticeData()),$d[n.id]=!0)},NI=function(n,t){var e={},i=n._geometry;return i&&(n.getScene().getGeometryByID(i.id)||Yb(i,t.geometries)),n.serialize&&n.serialize(e),e},v5=function(n,t){if(n.delayLoadState===1||n.delayLoadState===0){if(n.material&&!n.material.doNotSerialize)if(n.material instanceof Go){if(t.multiMaterials=t.multiMaterials||[],t.materials=t.materials||[],!t.multiMaterials.some(function(s){return s.id===n.material.id})){t.multiMaterials.push(n.material.serialize());for(var e=function(s){s&&(t.materials.some(function(l){return l.id===s.id})||t.materials.push(s.serialize()))},i=0,r=n.material.subMaterials;i<r.length;i++){var o=r[i];e(o)}}}else t.materials=t.materials||[],t.materials.some(function(s){return s.id===n.material.id})||t.materials.push(n.material.serialize());var a=n._geometry;a&&(t.geometries||(t.geometries={},t.geometries.boxes=[],t.geometries.spheres=[],t.geometries.cylinders=[],t.geometries.toruses=[],t.geometries.grounds=[],t.geometries.planes=[],t.geometries.torusKnots=[],t.geometries.vertexData=[]),Yb(a,t.geometries)),n.skeleton&&!n.skeleton.doNotSerialize&&(t.skeletons=t.skeletons||[],t.skeletons.push(n.skeleton.serialize())),t.meshes=t.meshes||[],t.meshes.push(NI(n,t))}},VO=function(){function n(){}return n.ClearCache=function(){$d=[]},n.Serialize=function(t){var e={};if(n.ClearCache(),e.useDelayedTextureLoading=t.useDelayedTextureLoading,e.autoClear=t.autoClear,e.clearColor=t.clearColor.asArray(),e.ambientColor=t.ambientColor.asArray(),e.gravity=t.gravity.asArray(),e.collisionsEnabled=t.collisionsEnabled,t.fogMode&&t.fogMode!==0&&(e.fogMode=t.fogMode,e.fogColor=t.fogColor.asArray(),e.fogStart=t.fogStart,e.fogEnd=t.fogEnd,e.fogDensity=t.fogDensity),t.isPhysicsEnabled()){var i=t.getPhysicsEngine();i&&(e.physicsEnabled=!0,e.physicsGravity=i.gravity.asArray(),e.physicsEngine=i.getPhysicsPluginName())}t.metadata&&(e.metadata=t.metadata),e.morphTargetManagers=[];for(var r=0,o=t.meshes;r<o.length;r++){var a=o[r],s=a.morphTargetManager;s&&e.morphTargetManagers.push(s.serialize())}e.lights=[];var l,u;for(l=0;l<t.lights.length;l++)u=t.lights[l],u.doNotSerialize||e.lights.push(u.serialize());for(e.cameras=[],l=0;l<t.cameras.length;l++){var f=t.cameras[l];f.doNotSerialize||e.cameras.push(f.serialize())}if(t.activeCamera&&(e.activeCameraID=t.activeCamera.id),Be.AppendSerializedAnimations(t,e),t.animationGroups&&t.animationGroups.length>0){e.animationGroups=[];for(var c=0;c<t.animationGroups.length;c++){var h=t.animationGroups[c];e.animationGroups.push(h.serialize())}}if(t.reflectionProbes&&t.reflectionProbes.length>0)for(e.reflectionProbes=[],l=0;l<t.reflectionProbes.length;l++){var p=t.reflectionProbes[l];e.reflectionProbes.push(p.serialize())}e.materials=[],e.multiMaterials=[];var _;for(l=0;l<t.materials.length;l++)_=t.materials[l],_.doNotSerialize||e.materials.push(_.serialize());for(e.multiMaterials=[],l=0;l<t.multiMaterials.length;l++){var g=t.multiMaterials[l];e.multiMaterials.push(g.serialize())}for(t.environmentTexture&&(e.environmentTexture=t.environmentTexture.name),e.environmentIntensity=t.environmentIntensity,e.skeletons=[],l=0;l<t.skeletons.length;l++){var v=t.skeletons[l];v.doNotSerialize||e.skeletons.push(v.serialize())}for(e.transformNodes=[],l=0;l<t.transformNodes.length;l++)t.transformNodes[l].doNotSerialize||e.transformNodes.push(t.transformNodes[l].serialize());e.geometries={},e.geometries.boxes=[],e.geometries.spheres=[],e.geometries.cylinders=[],e.geometries.toruses=[],e.geometries.grounds=[],e.geometries.planes=[],e.geometries.torusKnots=[],e.geometries.vertexData=[],$d=[];var E=t.getGeometries();for(l=0;l<E.length;l++){var T=E[l];T.isReady()&&Yb(T,e.geometries)}for(e.meshes=[],l=0;l<t.meshes.length;l++){var a=t.meshes[l];if(a instanceof ne){var S=a;S.doNotSerialize||(S.delayLoadState===1||S.delayLoadState===0)&&e.meshes.push(NI(S,e))}}for(e.particleSystems=[],l=0;l<t.particleSystems.length;l++)e.particleSystems.push(t.particleSystems[l].serialize(!1));for(e.postProcesses=[],l=0;l<t.postProcesses.length;l++)e.postProcesses.push(t.postProcesses[l].serialize());t.actionManager&&(e.actions=t.actionManager.serialize("scene"));for(var C=0,O=t._serializableComponents;C<O.length;C++){var A=O[C];A.serialize(e)}return e},n.SerializeMesh=function(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var r={};if(n.ClearCache(),t=t instanceof Array?t:[t],e||i)for(var o=0;o<t.length;++o)i&&t[o].getDescendants().forEach(function(a){a instanceof ne&&t.indexOf(a)<0&&!a.doNotSerialize&&t.push(a)}),e&&t[o].parent&&t.indexOf(t[o].parent)<0&&!t[o].parent.doNotSerialize&&t.push(t[o].parent);return t.forEach(function(a){v5(a,r)}),r},n}(),D8=function(){function n(){}return n.CreateResizedCopy=function(t,e,i,r){r===void 0&&(r=!0);var o=t.getScene(),a=o.getEngine(),s=new ji("resized"+t.name,{width:e,height:i},o,!t.noMipmap,!0,t._texture.type,!1,t.samplingMode,!1);s.wrapU=t.wrapU,s.wrapV=t.wrapV,s.uOffset=t.uOffset,s.vOffset=t.vOffset,s.uScale=t.uScale,s.vScale=t.vScale,s.uAng=t.uAng,s.vAng=t.vAng,s.wAng=t.wAng,s.coordinatesIndex=t.coordinatesIndex,s.level=t.level,s.anisotropicFilteringLevel=t.anisotropicFilteringLevel,s._texture.isReady=!1,t.wrapU=he.CLAMP_ADDRESSMODE,t.wrapV=he.CLAMP_ADDRESSMODE;var l=new rl("pass",1,null,r?he.BILINEAR_SAMPLINGMODE:he.NEAREST_SAMPLINGMODE,a,!1,0);return l.getEffect().executeWhenCompiled(function(){l.onApply=function(f){f.setTexture("textureSampler",t)};var u=s.getInternalTexture();u&&(o.postProcessManager.directRender([l],u),a.unBindFramebuffer(u),s.disposeFramebufferObjects(),l.dispose(),u.isReady=!0)}),s},n}(),w8=function(){function n(t,e){if(e===void 0&&(e=null),!n.IsSupported(t))throw"Your browser does not support recording so far.";var i=t.getRenderingCanvas();if(!i)throw"The babylon engine must have a canvas to be recorded";this._canvas=i,this._canvas.isRecording=!1,this._options=Ot(Ot({},n._defaultOptions),e);var r=this._canvas.captureStream(this._options.fps);if(this._options.audioTracks)for(var o=0,a=this._options.audioTracks;o<a.length;o++){var s=a[o];r.addTrack(s)}this._mediaRecorder=new MediaRecorder(r,{mimeType:this._options.mimeType}),this._mediaRecorder.ondataavailable=this._handleDataAvailable.bind(this),this._mediaRecorder.onerror=this._handleError.bind(this),this._mediaRecorder.onstop=this._handleStop.bind(this)}return n.IsSupported=function(t){var e=t.getRenderingCanvas();return!!e&&typeof e.captureStream=="function"},Object.defineProperty(n.prototype,"isRecording",{get:function(){return!!this._canvas&&this._canvas.isRecording},enumerable:!1,configurable:!0}),n.prototype.stopRecording=function(){!this._canvas||!this._mediaRecorder||this.isRecording&&(this._canvas.isRecording=!1,this._mediaRecorder.stop())},n.prototype.startRecording=function(t,e){var i=this;if(t===void 0&&(t="babylonjs.webm"),e===void 0&&(e=7),!this._canvas||!this._mediaRecorder)throw"Recorder has already been disposed";if(this.isRecording)throw"Recording already in progress";return e>0&&setTimeout(function(){i.stopRecording()},e*1e3),this._fileName=t,this._recordedChunks=[],this._resolve=null,this._reject=null,this._canvas.isRecording=!0,this._mediaRecorder.start(this._options.recordChunckSize),new Promise(function(r,o){i._resolve=r,i._reject=o})},n.prototype.dispose=function(){this._canvas=null,this._mediaRecorder=null,this._recordedChunks=[],this._fileName=null,this._resolve=null,this._reject=null},n.prototype._handleDataAvailable=function(t){t.data.size>0&&this._recordedChunks.push(t.data)},n.prototype._handleError=function(t){if(this.stopRecording(),this._reject)this._reject(t.error);else throw new t.error},n.prototype._handleStop=function(){this.stopRecording();var t=new Blob(this._recordedChunks);this._resolve&&this._resolve(t),window.URL.createObjectURL(t),this._fileName&&Ee.Download(t,this._fileName)},n._defaultOptions={mimeType:"video/webm",fps:25,recordChunckSize:3e3},n}(),vp=function(){function n(){}return n.CreateScreenshot=function(t,e,i,r,o){o===void 0&&(o="image/png");var a=n._getScreenshotSize(t,e,i),s=a.height,l=a.width;if(!(s&&l)){de.Error("Invalid 'size' parameter !");return}Ee._ScreenshotCanvas||(Ee._ScreenshotCanvas=document.createElement("canvas")),Ee._ScreenshotCanvas.width=l,Ee._ScreenshotCanvas.height=s;var u=Ee._ScreenshotCanvas.getContext("2d"),f=t.getRenderWidth()/t.getRenderHeight(),c=l,h=c/f;h>s&&(h=s,c=h*f);var p=Math.max(0,l-c)/2,_=Math.max(0,s-h)/2,g=t.getRenderingCanvas();u&&g&&u.drawImage(g,p,_,c,h),Ee.EncodeScreenshotCanvasData(r,o)},n.CreateScreenshotAsync=function(t,e,i,r){return r===void 0&&(r="image/png"),new Promise(function(o,a){n.CreateScreenshot(t,e,i,function(s){typeof s<"u"?o(s):a(new Error("Data is undefined"))},r)})},n.CreateScreenshotUsingRenderTarget=function(t,e,i,r,o,a,s,l,u,f){o===void 0&&(o="image/png"),a===void 0&&(a=1),s===void 0&&(s=!1),u===void 0&&(u=!1),f===void 0&&(f=!1);var c=n._getScreenshotSize(t,e,i),h=c.height,p=c.width,_={width:p,height:h};if(!(h&&p)){de.Error("Invalid 'size' parameter !");return}var g=t.getRenderingCanvas();if(!g){de.Error("No rendering canvas found !");return}var v={width:g.width,height:g.height};t.setSize(p,h);var E=e.getScene(),T=null,S=E.activeCameras;(E.activeCamera!==e||E.activeCameras&&E.activeCameras.length)&&(T=E.activeCamera,E.activeCamera=e),E.render();var C=new ji("screenShot",_,E,!1,!1,0,!1,he.NEAREST_SAMPLINGMODE,void 0,f);C.renderList=null,C.samples=a,C.renderSprites=u,C.onAfterRenderObservable.add(function(){Ee.DumpFramebuffer(p,h,t,r,o,l)});var O=function(){E.incrementRenderId(),E.resetCachedMaterial(),C.render(!0),C.dispose(),T&&(E.activeCamera=T),E.activeCameras=S,t.setSize(v.width,v.height),e.getProjectionMatrix(!0)};if(s){var A=new gp("antialiasing",1,E.activeCamera);C.addPostProcess(A),A.getEffect().isReady()?O():A.getEffect().onCompiled=function(){O()}}else O()},n.CreateScreenshotUsingRenderTargetAsync=function(t,e,i,r,o,a,s,l){return r===void 0&&(r="image/png"),o===void 0&&(o=1),a===void 0&&(a=!1),l===void 0&&(l=!1),new Promise(function(u,f){n.CreateScreenshotUsingRenderTarget(t,e,i,function(c){typeof c<"u"?u(c):f(new Error("Data is undefined"))},r,o,a,s,l)})},n._getScreenshotSize=function(t,e,i){var r=0,o=0;if(typeof i=="object"){var a=i.precision?Math.abs(i.precision):1;i.width&&i.height?(r=i.height*a,o=i.width*a):i.width&&!i.height?(o=i.width*a,r=Math.round(o/t.getAspectRatio(e))):i.height&&!i.width?(r=i.height*a,o=Math.round(r*t.getAspectRatio(e))):(o=Math.round(t.getRenderWidth()*a),r=Math.round(o/t.getAspectRatio(e)))}else isNaN(i)||(r=i,o=i);return o&&(o=Math.floor(o)),r&&(r=Math.floor(r)),{height:r|0,width:o|0}},n}();Ee.CreateScreenshot=vp.CreateScreenshot;Ee.CreateScreenshotAsync=vp.CreateScreenshotAsync;Ee.CreateScreenshotUsingRenderTarget=vp.CreateScreenshotUsingRenderTarget;Ee.CreateScreenshotUsingRenderTargetAsync=vp.CreateScreenshotUsingRenderTargetAsync;var UO;(function(n){n[n.Checkbox=0]="Checkbox",n[n.Slider=1]="Slider",n[n.Vector3=2]="Vector3",n[n.Quaternion=3]="Quaternion",n[n.Color3=4]="Color3",n[n.String=5]="String"})(UO||(UO={}));var Td=function(){function n(t){this.byteOffset=0,this.buffer=t}return n.prototype.loadAsync=function(t){var e=this;return this.buffer.readAsync(this.byteOffset,t).then(function(i){e._dataView=new DataView(i.buffer,i.byteOffset,i.byteLength),e._dataByteOffset=0})},n.prototype.readUint32=function(){var t=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,t},n.prototype.readUint8Array=function(t){var e=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,t);return this._dataByteOffset+=t,this.byteOffset+=t,e},n.prototype.readString=function(t){return Oi.Decode(this.readUint8Array(t))},n.prototype.skipBytes=function(t){this._dataByteOffset+=t,this.byteOffset+=t},n}(),L8=function(){function n(){}return n._GetStorage=function(){try{return localStorage.setItem("test",""),localStorage.removeItem("test"),localStorage}catch{var t={};return{getItem:function(i){var r=t[i];return r===void 0?null:r},setItem:function(i,r){t[i]=r}}}},n.ReadString=function(t,e){var i=this._Storage.getItem(t);return i!==null?i:e},n.WriteString=function(t,e){this._Storage.setItem(t,e)},n.ReadBoolean=function(t,e){var i=this._Storage.getItem(t);return i!==null?i==="true":e},n.WriteBoolean=function(t,e){this._Storage.setItem(t,e?"true":"false")},n.ReadNumber=function(t,e){var i=this._Storage.getItem(t);return i!==null?parseFloat(i):e},n.WriteNumber=function(t,e){this._Storage.setItem(t,e.toString())},n._Storage=n._GetStorage(),n}(),N8=function(){function n(){this._trackedScene=null}return n.prototype.track=function(t){this._trackedScene=t,this._savedJSON=VO.Serialize(t)},n.prototype.getDelta=function(){if(!this._trackedScene)return null;var t=VO.Serialize(this._trackedScene),e={};for(var i in t)this._compareCollections(i,this._savedJSON[i],t[i],e);return e},n.prototype._compareArray=function(t,e,i,r){if(e.length===0&&i.length===0)return!0;if(e.length&&!isNaN(e[0])||i.length&&!isNaN(i[0])){if(e.length!==i.length)return!1;if(e.length===0)return!0;for(var o=0;o<e.length;o++)if(e[o]!==i[o])return r[t]=i,!1;return!0}for(var a=[],s=function(){var c=e[o],h=c.uniqueId;a.push(h);var p=i.filter(function(v){return v.uniqueId===h});if(p.length){var _=p[0],g={};l._compareObjects(c,_,g)||(r[t]||(r[t]=[]),g.__state={id:_.id||_.name},r[t].push(g))}else{var g={__state:{deleteId:c.id||c.name}};r[t].push(g)}},l=this,o=0;o<e.length;o++)s();for(var o=0;o<i.length;o++){var u=i[o],f=u.uniqueId;a.indexOf(f)===-1&&(r[t]||(r[t]=[]),r[t].push(u))}return!0},n.prototype._compareObjects=function(t,e,i){var r=!1;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],s=e[o],l=!1;Array.isArray(a)?l=JSON.stringify(a)!==JSON.stringify(s):(!isNaN(a)||Object.prototype.toString.call(a)=="[object String]")&&(l=a!==s),l&&(r=!0,i[o]=s)}return!r},n.prototype._compareCollections=function(t,e,i,r){if(e!==i&&e&&i){if(Array.isArray(e)&&Array.isArray(i)){if(this._compareArray(t,e,i,r))return}else if(typeof e=="object"&&typeof i=="object"){var o={};this._compareObjects(e,i,o)||(r[t]=o);return}}},n.GetShadowGeneratorById=function(t,e){for(var i=t.lights.map(function(s){return s.getShadowGenerator()}),r=0,o=i;r<o.length;r++){var a=o[r];if(a&&a.id===e)return a}return null},n.ApplyDelta=function(t,e){var i=this;typeof t=="string"&&(t=JSON.parse(t));var r=e;for(var o in t){var a=t[o],s=r[o];if(Array.isArray(s)||o==="shadowGenerators")switch(o){case"cameras":this._ApplyDeltaForEntity(a,e,e.getCameraByID.bind(e),function(l){return dt.Parse(l,e)});break;case"lights":this._ApplyDeltaForEntity(a,e,e.getLightByID.bind(e),function(l){return Wr.Parse(l,e)});break;case"shadowGenerators":this._ApplyDeltaForEntity(a,e,function(l){return i.GetShadowGeneratorById(e,l)},function(l){return zn.Parse(l,e)});break;case"meshes":this._ApplyDeltaForEntity(a,e,e.getMeshByID.bind(e),function(l){return ne.Parse(l,e,"")});break;case"skeletons":this._ApplyDeltaForEntity(a,e,e.getSkeletonById.bind(e),function(l){return du.Parse(l,e)});break;case"materials":this._ApplyDeltaForEntity(a,e,e.getMaterialByID.bind(e),function(l){return gt.Parse(l,e,"")});break;case"multiMaterials":this._ApplyDeltaForEntity(a,e,e.getMaterialByID.bind(e),function(l){return Go.Parse(l,e,"")});break;case"transformNodes":this._ApplyDeltaForEntity(a,e,e.getTransformNodeByID.bind(e),function(l){return nr.Parse(l,e,"")});break;case"particleSystems":this._ApplyDeltaForEntity(a,e,e.getParticleSystemByID.bind(e),function(l){return vr.Parse(l,e,"")});break;case"morphTargetManagers":this._ApplyDeltaForEntity(a,e,e.getMorphTargetById.bind(e),function(l){return _p.Parse(l,e)});break;case"postProcesses":this._ApplyDeltaForEntity(a,e,e.getPostProcessByName.bind(e),function(l){return _t.Parse(l,e,"")});break}else isNaN(s)?s.fromArray&&s.fromArray(a):r[o]=a}},n._ApplyPropertiesToEntity=function(t,e){for(var i in t){var r=t[i],o=e[i];o!==void 0&&(!isNaN(o)||Array.isArray(o)?e[i]=r:o.fromArray&&o.fromArray(r))}},n._ApplyDeltaForEntity=function(t,e,i,r){for(var o=0,a=t;o<a.length;o++){var s=a[o];if(s.__state&&s.__state.id!==void 0){var l=i(s.__state.id);l&&this._ApplyPropertiesToEntity(s,l)}else if(s.__state&&s.__state.deleteId!==void 0){var u=i(s.__state.deleteId);u==null||u.dispose()}else r(s)}},n}(),hu;(function(n){var t=function(){function i(r,o,a,s){o===void 0&&(o=null),a===void 0&&(a=null),s===void 0&&(s=null),o=o??function(){return 1},a=a??function(){return 1},s=s??function(c,h){return c===h?0:1},this._characterToIdx=new Map,this._insertionCosts=new Array(r.length),this._deletionCosts=new Array(r.length),this._substitutionCosts=new Array(r.length);for(var l,u=0;u<r.length;++u){l=r[u],this._characterToIdx.set(l,u),this._insertionCosts[u]=o(l),this._deletionCosts[u]=a(l),this._substitutionCosts[u]=new Array(r.length);for(var f=u;f<r.length;++f)this._substitutionCosts[u][f]=s(l,r[f])}}return i.prototype.serialize=function(){var r={},o=new Array(this._characterToIdx.size);return this._characterToIdx.forEach(function(a,s){o[a]=s}),r.characters=o,r.insertionCosts=this._insertionCosts,r.deletionCosts=this._deletionCosts,r.substitutionCosts=this._substitutionCosts,JSON.stringify(r)},i.Deserialize=function(r){var o=JSON.parse(r),a=new i(o.characters);return a._insertionCosts=o.insertionCosts,a._deletionCosts=o.deletionCosts,a._substitutionCosts=o.substitutionCosts,a},i.prototype.getCharacterIdx=function(r){return this._characterToIdx.get(r)},i.prototype.getInsertionCost=function(r){return this._insertionCosts[r]},i.prototype.getDeletionCost=function(r){return this._deletionCosts[r]},i.prototype.getSubstitutionCost=function(r,o){var a=Math.min(r,o),s=Math.max(r,o);return this._substitutionCosts[a][s]},i}();n.Alphabet=t;var e=function(){function i(r,o){var a=this;if(r.length>i.MAX_SEQUENCE_LENGTH)throw new Error("Sequences longer than "+i.MAX_SEQUENCE_LENGTH+" not supported.");this._alphabet=o,this._characters=r.map(function(s){return a._alphabet.getCharacterIdx(s)})}return i.prototype.serialize=function(){return JSON.stringify(this._characters)},i.Deserialize=function(r,o){var a=new i([],o);return a._characters=JSON.parse(r),a},i.prototype.distance=function(r){return i._distance(this,r)},i._distance=function(r,o){var a=r._alphabet;if(a!==o._alphabet)throw new Error("Cannot Levenshtein compare Sequences built from different alphabets.");var s=r._characters,l=o._characters,u=s.length,f=l.length,c=i._costMatrix;c[0][0]=0;for(var h=0;h<u;++h)c[h+1][0]=c[h][0]+a.getInsertionCost(s[h]);for(var h=0;h<f;++h)c[0][h+1]=c[0][h]+a.getInsertionCost(l[h]);for(var p=0;p<u;++p)for(var _=0;_<f;++_)i._insertionCost=c[p+1][_]+a.getInsertionCost(l[_]),i._deletionCost=c[p][_+1]+a.getDeletionCost(s[p]),i._substitutionCost=c[p][_]+a.getSubstitutionCost(s[p],l[_]),c[p+1][_+1]=Math.min(i._insertionCost,i._deletionCost,i._substitutionCost);return c[u][f]},i.MAX_SEQUENCE_LENGTH=256,i._costMatrix=HM(Array(i.MAX_SEQUENCE_LENGTH+1)).map(function(r){return new Array(i.MAX_SEQUENCE_LENGTH+1)}),i}();n.Sequence=e})(hu||(hu={}));var F8=function(){function n(t){t===void 0&&(t=.01),this._points=[],this._segmentLength=t}return n.prototype.serialize=function(){return JSON.stringify(this)},n.Deserialize=function(t){var e=JSON.parse(t),i=new n(e._segmentLength);return i._points=e._points.map(function(r){return new y(r._x,r._y,r._z)}),i},n.prototype.getLength=function(){return this._points.length*this._segmentLength},n.prototype.add=function(t){var e=this,i=this._points.length;if(i===0)this._points.push(t.clone());else for(var r=function(){return e._segmentLength/y.Distance(e._points[i-1],t)},o=r();o<=1;o=r()){var a=this._points[i-1].scale(1-o);t.scaleAndAddToRef(o,a),this._points.push(a),++i}},n.prototype.resampleAtTargetResolution=function(t){var e=new n(this.getLength()/t);return this._points.forEach(function(i){e.add(i)}),e},n.prototype.tokenize=function(t){for(var e=[],i=new y,r=2;r<this._points.length;++r)n._transformSegmentDirToRef(this._points[r-2],this._points[r-1],this._points[r],i)&&e.push(n._tokenizeSegment(i,t));return e},n._transformSegmentDirToRef=function(t,e,i,r){var o=.98;return e.subtractToRef(t,n._forwardDir),n._forwardDir.normalize(),e.scaleToRef(-1,n._inverseFromVec),n._inverseFromVec.normalize(),Math.abs(y.Dot(n._forwardDir,n._inverseFromVec))>o?!1:(y.CrossToRef(n._forwardDir,n._inverseFromVec,n._upDir),n._upDir.normalize(),te.LookAtLHToRef(t,e,n._upDir,n._lookMatrix),i.subtractToRef(e,n._fromToVec),n._fromToVec.normalize(),y.TransformNormalToRef(n._fromToVec,n._lookMatrix,r),!0)},n._tokenizeSegment=function(t,e){n._bestMatch=0,n._score=y.Dot(t,e[0]),n._bestScore=n._score;for(var i=1;i<e.length;++i)n._score=y.Dot(t,e[i]),n._score>n._bestScore&&(n._bestMatch=i,n._bestScore=n._score);return n._bestMatch},n._forwardDir=new y,n._inverseFromVec=new y,n._upDir=new y,n._fromToVec=new y,n._lookMatrix=new te,n}(),kO=function(){function n(t){this.chars=new Array(t)}return n.Generate=function(t,e,i,r,o){t===void 0&&(t=64),e===void 0&&(e=256),i===void 0&&(i=.1),r===void 0&&(r=.001),o===void 0&&(o=[]);for(var a=.001,s=a*a,l=new n(t),u=0;u<t;++u)l.chars[u]=new y(Math.random()-.5,Math.random()-.5,Math.random()-.5),l.chars[u].normalize();for(var u=0;u<o.length;++u)l.chars[u].copyFrom(o[u]);for(var f,c,h=new y,p=new y,_=function(E,T,S){return(1-S)*E+S*T},g=0;g<e;++g){f=_(i,r,g/(e-1));for(var v=function(E){h.copyFromFloats(0,0,0),l.chars.forEach(function(T){l.chars[E].subtractToRef(T,p),c=p.lengthSquared(),c>s&&p.scaleAndAddToRef(1/(p.lengthSquared()*c),h)}),h.scaleInPlace(f),l.chars[E].addInPlace(h),l.chars[E].normalize()},u=o.length;u<l.chars.length;++u)v(u)}return l},n.prototype.serialize=function(){return JSON.stringify(this.chars)},n.Deserialize=function(t){for(var e=JSON.parse(t),i=new n(e.length),r=0;r<e.length;++r)i.chars[r]=new y(e[r]._x,e[r]._y,e[r]._z);return i},n}(),Ny=function(){function n(){this._sequences=[]}return n.prototype.serialize=function(){return JSON.stringify(this._sequences.map(function(t){return t.serialize()}))},n.Deserialize=function(t,e){var i=new n;return i._sequences=JSON.parse(t).map(function(r){return hu.Sequence.Deserialize(r,e)}),i},n.CreateFromTrajectory=function(t,e,i){return n.CreateFromTokenizationPyramid(n._getTokenizationPyramid(t,e),i)},n.CreateFromTokenizationPyramid=function(t,e){var i=new n;return i._sequences=t.map(function(r){return new hu.Sequence(r,e)}),i},n._getTokenizationPyramid=function(t,e,i){i===void 0&&(i=n.FINEST_DESCRIPTOR_RESOLUTION);for(var r=[],o=i;o>4;o=Math.floor(o/2))r.push(t.resampleAtTargetResolution(o).tokenize(e.chars));return r},n.prototype.distance=function(t){for(var e=0,i,r=0;r<this._sequences.length;++r)i=Math.pow(2,r),e+=i*this._sequences[r].distance(t._sequences[r]);return e},n.FINEST_DESCRIPTOR_RESOLUTION=32,n}(),zO=function(){function n(t){t===void 0&&(t=[]),this._descriptors=t,this._centroidIdx=-1,this._averageDistance=0,this._refreshDescription()}return n.prototype.serialize=function(){var t={};return t.descriptors=this._descriptors.map(function(e){return e.serialize()}),t.centroidIdx=this._centroidIdx,t.averageDistance=this._averageDistance,JSON.stringify(t)},n.Deserialize=function(t,e){var i=JSON.parse(t),r=new n;return r._descriptors=i.descriptors.map(function(o){return Ny.Deserialize(o,e)}),r._centroidIdx=i.centroidIdx,r._averageDistance=i.averageDistance,r},n.prototype.add=function(t){this._descriptors.push(t),this._refreshDescription()},n.prototype.getMatchCost=function(t){return t.distance(this._descriptors[this._centroidIdx])/this._averageDistance},n.prototype.getMatchMinimumDistance=function(t){return Math.min.apply(Math,this._descriptors.map(function(e){return e.distance(t)}))},n.prototype._refreshDescription=function(){var t=this;this._centroidIdx=-1;for(var e,i=this._descriptors.map(function(o){return e=0,t._descriptors.forEach(function(a){e+=o.distance(a)}),e}),r=0;r<i.length;++r)(this._centroidIdx<0||i[r]<i[this._centroidIdx])&&(this._centroidIdx=r);this._averageDistance=0,this._descriptors.forEach(function(o){t._averageDistance+=o.distance(t._descriptors[t._centroidIdx])}),this._descriptors.length>0&&(this._averageDistance=Math.max(this._averageDistance/this._descriptors.length,n.MIN_AVERAGE_DISTANCE))},n.MIN_AVERAGE_DISTANCE=1,n}(),B8=function(){function n(){this._maximumAllowableMatchCost=4,this._nameToDescribedTrajectory=new Map}return n.prototype.serialize=function(){var t={};return t.maximumAllowableMatchCost=this._maximumAllowableMatchCost,t.vector3Alphabet=this._vector3Alphabet.serialize(),t.levenshteinAlphabet=this._levenshteinAlphabet.serialize(),t.nameToDescribedTrajectory=[],this._nameToDescribedTrajectory.forEach(function(e,i){t.nameToDescribedTrajectory.push(i),t.nameToDescribedTrajectory.push(e.serialize())}),JSON.stringify(t)},n.Deserialize=function(t){var e=JSON.parse(t),i=new n;i._maximumAllowableMatchCost=e.maximumAllowableMatchCost,i._vector3Alphabet=kO.Deserialize(e.vector3Alphabet),i._levenshteinAlphabet=hu.Alphabet.Deserialize(e.levenshteinAlphabet);for(var r=0;r<e.nameToDescribedTrajectory.length;r+=2)i._nameToDescribedTrajectory.set(e.nameToDescribedTrajectory[r],zO.Deserialize(e.nameToDescribedTrajectory[r+1],i._levenshteinAlphabet));return i},n.Generate=function(){for(var t=kO.Generate(64,256,.1,.001,[y.Forward()]),e=new Array(t.chars.length),i=0;i<e.length;++i)e[i]=i;var r=new hu.Alphabet(e,function(a){return a===0?0:1},function(a){return a===0?0:1},function(a,s){return Math.min(1-y.Dot(t.chars[a],t.chars[s]),1)}),o=new n;return o._vector3Alphabet=t,o._levenshteinAlphabet=r,o},n.prototype.addTrajectoryToClassification=function(t,e){this._nameToDescribedTrajectory.has(e)||this._nameToDescribedTrajectory.set(e,new zO),this._nameToDescribedTrajectory.get(e).add(Ny.CreateFromTrajectory(t,this._vector3Alphabet,this._levenshteinAlphabet))},n.prototype.deleteClassification=function(t){return this._nameToDescribedTrajectory.delete(t)},n.prototype.classifyTrajectory=function(t){var e=this,i=Ny.CreateFromTrajectory(t,this._vector3Alphabet,this._levenshteinAlphabet),r=[];if(this._nameToDescribedTrajectory.forEach(function(u,f){u.getMatchCost(i)<e._maximumAllowableMatchCost&&r.push(f)}),r.length===0)return null;for(var o=0,a=this._nameToDescribedTrajectory.get(r[o]).getMatchMinimumDistance(i),s,l=0;l<r.length;++l)s=this._nameToDescribedTrajectory.get(r[l]).getMatchMinimumDistance(i),s<a&&(a=s,o=l);return r[o]},n}(),Yv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r.options=i,r._direction=new y(0,0,-1),r._mat=new te,r._onSelectEnabled=!1,r._origin=new y(0,0,0),r.lastNativeXRHitResults=[],r.onHitTestResultObservable=new ie,r._onHitTestResults=function(o){var a=o.map(function(s){var l=te.FromArray(s.hitMatrix);return r._xrSessionManager.scene.useRightHandedSystem||l.toggleModelMatrixHandInPlace(),r.options.worldParentNode&&l.multiplyToRef(r.options.worldParentNode.getWorldMatrix(),l),{xrHitResult:s,transformationMatrix:l}});r.lastNativeXRHitResults=o,r.onHitTestResultObservable.notifyObservers(a)},r._onSelect=function(o){r._onSelectEnabled&&t.XRHitTestWithSelectEvent(o,r._xrSessionManager.referenceSpace)},r.xrNativeFeatureName="hit-test",Ee.Warn("A newer version of this plugin is available"),r}return t.XRHitTestWithRay=function(e,i,r,o){return e.requestHitTest(i,r).then(function(a){var s=o||function(l){return!!l.hitMatrix};return a.filter(s)})},t.XRHitTestWithSelectEvent=function(e,i){var r=e.frame.getPose(e.inputSource.targetRaySpace,i);if(!r)return Promise.resolve([]);var o=new XRRay(r.transform);return this.XRHitTestWithRay(e.frame.session,o,i)},t.prototype.attach=function(){return n.prototype.attach.call(this)?(this.options.testOnPointerDownOnly&&this._xrSessionManager.session.addEventListener("select",this._onSelect,!1),!0):!1},t.prototype.detach=function(){return n.prototype.detach.call(this)?(this._onSelectEnabled=!1,this._xrSessionManager.session.removeEventListener("select",this._onSelect),!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){if(!(!this.attached||this.options.testOnPointerDownOnly)){var i=e.getViewerPose(this._xrSessionManager.referenceSpace);if(i){te.FromArrayToRef(i.transform.matrix,0,this._mat),y.TransformCoordinatesFromFloatsToRef(0,0,0,this._mat,this._origin),y.TransformCoordinatesFromFloatsToRef(0,0,-1,this._mat,this._direction),this._direction.subtractInPlace(this._origin),this._direction.normalize();var r=new XRRay({x:this._origin.x,y:this._origin.y,z:this._origin.z,w:0},{x:this._direction.x,y:this._direction.y,z:this._direction.z,w:0});t.XRHitTestWithRay(this._xrSessionManager.session,r,this._xrSessionManager.referenceSpace).then(this._onHitTestResults)}}},t.Name=Ko.HIT_TEST,t.Version=1,t}(qo);Oo.AddWebXRFeature(Yv.Name,function(n,t){return function(){return new Yv(n,t)}},Yv.Version,!1);var y5=0,Kv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r._options=i,r._lastFrameDetected=new Set,r._trackedAnchors=[],r._futureAnchors=[],r.onAnchorAddedObservable=new ie,r.onAnchorRemovedObservable=new ie,r.onAnchorUpdatedObservable=new ie,r._tmpVector=new y,r._tmpQuaternion=new Re,r.xrNativeFeatureName="anchors",r}return Object.defineProperty(t.prototype,"referenceSpaceForFrameAnchors",{set:function(e){this._referenceSpaceForFrameAnchors=e},enumerable:!1,configurable:!0}),t.prototype._populateTmpTransformation=function(e,i){return this._tmpVector.copyFrom(e),this._tmpQuaternion.copyFrom(i),this._xrSessionManager.scene.useRightHandedSystem||(this._tmpVector.z*=-1,this._tmpQuaternion.z*=-1,this._tmpQuaternion.w*=-1),{position:this._tmpVector,rotationQuaternion:this._tmpQuaternion}},t.prototype.addAnchorPointUsingHitTestResultAsync=function(e,i,r){return i===void 0&&(i=new y),r===void 0&&(r=new Re),eu(this,void 0,void 0,function(){var o,a,s,l=this;return tu(this,function(u){switch(u.label){case 0:if(this._populateTmpTransformation(i,r),o=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),e.xrHitResult.createAnchor)return[3,1];throw this.detach(),new Error("Anchors not enabled in this environment/browser");case 1:return u.trys.push([1,3,,4]),[4,e.xrHitResult.createAnchor(o)];case 2:return a=u.sent(),[2,new Promise(function(f,c){l._futureAnchors.push({nativeAnchor:a,resolved:!1,submitted:!0,xrTransformation:o,resolve:f,reject:c})})];case 3:throw s=u.sent(),new Error(s);case 4:return[2]}})})},t.prototype.addAnchorAtPositionAndRotationAsync=function(e,i,r){return i===void 0&&(i=new Re),r===void 0&&(r=!1),eu(this,void 0,void 0,function(){var o,a,s,l=this;return tu(this,function(u){switch(u.label){case 0:return this._populateTmpTransformation(e,i),o=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),r&&this.attached&&this._xrSessionManager.currentFrame?[4,this._createAnchorAtTransformation(o,this._xrSessionManager.currentFrame)]:[3,2];case 1:return s=u.sent(),[3,3];case 2:s=void 0,u.label=3;case 3:return a=s,[2,new Promise(function(f,c){l._futureAnchors.push({nativeAnchor:a,resolved:!1,submitted:!1,xrTransformation:o,resolve:f,reject:c})})]}})})},Object.defineProperty(t.prototype,"anchors",{get:function(){return this._trackedAnchors},enumerable:!1,configurable:!0}),t.prototype.detach=function(){if(!n.prototype.detach.call(this))return!1;if(!this._options.doNotRemoveAnchorsOnSessionEnded)for(;this._trackedAnchors.length;){var e=this._trackedAnchors.pop();if(e){try{e.remove()}catch{}this.onAnchorRemovedObservable.notifyObservers(e)}}return!0},t.prototype.dispose=function(){this._futureAnchors.length=0,n.prototype.dispose.call(this),this.onAnchorAddedObservable.clear(),this.onAnchorRemovedObservable.clear(),this.onAnchorUpdatedObservable.clear()},t.prototype._onXRFrame=function(e){var i=this;if(!(!this.attached||!e)){var r=e.trackedAnchors;if(r){var o=this._trackedAnchors.filter(function(s){return!r.has(s.xrAnchor)}).map(function(s){var l=i._trackedAnchors.indexOf(s);return l}),a=0;o.forEach(function(s){var l=i._trackedAnchors.splice(s-a,1)[0];i.onAnchorRemovedObservable.notifyObservers(l),a++}),r.forEach(function(s){if(i._lastFrameDetected.has(s)){var h=i._findIndexInAnchorArray(s),u=i._trackedAnchors[h];try{i._updateAnchorWithXRFrame(s,u,e),u.attachedNode&&(u.attachedNode.rotationQuaternion=u.attachedNode.rotationQuaternion||new Re,u.transformationMatrix.decompose(u.attachedNode.scaling,u.attachedNode.rotationQuaternion,u.attachedNode.position)),i.onAnchorUpdatedObservable.notifyObservers(u)}catch{Ee.Warn("Anchor could not be updated")}}else{var l={id:y5++,xrAnchor:s,remove:s.delete},u=i._updateAnchorWithXRFrame(s,l,e);i._trackedAnchors.push(u),i.onAnchorAddedObservable.notifyObservers(u);var f=i._futureAnchors.filter(function(p){return p.nativeAnchor===s}),c=f[0];c&&(c.resolve(u),c.resolved=!0)}}),this._lastFrameDetected=r}this._futureAnchors.forEach(function(s){!s.resolved&&!s.submitted&&(i._createAnchorAtTransformation(s.xrTransformation,e).then(function(l){s.nativeAnchor=l},function(l){s.resolved=!0,s.reject(l)}),s.submitted=!0)})}},t.prototype._findIndexInAnchorArray=function(e){for(var i=0;i<this._trackedAnchors.length;++i)if(this._trackedAnchors[i].xrAnchor===e)return i;return-1},t.prototype._updateAnchorWithXRFrame=function(e,i,r){var o=r.getPose(e.anchorSpace,this._xrSessionManager.referenceSpace);if(o){var a=i.transformationMatrix||new te;te.FromArrayToRef(o.transform.matrix,0,a),this._xrSessionManager.scene.useRightHandedSystem||a.toggleModelMatrixHandInPlace(),i.transformationMatrix=a,this._options.worldParentNode&&a.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),a)}return i},t.prototype._createAnchorAtTransformation=function(e,i){var r;return eu(this,void 0,void 0,function(){return tu(this,function(o){if(i.createAnchor)try{return[2,i.createAnchor(e,(r=this._referenceSpaceForFrameAnchors)!==null&&r!==void 0?r:this._xrSessionManager.referenceSpace)]}catch(a){throw new Error(a)}else throw this.detach(),new Error("Anchors are not enabled in your browser");return[2]})})},t.Name=Ko.ANCHOR_SYSTEM,t.Version=1,t}(qo);Oo.AddWebXRFeature(Kv.Name,function(n,t){return function(){return new Kv(n,t)}},Kv.Version);var b5=0,qv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r._options=i,r._detectedPlanes=[],r._enabled=!1,r._lastFrameDetected=new Set,r.onPlaneAddedObservable=new ie,r.onPlaneRemovedObservable=new ie,r.onPlaneUpdatedObservable=new ie,r.xrNativeFeatureName="plane-detection",r._xrSessionManager.session?r._init():r._xrSessionManager.onXRSessionInit.addOnce(function(){r._init()}),r}return t.prototype.detach=function(){if(!n.prototype.detach.call(this))return!1;if(!this._options.doNotRemovePlanesOnSessionEnded)for(;this._detectedPlanes.length;){var e=this._detectedPlanes.pop();e&&this.onPlaneRemovedObservable.notifyObservers(e)}return!0},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onPlaneAddedObservable.clear(),this.onPlaneRemovedObservable.clear(),this.onPlaneUpdatedObservable.clear()},t.prototype.isCompatible=function(){return typeof XRPlane<"u"},t.prototype._onXRFrame=function(e){var i=this;if(!(!this.attached||!this._enabled||!e)){var r=e.worldInformation.detectedPlanes;if(r){var o=this._detectedPlanes.filter(function(s){return!r.has(s.xrPlane)}).map(function(s){return i._detectedPlanes.indexOf(s)}),a=0;o.forEach(function(s){var l=i._detectedPlanes.splice(s-a,1)[0];i.onPlaneRemovedObservable.notifyObservers(l),a++}),r.forEach(function(s){if(i._lastFrameDetected.has(s)){if(s.lastChangedTime===i._xrSessionManager.currentTimestamp){var f=i.findIndexInPlaneArray(s),u=i._detectedPlanes[f];i._updatePlaneWithXRPlane(s,u,e),i.onPlaneUpdatedObservable.notifyObservers(u)}}else{var l={id:b5++,xrPlane:s,polygonDefinition:[]},u=i._updatePlaneWithXRPlane(s,l,e);i._detectedPlanes.push(u),i.onPlaneAddedObservable.notifyObservers(u)}}),this._lastFrameDetected=r}}},t.prototype._init=function(){var e=this,i,r,o=function(){e._enabled=!0,e._detectedPlanes.length&&(e._detectedPlanes.length=0)};if(!this._xrSessionManager.session.updateWorldTrackingState){var a=(r=(i=this._xrSessionManager.session.worldTrackingState)===null||i===void 0?void 0:i.planeDetectionState)===null||r===void 0?void 0:r.enabled;a&&o();return}this._xrSessionManager.session.updateWorldTrackingState({planeDetectionState:{enabled:!0}}),o()},t.prototype._updatePlaneWithXRPlane=function(e,i,r){var o=this;i.polygonDefinition=e.polygon.map(function(l){var u=o._xrSessionManager.scene.useRightHandedSystem?1:-1;return new y(l.x,l.y,l.z*u)});var a=r.getPose(e.planeSpace,this._xrSessionManager.referenceSpace);if(a){var s=i.transformationMatrix||new te;te.FromArrayToRef(a.transform.matrix,0,s),this._xrSessionManager.scene.useRightHandedSystem||s.toggleModelMatrixHandInPlace(),i.transformationMatrix=s,this._options.worldParentNode&&s.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),s)}return i},t.prototype.findIndexInPlaneArray=function(e){for(var i=0;i<this._detectedPlanes.length;++i)if(this._detectedPlanes[i].xrPlane===e)return i;return-1},t.Name=Ko.PLANE_DETECTION,t.Version=1,t}(qo);Oo.AddWebXRFeature(qv.Name,function(n,t){return function(){return new qv(n,t)}},qv.Version);var Qv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r.options=i,r.onBackgroundStateChangedObservable=new ie,r}return t.prototype.attach=function(){return this._setBackgroundState(!1),n.prototype.attach.call(this)},t.prototype.detach=function(){return this._setBackgroundState(!0),n.prototype.detach.call(this)},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onBackgroundStateChangedObservable.clear()},t.prototype._onXRFrame=function(e){},t.prototype._setBackgroundState=function(e){var i=this._xrSessionManager.scene;if(!this.options.ignoreEnvironmentHelper)if(this.options.environmentHelperRemovalFlags){if(this.options.environmentHelperRemovalFlags.skyBox){var r=i.getMeshByName("BackgroundSkybox");r&&r.setEnabled(e)}if(this.options.environmentHelperRemovalFlags.ground){var o=i.getMeshByName("BackgroundPlane");o&&o.setEnabled(e)}}else{var a=i.getMeshByName("BackgroundHelper");a&&a.setEnabled(e)}this.options.backgroundMeshes&&this.options.backgroundMeshes.forEach(function(s){return s.setEnabled(e)}),this.onBackgroundStateChangedObservable.notifyObservers(e)},t.Name=Ko.BACKGROUND_REMOVER,t.Version=1,t}(qo);Oo.AddWebXRFeature(Qv.Name,function(n,t){return function(){return new Qv(n,t)}},Qv.Version,!0);var V8=function(){function n(){}return n}(),$v=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r._options=i,r._attachController=function(o){if(!r._controllers[o.uniqueId])if(r._xrSessionManager.scene.isPhysicsEnabled()||de.Warn("physics engine not enabled, skipped. Please add this controller manually."),r._options.physicsProperties.useControllerMesh&&o.inputSource.gamepad)o.onMotionControllerInitObservable.addOnce(function(c){c.onModelLoadedObservable.addOnce(function(){var h=new It(c.rootMesh,It.MeshImpostor,Ot({mass:0},r._options.physicsProperties)),p=o.grip||o.pointer;r._controllers[o.uniqueId]={xrController:o,impostor:h,oldPos:p.position.clone(),oldRotation:p.rotationQuaternion.clone()}})});else{var a=r._options.physicsProperties.impostorType||It.SphereImpostor,s=r._options.physicsProperties.impostorSize||.1,l=tn.CreateSphere("impostor-mesh-"+o.uniqueId,{diameterX:typeof s=="number"?s:s.width,diameterY:typeof s=="number"?s:s.height,diameterZ:typeof s=="number"?s:s.depth});l.isVisible=r._debugMode,l.isPickable=!1,l.rotationQuaternion=new Re;var u=o.grip||o.pointer;l.position.copyFrom(u.position),l.rotationQuaternion.copyFrom(u.rotationQuaternion);var f=new It(l,a,Ot({mass:0},r._options.physicsProperties));r._controllers[o.uniqueId]={xrController:o,impostor:f,impostorMesh:l}}},r._controllers={},r._debugMode=!1,r._delta=0,r._lastTimestamp=0,r._tmpQuaternion=new Re,r._tmpVector=new y,r._options.physicsProperties||(r._options.physicsProperties={}),r}return t.prototype._enablePhysicsDebug=function(){var e=this;this._debugMode=!0,Object.keys(this._controllers).forEach(function(i){var r=e._controllers[i];r.impostorMesh&&(r.impostorMesh.isVisible=!0)})},t.prototype.addController=function(e){this._attachController(e)},t.prototype.attach=function(){var e=this;if(!n.prototype.attach.call(this))return!1;if(!this._options.xrInput)return!0;if(this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,function(o){e._detachController(o.uniqueId)}),this._options.enableHeadsetImpostor){var i=this._options.headsetImpostorParams||{impostorType:It.SphereImpostor,restitution:.8,impostorSize:.3},r=i.impostorSize||.3;this._headsetMesh=tn.CreateSphere("headset-mesh",{diameterX:typeof r=="number"?r:r.width,diameterY:typeof r=="number"?r:r.height,diameterZ:typeof r=="number"?r:r.depth}),this._headsetMesh.rotationQuaternion=new Re,this._headsetMesh.isVisible=!1,this._headsetImpostor=new It(this._headsetMesh,i.impostorType,Ot({mass:0},i))}return!0},t.prototype.detach=function(){var e=this;return n.prototype.detach.call(this)?(Object.keys(this._controllers).forEach(function(i){e._detachController(i)}),this._headsetMesh&&this._headsetMesh.dispose(),!0):!1},t.prototype.getHeadsetImpostor=function(){return this._headsetImpostor},t.prototype.getImpostorForController=function(e){var i=typeof e=="string"?e:e.uniqueId;return this._controllers[i]?this._controllers[i].impostor:null},t.prototype.setPhysicsProperties=function(e){this._options.physicsProperties=Ot(Ot({},this._options.physicsProperties),e)},t.prototype._onXRFrame=function(e){var i=this;this._delta=this._xrSessionManager.currentTimestamp-this._lastTimestamp,this._lastTimestamp=this._xrSessionManager.currentTimestamp,this._headsetMesh&&(this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.position),this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion)),Object.keys(this._controllers).forEach(function(r){var o=i._controllers[r],a=o.xrController.grip||o.xrController.pointer,s=o.oldPos||o.impostorMesh.position,l=o.oldRotation||o.impostorMesh.rotationQuaternion;if(a.position.subtractToRef(s,i._tmpVector),i._tmpVector.scaleInPlace(1e3/i._delta),o.impostor.setLinearVelocity(i._tmpVector),i._debugMode&&console.log(i._tmpVector,"linear"),!l.equalsWithEpsilon(a.rotationQuaternion)){l.conjugateInPlace().multiplyToRef(a.rotationQuaternion,i._tmpQuaternion);var u=Math.sqrt(i._tmpQuaternion.x*i._tmpQuaternion.x+i._tmpQuaternion.y*i._tmpQuaternion.y+i._tmpQuaternion.z*i._tmpQuaternion.z);if(i._tmpVector.set(i._tmpQuaternion.x,i._tmpQuaternion.y,i._tmpQuaternion.z),u<.001)i._tmpVector.scaleInPlace(2);else{var f=2*Math.atan2(u,i._tmpQuaternion.w);i._tmpVector.scaleInPlace(f/(u*(i._delta/1e3)))}o.impostor.setAngularVelocity(i._tmpVector),i._debugMode&&console.log(i._tmpVector,i._tmpQuaternion,"angular")}s.copyFrom(a.position),l.copyFrom(a.rotationQuaternion)})},t.prototype._detachController=function(e){var i=this._controllers[e];i&&(i.impostorMesh&&i.impostorMesh.dispose(),delete this._controllers[e])},t.Name=Ko.PHYSICS_CONTROLLERS,t.Version=1,t}(qo);Oo.AddWebXRFeature($v.Name,function(n,t){return function(){return new $v(n,t)}},$v.Version,!0);var Zv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r.options=i,r._tmpMat=new te,r._tmpPos=new y,r._tmpQuat=new Re,r.initHitTestSource=function(o){if(o){var a=new XRRay(r.options.offsetRay||{}),s={space:r.options.useReferenceSpace?o:r._xrSessionManager.viewerReferenceSpace,offsetRay:a};if(r.options.entityTypes&&(s.entityTypes=r.options.entityTypes),!s.space){Ee.Warn("waiting for viewer reference space to initialize");return}r._xrSessionManager.session.requestHitTestSource(s).then(function(l){r._xrHitTestSource&&r._xrHitTestSource.cancel(),r._xrHitTestSource=l})}},r.autoCloneTransformation=!1,r.onHitTestResultObservable=new ie,r.paused=!1,r.xrNativeFeatureName="hit-test",Ee.Warn("Hit test is an experimental and unstable feature."),r}return t.prototype.attach=function(){var e=this;if(!n.prototype.attach.call(this)||!this._xrSessionManager.session.requestHitTestSource)return!1;if(this.options.disablePermanentHitTest||(this._xrSessionManager.referenceSpace&&this.initHitTestSource(this._xrSessionManager.referenceSpace),this._xrSessionManager.onXRReferenceSpaceChanged.add(this.initHitTestSource)),this.options.enableTransientHitTest){var i=new XRRay(this.options.transientOffsetRay||{});this._xrSessionManager.session.requestHitTestSourceForTransientInput({profile:"generic-touchscreen",offsetRay:i,entityTypes:this.options.entityTypes}).then(function(r){e._transientXrHitTestSource=r})}return!0},t.prototype.detach=function(){return n.prototype.detach.call(this)?(this._xrHitTestSource&&(this._xrHitTestSource.cancel(),this._xrHitTestSource=null),this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this.initHitTestSource),this._transientXrHitTestSource&&(this._transientXrHitTestSource.cancel(),this._transientXrHitTestSource=null),!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){var i=this;if(!(!this.attached||this.paused)){if(this._xrHitTestSource){var r=e.getHitTestResults(this._xrHitTestSource);this._processWebXRHitTestResult(r)}if(this._transientXrHitTestSource){var o=e.getHitTestResultsForTransientInput(this._transientXrHitTestSource);o.forEach(function(a){i._processWebXRHitTestResult(a.results,a.inputSource)})}}},t.prototype._processWebXRHitTestResult=function(e,i){var r=this,o=[];e.forEach(function(a){var s=a.getPose(r._xrSessionManager.referenceSpace);if(s){var l=s.transform.position,u=s.transform.orientation;r._tmpPos.set(l.x,l.y,l.z),r._tmpQuat.set(u.x,u.y,u.z,u.w),te.FromFloat32ArrayToRefScaled(s.transform.matrix,0,1,r._tmpMat),r._xrSessionManager.scene.useRightHandedSystem||(r._tmpPos.z*=-1,r._tmpQuat.z*=-1,r._tmpQuat.w*=-1,r._tmpMat.toggleModelMatrixHandInPlace());var f={position:r.autoCloneTransformation?r._tmpPos.clone():r._tmpPos,rotationQuaternion:r.autoCloneTransformation?r._tmpQuat.clone():r._tmpQuat,transformationMatrix:r.autoCloneTransformation?r._tmpMat.clone():r._tmpMat,inputSource:i,isTransient:!!i,xrHitResult:a};o.push(f)}}),this.onHitTestResultObservable.notifyObservers(o)},t.Name=Ko.HIT_TEST,t.Version=2,t}(qo);Oo.AddWebXRFeature(Zv.Name,function(n,t){return function(){return new Zv(n,t)}},Zv.Version,!1);var Jv=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i._enabled=!1,i._featurePointCloud=[],i.onFeaturePointsAddedObservable=new ie,i.onFeaturePointsUpdatedObservable=new ie,i.xrNativeFeatureName="bjsfeature-points",i._xrSessionManager.session?i._init():i._xrSessionManager.onXRSessionInit.addOnce(function(){i._init()}),i}return Object.defineProperty(t.prototype,"featurePointCloud",{get:function(){return this._featurePointCloud},enumerable:!1,configurable:!0}),t.prototype.detach=function(){return n.prototype.detach.call(this)?(this.featurePointCloud.length=0,!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this._featurePointCloud.length=0,this.onFeaturePointsUpdatedObservable.clear(),this.onFeaturePointsAddedObservable.clear()},t.prototype._onXRFrame=function(e){if(!(!this.attached||!this._enabled||!e)){var i=e.featurePointCloud;if(!(!i||i.length===0)){if(i.length%5!==0)throw new Error("Received malformed feature point cloud of length: "+i.length);for(var r=i.length/5,o=new Array,a=new Array,s=0;s<r;s++){var l=s*5,u=i[l+4];this._featurePointCloud[u]?o.push(u):(this._featurePointCloud[u]={position:new y,confidenceValue:0},a.push(u)),this._featurePointCloud[u].position.x=i[l],this._featurePointCloud[u].position.y=i[l+1],this._featurePointCloud[u].position.z=i[l+2],this._featurePointCloud[u].confidenceValue=i[l+3]}a.length>0&&this.onFeaturePointsAddedObservable.notifyObservers(a),o.length>0&&this.onFeaturePointsUpdatedObservable.notifyObservers(o)}}},t.prototype._init=function(){!this._xrSessionManager.session.trySetFeaturePointCloudEnabled||!this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0)||(this._enabled=!0)},t.Name=Ko.FEATURE_POINTS,t.Version=1,t}(qo);Oo.AddWebXRFeature(Jv.Name,function(n){return function(){return new Jv(n)}},Jv.Version);var E5=function(){function n(t,e,i,r,o){this.xrController=t,this.trackedMeshes=e,this._handMesh=i,this._rigMapping=r,this._defaultHandMesh=!1,this._transformNodeMapping=[],this.handPartsDefinition=this.generateHandPartsDefinition(t.inputSource.hand),this._scene=e[0].getScene(),this._handMesh&&this._rigMapping?this._defaultHandMesh=!1:o||this._generateDefaultHandMesh(),this.xrController.motionController&&(this.xrController.motionController.rootMesh?this.xrController.motionController.rootMesh.setEnabled(!1):this.xrController.motionController.onModelLoadedObservable.add(function(a){a.rootMesh&&a.rootMesh.setEnabled(!1)})),this.xrController.onMotionControllerInitObservable.add(function(a){a.onModelLoadedObservable.add(function(s){s.rootMesh&&s.rootMesh.setEnabled(!1)}),a.rootMesh&&a.rootMesh.setEnabled(!1)})}return n.prototype.generateHandPartsDefinition=function(t){var e;return e={},e.wrist=[t.WRIST],e.thumb=[t.THUMB_METACARPAL,t.THUMB_PHALANX_PROXIMAL,t.THUMB_PHALANX_DISTAL,t.THUMB_PHALANX_TIP],e.index=[t.INDEX_METACARPAL,t.INDEX_PHALANX_PROXIMAL,t.INDEX_PHALANX_INTERMEDIATE,t.INDEX_PHALANX_DISTAL,t.INDEX_PHALANX_TIP],e.middle=[t.MIDDLE_METACARPAL,t.MIDDLE_PHALANX_PROXIMAL,t.MIDDLE_PHALANX_INTERMEDIATE,t.MIDDLE_PHALANX_DISTAL,t.MIDDLE_PHALANX_TIP],e.ring=[t.RING_METACARPAL,t.RING_PHALANX_PROXIMAL,t.RING_PHALANX_INTERMEDIATE,t.RING_PHALANX_DISTAL,t.RING_PHALANX_TIP],e.little=[t.LITTLE_METACARPAL,t.LITTLE_PHALANX_PROXIMAL,t.LITTLE_PHALANX_INTERMEDIATE,t.LITTLE_PHALANX_DISTAL,t.LITTLE_PHALANX_TIP],e},n.prototype.updateFromXRFrame=function(t,e,i){var r=this;i===void 0&&(i=2);var o=this.xrController.inputSource.hand;o&&this.trackedMeshes.forEach(function(a,s){var l=o[s];if(l){var u=t.getJointPose(l,e);if(!u||!u.transform)return;var f=u.transform.position,c=u.transform.orientation;a.position.set(f.x,f.y,f.z),a.rotationQuaternion.set(c.x,c.y,c.z,c.w);var h=(u.radius||.008)*i;a.scaling.set(h,h,h),r._handMesh&&r._rigMapping&&r._rigMapping[s]&&(r._transformNodeMapping[s]=r._transformNodeMapping[s]||r._scene.getTransformNodeByName(r._rigMapping[s]),r._transformNodeMapping[s]&&(r._transformNodeMapping[s].position.copyFrom(a.position),r._transformNodeMapping[s].rotationQuaternion.copyFrom(a.rotationQuaternion),a.isVisible=!1)),a.getScene().useRightHandedSystem||(a.position.z*=-1,a.rotationQuaternion.z*=-1,a.rotationQuaternion.w*=-1)}})},n.prototype.getHandPartMeshes=function(t){var e=this;return this.handPartsDefinition[t].map(function(i){return e.trackedMeshes[i]})},n.prototype.dispose=function(){this.trackedMeshes.forEach(function(t){return t.dispose()}),this._defaultHandMesh&&this._handMesh&&this._handMesh.dispose()},n.prototype._generateDefaultHandMesh=function(){return eu(this,void 0,void 0,function(){var t,e,i,r,o,a,s,l;return tu(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),t=this.xrController.inputSource.handedness==="right"?"right":"left",e=(t==="right"?"r":"l")+"_hand_"+(this._scene.useRightHandedSystem?"r":"l")+"hs.glb",[4,$t.ImportMeshAsync("","https://assets.babylonjs.com/meshes/HandMeshes/",e,this._scene)];case 1:return i=u.sent(),r={base:_e.FromInts(116,63,203),fresnel:_e.FromInts(149,102,229),fingerColor:_e.FromInts(177,130,255),tipFresnel:_e.FromInts(220,200,255)},o=new Wb("leftHandShader",this._scene,{emitComments:!1}),[4,o.loadAsync("https://patrickryanms.github.io/BabylonJStextures/Demos/xrHandMesh/handsShader.json")];case 2:if(u.sent(),o.build(!1),o.needDepthPrePass=!0,o.transparencyMode=gt.MATERIAL_ALPHABLEND,o.alphaMode=Me.ALPHA_COMBINE,a={base:o.getBlockByName("baseColor"),fresnel:o.getBlockByName("fresnelColor"),fingerColor:o.getBlockByName("fingerColor"),tipFresnel:o.getBlockByName("tipFresnelColor")},a.base.value=r.base,a.fresnel.value=r.fresnel,a.fingerColor.value=r.fingerColor,a.tipFresnel.value=r.tipFresnel,i.meshes[1].material=o,this._defaultHandMesh=!0,this._handMesh=i.meshes[0],this._rigMapping=["wrist_","thumb_metacarpal_","thumb_proxPhalanx_","thumb_distPhalanx_","thumb_tip_","index_metacarpal_","index_proxPhalanx_","index_intPhalanx_","index_distPhalanx_","index_tip_","middle_metacarpal_","middle_proxPhalanx_","middle_intPhalanx_","middle_distPhalanx_","middle_tip_","ring_metacarpal_","ring_proxPhalanx_","ring_intPhalanx_","ring_distPhalanx_","ring_tip_","little_metacarpal_","little_proxPhalanx_","little_intPhalanx_","little_distPhalanx_","little_tip_"].map(function(f){return""+f+(t==="right"?"R":"L")}),s=this._scene.getTransformNodeByName(this._rigMapping[0]),s)s.parent&&s.parent.rotate(Mi.Y,Math.PI);else throw new Error("could not find the wrist node");return[3,4];case 3:return l=u.sent(),Ee.Error("error loading hand mesh"),console.log(l),[3,4];case 4:return[2]}})})},n}(),ey=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.options=i,r.onHandAddedObservable=new ie,r.onHandRemovedObservable=new ie,r._hands={},r._attachHand=function(o){var a,s,l,u,f,c,h,p,_,g;if(!(!o.inputSource.hand||r._hands[o.uniqueId])){var v=o.inputSource.hand,E=[],T=((a=r.options.jointMeshes)===null||a===void 0?void 0:a.sourceMesh)||tn.CreateSphere("jointParent",{diameter:1});T.isVisible=!!(!((s=r.options.jointMeshes)===null||s===void 0)&&s.keepOriginalVisible);for(var S=0;S<v.length;++S){var C=T.createInstance(o.uniqueId+"-handJoint-"+S);if(!((l=r.options.jointMeshes)===null||l===void 0)&&l.onHandJointMeshGenerated){var O=r.options.jointMeshes.onHandJointMeshGenerated(C,S,o.uniqueId);O&&O!==C&&(C.dispose(),C=O)}if(C.isPickable=!1,!((u=r.options.jointMeshes)===null||u===void 0)&&u.enablePhysics){var A=r.options.jointMeshes.physicsProps||{},M=A.impostorType!==void 0?A.impostorType:It.SphereImpostor;C.physicsImpostor=new It(C,M,Ot({mass:0},A))}C.rotationQuaternion=new Re,!((f=r.options.jointMeshes)===null||f===void 0)&&f.invisible&&(C.isVisible=!1),E.push(C)}var D=o.inputSource.handedness==="right"?"right":"left",U=((c=r.options.jointMeshes)===null||c===void 0?void 0:c.handMeshes)&&((h=r.options.jointMeshes)===null||h===void 0?void 0:h.handMeshes[D]),V=((p=r.options.jointMeshes)===null||p===void 0?void 0:p.rigMapping)&&((_=r.options.jointMeshes)===null||_===void 0?void 0:_.rigMapping[D]),B=new E5(o,E,U,V,(g=r.options.jointMeshes)===null||g===void 0?void 0:g.disableDefaultHandMesh);r._hands[o.uniqueId]={handObject:B,id:t._idCounter++},r.onHandAddedObservable.notifyObservers(B)}},r.xrNativeFeatureName="hand-tracking",r}return t.prototype.isCompatible=function(){return typeof XRHand<"u"},t.prototype.attach=function(){var e=this;return n.prototype.attach.call(this)?(this.options.xrInput.controllers.forEach(this._attachHand),this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable,this._attachHand),this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable,function(i){e._detachHand(i.uniqueId)}),!0):!1},t.prototype.detach=function(){var e=this;return n.prototype.detach.call(this)?(Object.keys(this._hands).forEach(function(i){e._detachHand(i)}),!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onHandAddedObservable.clear()},t.prototype.getHandByControllerId=function(e){var i;return((i=this._hands[e])===null||i===void 0?void 0:i.handObject)||null},t.prototype.getHandByHandedness=function(e){var i=this,r=Object.keys(this._hands).map(function(a){return i._hands[a].handObject.xrController.inputSource.handedness}),o=r.indexOf(e);return o!==-1?this._hands[o].handObject:null},t.prototype._onXRFrame=function(e){var i=this;Object.keys(this._hands).forEach(function(r){var o;i._hands[r].handObject.updateFromXRFrame(e,i._xrSessionManager.referenceSpace,(o=i.options.jointMeshes)===null||o===void 0?void 0:o.scaleFactor)})},t.prototype._detachHand=function(e){this._hands[e]&&(this.onHandRemovedObservable.notifyObservers(this._hands[e].handObject),this._hands[e].handObject.dispose())},t._idCounter=0,t.Name=Ko.HAND_TRACKING,t.Version=1,t}(qo);Oo.AddWebXRFeature(ey.Name,function(n,t){return function(){return new ey(n,t)}},ey.Version,!1);var T5=function(n){j(t,n);function t(e,i,r){var o=n.call(this,e,S5["left-right"],i,r)||this;return o._mapping={defaultButton:{valueNodeName:"VALUE",unpressedNodeName:"UNPRESSED",pressedNodeName:"PRESSED"},defaultAxis:{valueNodeName:"VALUE",minNodeName:"MIN",maxNodeName:"MAX"},buttons:{"xr-standard-trigger":{rootNodeName:"SELECT",componentProperty:"button",states:["default","touched","pressed"]},"xr-standard-squeeze":{rootNodeName:"GRASP",componentProperty:"state",states:["pressed"]},"xr-standard-touchpad":{rootNodeName:"TOUCHPAD_PRESS",labelAnchorNodeName:"squeeze-label",touchPointNodeName:"TOUCH"},"xr-standard-thumbstick":{rootNodeName:"THUMBSTICK_PRESS",componentProperty:"state",states:["pressed"]}},axes:{"xr-standard-touchpad":{"x-axis":{rootNodeName:"TOUCHPAD_TOUCH_X"},"y-axis":{rootNodeName:"TOUCHPAD_TOUCH_Y"}},"xr-standard-thumbstick":{"x-axis":{rootNodeName:"THUMBSTICK_X"},"y-axis":{rootNodeName:"THUMBSTICK_Y"}}}},o.profileId="microsoft-mixed-reality",o}return t.prototype._getFilenameAndPath=function(){var e="";this.handedness==="left"?e=t.MODEL_LEFT_FILENAME:e=t.MODEL_RIGHT_FILENAME;var i="default",r=t.MODEL_BASE_URL+i+"/";return{filename:e,path:r}},t.prototype._getModelLoadingConstraints=function(){var e=$t.IsPluginForExtensionAvailable(".glb");return e||de.Warn("glTF / glb loaded was not registered, using generic controller instead"),e},t.prototype._processLoadedModel=function(e){var i=this;this.rootMesh&&(this.getComponentIds().forEach(function(r,o){if(!i.disableAnimation&&r&&i.rootMesh){var a=i._mapping.buttons[r],s=a.rootNodeName;if(!s){de.Log("Skipping unknown button at index: "+o+" with mapped name: "+r);return}var l=i._getChildByName(i.rootMesh,s);if(!l){de.Warn("Missing button mesh with name: "+s);return}if(a.valueMesh=i._getImmediateChildByName(l,i._mapping.defaultButton.valueNodeName),a.pressedMesh=i._getImmediateChildByName(l,i._mapping.defaultButton.pressedNodeName),a.unpressedMesh=i._getImmediateChildByName(l,i._mapping.defaultButton.unpressedNodeName),a.valueMesh&&a.pressedMesh&&a.unpressedMesh){var u=i.getComponent(r);u&&u.onButtonStateChangedObservable.add(function(f){i._lerpTransform(a,f.value)},void 0,!0)}else de.Warn("Missing button submesh under mesh with name: "+s)}}),this.getComponentIds().forEach(function(r,o){var a=i.getComponent(r);a.isAxes()&&["x-axis","y-axis"].forEach(function(s){if(i.rootMesh){var l=i._mapping.axes[r][s],u=i._getChildByName(i.rootMesh,l.rootNodeName);if(!u){de.Warn("Missing axis mesh with name: "+l.rootNodeName);return}l.valueMesh=i._getImmediateChildByName(u,i._mapping.defaultAxis.valueNodeName),l.minMesh=i._getImmediateChildByName(u,i._mapping.defaultAxis.minNodeName),l.maxMesh=i._getImmediateChildByName(u,i._mapping.defaultAxis.maxNodeName),l.valueMesh&&l.minMesh&&l.maxMesh?a&&a.onAxisValueChangedObservable.add(function(f){var c=s==="x-axis"?f.x:f.y;i._lerpTransform(l,c,!0)},void 0,!0):de.Warn("Missing axis submesh under mesh with name: "+l.rootNodeName)}})}))},t.prototype._setRootMesh=function(e){this.rootMesh=new ne(this.profileId+" "+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(var i,r=0;r<e.length;r++){var o=e[r];o.isPickable=!1,o.parent||(i=o)}i&&i.setParent(this.rootMesh),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=Re.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/microsoft/",t.MODEL_LEFT_FILENAME="left.glb",t.MODEL_RIGHT_FILENAME="right.glb",t}(cc);Gn.RegisterController("windows-mixed-reality",function(n,t){return new T5(t,n.gamepad,n.handedness)});var S5={},FI=function(n){j(t,n);function t(e,i,r,o,a){a===void 0&&(a=!1);var s=n.call(this,e,C5[r],i,r)||this;return s._forceLegacyControllers=a,s.profileId="oculus-touch",s}return t.prototype._getFilenameAndPath=function(){var e="";this.handedness==="left"?e=t.MODEL_LEFT_FILENAME:e=t.MODEL_RIGHT_FILENAME;var i=this._isQuest()?t.QUEST_MODEL_BASE_URL:t.MODEL_BASE_URL;return{filename:e,path:i}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var i=this,r=this._isQuest(),o=this.handedness==="right"?-1:1;this.getComponentIds().forEach(function(a){var s=a&&i.getComponent(a);s&&s.onButtonStateChangedObservable.add(function(l){if(!(!i.rootMesh||i.disableAnimation))switch(a){case"xr-standard-trigger":r||(i._modelRootNode.getChildren()[3].rotation.x=-l.value*.2,i._modelRootNode.getChildren()[3].position.y=-l.value*.005,i._modelRootNode.getChildren()[3].position.z=-l.value*.005);return;case"xr-standard-squeeze":r||(i._modelRootNode.getChildren()[4].position.x=o*l.value*.0035);return;case"xr-standard-thumbstick":return;case"a-button":case"x-button":r||(l.pressed?i._modelRootNode.getChildren()[1].position.y=-.001:i._modelRootNode.getChildren()[1].position.y=0);return;case"b-button":case"y-button":r||(l.pressed?i._modelRootNode.getChildren()[2].position.y=-.001:i._modelRootNode.getChildren()[2].position.y=0);return}},void 0,!0)})},t.prototype._setRootMesh=function(e){this.rootMesh=new ne(this.profileId+" "+this.handedness,this.scene),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=Re.FromEulerAngles(0,Math.PI,0)),e.forEach(function(i){i.isPickable=!1}),this._isQuest()?this._modelRootNode=e[0]:(this._modelRootNode=e[1],this.rootMesh.position.y=.034,this.rootMesh.position.z=.052),this._modelRootNode.parent=this.rootMesh},t.prototype._updateModel=function(){},t.prototype._isQuest=function(){return!!navigator.userAgent.match(/Quest/gi)&&!this._forceLegacyControllers},t.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",t.MODEL_LEFT_FILENAME="left.babylon",t.MODEL_RIGHT_FILENAME="right.babylon",t.QUEST_MODEL_BASE_URL="https://controllers.babylonjs.com/oculusQuest/",t}(cc);Gn.RegisterController("oculus-touch",function(n,t){return new FI(t,n.gamepad,n.handedness)});Gn.RegisterController("oculus-touch-legacy",function(n,t){return new FI(t,n.gamepad,n.handedness,!0)});var C5={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"x-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"x_button",visualResponses:{}},"y-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"y_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"a-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"a_button",visualResponses:{}},"b-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"b_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-right",assetPath:"right.glb"}},P5=function(n){j(t,n);function t(e,i,r){var o=n.call(this,e,A5[r],i,r)||this;return o.profileId="htc-vive",o}return t.prototype._getFilenameAndPath=function(){var e=t.MODEL_FILENAME,i=t.MODEL_BASE_URL;return{filename:e,path:i}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var i=this;this.getComponentIds().forEach(function(r){var o=r&&i.getComponent(r);o&&o.onButtonStateChangedObservable.add(function(a){if(!(!i.rootMesh||i.disableAnimation))switch(r){case"xr-standard-trigger":i._modelRootNode.getChildren()[6].rotation.x=-a.value*.15;return;case"xr-standard-touchpad":return;case"xr-standard-squeeze":return}},void 0,!0)})},t.prototype._setRootMesh=function(e){this.rootMesh=new ne(this.profileId+" "+this.handedness,this.scene),e.forEach(function(i){i.isPickable=!1}),this._modelRootNode=e[1],this._modelRootNode.parent=this.rootMesh,this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=Re.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/vive/",t.MODEL_FILENAME="wand.babylon",t}(cc);Gn.RegisterController("htc-vive",function(n,t){return new P5(t,n.gamepad,n.handedness)});var A5={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc-vive-none",assetPath:"none.glb"}};function ou(n){return n.startsWith("#")?n:"#"+n}function R5(n){return n.startsWith("#")?n.slice(1):n}function ty(n){return("0"+(n*255|0).toString(16)).slice(-2)}function au(n){return ty(n.r)+ty(n.g)+ty(n.b)}function Fy(n){const t=R5(n);return new _e(parseInt(t.slice(0,2),16)/256,parseInt(t.slice(2,4),16)/256,parseInt(t.slice(4,6),16)/256)}function BI(n,t){return n.bodyShapes.includes(t)}function O5(n){return BI(n,Ce.BodyShape.MALE)}function M5(n){return BI(n,Ce.BodyShape.FEMALE)}function Kb(n,t=Ce.BodyShape.MALE){const e=n.emoteDataADR74.representations.find(i=>i.bodyShapes.includes(t));if(!e)throw new Error(`Could not find a representation of bodyShape=${t} for emote="${n.id}"`);return e}function mu(n,t=Ce.BodyShape.MALE){switch(t){case Ce.BodyShape.FEMALE:{const e=n.data.representations.find(M5);if(!e)throw new Error(`Could not find a BaseFemale representation for wearable="${n.id}"`);return e}case Ce.BodyShape.MALE:{const e=n.data.representations.find(O5);if(!e)throw new Error(`Could not find a BaseMale representation for wearable="${n.id}"`);return e}}}function qb(n,t=Ce.BodyShape.MALE){if(Qb(n,t))return mu(n,t);if(n.data.representations.length>0)return n.data.representations[0];throw new Error(`The wearable="${n.id}" has no representation`)}function Qb(n,t=Ce.BodyShape.MALE){try{return mu(n,t),!0}catch{return!1}}function x5(n){const t=n.contents.find(e=>e.key===n.mainFile);if(!t)throw new Error("Could not find main file");return t.url}function yp(n){return n.mainFile.endsWith("png")}const VI=1,I5=2.8,D5=I5-VI;function w5(n){return Math.min(Math.max(n,0),100)/100*D5+VI}function L5(n){const t=n?parseFloat(n):null;return t===null||isNaN(t)?null:t}function N5(n){switch(n&&ko(n)?null:n==null?void 0:n.data.category){case Ce.WearableCategory.UPPER_BODY:return 2;case Ce.WearableCategory.SKIN:return 1.75;default:return 1.25}}const Nd="default",F5=6,GO="collections-thirdparty",B5=10;function V5(n){const t=n.split(":"),e=t.length;let i;return n.includes(GO)&&e===B5?i={assetUrn:t.slice(0,7).join(":"),tokenId:t[9],contractAddress:t[8],network:t[7]}:!n.includes(GO)&&e>F5&&(i={assetUrn:t.slice(0,-1).join(":"),tokenId:t[e-1]}),i??{assetUrn:n,tokenId:void 0}}async function U5(n,t){const[e,i]=await Zd([n],t);if(e.length===1)return e[0];if(i.length===1)return i[0];throw new Error(`Could not find wearable or emote for urn="${n}"`)}function k5(n){const t=n.map(r=>JSON.parse(atob(r))),e=t.filter(as),i=t.filter(ko);return[e,i]}function iy(n){return typeof n=="number"&&!isNaN(n)}function z5(n){return/^0x[a-fA-F0-9]{40}$/g.test(n)}function G5(n){return/^baf[a-z2-7]{56}$/.test(n)}function UI(n){return n?n===Nd?{type:"address",value:n}:n.startsWith(Nd)?isNaN(Number(n.replace(Nd,"")))?null:{type:"address",value:n}:z5(n)?{type:"address",value:n}:G5(n)?{type:"entity",value:n}:null:null}async function W5(n,t){if(!n)return[];const[e]=await Zd(n.avatar.wearables,t);return e}async function Zd(n,t){if(n.length===0)return[[],[]];const e=n.map(i=>i.replace(/^dcl:\/\/base-avatars\//,"urn:decentraland:off-chain:base-avatars:")).map(i=>V5(i).assetUrn);return Cb.fetchItems(e,t)}async function H5(n){if(n.length===0)return[[],[]];const t=n.map(o=>fetch(o).then(a=>a.json()).catch()),e=await Promise.all(t),i=e.filter(as),r=e.filter(ko);return[i,r]}const kI=YF();async function zI(n,t){return kI.memo(n,async()=>n===Nd?null:await Cb.fetchProfile(n,t).then(i=>i&&i.avatars.length>0?i.avatars[0]:null).catch(i=>console.log(`Failed to load profile="${n}"`,i))||null)}async function GI(n,t){return kI.memo(n,async()=>await Cb.fetchProfileEntity(n,t).then(i=>i&&i.avatars.length>0?i.avatars[0]:null).catch(i=>console.log(`Failed to load profile="${n}"`,i))||null)}async function WI(n){const{contractAddress:t,itemId:e,tokenId:i,peerUrl:r,nftServerUrl:o}=n;if(!e&&!i)throw new Error("You need to provide an itemId or a tokenId");const a=Wf.get("NETWORK");let s=`urn:decentraland:${a}:collections-v2:${t}:${e}`;if(!e&&!i)throw new Error("You must provide either tokenId or itemId");if(!e&&i){const l=await VF.fetchNFT(t,i,o);s=l.network!==Ce.Network.ETHEREUM?`urn:decentraland:${a}:collections-v2:${t}:${l.itemId}`:l.image.split("contents/")[1].split("/thumbnail")[0]}return U5(s,r)}async function j5(n,t,e,i,r,o,a,s){const[l,[u,f],[c,h]]=await Promise.all([W5(n,s),Zd([r,...t],s),H5(e)]),[p,_]=k5(i);let g=[...l,...u,...c,...p];const v=[...f,...h,..._];g=g.filter(S=>Qb(S,r));const E=[],T=o&&a?GF():o?zF():a?kF():[];for(const S of T)if(!UF(g,S)){const O=WF(S,r);if(O)E.push(O);else throw new Error(`Could not get default URN for category="${S}"`)}if(E.length>0){const[S]=await Zd(E,s);g=[...g,...S]}return[g,v]}async function X5(n={}){const{contractAddress:t,tokenId:e,itemId:i}=n,r=n.peerUrl||Wf.get("PEER_URL"),o=n.nftServerUrl||Wf.get("NFT_SERVER_URL");let a=Promise.resolve();t&&(a=WI({contractAddress:t,tokenId:e,itemId:i,peerUrl:r,nftServerUrl:o}));const s=UI(n.profile),l=s?s.type==="address"?zI(s.value,r):GI(s.value,r):Promise.resolve(null),[u,f]=await Promise.all([a,l]),c=n.bodyShape||f&&f.avatar.bodyShape||(u&&as(u)?HF(u):Ce.BodyShape.MALE),h=ou(n.skin||f&&au(f.avatar.skin.color)||"cc9b76"),p=ou(n.hair||f&&au(f.avatar.hair.color)||"000000"),_=ou(n.eyes||f&&au(f.avatar.eyes.color)||"000000"),g=[...n.urns||[]],v=n.urls||[],E=n.base64s||[],T=n.blob?Y5(n.blob):null;let S=[],C=[],O=1.75,A=Ce.PreviewType.WEARABLE,M={color:"#4b4852",transparent:n.disableBackground===!0};if(g.length>0||v.length>0||E.length>0||u&&ko(u)||n.profile){A=Ce.PreviewType.AVATAR;const[N,W]=await j5(f,g,v,E,c,!n.disableDefaultWearables&&!(f!=null&&f.avatar),!n.disableFace,r);S=N,C=W}if(u){if(O=S.length>0?O:N5(u),as(u)){const N=qb(u);yp(N)&&A!==Ce.PreviewType.AVATAR&&(A=Ce.PreviewType.TEXTURE)}if(M={...M,image:u.thumbnail},Ce.isStandard(u)){const N=Ce.Rarity.getColor(u.rarity);M={...M,image:u.thumbnail,color:N}}}let D=n.disableDefaultEmotes||ko(u)?null:n.emote?n.emote:Ce.PreviewEmote.IDLE;n.emote&&Object.values(Ce.PreviewEmote).includes(n.emote)&&(D=n.emote);let U=Ce.PreviewCamera.INTERACTIVE;n.camera&&Object.values(Ce.PreviewCamera).includes(n.camera)&&(U=n.camera);let V=Ce.PreviewProjection.PERSPECTIVE;n.projection&&Object.values(Ce.PreviewProjection).includes(n.projection)&&(V=n.projection);const B=typeof n.autoRotateSpeed=="number"&&!isNaN(n.autoRotateSpeed)?n.autoRotateSpeed:.2,z=!n.disableAutoCenter;let J=1,X=100,re=50;ry(n.wheelZoom)&&(J=Math.max(n.wheelZoom,1)),ry(n.wheelPrecision)&&(X=Math.max(n.wheelPrecision,1)),ry(n.wheelStart)&&(re=100-Math.min(Math.max(n.wheelStart,0),100)),n.background&&(M.color=n.background);let ae=0,se=0,H=0;switch(A){case Ce.PreviewType.WEARABLE:{ae=-2,se=2,H=2;break}case Ce.PreviewType.AVATAR:{ae=0,se=1,H=3.5;break}}iy(n.cameraX)&&(ae=n.cameraX),iy(n.cameraY)&&(se=n.cameraY),iy(n.cameraZ)&&(H=n.cameraZ);let Z=null;(n==null?void 0:n.type)===Ce.PreviewType.WEARABLE&&S.length>=2&&(A=n.type,Z=S[1]);const q=typeof n.zoomScale!="number"||isNaN(n.zoomScale)||n.zoomScale<=0?1:n.zoomScale;return{item:u??T??Z??C.pop(),wearables:S,bodyShape:c,forceRender:(f==null?void 0:f.avatar.forceRender)||[],skin:h,hair:p,eyes:_,type:A,background:M,face:n.disableFace!==!1,emote:D,camera:U,projection:V,autoRotateSpeed:n.disableAutoRotate?0:B,centerBoundingBox:z,offsetX:n.offsetX||0,offsetY:n.offsetY||0,offsetZ:n.offsetZ||0,cameraX:ae,cameraY:se,cameraZ:H,zoom:(typeof n.zoom=="number"?w5(n.zoom):O)*q,wheelZoom:J,wheelPrecision:X,wheelStart:re,fadeEffect:!n.disableFadeEffect,showSceneBoundaries:!!n.showSceneBoundaries,showThumbnailBoundaries:!!n.showThumbnailBoundaries,panning:!!n.panning,lockAlpha:!!n.lockAlpha,lockBeta:!!n.lockBeta,lockRadius:!!n.lockRadius,socialEmote:n.socialEmote||void 0}}function ry(n){return typeof n=="number"&&!isNaN(n)}function WO(n){return{...n,contents:n.contents.map(t=>({key:t.key,url:URL.createObjectURL(t.blob)}))}}function Y5(n){return"emoteDataADR74"in n?{...n,emoteDataADR74:{...n.emoteDataADR74,representations:n.emoteDataADR74.representations.map(WO)}}:{...n,data:{...n.data,representations:n.data.representations.map(WO)}}}const Fd={};function ny(n,t){return t===Fd[n]}function K5(n,t,e=[]){const[i,r]=Ct.useState(!1),[o,a]=Ct.useState(null),[s,l]=Ct.useState("");return typeof Fd[n]>"u"&&(Fd[n]=0),Ct.useEffect(()=>{const u=++Fd[n];r(!0),t().then(f=>{ny(n,u)&&a(f)}).catch(f=>{ny(n,u)&&l(f.message)}).finally(()=>{ny(n,u)&&r(!1)})},e),[o,i,s]}var q5=Jd();const Q5=ub(q5),HI=n=>{const t=Ct.useCallback(n,[]);Ct.useEffect(()=>{function e(i){t(i)}return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t])},$5=()=>{const[n,t]=Ct.useState({});return HI(e=>{if(e.data&&e.data.type===Ce.PreviewMessageType.UPDATE&&typeof e.data.payload=="object"&&typeof e.data.payload.options=="object"){const{options:i}=e.data.payload;Q5(n,i)||t(i)}}),n},$b=()=>{const[n,t]=Ct.useState(()=>new URLSearchParams(window.location.search)),e=Ct.useRef(window.location.search);Ct.useEffect(()=>{const a=window.location.search;a!==e.current&&(t(new URLSearchParams(a)),e.current=a)});const i=Ct.useMemo(()=>{const a=n.get("autoRotateSpeed"),s=n.get("offsetX"),l=n.get("offsetY"),u=n.get("offsetZ"),f=n.get("cameraX"),c=n.get("cameraY"),h=n.get("cameraZ"),p=n.get("zoomScale"),_=n.get("wheelZoom"),g=n.get("wheelPrecision"),v=n.get("wheelStart"),E=n.get("bodyShape"),T=n.get("panning"),S=n.get("lockAlpha"),C=n.get("lockBeta"),O=n.get("lockRadius"),A=n.has("transparentBackground");A&&console.warn('Deprecated: you are using the query param "transparentBackground" that has been deprecated in favor of "disableBackground". Please switch to the new query param since in the future this will not be supported.');const M=n.get("centerBoundingBox")!=="false";return{contractAddress:n.get("contract"),tokenId:n.get("token"),itemId:n.get("item"),skin:n.get("skin"),hair:n.get("hair"),eyes:n.get("eyes"),emote:n.get("emote"),camera:n.get("camera"),projection:n.get("projection"),background:n.get("background"),autoRotateSpeed:a?parseFloat(a):null,offsetX:s?parseFloat(s):null,offsetY:l?parseFloat(l):null,offsetZ:u?parseFloat(u):null,cameraX:f?parseFloat(f):null,cameraY:c?parseFloat(c):null,cameraZ:h?parseFloat(h):null,wheelZoom:_?parseFloat(_):null,wheelPrecision:g?parseFloat(g):null,wheelStart:v?parseFloat(v):null,zoom:L5(n.get("zoom")),zoomScale:p?parseFloat(p):null,bodyShape:E==="female"||E===Ce.BodyShape.FEMALE?Ce.BodyShape.FEMALE:E==="male"||E===Ce.BodyShape.MALE?Ce.BodyShape.MALE:null,urns:n.getAll("urn"),urls:n.getAll("url"),base64s:n.getAll("base64"),profile:n.get("profile"),showSceneBoundaries:n.has("showSceneBoundaries")||!1,showThumbnailBoundaries:n.has("showThumbnailBoundaries")||!1,disableBackground:n.has("disableBackground")||A,disableAutoCenter:n.has("disableAutoCenter")||!M,disableAutoRotate:n.has("disableAutoRotate")||!M,disableFace:n.has("disableFace"),disableDefaultWearables:n.has("disableDefaultWearables"),disableDefaultEmotes:n.has("disableDefaultEmotes"),disableFadeEffect:n.has("disableFadeEffect"),peerUrl:n.get("peerUrl"),nftServerUrl:n.get("nftServerUrl"),type:n.get("type"),panning:T==="true"||T===null,lockAlpha:S==="true",lockBeta:C==="true",lockRadius:O==="true",unityMode:n.get("mode"),disableLoader:n.has("disableLoader"),username:n.get("username"),socialEmote:(()=>{const U=n.get("socialEmote");if(!U)return null;try{return JSON.parse(U)}catch{return null}})()}},[n]),r=$5();return Ct.useMemo(()=>{const a={...i,...r},s={};return Object.keys(r).forEach(l=>{r[l]!==void 0&&(s[l]=!0)}),{options:a,overrideSources:s}},[i,r])};function Z5(){const{options:n}=$b(),[t,e,i]=K5("useConfig",()=>X5(n),[n]);return[t,e,i]}function cn(){return window.parent||window}const jI=()=>{const[n,t]=Ct.useState(!1);Ct.useEffect(()=>{n||(Ce.sendMessage(cn(),Ce.PreviewMessageType.READY,null),t(!0))},[n])};function J5(n,t){Ce.sendMessage(cn(),Ce.PreviewMessageType.CONTROLLER_RESPONSE,{id:n,ok:!0,result:t})}function Sd(n,t){Ce.sendMessage(cn(),Ce.PreviewMessageType.CONTROLLER_RESPONSE,{id:n,ok:!1,error:t})}const XI=()=>{const n=Ct.useRef();return HI(async t=>{if(t.data&&t.data.type===Ce.PreviewMessageType.CONTROLLER_REQUEST&&typeof t.data.payload=="object"&&typeof t.data.payload.id=="string"&&typeof t.data.payload.namespace=="string"&&typeof t.data.payload.method=="string"&&typeof t.data.payload.params=="object"&&Array.isArray(t.data.payload.params)){const{id:e,method:i,namespace:r,params:o}=t.data.payload;if(n.current)if(r in n.current)if(i in n.current[r])try{const l=await n.current[r][i].apply(null,o);J5(e,l)}catch(a){Sd(e,a.message)}else Sd(e,"Invalid method");else Sd(e,"Invalid namespace");else Sd(e,"Controller not ready")}}),n};function eX(n){return t=>t.data.category===n}function lf(n){return t=>t.wearable.data.category===n||(t.wearable.data.hides||[]).includes(n)||(t.wearable.data.replaces||[]).includes(n)}function tX(n){return n.some(t=>{var o,a;const e=t.wearable.data.category===Ce.WearableCategory.UPPER_BODY,i=(o=t.wearable.data.hides)==null?void 0:o.includes(Ce.WearableCategory.UPPER_BODY),r=(a=t.wearable.data.removesDefaultHiding)==null?void 0:a.includes(Ce.BodyPartCategory.HANDS);return(e||i)&&!r})}function iX(n){return!!n}function YI(n){const t=qb(n);return!yp(t)}function rX(n){return!YI(n)}function nX(n,t){var s,l,u;const e=n.name.toLowerCase(),i=e.includes("prop")||e.includes("armature_prop"),r=e.includes("avatarother")||e.includes("armature_other"),o=e.includes("avatar")||e.includes("armature")||!i&&!r;return[((s=t==null?void 0:t.Armature_Prop)==null?void 0:s.animation.toLowerCase())===e&&i,((l=t==null?void 0:t.Armature_Other)==null?void 0:l.animation.toLowerCase())===e&&r,((u=t==null?void 0:t.Armature)==null?void 0:u.animation.toLowerCase())===e&&o,!(t!=null&&t.Armature)&&!(t!=null&&t.Armature_Other)&&!(t!=null&&t.Armature_Prop)].some(f=>f)}function oX(n){const t=[...n.transformNodes,...n.meshes],e=new Set(t);return t.filter(i=>!i.parent||!e.has(i.parent))}function aX(n,t){const e=new Map,i=oX(n),r=(a,s)=>{e.set(a,s);const l=a.getChildren(),u=s.getChildren(),f=Math.min(l.length,u.length);for(let c=0;c<f;c++)r(l[c],u[c])},o=Math.min(i.length,t.length);for(let a=0;a<o;a++)r(i[a],t[a]);return e}const sX=(n,t)=>{for(const e of n)e.getChildMeshes().forEach(i=>{if(!i.material)return;const r=i.material.clone(i.material.name+"_Other");if(!r)return;const o=r.name.toLowerCase().includes("skin");if(o&&r instanceof Ci){const a=r.albedoTexture;a&&a.dispose(),r.albedoTexture=void 0;const s=r.bumpTexture;s&&s.dispose(),r.bumpTexture=void 0;const l=r.metallicTexture;l&&l.dispose(),r.metallicTexture=void 0,r.albedoColor=t,r.specularIntensity=0,i.material=r}else if(o&&r instanceof Mt){const a=r.diffuseTexture;a&&a.dispose(),r.diffuseTexture=void 0;const s=r.bumpTexture;s&&s.dispose(),r.bumpTexture=void 0;const l=r.specularTexture;l&&l.dispose(),r.specularTexture=void 0,r.diffuseColor=t,r.specularColor=_e.Black(),i.material=r}else r.dispose(),i.visibility=0})};function lX(n){const t=n.find(l=>l.wearable.data.category===Ce.WearableCategory.BODY_SHAPE);if(!t)return null;const e=n.some(l=>l.wearable.data.category===Ce.WearableCategory.SKIN),i=e||n.some(lf(Ce.WearableCategory.UPPER_BODY)),r=e||n.some(lf(Ce.WearableCategory.LOWER_BODY)),o=e||n.some(lf(Ce.WearableCategory.FEET)),a=e||n.some(lf(Ce.BodyPartCategory.HEAD)),s=e||n.some(lf(Ce.BodyPartCategory.HANDS))||tX(n);for(const l of t.container.meshes){const u=l.name.toLowerCase();u.endsWith("ubody_basemesh")&&i&&l.setEnabled(!1),u.endsWith("lbody_basemesh")&&r&&l.setEnabled(!1),u.endsWith("feet_basemesh")&&o&&l.setEnabled(!1),u.endsWith("head")&&a&&l.setEnabled(!1),u.endsWith("head_basemesh")&&a&&l.setEnabled(!1),u.endsWith("mask_eyes")&&a&&l.setEnabled(!1),u.endsWith("mask_eyebrows")&&a&&l.setEnabled(!1),u.endsWith("mask_mouth")&&a&&l.setEnabled(!1),u.endsWith("hands_basemesh")&&s&&l.setEnabled(!1)}return t}const KI=[Ce.WearableCategory.HELMET,Ce.WearableCategory.HAIR,Ce.WearableCategory.FACIAL_HAIR,Ce.WearableCategory.MOUTH,Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.EYES,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET,Ce.WearableCategory.HANDS_WEAR,Ce.BodyPartCategory.HANDS],uX=[Ce.WearableCategory.SKIN,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.HANDS_WEAR,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET,Ce.WearableCategory.HELMET,Ce.WearableCategory.HAT,Ce.WearableCategory.TOP_HEAD,Ce.WearableCategory.MASK,Ce.WearableCategory.EYEWEAR,Ce.WearableCategory.EARRING,Ce.WearableCategory.TIARA,Ce.WearableCategory.HAIR,Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.EYES,Ce.WearableCategory.MOUTH,Ce.WearableCategory.FACIAL_HAIR,Ce.WearableCategory.BODY_SHAPE];function fX(n){const t=n.data.category,e=n.data.replaces||[],i=n.data.hides||[];return t===Ce.WearableCategory.SKIN&&i.push(...KI),Array.from(new Set([...e,...i])).filter(r=>r!==t)}function cX(n){const t=new Map;let e=[...n.wearables];if(n.item&&as(n.item)){e=[];for(const a of n.wearables){const{category:s,hides:l,replaces:u}=n.item.data;a.data.category==="skin"&&(KI.includes(s)||l&&l.includes(Ce.BodyPartCategory.HEAD)||u&&u.includes(Ce.BodyPartCategory.HEAD))||a.data.hides&&a.data.hides.includes(s)||a.data.replaces&&a.data.replaces.includes(s)||e.push(a)}e.push(n.item)}for(const a of e){const s=a.data.category;Qb(a,n.bodyShape)&&t.set(s,a)}const i=n.forceRender||[],r=new Set;for(const a of uX){const s=t.get(a);if(s&&!r.has(a))for(const l of fX(s))r.add(l)}const o=Array.from(r).filter(a=>!i.includes(a));for(const a of o)t.delete(a);return t}function qI(n,t){n&&(n.useAutoRotationBehavior=!0,n.autoRotationBehavior&&(n.autoRotationBehavior.idleRotationSpeed=t.autoRotateSpeed))}const hX="modulepreload",dX=function(n,t){return new URL(n,t).href},HO={},pX=function(t,e,i){let r=Promise.resolve();if(e&&e.length>0){let a=function(f){return Promise.all(f.map(c=>Promise.resolve(c).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const s=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=a(e.map(f=>{if(f=dX(f,i),f in HO)return;HO[f]=!0;const c=f.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(!!i)for(let g=s.length-1;g>=0;g--){const v=s[g];if(v.href===f&&(!c||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${h}`))return;const _=document.createElement("link");if(_.rel=c?"stylesheet":hX,c||(_.as="script"),_.crossOrigin="",_.href=f,u&&_.setAttribute("nonce",u),document.head.appendChild(_),c)return new Promise((g,v)=>{_.addEventListener("load",g),_.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return r.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};var zt=function(){function n(t,e,i){e===void 0&&(e=n.UNITMODE_PIXEL),i===void 0&&(i=!0),this.unit=e,this.negativeValueAllowed=i,this._value=1,this.ignoreAdaptiveScaling=!1,this._value=t,this._originalUnit=e}return Object.defineProperty(n.prototype,"isPercentage",{get:function(){return this.unit===n.UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isPixel",{get:function(){return this.unit===n.UNITMODE_PIXEL},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"internalValue",{get:function(){return this._value},enumerable:!1,configurable:!0}),n.prototype.getValueInPixel=function(t,e){return this.isPixel?this.getValue(t):this.getValue(t)*e},n.prototype.updateInPlace=function(t,e){return e===void 0&&(e=n.UNITMODE_PIXEL),this._value=t,this.unit=e,this},n.prototype.getValue=function(t){if(t&&!this.ignoreAdaptiveScaling&&this.unit!==n.UNITMODE_PERCENTAGE){var e=0,i=0;if(t.idealWidth&&(e=this._value*t.getSize().width/t.idealWidth),t.idealHeight&&(i=this._value*t.getSize().height/t.idealHeight),t.useSmallestIdeal&&t.idealWidth&&t.idealHeight)return window.innerWidth<window.innerHeight?e:i;if(t.idealWidth)return e;if(t.idealHeight)return i}return this._value},n.prototype.toString=function(t,e){switch(this.unit){case n.UNITMODE_PERCENTAGE:var i=this.getValue(t)*100;return(e?i.toFixed(e):i)+"%";case n.UNITMODE_PIXEL:var r=this.getValue(t);return(e?r.toFixed(e):r)+"px"}return this.unit.toString()},n.prototype.fromString=function(t){var e=n._Regex.exec(t.toString());if(!e||e.length===0)return!1;var i=parseFloat(e[1]),r=this._originalUnit;if(this.negativeValueAllowed||i<0&&(i=0),e.length===4)switch(e[3]){case"px":r=n.UNITMODE_PIXEL;break;case"%":r=n.UNITMODE_PERCENTAGE,i/=100;break}return i===this._value&&r===this.unit?!1:(this._value=i,this.unit=r,!0)},Object.defineProperty(n,"UNITMODE_PERCENTAGE",{get:function(){return n._UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(n,"UNITMODE_PIXEL",{get:function(){return n._UNITMODE_PIXEL},enumerable:!1,configurable:!0}),n._Regex=/(^-?\d*(\.\d+)?)(%|px)?/,n._UNITMODE_PERCENTAGE=0,n._UNITMODE_PIXEL=1,n}(),Vl=[new Ie(0,0),new Ie(0,0),new Ie(0,0),new Ie(0,0)],uf=[new Ie(0,0),new Ie(0,0),new Ie(0,0),new Ie(0,0)],ha=new Ie(0,0),Gs=new Ie(0,0),Jr=function(){function n(t,e,i,r){this.left=t,this.top=e,this.width=i,this.height=r}return n.prototype.copyFrom=function(t){this.left=t.left,this.top=t.top,this.width=t.width,this.height=t.height},n.prototype.copyFromFloats=function(t,e,i,r){this.left=t,this.top=e,this.width=i,this.height=r},n.CombineToRef=function(t,e,i){var r=Math.min(t.left,e.left),o=Math.min(t.top,e.top),a=Math.max(t.left+t.width,e.left+e.width),s=Math.max(t.top+t.height,e.top+e.height);i.left=r,i.top=o,i.width=a-r,i.height=s-o},n.prototype.addAndTransformToRef=function(t,e,i,r,o,a){var s=this.left+e,l=this.top+i,u=this.width+r,f=this.height+o;Vl[0].copyFromFloats(s,l),Vl[1].copyFromFloats(s+u,l),Vl[2].copyFromFloats(s+u,l+f),Vl[3].copyFromFloats(s,l+f),ha.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE),Gs.copyFromFloats(0,0);for(var c=0;c<4;c++)t.transformCoordinates(Vl[c].x,Vl[c].y,uf[c]),ha.x=Math.floor(Math.min(ha.x,uf[c].x)),ha.y=Math.floor(Math.min(ha.y,uf[c].y)),Gs.x=Math.ceil(Math.max(Gs.x,uf[c].x)),Gs.y=Math.ceil(Math.max(Gs.y,uf[c].y));a.left=ha.x,a.top=ha.y,a.width=Gs.x-ha.x,a.height=Gs.y-ha.y},n.prototype.transformToRef=function(t,e){this.addAndTransformToRef(t,0,0,0,0,e)},n.prototype.isEqualsTo=function(t){return!(this.left!==t.left||this.top!==t.top||this.width!==t.width||this.height!==t.height)},n.Empty=function(){return new n(0,0,0,0)},n}(),oy=function(n){j(t,n);function t(e,i){i===void 0&&(i=0);var r=n.call(this,e.x,e.y)||this;return r.buttonIndex=i,r}return t}(Ie),ay=function(){function n(t,e,i,r,o,a){this.m=new Float32Array(6),this.fromValues(t,e,i,r,o,a)}return n.prototype.fromValues=function(t,e,i,r,o,a){return this.m[0]=t,this.m[1]=e,this.m[2]=i,this.m[3]=r,this.m[4]=o,this.m[5]=a,this},n.prototype.determinant=function(){return this.m[0]*this.m[3]-this.m[1]*this.m[2]},n.prototype.invertToRef=function(t){var e=this.m[0],i=this.m[1],r=this.m[2],o=this.m[3],a=this.m[4],s=this.m[5],l=this.determinant();if(l<Zt*Zt)return t.m[0]=0,t.m[1]=0,t.m[2]=0,t.m[3]=0,t.m[4]=0,t.m[5]=0,this;var u=1/l,f=r*s-o*a,c=i*a-e*s;return t.m[0]=o*u,t.m[1]=-i*u,t.m[2]=-r*u,t.m[3]=e*u,t.m[4]=f*u,t.m[5]=c*u,this},n.prototype.multiplyToRef=function(t,e){var i=this.m[0],r=this.m[1],o=this.m[2],a=this.m[3],s=this.m[4],l=this.m[5],u=t.m[0],f=t.m[1],c=t.m[2],h=t.m[3],p=t.m[4],_=t.m[5];return e.m[0]=i*u+r*c,e.m[1]=i*f+r*h,e.m[2]=o*u+a*c,e.m[3]=o*f+a*h,e.m[4]=s*u+l*c+p,e.m[5]=s*f+l*h+_,this},n.prototype.transformCoordinates=function(t,e,i){return i.x=t*this.m[0]+e*this.m[2]+this.m[4],i.y=t*this.m[1]+e*this.m[3]+this.m[5],this},n.Identity=function(){return new n(1,0,0,1,0,0)},n.TranslationToRef=function(t,e,i){i.fromValues(1,0,0,1,t,e)},n.ScalingToRef=function(t,e,i){i.fromValues(t,0,0,e,0,0)},n.RotationToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);e.fromValues(r,i,-i,r,0,0)},n.ComposeToRef=function(t,e,i,r,o,a,s){n.TranslationToRef(t,e,n._TempPreTranslationMatrix),n.ScalingToRef(r,o,n._TempScalingMatrix),n.RotationToRef(i,n._TempRotationMatrix),n.TranslationToRef(-t,-e,n._TempPostTranslationMatrix),n._TempPreTranslationMatrix.multiplyToRef(n._TempScalingMatrix,n._TempCompose0),n._TempCompose0.multiplyToRef(n._TempRotationMatrix,n._TempCompose1),a?(n._TempCompose1.multiplyToRef(n._TempPostTranslationMatrix,n._TempCompose2),n._TempCompose2.multiplyToRef(a,s)):n._TempCompose1.multiplyToRef(n._TempPostTranslationMatrix,s)},n._TempPreTranslationMatrix=n.Identity(),n._TempPostTranslationMatrix=n.Identity(),n._TempRotationMatrix=n.Identity(),n._TempScalingMatrix=n.Identity(),n._TempCompose0=n.Identity(),n._TempCompose1=n.Identity(),n._TempCompose2=n.Identity(),n}(),ot=function(){function n(t){this.name=t,this._alpha=1,this._alphaSet=!1,this._zIndex=0,this._currentMeasure=Jr.Empty(),this._fontFamily="Arial",this._fontStyle="",this._fontWeight="",this._fontSize=new zt(18,zt.UNITMODE_PIXEL,!1),this._width=new zt(1,zt.UNITMODE_PERCENTAGE,!1),this._height=new zt(1,zt.UNITMODE_PERCENTAGE,!1),this._color="",this._style=null,this._horizontalAlignment=n.HORIZONTAL_ALIGNMENT_CENTER,this._verticalAlignment=n.VERTICAL_ALIGNMENT_CENTER,this._isDirty=!0,this._wasDirty=!1,this._tempParentMeasure=Jr.Empty(),this._prevCurrentMeasureTransformedIntoGlobalSpace=Jr.Empty(),this._cachedParentMeasure=Jr.Empty(),this._paddingLeft=new zt(0),this._paddingRight=new zt(0),this._paddingTop=new zt(0),this._paddingBottom=new zt(0),this._left=new zt(0),this._top=new zt(0),this._scaleX=1,this._scaleY=1,this._rotation=0,this._transformCenterX=.5,this._transformCenterY=.5,this._transformMatrix=ay.Identity(),this._invertTransformMatrix=ay.Identity(),this._transformedPosition=Ie.Zero(),this._isMatrixDirty=!0,this._isVisible=!0,this._isHighlighted=!1,this._fontSet=!1,this._dummyVector2=Ie.Zero(),this._downCount=0,this._enterCount=-1,this._doNotRender=!1,this._downPointerIds={},this._isEnabled=!0,this._disabledColor="#9a9a9a",this._disabledColorItem="#6a6a6a",this._rebuildLayout=!1,this._customData={},this._isClipped=!1,this._automaticSize=!1,this.metadata=null,this.isHitTestVisible=!0,this.isPointerBlocker=!1,this.isFocusInvisible=!1,this.clipChildren=!0,this.clipContent=!0,this.useBitmapCache=!1,this._shadowOffsetX=0,this._shadowOffsetY=0,this._shadowBlur=0,this._shadowColor="black",this.hoverCursor="",this._linkOffsetX=new zt(0),this._linkOffsetY=new zt(0),this.onWheelObservable=new ie,this.onPointerMoveObservable=new ie,this.onPointerOutObservable=new ie,this.onPointerDownObservable=new ie,this.onPointerUpObservable=new ie,this.onPointerClickObservable=new ie,this.onPointerEnterObservable=new ie,this.onDirtyObservable=new ie,this.onBeforeDrawObservable=new ie,this.onAfterDrawObservable=new ie,this.onDisposeObservable=new ie,this.fixedRatio=0,this._fixedRatioMasterIsWidth=!0,this._tmpMeasureA=new Jr(0,0,0,0)}return Object.defineProperty(n.prototype,"shadowOffsetX",{get:function(){return this._shadowOffsetX},set:function(t){this._shadowOffsetX!==t&&(this._shadowOffsetX=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shadowOffsetY",{get:function(){return this._shadowOffsetY},set:function(t){this._shadowOffsetY!==t&&(this._shadowOffsetY=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shadowBlur",{get:function(){return this._shadowBlur},set:function(t){this._shadowBlur!==t&&(this._shadowBlur=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shadowColor",{get:function(){return this._shadowColor},set:function(t){this._shadowColor!==t&&(this._shadowColor=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"typeName",{get:function(){return this._getTypeName()},enumerable:!1,configurable:!0}),n.prototype.getClassName=function(){return this._getTypeName()},Object.defineProperty(n.prototype,"host",{get:function(){return this._host},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontOffset",{get:function(){return this._fontOffset},set:function(t){this._fontOffset=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alphaSet=!0,this._alpha=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isHighlighted",{get:function(){return this._isHighlighted},set:function(t){this._isHighlighted!==t&&(this._isHighlighted=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"scaleX",{get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"scaleY",{get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transformCenterY",{get:function(){return this._transformCenterY},set:function(t){this._transformCenterY!==t&&(this._transformCenterY=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transformCenterX",{get:function(){return this._transformCenterX},set:function(t){this._transformCenterX!==t&&(this._transformCenterX=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"horizontalAlignment",{get:function(){return this._horizontalAlignment},set:function(t){this._horizontalAlignment!==t&&(this._horizontalAlignment=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"verticalAlignment",{get:function(){return this._verticalAlignment},set:function(t){this._verticalAlignment!==t&&(this._verticalAlignment=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(t){this._fixedRatioMasterIsWidth=!0,this._width.toString(this._host)!==t&&this._width.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"widthInPixels",{get:function(){return this._width.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this._fixedRatioMasterIsWidth=!0,this.width=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(t){this._fixedRatioMasterIsWidth=!1,this._height.toString(this._host)!==t&&this._height.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"heightInPixels",{get:function(){return this._height.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this._fixedRatioMasterIsWidth=!1,this.height=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontFamily",{get:function(){return this._fontSet?this._fontFamily:""},set:function(t){this._fontFamily!==t&&(this._fontFamily=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this._style},set:function(t){var e=this;this._style&&(this._style.onChangedObservable.remove(this._styleObserver),this._styleObserver=null),this._style=t,this._style&&(this._styleObserver=this._style.onChangedObservable.add(function(){e._markAsDirty(),e._resetFontCache()})),this._markAsDirty(),this._resetFontCache()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_isFontSizeInPercentage",{get:function(){return this._fontSize.isPercentage},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontSizeInPixels",{get:function(){var t=this._style?this._style._fontSize:this._fontSize;return t.isPixel?t.getValue(this._host):t.getValueInPixel(this._host,this._tempParentMeasure.height||this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.fontSize=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontSize",{get:function(){return this._fontSize.toString(this._host)},set:function(t){this._fontSize.toString(this._host)!==t&&this._fontSize.fromString(t)&&(this._markAsDirty(),this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this._color},set:function(t){this._color!==t&&(this._color=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this.zIndex!==t&&(this._zIndex=t,this.parent&&this.parent._reOrderControl(this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"notRenderable",{get:function(){return this._doNotRender},set:function(t){this._doNotRender!==t&&(this._doNotRender=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!==t&&(this._isVisible=t,this._markAsDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkedMesh",{get:function(){return this._linkedMesh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingLeft",{get:function(){return this._paddingLeft.toString(this._host)},set:function(t){this._paddingLeft.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingLeftInPixels",{get:function(){return this._paddingLeft.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.paddingLeft=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingRight",{get:function(){return this._paddingRight.toString(this._host)},set:function(t){this._paddingRight.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingRightInPixels",{get:function(){return this._paddingRight.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.paddingRight=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingTop",{get:function(){return this._paddingTop.toString(this._host)},set:function(t){this._paddingTop.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingTopInPixels",{get:function(){return this._paddingTop.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.paddingTop=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingBottom",{get:function(){return this._paddingBottom.toString(this._host)},set:function(t){this._paddingBottom.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingBottomInPixels",{get:function(){return this._paddingBottom.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.paddingBottom=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"left",{get:function(){return this._left.toString(this._host)},set:function(t){this._left.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"leftInPixels",{get:function(){return this._left.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.left=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"top",{get:function(){return this._top.toString(this._host)},set:function(t){this._top.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"topInPixels",{get:function(){return this._top.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.top=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetX",{get:function(){return this._linkOffsetX.toString(this._host)},set:function(t){this._linkOffsetX.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetXInPixels",{get:function(){return this._linkOffsetX.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.linkOffsetX=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetY",{get:function(){return this._linkOffsetY.toString(this._host)},set:function(t){this._linkOffsetY.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetYInPixels",{get:function(){return this._linkOffsetY.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.linkOffsetY=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"centerX",{get:function(){return this._currentMeasure.left+this._currentMeasure.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"centerY",{get:function(){return this._currentMeasure.top+this._currentMeasure.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(t){this._isEnabled!==t&&(this._isEnabled=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabledColor",{get:function(){return this._disabledColor},set:function(t){this._disabledColor!==t&&(this._disabledColor=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabledColorItem",{get:function(){return this._disabledColorItem},set:function(t){this._disabledColorItem!==t&&(this._disabledColorItem=t,this._markAsDirty())},enumerable:!1,configurable:!0}),n.prototype._getTypeName=function(){return"Control"},n.prototype.getAscendantOfClass=function(t){return this.parent?this.parent.getClassName()===t?this.parent:this.parent.getAscendantOfClass(t):null},n.prototype._resetFontCache=function(){this._fontSet=!0,this._markAsDirty()},n.prototype.isAscendant=function(t){return this.parent?this.parent===t?!0:this.parent.isAscendant(t):!1},n.prototype.getLocalCoordinates=function(t){var e=Ie.Zero();return this.getLocalCoordinatesToRef(t,e),e},n.prototype.getLocalCoordinatesToRef=function(t,e){return e.x=t.x-this._currentMeasure.left,e.y=t.y-this._currentMeasure.top,this},n.prototype.getParentLocalCoordinates=function(t){var e=Ie.Zero();return e.x=t.x-this._cachedParentMeasure.left,e.y=t.y-this._cachedParentMeasure.top,e},n.prototype.moveToVector3=function(t,e){if(!this._host||this.parent!==this._host._rootContainer){Ee.Error("Cannot move a control to a vector3 if the control is not at root level");return}this.horizontalAlignment=n.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=n.VERTICAL_ALIGNMENT_TOP;var i=this._host._getGlobalViewport(e),r=y.Project(t,te.Identity(),e.getTransformMatrix(),i);if(this._moveToProjectedPosition(r),r.z<0||r.z>1){this.notRenderable=!0;return}this.notRenderable=!1},n.prototype.getDescendantsToRef=function(t,e,i){},n.prototype.getDescendants=function(t,e){var i=new Array;return this.getDescendantsToRef(i,t,e),i},n.prototype.linkWithMesh=function(t){if(!this._host||this.parent&&this.parent!==this._host._rootContainer){t&&Ee.Error("Cannot link a control to a mesh if the control is not at root level");return}var e=this._host._linkedControls.indexOf(this);if(e!==-1){this._linkedMesh=t,t||this._host._linkedControls.splice(e,1);return}else if(!t)return;this.horizontalAlignment=n.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=n.VERTICAL_ALIGNMENT_TOP,this._linkedMesh=t,this._host._linkedControls.push(this)},n.prototype._moveToProjectedPosition=function(t){var e=this._left.getValue(this._host),i=this._top.getValue(this._host),r=t.x+this._linkOffsetX.getValue(this._host)-this._currentMeasure.width/2,o=t.y+this._linkOffsetY.getValue(this._host)-this._currentMeasure.height/2;this._left.ignoreAdaptiveScaling&&this._top.ignoreAdaptiveScaling&&(Math.abs(r-e)<.5&&(r=e),Math.abs(o-i)<.5&&(o=i)),this.left=r+"px",this.top=o+"px",this._left.ignoreAdaptiveScaling=!0,this._top.ignoreAdaptiveScaling=!0,this._markAsDirty()},n.prototype._offsetLeft=function(t){this._isDirty=!0,this._currentMeasure.left+=t},n.prototype._offsetTop=function(t){this._isDirty=!0,this._currentMeasure.top+=t},n.prototype._markMatrixAsDirty=function(){this._isMatrixDirty=!0,this._flagDescendantsAsMatrixDirty()},n.prototype._flagDescendantsAsMatrixDirty=function(){},n.prototype._intersectsRect=function(t){return this._currentMeasure.transformToRef(this._transformMatrix,this._tmpMeasureA),!(this._tmpMeasureA.left>=t.left+t.width||this._tmpMeasureA.top>=t.top+t.height||this._tmpMeasureA.left+this._tmpMeasureA.width<=t.left||this._tmpMeasureA.top+this._tmpMeasureA.height<=t.top)},n.prototype.invalidateRect=function(){if(this._transform(),this.host&&this.host.useInvalidateRectOptimization)if(this._currentMeasure.transformToRef(this._transformMatrix,this._tmpMeasureA),Jr.CombineToRef(this._tmpMeasureA,this._prevCurrentMeasureTransformedIntoGlobalSpace,this._tmpMeasureA),this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY){var t=this.shadowOffsetX,e=this.shadowOffsetY,i=this.shadowBlur,r=Math.min(Math.min(t,0)-i*2,0),o=Math.max(Math.max(t,0)+i*2,0),a=Math.min(Math.min(e,0)-i*2,0),s=Math.max(Math.max(e,0)+i*2,0);this.host.invalidateRect(Math.floor(this._tmpMeasureA.left+r),Math.floor(this._tmpMeasureA.top+a),Math.ceil(this._tmpMeasureA.left+this._tmpMeasureA.width+o),Math.ceil(this._tmpMeasureA.top+this._tmpMeasureA.height+s))}else this.host.invalidateRect(Math.floor(this._tmpMeasureA.left),Math.floor(this._tmpMeasureA.top),Math.ceil(this._tmpMeasureA.left+this._tmpMeasureA.width),Math.ceil(this._tmpMeasureA.top+this._tmpMeasureA.height))},n.prototype._markAsDirty=function(t){t===void 0&&(t=!1),!(!this._isVisible&&!t)&&(this._isDirty=!0,this._host&&this._host.markAsDirty())},n.prototype._markAllAsDirty=function(){this._markAsDirty(),this._font&&this._prepareFont()},n.prototype._link=function(t){this._host=t,this._host&&(this.uniqueId=this._host.getScene().getUniqueId())},n.prototype._transform=function(t){if(!(!this._isMatrixDirty&&this._scaleX===1&&this._scaleY===1&&this._rotation===0)){var e=this._currentMeasure.width*this._transformCenterX+this._currentMeasure.left,i=this._currentMeasure.height*this._transformCenterY+this._currentMeasure.top;t&&(t.translate(e,i),t.rotate(this._rotation),t.scale(this._scaleX,this._scaleY),t.translate(-e,-i)),(this._isMatrixDirty||this._cachedOffsetX!==e||this._cachedOffsetY!==i)&&(this._cachedOffsetX=e,this._cachedOffsetY=i,this._isMatrixDirty=!1,this._flagDescendantsAsMatrixDirty(),ay.ComposeToRef(-e,-i,this._rotation,this._scaleX,this._scaleY,this.parent?this.parent._transformMatrix:null,this._transformMatrix),this._transformMatrix.invertToRef(this._invertTransformMatrix))}},n.prototype._renderHighlight=function(t){this.isHighlighted&&(t.save(),t.strokeStyle="#4affff",t.lineWidth=2,this._renderHighlightSpecific(t),t.restore())},n.prototype._renderHighlightSpecific=function(t){t.strokeRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)},n.prototype._applyStates=function(t){this._isFontSizeInPercentage&&(this._fontSet=!0),this._fontSet&&(this._prepareFont(),this._fontSet=!1),this._font&&(t.font=this._font),this._color&&(t.fillStyle=this._color),n.AllowAlphaInheritance?t.globalAlpha*=this._alpha:this._alphaSet&&(t.globalAlpha=this.parent?this.parent.alpha*this._alpha:this._alpha)},n.prototype._layout=function(t,e){if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;if(this._isDirty||!this._cachedParentMeasure.isEqualsTo(t)){this.host._numLayoutCalls++,this._currentMeasure.addAndTransformToRef(this._transformMatrix,-this.paddingLeftInPixels|0,-this.paddingTopInPixels|0,this.paddingRightInPixels|0,this.paddingBottomInPixels|0,this._prevCurrentMeasureTransformedIntoGlobalSpace),e.save(),this._applyStates(e);var i=0;do this._rebuildLayout=!1,this._processMeasures(t,e),i++;while(this._rebuildLayout&&i<3);i>=3&&de.Error("Layout cycle detected in GUI (Control name="+this.name+", uniqueId="+this.uniqueId+")"),e.restore(),this.invalidateRect(),this._evaluateClippingState(t)}return this._wasDirty=this._isDirty,this._isDirty=!1,!0},n.prototype._processMeasures=function(t,e){this._currentMeasure.copyFrom(t),this._preMeasure(t,e),this._measure(),this._computeAlignment(t,e),this._currentMeasure.left=this._currentMeasure.left|0,this._currentMeasure.top=this._currentMeasure.top|0,this._currentMeasure.width=this._currentMeasure.width|0,this._currentMeasure.height=this._currentMeasure.height|0,this._additionalProcessing(t,e),this._cachedParentMeasure.copyFrom(t),this.onDirtyObservable.hasObservers()&&this.onDirtyObservable.notifyObservers(this)},n.prototype._evaluateClippingState=function(t){if(this.parent&&this.parent.clipChildren){if(this._currentMeasure.left>t.left+t.width){this._isClipped=!0;return}if(this._currentMeasure.left+this._currentMeasure.width<t.left){this._isClipped=!0;return}if(this._currentMeasure.top>t.top+t.height){this._isClipped=!0;return}if(this._currentMeasure.top+this._currentMeasure.height<t.top){this._isClipped=!0;return}}this._isClipped=!1},n.prototype._measure=function(){this._width.isPixel?this._currentMeasure.width=this._width.getValue(this._host):this._currentMeasure.width*=this._width.getValue(this._host),this._height.isPixel?this._currentMeasure.height=this._height.getValue(this._host):this._currentMeasure.height*=this._height.getValue(this._host),this.fixedRatio!==0&&(this._fixedRatioMasterIsWidth?this._currentMeasure.height=this._currentMeasure.width*this.fixedRatio:this._currentMeasure.width=this._currentMeasure.height*this.fixedRatio)},n.prototype._computeAlignment=function(t,e){var i=this._currentMeasure.width,r=this._currentMeasure.height,o=t.width,a=t.height,s=0,l=0;switch(this.horizontalAlignment){case n.HORIZONTAL_ALIGNMENT_LEFT:s=0;break;case n.HORIZONTAL_ALIGNMENT_RIGHT:s=o-i;break;case n.HORIZONTAL_ALIGNMENT_CENTER:s=(o-i)/2;break}switch(this.verticalAlignment){case n.VERTICAL_ALIGNMENT_TOP:l=0;break;case n.VERTICAL_ALIGNMENT_BOTTOM:l=a-r;break;case n.VERTICAL_ALIGNMENT_CENTER:l=(a-r)/2;break}this._paddingLeft.isPixel?(this._currentMeasure.left+=this._paddingLeft.getValue(this._host),this._currentMeasure.width-=this._paddingLeft.getValue(this._host)):(this._currentMeasure.left+=o*this._paddingLeft.getValue(this._host),this._currentMeasure.width-=o*this._paddingLeft.getValue(this._host)),this._paddingRight.isPixel?this._currentMeasure.width-=this._paddingRight.getValue(this._host):this._currentMeasure.width-=o*this._paddingRight.getValue(this._host),this._paddingTop.isPixel?(this._currentMeasure.top+=this._paddingTop.getValue(this._host),this._currentMeasure.height-=this._paddingTop.getValue(this._host)):(this._currentMeasure.top+=a*this._paddingTop.getValue(this._host),this._currentMeasure.height-=a*this._paddingTop.getValue(this._host)),this._paddingBottom.isPixel?this._currentMeasure.height-=this._paddingBottom.getValue(this._host):this._currentMeasure.height-=a*this._paddingBottom.getValue(this._host),this._left.isPixel?this._currentMeasure.left+=this._left.getValue(this._host):this._currentMeasure.left+=o*this._left.getValue(this._host),this._top.isPixel?this._currentMeasure.top+=this._top.getValue(this._host):this._currentMeasure.top+=a*this._top.getValue(this._host),this._currentMeasure.left+=s,this._currentMeasure.top+=l},n.prototype._preMeasure=function(t,e){},n.prototype._additionalProcessing=function(t,e){},n.prototype._clipForChildren=function(t){},n.prototype._clip=function(t,e){if(t.beginPath(),n._ClipMeasure.copyFrom(this._currentMeasure),e){e.transformToRef(this._invertTransformMatrix,this._tmpMeasureA);var i=new Jr(0,0,0,0);i.left=Math.max(this._tmpMeasureA.left,this._currentMeasure.left),i.top=Math.max(this._tmpMeasureA.top,this._currentMeasure.top),i.width=Math.min(this._tmpMeasureA.left+this._tmpMeasureA.width,this._currentMeasure.left+this._currentMeasure.width)-i.left,i.height=Math.min(this._tmpMeasureA.top+this._tmpMeasureA.height,this._currentMeasure.top+this._currentMeasure.height)-i.top,n._ClipMeasure.copyFrom(i)}if(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY){var r=this.shadowOffsetX,o=this.shadowOffsetY,a=this.shadowBlur,s=Math.min(Math.min(r,0)-a*2,0),l=Math.max(Math.max(r,0)+a*2,0),u=Math.min(Math.min(o,0)-a*2,0),f=Math.max(Math.max(o,0)+a*2,0);t.rect(n._ClipMeasure.left+s,n._ClipMeasure.top+u,n._ClipMeasure.width+l-s,n._ClipMeasure.height+f-u)}else t.rect(n._ClipMeasure.left,n._ClipMeasure.top,n._ClipMeasure.width,n._ClipMeasure.height);t.clip()},n.prototype._render=function(t,e){return!this.isVisible||this.notRenderable||this._isClipped?(this._isDirty=!1,!1):(this.host._numRenderCalls++,t.save(),this._applyStates(t),this._transform(t),this.clipContent&&this._clip(t,e),this.onBeforeDrawObservable.hasObservers()&&this.onBeforeDrawObservable.notifyObservers(this),this.useBitmapCache&&!this._wasDirty&&this._cacheData?t.putImageData(this._cacheData,this._currentMeasure.left,this._currentMeasure.top):this._draw(t,e),this.useBitmapCache&&this._wasDirty&&(this._cacheData=t.getImageData(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._renderHighlight(t),this.onAfterDrawObservable.hasObservers()&&this.onAfterDrawObservable.notifyObservers(this),t.restore(),!0)},n.prototype._draw=function(t,e){},n.prototype.contains=function(t,e){return this._invertTransformMatrix.transformCoordinates(t,e,this._transformedPosition),t=this._transformedPosition.x,e=this._transformedPosition.y,t<this._currentMeasure.left||t>this._currentMeasure.left+this._currentMeasure.width||e<this._currentMeasure.top||e>this._currentMeasure.top+this._currentMeasure.height?!1:(this.isPointerBlocker&&(this._host._shouldBlockPointer=!0),!0)},n.prototype._processPicking=function(t,e,i,r,o,a,s,l){return!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this._doNotRender||!this.contains(t,e)?!1:(this._processObservables(r,t,e,i,o,a,s,l),!0)},n.prototype._onPointerMove=function(t,e,i,r){var o=this.onPointerMoveObservable.notifyObservers(e,-1,t,this,r);o&&this.parent!=null&&this.parent._onPointerMove(t,e,i,r)},n.prototype._onPointerEnter=function(t,e){if(!this._isEnabled||this._enterCount>0)return!1;this._enterCount===-1&&(this._enterCount=0),this._enterCount++;var i=this.onPointerEnterObservable.notifyObservers(this,-1,t,this,e);return i&&this.parent!=null&&this.parent._onPointerEnter(t,e),!0},n.prototype._onPointerOut=function(t,e,i){if(i===void 0&&(i=!1),!(!i&&(!this._isEnabled||t===this))){this._enterCount=0;var r=!0;t.isAscendant(this)||(r=this.onPointerOutObservable.notifyObservers(this,-1,t,this,e)),r&&this.parent!=null&&this.parent._onPointerOut(t,e,i)}},n.prototype._onPointerDown=function(t,e,i,r,o){if(this._onPointerEnter(this,o),this._downCount!==0)return!1;this._downCount++,this._downPointerIds[i]=!0;var a=this.onPointerDownObservable.notifyObservers(new oy(e,r),-1,t,this,o);return a&&this.parent!=null&&this.parent._onPointerDown(t,e,i,r,o),!0},n.prototype._onPointerUp=function(t,e,i,r,o,a){if(this._isEnabled){this._downCount=0,delete this._downPointerIds[i];var s=o;o&&(this._enterCount>0||this._enterCount===-1)&&(s=this.onPointerClickObservable.notifyObservers(new oy(e,r),-1,t,this,a));var l=this.onPointerUpObservable.notifyObservers(new oy(e,r),-1,t,this,a);l&&this.parent!=null&&this.parent._onPointerUp(t,e,i,r,s,a)}},n.prototype._forcePointerUp=function(t){if(t===void 0&&(t=null),t!==null)this._onPointerUp(this,Ie.Zero(),t,0,!0);else for(var e in this._downPointerIds)this._onPointerUp(this,Ie.Zero(),+e,0,!0)},n.prototype._onWheelScroll=function(t,e){if(this._isEnabled){var i=this.onWheelObservable.notifyObservers(new Ie(t,e));i&&this.parent!=null&&this.parent._onWheelScroll(t,e)}},n.prototype._onCanvasBlur=function(){},n.prototype._processObservables=function(t,e,i,r,o,a,s,l){if(!this._isEnabled)return!1;if(this._dummyVector2.copyFromFloats(e,i),t===He.POINTERMOVE){this._onPointerMove(this,this._dummyVector2,o,r);var u=this._host._lastControlOver[o];return u&&u!==this&&u._onPointerOut(this,r),u!==this&&this._onPointerEnter(this,r),this._host._lastControlOver[o]=this,!0}return t===He.POINTERDOWN?(this._onPointerDown(this,this._dummyVector2,o,a,r),this._host._registerLastControlDown(this,o),this._host._lastPickedControl=this,!0):t===He.POINTERUP?(this._host._lastControlDown[o]&&this._host._lastControlDown[o]._onPointerUp(this,this._dummyVector2,o,a,!0,r),delete this._host._lastControlDown[o],!0):t===He.POINTERWHEEL&&this._host._lastControlOver[o]?(this._host._lastControlOver[o]._onWheelScroll(s,l),!0):!1},n.prototype._prepareFont=function(){!this._font&&!this._fontSet||(this._style?this._font=this._style.fontStyle+" "+this._style.fontWeight+" "+this.fontSizeInPixels+"px "+this._style.fontFamily:this._font=this._fontStyle+" "+this._fontWeight+" "+this.fontSizeInPixels+"px "+this._fontFamily,this._fontOffset=n._GetFontOffset(this._font))},n.prototype.dispose=function(){if(this.onDirtyObservable.clear(),this.onBeforeDrawObservable.clear(),this.onAfterDrawObservable.clear(),this.onPointerDownObservable.clear(),this.onPointerEnterObservable.clear(),this.onPointerMoveObservable.clear(),this.onPointerOutObservable.clear(),this.onPointerUpObservable.clear(),this.onPointerClickObservable.clear(),this.onWheelObservable.clear(),this._styleObserver&&this._style&&(this._style.onChangedObservable.remove(this._styleObserver),this._styleObserver=null),this.parent&&(this.parent.removeControl(this),this.parent=null),this._host){var t=this._host._linkedControls.indexOf(this);t>-1&&this.linkWithMesh(null)}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},Object.defineProperty(n,"HORIZONTAL_ALIGNMENT_LEFT",{get:function(){return n._HORIZONTAL_ALIGNMENT_LEFT},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HORIZONTAL_ALIGNMENT_RIGHT",{get:function(){return n._HORIZONTAL_ALIGNMENT_RIGHT},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HORIZONTAL_ALIGNMENT_CENTER",{get:function(){return n._HORIZONTAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),Object.defineProperty(n,"VERTICAL_ALIGNMENT_TOP",{get:function(){return n._VERTICAL_ALIGNMENT_TOP},enumerable:!1,configurable:!0}),Object.defineProperty(n,"VERTICAL_ALIGNMENT_BOTTOM",{get:function(){return n._VERTICAL_ALIGNMENT_BOTTOM},enumerable:!1,configurable:!0}),Object.defineProperty(n,"VERTICAL_ALIGNMENT_CENTER",{get:function(){return n._VERTICAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),n._GetFontOffset=function(t){if(n._FontHeightSizes[t])return n._FontHeightSizes[t];var e=document.createElement("span");e.innerHTML="Hg",e.style.font=t;var i=document.createElement("div");i.style.display="inline-block",i.style.width="1px",i.style.height="0px",i.style.verticalAlign="bottom";var r=document.createElement("div");r.style.whiteSpace="nowrap",r.appendChild(e),r.appendChild(i),document.body.appendChild(r);var o=0,a=0;try{a=i.getBoundingClientRect().top-e.getBoundingClientRect().top,i.style.verticalAlign="baseline",o=i.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(r)}var s={ascent:o,height:a,descent:a-o};return n._FontHeightSizes[t]=s,s},n.drawEllipse=function(t,e,i,r,o){o.translate(t,e),o.scale(i,r),o.beginPath(),o.arc(0,0,1,0,2*Math.PI),o.closePath(),o.scale(1/i,1/r),o.translate(-t,-e)},n.AllowAlphaInheritance=!1,n._ClipMeasure=new Jr(0,0,0,0),n._HORIZONTAL_ALIGNMENT_LEFT=0,n._HORIZONTAL_ALIGNMENT_RIGHT=1,n._HORIZONTAL_ALIGNMENT_CENTER=2,n._VERTICAL_ALIGNMENT_TOP=0,n._VERTICAL_ALIGNMENT_BOTTOM=1,n._VERTICAL_ALIGNMENT_CENTER=2,n._FontHeightSizes={},n.AddHeader=function(){},n}();Ae.RegisteredTypes["BABYLON.GUI.Control"]=ot;var ao=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._children=new Array,i._measureForChildren=Jr.Empty(),i._background="",i._adaptWidthToChildren=!1,i._adaptHeightToChildren=!1,i.logLayoutCycleErrors=!1,i.maxLayoutCycle=3,i}return Object.defineProperty(t.prototype,"adaptHeightToChildren",{get:function(){return this._adaptHeightToChildren},set:function(e){this._adaptHeightToChildren!==e&&(this._adaptHeightToChildren=e,e&&(this.height="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adaptWidthToChildren",{get:function(){return this._adaptWidthToChildren},set:function(e){this._adaptWidthToChildren!==e&&(this._adaptWidthToChildren=e,e&&(this.width="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Container"},t.prototype._flagDescendantsAsMatrixDirty=function(){for(var e=0,i=this.children;e<i.length;e++){var r=i[e];r._markMatrixAsDirty()}},t.prototype.getChildByName=function(e){for(var i=0,r=this.children;i<r.length;i++){var o=r[i];if(o.name===e)return o}return null},t.prototype.getChildByType=function(e,i){for(var r=0,o=this.children;r<o.length;r++){var a=o[r];if(a.typeName===i)return a}return null},t.prototype.containsControl=function(e){return this.children.indexOf(e)!==-1},t.prototype.addControl=function(e){if(!e)return this;var i=this._children.indexOf(e);return i!==-1?this:(e._link(this._host),e._markAllAsDirty(),this._reOrderControl(e),this._markAsDirty(),this)},t.prototype.clearControls=function(){for(var e=this.children.slice(),i=0,r=e;i<r.length;i++){var o=r[i];this.removeControl(o)}return this},t.prototype.removeControl=function(e){var i=this._children.indexOf(e);return i!==-1&&(this._children.splice(i,1),e.parent=null),e.linkWithMesh(null),this._host&&this._host._cleanControlAfterRemoval(e),this._markAsDirty(),this},t.prototype._reOrderControl=function(e){this.removeControl(e);for(var i=!1,r=0;r<this._children.length;r++)if(this._children[r].zIndex>e.zIndex){this._children.splice(r,0,e),i=!0;break}i||this._children.push(e),e.parent=this,this._markAsDirty()},t.prototype._offsetLeft=function(e){n.prototype._offsetLeft.call(this,e);for(var i=0,r=this._children;i<r.length;i++){var o=r[i];o._offsetLeft(e)}},t.prototype._offsetTop=function(e){n.prototype._offsetTop.call(this,e);for(var i=0,r=this._children;i<r.length;i++){var o=r[i];o._offsetTop(e)}},t.prototype._markAllAsDirty=function(){n.prototype._markAllAsDirty.call(this);for(var e=0;e<this._children.length;e++)this._children[e]._markAllAsDirty()},t.prototype._localDraw=function(e){this._background&&(e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),e.fillStyle=this._background,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height),e.restore())},t.prototype._link=function(e){n.prototype._link.call(this,e);for(var i=0,r=this._children;i<r.length;i++){var o=r[i];o._link(e)}},t.prototype._beforeLayout=function(){},t.prototype._processMeasures=function(e,i){(this._isDirty||!this._cachedParentMeasure.isEqualsTo(e))&&(n.prototype._processMeasures.call(this,e,i),this._evaluateClippingState(e))},t.prototype._layout=function(e,i){if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;this.host._numLayoutCalls++,this._isDirty&&this._currentMeasure.transformToRef(this._transformMatrix,this._prevCurrentMeasureTransformedIntoGlobalSpace);var r=0;i.save(),this._applyStates(i),this._beforeLayout();do{var o=-1,a=-1;if(this._rebuildLayout=!1,this._processMeasures(e,i),!this._isClipped){for(var s=0,l=this._children;s<l.length;s++){var u=l[s];u._tempParentMeasure.copyFrom(this._measureForChildren),u._layout(this._measureForChildren,i)&&(this.adaptWidthToChildren&&u._width.isPixel&&(o=Math.max(o,u._currentMeasure.width+u.paddingLeftInPixels+u.paddingRightInPixels)),this.adaptHeightToChildren&&u._height.isPixel&&(a=Math.max(a,u._currentMeasure.height+u.paddingTopInPixels+u.paddingBottomInPixels)))}this.adaptWidthToChildren&&o>=0&&(o+=this.paddingLeftInPixels+this.paddingRightInPixels,this.width!==o+"px"&&(this.width=o+"px",this._rebuildLayout=!0)),this.adaptHeightToChildren&&a>=0&&(a+=this.paddingTopInPixels+this.paddingBottomInPixels,this.height!==a+"px"&&(this.height=a+"px",this._rebuildLayout=!0)),this._postMeasure()}r++}while(this._rebuildLayout&&r<this.maxLayoutCycle);return r>=3&&this.logLayoutCycleErrors&&de.Error("Layout cycle detected in GUI (Container name="+this.name+", uniqueId="+this.uniqueId+")"),i.restore(),this._isDirty&&(this.invalidateRect(),this._isDirty=!1),!0},t.prototype._postMeasure=function(){},t.prototype._draw=function(e,i){this._localDraw(e),this.clipChildren&&this._clipForChildren(e);for(var r=0,o=this._children;r<o.length;r++){var a=o[r];i&&!a._intersectsRect(i)||a._render(e,i)}},t.prototype.getDescendantsToRef=function(e,i,r){if(i===void 0&&(i=!1),!!this.children)for(var o=0;o<this.children.length;o++){var a=this.children[o];(!r||r(a))&&e.push(a),i||a.getDescendantsToRef(e,!1,r)}},t.prototype._processPicking=function(e,i,r,o,a,s,l,u){if(!this._isEnabled||!this.isVisible||this.notRenderable||!n.prototype.contains.call(this,e,i))return!1;for(var f=this._children.length-1;f>=0;f--){var c=this._children[f];if(c._processPicking(e,i,r,o,a,s,l,u))return c.hoverCursor&&this._host._changeCursor(c.hoverCursor),!0}return this.isHitTestVisible?this._processObservables(o,e,i,r,a,s,l,u):!1},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.copyFrom(this._currentMeasure)},t.prototype.dispose=function(){n.prototype.dispose.call(this);for(var e=this.children.length-1;e>=0;e--)this.children[e].dispose()},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.Container"]=ao;var so=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._thickness=1,i._cornerRadius=0,i}return Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cornerRadius",{get:function(){return this._cornerRadius},set:function(e){e<0&&(e=0),this._cornerRadius!==e&&(this._cornerRadius=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Rectangle"},t.prototype._localDraw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._background&&(e.fillStyle=this._background,this._cornerRadius?(this._drawRoundedRect(e,this._thickness/2),e.fill()):e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._thickness&&((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this.color&&(e.strokeStyle=this.color),e.lineWidth=this._thickness,this._cornerRadius?(this._drawRoundedRect(e,this._thickness/2),e.stroke()):e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness)),e.restore()},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.width-=2*this._thickness,this._measureForChildren.height-=2*this._thickness,this._measureForChildren.left+=this._thickness,this._measureForChildren.top+=this._thickness},t.prototype._drawRoundedRect=function(e,i){i===void 0&&(i=0);var r=this._currentMeasure.left+i,o=this._currentMeasure.top+i,a=this._currentMeasure.width-i*2,s=this._currentMeasure.height-i*2,l=Math.min(s/2-2,Math.min(a/2-2,this._cornerRadius));e.beginPath(),e.moveTo(r+l,o),e.lineTo(r+a-l,o),e.quadraticCurveTo(r+a,o,r+a,o+l),e.lineTo(r+a,o+s-l),e.quadraticCurveTo(r+a,o+s,r+a-l,o+s),e.lineTo(r+l,o+s),e.quadraticCurveTo(r,o+s,r,o+s-l),e.lineTo(r,o+l),e.quadraticCurveTo(r,o,r+l,o),e.closePath()},t.prototype._clipForChildren=function(e){this._cornerRadius&&(this._drawRoundedRect(e,this._thickness),e.clip())},t}(ao);Ae.RegisteredTypes["BABYLON.GUI.Rectangle"]=so;var $l;(function(n){n[n.Clip=0]="Clip",n[n.WordWrap=1]="WordWrap",n[n.Ellipsis=2]="Ellipsis"})($l||($l={}));var Mn=function(n){j(t,n);function t(e,i){i===void 0&&(i="");var r=n.call(this,e)||this;return r.name=e,r._text="",r._textWrapping=$l.Clip,r._textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,r._textVerticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,r._resizeToFit=!1,r._lineSpacing=new zt(0),r._outlineWidth=0,r._outlineColor="white",r._underline=!1,r._lineThrough=!1,r.onTextChangedObservable=new ie,r.onLinesReadyObservable=new ie,r.text=i,r}return Object.defineProperty(t.prototype,"lines",{get:function(){return this._lines},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resizeToFit",{get:function(){return this._resizeToFit},set:function(e){this._resizeToFit!==e&&(this._resizeToFit=e,this._resizeToFit&&(this._width.ignoreAdaptiveScaling=!0,this._height.ignoreAdaptiveScaling=!0),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textWrapping",{get:function(){return this._textWrapping},set:function(e){this._textWrapping!==e&&(this._textWrapping=+e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._markAsDirty(),this.onTextChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textHorizontalAlignment",{get:function(){return this._textHorizontalAlignment},set:function(e){this._textHorizontalAlignment!==e&&(this._textHorizontalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textVerticalAlignment",{get:function(){return this._textVerticalAlignment},set:function(e){this._textVerticalAlignment!==e&&(this._textVerticalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineSpacing",{get:function(){return this._lineSpacing.toString(this._host)},set:function(e){this._lineSpacing.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outlineWidth",{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underline",{get:function(){return this._underline},set:function(e){this._underline!==e&&(this._underline=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineThrough",{get:function(){return this._lineThrough},set:function(e){this._lineThrough!==e&&(this._lineThrough=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outlineColor",{get:function(){return this._outlineColor},set:function(e){this._outlineColor!==e&&(this._outlineColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"TextBlock"},t.prototype._processMeasures=function(e,i){this._fontOffset||(this._fontOffset=ot._GetFontOffset(i.font)),n.prototype._processMeasures.call(this,e,i),this._lines=this._breakLines(this._currentMeasure.width,i),this.onLinesReadyObservable.notifyObservers(this);for(var r=0,o=0;o<this._lines.length;o++){var a=this._lines[o];a.width>r&&(r=a.width)}if(this._resizeToFit){if(this._textWrapping===$l.Clip){var s=this.paddingLeftInPixels+this.paddingRightInPixels+r|0;s!==this._width.internalValue&&(this._width.updateInPlace(s,zt.UNITMODE_PIXEL),this._rebuildLayout=!0)}var l=this.paddingTopInPixels+this.paddingBottomInPixels+this._fontOffset.height*this._lines.length|0;if(this._lines.length>0&&this._lineSpacing.internalValue!==0){var u=0;this._lineSpacing.isPixel?u=this._lineSpacing.getValue(this._host):u=this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height),l+=(this._lines.length-1)*u}l!==this._height.internalValue&&(this._height.updateInPlace(l,zt.UNITMODE_PIXEL),this._rebuildLayout=!0)}},t.prototype._drawText=function(e,i,r,o){var a=this._currentMeasure.width,s=0;switch(this._textHorizontalAlignment){case ot.HORIZONTAL_ALIGNMENT_LEFT:s=0;break;case ot.HORIZONTAL_ALIGNMENT_RIGHT:s=a-i;break;case ot.HORIZONTAL_ALIGNMENT_CENTER:s=(a-i)/2;break}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&o.strokeText(e,this._currentMeasure.left+s,r),o.fillText(e,this._currentMeasure.left+s,r),this._underline&&(o.beginPath(),o.lineWidth=Math.round(this.fontSizeInPixels*.05),o.moveTo(this._currentMeasure.left+s,r+3),o.lineTo(this._currentMeasure.left+s+i,r+3),o.stroke(),o.closePath()),this._lineThrough&&(o.beginPath(),o.lineWidth=Math.round(this.fontSizeInPixels*.05),o.moveTo(this._currentMeasure.left+s,r-this.fontSizeInPixels/3),o.lineTo(this._currentMeasure.left+s+i,r-this.fontSizeInPixels/3),o.stroke(),o.closePath())},t.prototype._draw=function(e,i){e.save(),this._applyStates(e),this._renderLines(e),e.restore()},t.prototype._applyStates=function(e){n.prototype._applyStates.call(this,e),this.outlineWidth&&(e.lineWidth=this.outlineWidth,e.strokeStyle=this.outlineColor,e.lineJoin="miter",e.miterLimit=2)},t.prototype._breakLines=function(e,i){var r=[],o=this.text.split(`
|
|
13296
|
+
\r`),a=0;a<r;a++){var s=o[a].split(",").map(Number),l=e._createTileBuffer(s);e._tileMaps[a].dispose(),e._tileMaps[a]=l}e._material.setTextureArray("tileMap",e._tileMaps)},i.send()},n.prototype.dispose=function(){this._output.dispose(),this._material.dispose(),this._animationMap.dispose(),this._tileMaps.forEach(function(t){t.dispose()}),this._frameMap.dispose()},n}(),R8=function(n){j(t,n);function t(e,i,r,o,a,s,l){a===void 0&&(a=null),s===void 0&&(s=.01),l===void 0&&(l=he.TRILINEAR_SAMPLINGMODE);var u=n.call(this,e,i,r,64,o,s,l,!0,a)||this;return u.name=e,u}return t}(n5),ya;(function(n){n[n.INIT=0]="INIT",n[n.RUNNING=1]="RUNNING",n[n.DONE=2]="DONE",n[n.ERROR=3]="ERROR"})(ya||(ya={}));var Ra=function(){function n(t){this.name=t,this._isCompleted=!1,this._taskState=ya.INIT}return Object.defineProperty(n.prototype,"isCompleted",{get:function(){return this._isCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"taskState",{get:function(){return this._taskState},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"errorObject",{get:function(){return this._errorObject},enumerable:!1,configurable:!0}),n.prototype._setErrorObject=function(t,e){this._errorObject||(this._errorObject={message:t,exception:e})},n.prototype.run=function(t,e,i){var r=this;this._taskState=ya.RUNNING,this.runTask(t,function(){r.onDoneCallback(e,i)},function(o,a){r.onErrorCallback(i,o,a)})},n.prototype.runTask=function(t,e,i){throw new Error("runTask is not implemented")},n.prototype.reset=function(){this._taskState=ya.INIT},n.prototype.onErrorCallback=function(t,e,i){this._taskState=ya.ERROR,this._errorObject={message:e,exception:i},this.onError&&this.onError(this,e,i),t()},n.prototype.onDoneCallback=function(t,e){try{this._taskState=ya.DONE,this._isCompleted=!0,this.onSuccess&&this.onSuccess(this),t()}catch(i){this.onErrorCallback(e,"Task is done, error executing success callback(s)",i)}},n}(),u5=function(){function n(t,e,i){this.remainingCount=t,this.totalCount=e,this.task=i}return n}(),f5=function(n){j(t,n);function t(e,i,r,o){var a=n.call(this,e)||this;return a.name=e,a.meshesNames=i,a.rootUrl=r,a.sceneFilename=o,a}return t.prototype.runTask=function(e,i,r){var o=this;$t.LoadAssetContainer(this.rootUrl,this.sceneFilename,e,function(a){o.loadedContainer=a,o.loadedMeshes=a.meshes,o.loadedParticleSystems=a.particleSystems,o.loadedSkeletons=a.skeletons,o.loadedAnimationGroups=a.animationGroups,i()},null,function(a,s,l){r(s,l)})},t}(Ra),c5=function(n){j(t,n);function t(e,i,r,o){var a=n.call(this,e)||this;return a.name=e,a.meshesNames=i,a.rootUrl=r,a.sceneFilename=o,a}return t.prototype.runTask=function(e,i,r){var o=this;$t.ImportMesh(this.meshesNames,this.rootUrl,this.sceneFilename,e,function(a,s,l,u){o.loadedMeshes=a,o.loadedParticleSystems=s,o.loadedSkeletons=l,o.loadedAnimationGroups=u,i()},null,function(a,s,l){r(s,l)})},t}(Ra),h5=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.name=e,r.url=i,r}return t.prototype.runTask=function(e,i,r){var o=this;e._loadFile(this.url,function(a){o.text=a,i()},void 0,!1,!1,function(a,s){a&&r(a.status+" "+a.statusText,s)})},t}(Ra),LI=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.name=e,r.url=i,r}return t.prototype.runTask=function(e,i,r){var o=this;e._loadFile(this.url,function(a){o.data=a,i()},void 0,!0,!0,function(a,s){a&&r(a.status+" "+a.statusText,s)})},t}(Ra),d5=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.name=e,r.url=i,r}return t.prototype.runTask=function(e,i,r){var o=this,a=new Image;Ee.SetCorsBehavior(this.url,a),a.onload=function(){o.image=a,i()},a.onerror=function(s){r("Error loading image",s)},a.src=this.url},t}(Ra),Xb=function(n){j(t,n);function t(e,i,r,o,a){o===void 0&&(o=!0),a===void 0&&(a=he.TRILINEAR_SAMPLINGMODE);var s=n.call(this,e)||this;return s.name=e,s.url=i,s.noMipmap=r,s.invertY=o,s.samplingMode=a,s}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new he(this.url,e,this.noMipmap,this.invertY,this.samplingMode,o,a)},t}(Ra),p5=function(n){j(t,n);function t(e,i,r,o,a){var s=n.call(this,e)||this;return s.name=e,s.url=i,s.extensions=r,s.noMipmap=o,s.files=a,s}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new Yo(this.url,e,this.extensions,this.noMipmap,this.files,o,a)},t}(Ra),_5=function(n){j(t,n);function t(e,i,r,o,a,s,l){o===void 0&&(o=!1),a===void 0&&(a=!0),s===void 0&&(s=!1),l===void 0&&(l=!1);var u=n.call(this,e)||this;return u.name=e,u.url=i,u.size=r,u.noMipmap=o,u.generateHarmonics=a,u.gammaSpace=s,u.reserved=l,u}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new Ub(this.url,e,this.size,this.noMipmap,this.generateHarmonics,this.gammaSpace,this.reserved,o,a)},t}(Ra),m5=function(n){j(t,n);function t(e,i,r,o,a){o===void 0&&(o=!1),a===void 0&&(a=!0);var s=n.call(this,e)||this;return s.name=e,s.url=i,s.size=r,s.noMipmap=o,s.gammaSpace=a,s}return t.prototype.runTask=function(e,i,r){var o=function(){i()},a=function(s,l){r(s,l)};this.texture=new qG(this.url,e,this.size,this.noMipmap,this.gammaSpace,o,a)},t}(Ra),O8=function(){function n(t){this._isLoading=!1,this._tasks=new Array,this._waitingTasksCount=0,this._totalTasksCount=0,this.onTaskSuccessObservable=new ie,this.onTaskErrorObservable=new ie,this.onTasksDoneObservable=new ie,this.onProgressObservable=new ie,this.useDefaultLoadingScreen=!0,this.autoHideLoadingUI=!0,this._scene=t}return n.prototype.addContainerTask=function(t,e,i,r){var o=new f5(t,e,i,r);return this._tasks.push(o),o},n.prototype.addMeshTask=function(t,e,i,r){var o=new c5(t,e,i,r);return this._tasks.push(o),o},n.prototype.addTextFileTask=function(t,e){var i=new h5(t,e);return this._tasks.push(i),i},n.prototype.addBinaryFileTask=function(t,e){var i=new LI(t,e);return this._tasks.push(i),i},n.prototype.addImageTask=function(t,e){var i=new d5(t,e);return this._tasks.push(i),i},n.prototype.addTextureTask=function(t,e,i,r,o){o===void 0&&(o=he.TRILINEAR_SAMPLINGMODE);var a=new Xb(t,e,i,r,o);return this._tasks.push(a),a},n.prototype.addCubeTextureTask=function(t,e,i,r,o){var a=new p5(t,e,i,r,o);return this._tasks.push(a),a},n.prototype.addHDRCubeTextureTask=function(t,e,i,r,o,a,s){r===void 0&&(r=!1),o===void 0&&(o=!0),a===void 0&&(a=!1),s===void 0&&(s=!1);var l=new _5(t,e,i,r,o,a,s);return this._tasks.push(l),l},n.prototype.addEquiRectangularCubeTextureAssetTask=function(t,e,i,r,o){r===void 0&&(r=!1),o===void 0&&(o=!0);var a=new m5(t,e,i,r,o);return this._tasks.push(a),a},n.prototype.removeTask=function(t){var e=this._tasks.indexOf(t);e>-1&&this._tasks.splice(e,1)},n.prototype._decreaseWaitingTasksCount=function(t){this._waitingTasksCount--;try{this.onProgress&&this.onProgress(this._waitingTasksCount,this._totalTasksCount,t),this.onProgressObservable.notifyObservers(new u5(this._waitingTasksCount,this._totalTasksCount,t))}catch(a){de.Error("Error running progress callbacks."),console.log(a)}if(this._waitingTasksCount===0){try{var e=this._tasks.slice();this.onFinish&&this.onFinish(e);for(var i=0,r=e;i<r.length;i++){var t=r[i];if(t.taskState===ya.DONE){var o=this._tasks.indexOf(t);o>-1&&this._tasks.splice(o,1)}}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(a){de.Error("Error running tasks-done callbacks."),console.log(a)}this._isLoading=!1,this.autoHideLoadingUI&&this._scene.getEngine().hideLoadingUI()}},n.prototype._runTask=function(t){var e=this,i=function(){try{e.onTaskSuccess&&e.onTaskSuccess(t),e.onTaskSuccessObservable.notifyObservers(t),e._decreaseWaitingTasksCount(t)}catch(o){r("Error executing task success callbacks",o)}},r=function(o,a){t._setErrorObject(o,a),e.onTaskError&&e.onTaskError(t),e.onTaskErrorObservable.notifyObservers(t),e._decreaseWaitingTasksCount(t)};t.run(this._scene,i,r)},n.prototype.reset=function(){return this._isLoading=!1,this._tasks=new Array,this},n.prototype.load=function(){if(this._isLoading)return this;if(this._isLoading=!0,this._waitingTasksCount=this._tasks.length,this._totalTasksCount=this._tasks.length,this._waitingTasksCount===0)return this._isLoading=!1,this.onFinish&&this.onFinish(this._tasks),this.onTasksDoneObservable.notifyObservers(this._tasks),this;this.useDefaultLoadingScreen&&this._scene.getEngine().displayLoadingUI();for(var t=0;t<this._tasks.length;t++){var e=this._tasks[t];e.taskState===ya.INIT&&this._runTask(e)}return this},n.prototype.loadAsync=function(){var t=this;return new Promise(function(e,i){if(t._isLoading){e();return}t.onTasksDoneObservable.addOnce(function(r){r&&r.length?i(r):e()}),t.load()})},n}(),Nf=function(){function n(){var t=this;this.promise=new Promise(function(e,i){t._resolve=e,t._reject=i})}return Object.defineProperty(n.prototype,"resolve",{get:function(){return this._resolve},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"reject",{get:function(){return this._reject},enumerable:!1,configurable:!0}),n}(),M8=function(){function n(t,e){this._meshesOrigins=[],this._toCenterVectors=[],this._scaledDirection=y.Zero(),this._newPosition=y.Zero(),this._centerPosition=y.Zero(),this._meshes=t.slice(),e?this._centerMesh=e:this._setCenterMesh();var i=this._meshes.indexOf(this._centerMesh);i>=0&&this._meshes.splice(i,1),this._centerPosition=this._centerMesh.getAbsolutePosition().clone();for(var r=0;r<this._meshes.length;r++)if(this._meshes[r]){var o=this._meshes[r];this._meshesOrigins[r]=o.getAbsolutePosition().clone(),this._toCenterVectors[r]=y.Zero(),o._boundingInfo&&this._centerMesh._boundingInfo&&o._boundingInfo.boundingBox.centerWorld.subtractToRef(this._centerMesh._boundingInfo.boundingBox.centerWorld,this._toCenterVectors[r])}}return n.prototype._setCenterMesh=function(){for(var t=y.Zero(),e=y.Zero(),i=Number.MAX_VALUE,r=0;r<this._meshes.length;r++)if(this._meshes[r]){var o=this._meshes[r],a=o.getBoundingInfo();a&&e.addInPlace(a.boundingBox.centerWorld)}t=e.scale(1/this._meshes.length);for(var r=0;r<this._meshes.length;r++)if(this._meshes[r]){var o=this._meshes[r],a=o.getBoundingInfo();if(a){var s=a.boundingBox.centerWorld.subtract(t).lengthSquared();s<i&&(this._centerMesh=o,i=s)}}},n.prototype.getClassName=function(){return"MeshExploder"},n.prototype.getMeshes=function(){var t=this._meshes.slice();return t.unshift(this._centerMesh),t},n.prototype.explode=function(t){t===void 0&&(t=1);for(var e=0;e<this._meshes.length;e++)this._meshes[e]&&this._meshesOrigins[e]&&this._toCenterVectors[e]&&(this._toCenterVectors[e].scaleToRef(t,this._scaledDirection),this._meshesOrigins[e].addToRef(this._scaledDirection,this._newPosition),this._meshes[e].setAbsolutePosition(this._newPosition));this._centerMesh.setAbsolutePosition(this._centerPosition)},n}(),x8=function(){function n(t,e,i,r,o,a,s,l,u){this.onProcessFileCallback=function(){return!0},this._engine=t,this._currentScene=e,this._sceneLoadedCallback=i,this._progressCallback=r,this._additionalRenderLoopLogicCallback=o,this._textureLoadingCallback=a,this._startingProcessingFilesCallback=s,this._onReloadCallback=l,this._errorCallback=u}return Object.defineProperty(n,"FilesToLoad",{get:function(){return Gl.FilesToLoad},enumerable:!1,configurable:!0}),n.prototype.monitorElementForDragNDrop=function(t){var e=this;t&&(this._elementToMonitor=t,this._dragEnterHandler=function(i){e.drag(i)},this._dragOverHandler=function(i){e.drag(i)},this._dropHandler=function(i){e.drop(i)},this._elementToMonitor.addEventListener("dragenter",this._dragEnterHandler,!1),this._elementToMonitor.addEventListener("dragover",this._dragOverHandler,!1),this._elementToMonitor.addEventListener("drop",this._dropHandler,!1))},Object.defineProperty(n.prototype,"filesToLoad",{get:function(){return this._filesToLoad},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){this._elementToMonitor&&(this._elementToMonitor.removeEventListener("dragenter",this._dragEnterHandler),this._elementToMonitor.removeEventListener("dragover",this._dragOverHandler),this._elementToMonitor.removeEventListener("drop",this._dropHandler))},n.prototype.renderFunction=function(){if(this._additionalRenderLoopLogicCallback&&this._additionalRenderLoopLogicCallback(),this._currentScene){if(this._textureLoadingCallback){var t=this._currentScene.getWaitingItemsCount();t>0&&this._textureLoadingCallback(t)}this._currentScene.render()}},n.prototype.drag=function(t){t.stopPropagation(),t.preventDefault()},n.prototype.drop=function(t){t.stopPropagation(),t.preventDefault(),this.loadFiles(t)},n.prototype._traverseFolder=function(t,e,i,r){var o=this,a=t.createReader(),s=t.fullPath.replace(/^\//,"").replace(/(.+?)\/?$/,"$1/");a.readEntries(function(l){i.count+=l.length;for(var u=0,f=l;u<f.length;u++){var c=f[u];c.isFile?c.file(function(h){h.correctName=s+h.name,e.push(h),--i.count===0&&r()}):c.isDirectory&&o._traverseFolder(c,e,i,r)}--i.count===0&&r()})},n.prototype._processFiles=function(t){for(var e=0;e<t.length;e++){var i=t[e].correctName.toLowerCase(),r=i.split(".").pop();this.onProcessFileCallback(t[e],i,r)&&($t.IsPluginForExtensionAvailable("."+r)&&(this._sceneFileToLoad=t[e]),n.FilesToLoad[i]=t[e])}},n.prototype.loadFiles=function(t){var e=this;if(t&&t.dataTransfer&&t.dataTransfer.files&&(this._filesToLoad=t.dataTransfer.files),t&&t.target&&t.target.files&&(this._filesToLoad=t.target.files),!(!this._filesToLoad||this._filesToLoad.length===0)&&(this._startingProcessingFilesCallback&&this._startingProcessingFilesCallback(this._filesToLoad),this._filesToLoad&&this._filesToLoad.length>0)){for(var i=new Array,r=[],o=t.dataTransfer?t.dataTransfer.items:null,a=0;a<this._filesToLoad.length;a++){var s=this._filesToLoad[a],l=s.name.toLowerCase(),u=void 0;if(s.correctName=l,o){var f=o[a];f.getAsEntry?u=f.getAsEntry():f.webkitGetAsEntry&&(u=f.webkitGetAsEntry())}u&&u.isDirectory?r.push(u):i.push(s)}if(r.length===0)this._processFiles(i),this._processReload();else for(var c={count:r.length},h=0,p=r;h<p.length;h++){var _=p[h];this._traverseFolder(_,i,c,function(){e._processFiles(i),c.count===0&&e._processReload()})}}},n.prototype._processReload=function(){this._onReloadCallback?this._onReloadCallback(this._sceneFileToLoad):this.reload()},n.prototype.reload=function(){var t=this;this._sceneFileToLoad?(this._currentScene&&(de.errorsCount>0&&de.ClearLogCache(),this._engine.stopRenderLoop()),$t.ShowLoadingScreen=!1,this._engine.displayLoadingUI(),$t.LoadAsync("file:",this._sceneFileToLoad,this._engine,function(e){t._progressCallback&&t._progressCallback(e)}).then(function(e){t._currentScene&&t._currentScene.dispose(),t._currentScene=e,t._sceneLoadedCallback&&t._sceneLoadedCallback(t._sceneFileToLoad,t._currentScene),t._currentScene.executeWhenReady(function(){t._engine.hideLoadingUI(),t._engine.runRenderLoop(function(){t.renderFunction()})})}).catch(function(e){t._engine.hideLoadingUI(),t._errorCallback&&t._errorCallback(t._sceneFileToLoad,t._currentScene,e.message)})):de.Error("Please provide a valid .babylon file.")},n}(),Oa=function(){function n(t){t===void 0&&(t=0),this.priority=t}return n.prototype.getDescription=function(){return""},n.prototype.apply=function(t,e){return!0},n}(),zv=function(n){j(t,n);function t(e,i,r){e===void 0&&(e=0),i===void 0&&(i=1024),r===void 0&&(r=.5);var o=n.call(this,e)||this;return o.priority=e,o.maximumSize=i,o.step=r,o}return t.prototype.getDescription=function(){return"Reducing render target texture size to "+this.maximumSize},t.prototype.apply=function(e,i){for(var r=!0,o=0;o<e.textures.length;o++){var a=e.textures[o];if(!(!a.canRescale||a.getContext)){var s=a.getSize(),l=Math.max(s.width,s.height);l>this.maximumSize&&(a.scale(this.step),r=!1)}}return r},t}(Oa),NO=function(n){j(t,n);function t(e,i,r){e===void 0&&(e=0),i===void 0&&(i=2),r===void 0&&(r=.25);var o=n.call(this,e)||this;return o.priority=e,o.maximumScale=i,o.step=r,o._currentScale=-1,o._directionOffset=1,o}return t.prototype.getDescription=function(){return"Setting hardware scaling level to "+this._currentScale},t.prototype.apply=function(e,i){return this._currentScale===-1&&(this._currentScale=e.getEngine().getHardwareScalingLevel(),this._currentScale>this.maximumScale&&(this._directionOffset=-1)),this._currentScale+=this._directionOffset*this.step,e.getEngine().setHardwareScalingLevel(this._currentScale),this._directionOffset===1?this._currentScale>=this.maximumScale:this._currentScale<=this.maximumScale},t}(Oa),Gv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning shadows on/off"},t.prototype.apply=function(e,i){return e.shadowsEnabled=i.isInImprovementMode,!0},t}(Oa),Wv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning post-processes on/off"},t.prototype.apply=function(e,i){return e.postProcessesEnabled=i.isInImprovementMode,!0},t}(Oa),Hv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning lens flares on/off"},t.prototype.apply=function(e,i){return e.lensFlaresEnabled=i.isInImprovementMode,!0},t}(Oa),g5=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return this.onGetDescription?this.onGetDescription():"Running user defined callback"},t.prototype.apply=function(e,i){return this.onApply?this.onApply(e,i):!0},t}(Oa),jv=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning particles on/off"},t.prototype.apply=function(e,i){return e.particlesEnabled=i.isInImprovementMode,!0},t}(Oa),FO=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getDescription=function(){return"Turning render targets off"},t.prototype.apply=function(e,i){return e.renderTargetsEnabled=i.isInImprovementMode,!0},t}(Oa),Xv=function(n){j(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e._canBeMerged=function(i){if(!(i instanceof ne))return!1;var r=i;return!(r.isDisposed()||!r.isVisible||!r.isEnabled()||r.instances.length>0||r.skeleton||r.hasLODLevels)},e}return Object.defineProperty(t,"UpdateSelectionTree",{get:function(){return t._UpdateSelectionTree},set:function(e){t._UpdateSelectionTree=e},enumerable:!1,configurable:!0}),t.prototype.getDescription=function(){return"Merging similar meshes together"},t.prototype.apply=function(e,i,r){for(var o=e.meshes.slice(0),a=o.length,s=0;s<a;s++){var l=new Array,u=o[s];if(this._canBeMerged(u)){l.push(u);for(var f=s+1;f<a;f++){var c=o[f];this._canBeMerged(c)&&c.material===u.material&&c.checkCollisions===u.checkCollisions&&(l.push(c),a--,o.splice(f,1),f--)}l.length<2||ne.MergeMeshes(l,void 0,!0)}}var h=e;return h.createOrUpdateSelectionOctree&&(r!=null?r&&h.createOrUpdateSelectionOctree():t.UpdateSelectionTree&&h.createOrUpdateSelectionOctree()),!0},t._UpdateSelectionTree=!1,t}(Oa),BO=function(){function n(t,e){t===void 0&&(t=60),e===void 0&&(e=2e3),this.targetFrameRate=t,this.trackerDuration=e,this.optimizations=new Array}return n.prototype.addOptimization=function(t){return this.optimizations.push(t),this},n.prototype.addCustomOptimization=function(t,e,i){i===void 0&&(i=0);var r=new g5(i);return r.onApply=t,r.onGetDescription=e,this.optimizations.push(r),this},n.LowDegradationAllowed=function(t){var e=new n(t),i=0;return e.addOptimization(new Xv(i)),e.addOptimization(new Gv(i)),e.addOptimization(new Hv(i)),i++,e.addOptimization(new Wv(i)),e.addOptimization(new jv(i)),i++,e.addOptimization(new zv(i,1024)),e},n.ModerateDegradationAllowed=function(t){var e=new n(t),i=0;return e.addOptimization(new Xv(i)),e.addOptimization(new Gv(i)),e.addOptimization(new Hv(i)),i++,e.addOptimization(new Wv(i)),e.addOptimization(new jv(i)),i++,e.addOptimization(new zv(i,512)),i++,e.addOptimization(new FO(i)),i++,e.addOptimization(new NO(i,2)),e},n.HighDegradationAllowed=function(t){var e=new n(t),i=0;return e.addOptimization(new Xv(i)),e.addOptimization(new Gv(i)),e.addOptimization(new Hv(i)),i++,e.addOptimization(new Wv(i)),e.addOptimization(new jv(i)),i++,e.addOptimization(new zv(i,256)),i++,e.addOptimization(new FO(i)),i++,e.addOptimization(new NO(i,4)),e},n}(),I8=function(){function n(t,e,i,r){var o=this;if(i===void 0&&(i=!0),r===void 0&&(r=!1),this._isRunning=!1,this._currentPriorityLevel=0,this._targetFrameRate=60,this._trackerDuration=2e3,this._currentFrameRate=0,this._improvementMode=!1,this.onSuccessObservable=new ie,this.onNewOptimizationAppliedObservable=new ie,this.onFailureObservable=new ie,e?this._options=e:this._options=new BO,this._options.targetFrameRate&&(this._targetFrameRate=this._options.targetFrameRate),this._options.trackerDuration&&(this._trackerDuration=this._options.trackerDuration),i)for(var a=0,s=0,l=this._options.optimizations;s<l.length;s++){var u=l[s];u.priority=a++}this._improvementMode=r,this._scene=t||pt.LastCreatedScene,this._sceneDisposeObserver=this._scene.onDisposeObservable.add(function(){o._sceneDisposeObserver=null,o.dispose()})}return Object.defineProperty(n.prototype,"isInImprovementMode",{get:function(){return this._improvementMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentPriorityLevel",{get:function(){return this._currentPriorityLevel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentFrameRate",{get:function(){return this._currentFrameRate},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetFrameRate",{get:function(){return this._targetFrameRate},set:function(t){this._targetFrameRate=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"trackerDuration",{get:function(){return this._trackerDuration},set:function(t){this._trackerDuration=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"optimizations",{get:function(){return this._options.optimizations},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this._isRunning=!1},n.prototype.reset=function(){this._currentPriorityLevel=0},n.prototype.start=function(){var t=this;this._isRunning||(this._isRunning=!0,this._scene.executeWhenReady(function(){setTimeout(function(){t._checkCurrentState()},t._trackerDuration)}))},n.prototype._checkCurrentState=function(){var t=this;if(this._isRunning){var e=this._scene,i=this._options;if(this._currentFrameRate=Math.round(e.getEngine().getFps()),this._improvementMode&&this._currentFrameRate<=this._targetFrameRate||!this._improvementMode&&this._currentFrameRate>=this._targetFrameRate){this._isRunning=!1,this.onSuccessObservable.notifyObservers(this);return}for(var r=!0,o=!0,a=0;a<i.optimizations.length;a++){var s=i.optimizations[a];s.priority===this._currentPriorityLevel&&(o=!1,r=r&&s.apply(e,this),this.onNewOptimizationAppliedObservable.notifyObservers(s))}if(o){this._isRunning=!1,this.onFailureObservable.notifyObservers(this);return}r&&this._currentPriorityLevel++,e.executeWhenReady(function(){setTimeout(function(){t._checkCurrentState()},t._trackerDuration)})}},n.prototype.dispose=function(){this.stop(),this.onSuccessObservable.clear(),this.onFailureObservable.clear(),this.onNewOptimizationAppliedObservable.clear(),this._sceneDisposeObserver&&this._scene.onDisposeObservable.remove(this._sceneDisposeObserver)},n.OptimizeAsync=function(t,e,i,r){var o=new n(t,e||BO.ModerateDegradationAllowed(),!1);return i&&o.onSuccessObservable.add(function(){i()}),r&&o.onFailureObservable.add(function(){r()}),o.start(),o},n}(),$d=[],Yb=function(n,t){$d[n.id]||n.doNotSerialize||(t.vertexData.push(n.serializeVerticeData()),$d[n.id]=!0)},NI=function(n,t){var e={},i=n._geometry;return i&&(n.getScene().getGeometryByID(i.id)||Yb(i,t.geometries)),n.serialize&&n.serialize(e),e},v5=function(n,t){if(n.delayLoadState===1||n.delayLoadState===0){if(n.material&&!n.material.doNotSerialize)if(n.material instanceof Go){if(t.multiMaterials=t.multiMaterials||[],t.materials=t.materials||[],!t.multiMaterials.some(function(s){return s.id===n.material.id})){t.multiMaterials.push(n.material.serialize());for(var e=function(s){s&&(t.materials.some(function(l){return l.id===s.id})||t.materials.push(s.serialize()))},i=0,r=n.material.subMaterials;i<r.length;i++){var o=r[i];e(o)}}}else t.materials=t.materials||[],t.materials.some(function(s){return s.id===n.material.id})||t.materials.push(n.material.serialize());var a=n._geometry;a&&(t.geometries||(t.geometries={},t.geometries.boxes=[],t.geometries.spheres=[],t.geometries.cylinders=[],t.geometries.toruses=[],t.geometries.grounds=[],t.geometries.planes=[],t.geometries.torusKnots=[],t.geometries.vertexData=[]),Yb(a,t.geometries)),n.skeleton&&!n.skeleton.doNotSerialize&&(t.skeletons=t.skeletons||[],t.skeletons.push(n.skeleton.serialize())),t.meshes=t.meshes||[],t.meshes.push(NI(n,t))}},VO=function(){function n(){}return n.ClearCache=function(){$d=[]},n.Serialize=function(t){var e={};if(n.ClearCache(),e.useDelayedTextureLoading=t.useDelayedTextureLoading,e.autoClear=t.autoClear,e.clearColor=t.clearColor.asArray(),e.ambientColor=t.ambientColor.asArray(),e.gravity=t.gravity.asArray(),e.collisionsEnabled=t.collisionsEnabled,t.fogMode&&t.fogMode!==0&&(e.fogMode=t.fogMode,e.fogColor=t.fogColor.asArray(),e.fogStart=t.fogStart,e.fogEnd=t.fogEnd,e.fogDensity=t.fogDensity),t.isPhysicsEnabled()){var i=t.getPhysicsEngine();i&&(e.physicsEnabled=!0,e.physicsGravity=i.gravity.asArray(),e.physicsEngine=i.getPhysicsPluginName())}t.metadata&&(e.metadata=t.metadata),e.morphTargetManagers=[];for(var r=0,o=t.meshes;r<o.length;r++){var a=o[r],s=a.morphTargetManager;s&&e.morphTargetManagers.push(s.serialize())}e.lights=[];var l,u;for(l=0;l<t.lights.length;l++)u=t.lights[l],u.doNotSerialize||e.lights.push(u.serialize());for(e.cameras=[],l=0;l<t.cameras.length;l++){var f=t.cameras[l];f.doNotSerialize||e.cameras.push(f.serialize())}if(t.activeCamera&&(e.activeCameraID=t.activeCamera.id),Be.AppendSerializedAnimations(t,e),t.animationGroups&&t.animationGroups.length>0){e.animationGroups=[];for(var c=0;c<t.animationGroups.length;c++){var h=t.animationGroups[c];e.animationGroups.push(h.serialize())}}if(t.reflectionProbes&&t.reflectionProbes.length>0)for(e.reflectionProbes=[],l=0;l<t.reflectionProbes.length;l++){var p=t.reflectionProbes[l];e.reflectionProbes.push(p.serialize())}e.materials=[],e.multiMaterials=[];var _;for(l=0;l<t.materials.length;l++)_=t.materials[l],_.doNotSerialize||e.materials.push(_.serialize());for(e.multiMaterials=[],l=0;l<t.multiMaterials.length;l++){var g=t.multiMaterials[l];e.multiMaterials.push(g.serialize())}for(t.environmentTexture&&(e.environmentTexture=t.environmentTexture.name),e.environmentIntensity=t.environmentIntensity,e.skeletons=[],l=0;l<t.skeletons.length;l++){var v=t.skeletons[l];v.doNotSerialize||e.skeletons.push(v.serialize())}for(e.transformNodes=[],l=0;l<t.transformNodes.length;l++)t.transformNodes[l].doNotSerialize||e.transformNodes.push(t.transformNodes[l].serialize());e.geometries={},e.geometries.boxes=[],e.geometries.spheres=[],e.geometries.cylinders=[],e.geometries.toruses=[],e.geometries.grounds=[],e.geometries.planes=[],e.geometries.torusKnots=[],e.geometries.vertexData=[],$d=[];var E=t.getGeometries();for(l=0;l<E.length;l++){var T=E[l];T.isReady()&&Yb(T,e.geometries)}for(e.meshes=[],l=0;l<t.meshes.length;l++){var a=t.meshes[l];if(a instanceof ne){var S=a;S.doNotSerialize||(S.delayLoadState===1||S.delayLoadState===0)&&e.meshes.push(NI(S,e))}}for(e.particleSystems=[],l=0;l<t.particleSystems.length;l++)e.particleSystems.push(t.particleSystems[l].serialize(!1));for(e.postProcesses=[],l=0;l<t.postProcesses.length;l++)e.postProcesses.push(t.postProcesses[l].serialize());t.actionManager&&(e.actions=t.actionManager.serialize("scene"));for(var C=0,O=t._serializableComponents;C<O.length;C++){var A=O[C];A.serialize(e)}return e},n.SerializeMesh=function(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var r={};if(n.ClearCache(),t=t instanceof Array?t:[t],e||i)for(var o=0;o<t.length;++o)i&&t[o].getDescendants().forEach(function(a){a instanceof ne&&t.indexOf(a)<0&&!a.doNotSerialize&&t.push(a)}),e&&t[o].parent&&t.indexOf(t[o].parent)<0&&!t[o].parent.doNotSerialize&&t.push(t[o].parent);return t.forEach(function(a){v5(a,r)}),r},n}(),D8=function(){function n(){}return n.CreateResizedCopy=function(t,e,i,r){r===void 0&&(r=!0);var o=t.getScene(),a=o.getEngine(),s=new ji("resized"+t.name,{width:e,height:i},o,!t.noMipmap,!0,t._texture.type,!1,t.samplingMode,!1);s.wrapU=t.wrapU,s.wrapV=t.wrapV,s.uOffset=t.uOffset,s.vOffset=t.vOffset,s.uScale=t.uScale,s.vScale=t.vScale,s.uAng=t.uAng,s.vAng=t.vAng,s.wAng=t.wAng,s.coordinatesIndex=t.coordinatesIndex,s.level=t.level,s.anisotropicFilteringLevel=t.anisotropicFilteringLevel,s._texture.isReady=!1,t.wrapU=he.CLAMP_ADDRESSMODE,t.wrapV=he.CLAMP_ADDRESSMODE;var l=new rl("pass",1,null,r?he.BILINEAR_SAMPLINGMODE:he.NEAREST_SAMPLINGMODE,a,!1,0);return l.getEffect().executeWhenCompiled(function(){l.onApply=function(f){f.setTexture("textureSampler",t)};var u=s.getInternalTexture();u&&(o.postProcessManager.directRender([l],u),a.unBindFramebuffer(u),s.disposeFramebufferObjects(),l.dispose(),u.isReady=!0)}),s},n}(),w8=function(){function n(t,e){if(e===void 0&&(e=null),!n.IsSupported(t))throw"Your browser does not support recording so far.";var i=t.getRenderingCanvas();if(!i)throw"The babylon engine must have a canvas to be recorded";this._canvas=i,this._canvas.isRecording=!1,this._options=Ot(Ot({},n._defaultOptions),e);var r=this._canvas.captureStream(this._options.fps);if(this._options.audioTracks)for(var o=0,a=this._options.audioTracks;o<a.length;o++){var s=a[o];r.addTrack(s)}this._mediaRecorder=new MediaRecorder(r,{mimeType:this._options.mimeType}),this._mediaRecorder.ondataavailable=this._handleDataAvailable.bind(this),this._mediaRecorder.onerror=this._handleError.bind(this),this._mediaRecorder.onstop=this._handleStop.bind(this)}return n.IsSupported=function(t){var e=t.getRenderingCanvas();return!!e&&typeof e.captureStream=="function"},Object.defineProperty(n.prototype,"isRecording",{get:function(){return!!this._canvas&&this._canvas.isRecording},enumerable:!1,configurable:!0}),n.prototype.stopRecording=function(){!this._canvas||!this._mediaRecorder||this.isRecording&&(this._canvas.isRecording=!1,this._mediaRecorder.stop())},n.prototype.startRecording=function(t,e){var i=this;if(t===void 0&&(t="babylonjs.webm"),e===void 0&&(e=7),!this._canvas||!this._mediaRecorder)throw"Recorder has already been disposed";if(this.isRecording)throw"Recording already in progress";return e>0&&setTimeout(function(){i.stopRecording()},e*1e3),this._fileName=t,this._recordedChunks=[],this._resolve=null,this._reject=null,this._canvas.isRecording=!0,this._mediaRecorder.start(this._options.recordChunckSize),new Promise(function(r,o){i._resolve=r,i._reject=o})},n.prototype.dispose=function(){this._canvas=null,this._mediaRecorder=null,this._recordedChunks=[],this._fileName=null,this._resolve=null,this._reject=null},n.prototype._handleDataAvailable=function(t){t.data.size>0&&this._recordedChunks.push(t.data)},n.prototype._handleError=function(t){if(this.stopRecording(),this._reject)this._reject(t.error);else throw new t.error},n.prototype._handleStop=function(){this.stopRecording();var t=new Blob(this._recordedChunks);this._resolve&&this._resolve(t),window.URL.createObjectURL(t),this._fileName&&Ee.Download(t,this._fileName)},n._defaultOptions={mimeType:"video/webm",fps:25,recordChunckSize:3e3},n}(),vp=function(){function n(){}return n.CreateScreenshot=function(t,e,i,r,o){o===void 0&&(o="image/png");var a=n._getScreenshotSize(t,e,i),s=a.height,l=a.width;if(!(s&&l)){de.Error("Invalid 'size' parameter !");return}Ee._ScreenshotCanvas||(Ee._ScreenshotCanvas=document.createElement("canvas")),Ee._ScreenshotCanvas.width=l,Ee._ScreenshotCanvas.height=s;var u=Ee._ScreenshotCanvas.getContext("2d"),f=t.getRenderWidth()/t.getRenderHeight(),c=l,h=c/f;h>s&&(h=s,c=h*f);var p=Math.max(0,l-c)/2,_=Math.max(0,s-h)/2,g=t.getRenderingCanvas();u&&g&&u.drawImage(g,p,_,c,h),Ee.EncodeScreenshotCanvasData(r,o)},n.CreateScreenshotAsync=function(t,e,i,r){return r===void 0&&(r="image/png"),new Promise(function(o,a){n.CreateScreenshot(t,e,i,function(s){typeof s<"u"?o(s):a(new Error("Data is undefined"))},r)})},n.CreateScreenshotUsingRenderTarget=function(t,e,i,r,o,a,s,l,u,f){o===void 0&&(o="image/png"),a===void 0&&(a=1),s===void 0&&(s=!1),u===void 0&&(u=!1),f===void 0&&(f=!1);var c=n._getScreenshotSize(t,e,i),h=c.height,p=c.width,_={width:p,height:h};if(!(h&&p)){de.Error("Invalid 'size' parameter !");return}var g=t.getRenderingCanvas();if(!g){de.Error("No rendering canvas found !");return}var v={width:g.width,height:g.height};t.setSize(p,h);var E=e.getScene(),T=null,S=E.activeCameras;(E.activeCamera!==e||E.activeCameras&&E.activeCameras.length)&&(T=E.activeCamera,E.activeCamera=e),E.render();var C=new ji("screenShot",_,E,!1,!1,0,!1,he.NEAREST_SAMPLINGMODE,void 0,f);C.renderList=null,C.samples=a,C.renderSprites=u,C.onAfterRenderObservable.add(function(){Ee.DumpFramebuffer(p,h,t,r,o,l)});var O=function(){E.incrementRenderId(),E.resetCachedMaterial(),C.render(!0),C.dispose(),T&&(E.activeCamera=T),E.activeCameras=S,t.setSize(v.width,v.height),e.getProjectionMatrix(!0)};if(s){var A=new gp("antialiasing",1,E.activeCamera);C.addPostProcess(A),A.getEffect().isReady()?O():A.getEffect().onCompiled=function(){O()}}else O()},n.CreateScreenshotUsingRenderTargetAsync=function(t,e,i,r,o,a,s,l){return r===void 0&&(r="image/png"),o===void 0&&(o=1),a===void 0&&(a=!1),l===void 0&&(l=!1),new Promise(function(u,f){n.CreateScreenshotUsingRenderTarget(t,e,i,function(c){typeof c<"u"?u(c):f(new Error("Data is undefined"))},r,o,a,s,l)})},n._getScreenshotSize=function(t,e,i){var r=0,o=0;if(typeof i=="object"){var a=i.precision?Math.abs(i.precision):1;i.width&&i.height?(r=i.height*a,o=i.width*a):i.width&&!i.height?(o=i.width*a,r=Math.round(o/t.getAspectRatio(e))):i.height&&!i.width?(r=i.height*a,o=Math.round(r*t.getAspectRatio(e))):(o=Math.round(t.getRenderWidth()*a),r=Math.round(o/t.getAspectRatio(e)))}else isNaN(i)||(r=i,o=i);return o&&(o=Math.floor(o)),r&&(r=Math.floor(r)),{height:r|0,width:o|0}},n}();Ee.CreateScreenshot=vp.CreateScreenshot;Ee.CreateScreenshotAsync=vp.CreateScreenshotAsync;Ee.CreateScreenshotUsingRenderTarget=vp.CreateScreenshotUsingRenderTarget;Ee.CreateScreenshotUsingRenderTargetAsync=vp.CreateScreenshotUsingRenderTargetAsync;var UO;(function(n){n[n.Checkbox=0]="Checkbox",n[n.Slider=1]="Slider",n[n.Vector3=2]="Vector3",n[n.Quaternion=3]="Quaternion",n[n.Color3=4]="Color3",n[n.String=5]="String"})(UO||(UO={}));var Td=function(){function n(t){this.byteOffset=0,this.buffer=t}return n.prototype.loadAsync=function(t){var e=this;return this.buffer.readAsync(this.byteOffset,t).then(function(i){e._dataView=new DataView(i.buffer,i.byteOffset,i.byteLength),e._dataByteOffset=0})},n.prototype.readUint32=function(){var t=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,t},n.prototype.readUint8Array=function(t){var e=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,t);return this._dataByteOffset+=t,this.byteOffset+=t,e},n.prototype.readString=function(t){return Oi.Decode(this.readUint8Array(t))},n.prototype.skipBytes=function(t){this._dataByteOffset+=t,this.byteOffset+=t},n}(),L8=function(){function n(){}return n._GetStorage=function(){try{return localStorage.setItem("test",""),localStorage.removeItem("test"),localStorage}catch{var t={};return{getItem:function(i){var r=t[i];return r===void 0?null:r},setItem:function(i,r){t[i]=r}}}},n.ReadString=function(t,e){var i=this._Storage.getItem(t);return i!==null?i:e},n.WriteString=function(t,e){this._Storage.setItem(t,e)},n.ReadBoolean=function(t,e){var i=this._Storage.getItem(t);return i!==null?i==="true":e},n.WriteBoolean=function(t,e){this._Storage.setItem(t,e?"true":"false")},n.ReadNumber=function(t,e){var i=this._Storage.getItem(t);return i!==null?parseFloat(i):e},n.WriteNumber=function(t,e){this._Storage.setItem(t,e.toString())},n._Storage=n._GetStorage(),n}(),N8=function(){function n(){this._trackedScene=null}return n.prototype.track=function(t){this._trackedScene=t,this._savedJSON=VO.Serialize(t)},n.prototype.getDelta=function(){if(!this._trackedScene)return null;var t=VO.Serialize(this._trackedScene),e={};for(var i in t)this._compareCollections(i,this._savedJSON[i],t[i],e);return e},n.prototype._compareArray=function(t,e,i,r){if(e.length===0&&i.length===0)return!0;if(e.length&&!isNaN(e[0])||i.length&&!isNaN(i[0])){if(e.length!==i.length)return!1;if(e.length===0)return!0;for(var o=0;o<e.length;o++)if(e[o]!==i[o])return r[t]=i,!1;return!0}for(var a=[],s=function(){var c=e[o],h=c.uniqueId;a.push(h);var p=i.filter(function(v){return v.uniqueId===h});if(p.length){var _=p[0],g={};l._compareObjects(c,_,g)||(r[t]||(r[t]=[]),g.__state={id:_.id||_.name},r[t].push(g))}else{var g={__state:{deleteId:c.id||c.name}};r[t].push(g)}},l=this,o=0;o<e.length;o++)s();for(var o=0;o<i.length;o++){var u=i[o],f=u.uniqueId;a.indexOf(f)===-1&&(r[t]||(r[t]=[]),r[t].push(u))}return!0},n.prototype._compareObjects=function(t,e,i){var r=!1;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],s=e[o],l=!1;Array.isArray(a)?l=JSON.stringify(a)!==JSON.stringify(s):(!isNaN(a)||Object.prototype.toString.call(a)=="[object String]")&&(l=a!==s),l&&(r=!0,i[o]=s)}return!r},n.prototype._compareCollections=function(t,e,i,r){if(e!==i&&e&&i){if(Array.isArray(e)&&Array.isArray(i)){if(this._compareArray(t,e,i,r))return}else if(typeof e=="object"&&typeof i=="object"){var o={};this._compareObjects(e,i,o)||(r[t]=o);return}}},n.GetShadowGeneratorById=function(t,e){for(var i=t.lights.map(function(s){return s.getShadowGenerator()}),r=0,o=i;r<o.length;r++){var a=o[r];if(a&&a.id===e)return a}return null},n.ApplyDelta=function(t,e){var i=this;typeof t=="string"&&(t=JSON.parse(t));var r=e;for(var o in t){var a=t[o],s=r[o];if(Array.isArray(s)||o==="shadowGenerators")switch(o){case"cameras":this._ApplyDeltaForEntity(a,e,e.getCameraByID.bind(e),function(l){return dt.Parse(l,e)});break;case"lights":this._ApplyDeltaForEntity(a,e,e.getLightByID.bind(e),function(l){return Wr.Parse(l,e)});break;case"shadowGenerators":this._ApplyDeltaForEntity(a,e,function(l){return i.GetShadowGeneratorById(e,l)},function(l){return zn.Parse(l,e)});break;case"meshes":this._ApplyDeltaForEntity(a,e,e.getMeshByID.bind(e),function(l){return ne.Parse(l,e,"")});break;case"skeletons":this._ApplyDeltaForEntity(a,e,e.getSkeletonById.bind(e),function(l){return du.Parse(l,e)});break;case"materials":this._ApplyDeltaForEntity(a,e,e.getMaterialByID.bind(e),function(l){return gt.Parse(l,e,"")});break;case"multiMaterials":this._ApplyDeltaForEntity(a,e,e.getMaterialByID.bind(e),function(l){return Go.Parse(l,e,"")});break;case"transformNodes":this._ApplyDeltaForEntity(a,e,e.getTransformNodeByID.bind(e),function(l){return nr.Parse(l,e,"")});break;case"particleSystems":this._ApplyDeltaForEntity(a,e,e.getParticleSystemByID.bind(e),function(l){return vr.Parse(l,e,"")});break;case"morphTargetManagers":this._ApplyDeltaForEntity(a,e,e.getMorphTargetById.bind(e),function(l){return _p.Parse(l,e)});break;case"postProcesses":this._ApplyDeltaForEntity(a,e,e.getPostProcessByName.bind(e),function(l){return _t.Parse(l,e,"")});break}else isNaN(s)?s.fromArray&&s.fromArray(a):r[o]=a}},n._ApplyPropertiesToEntity=function(t,e){for(var i in t){var r=t[i],o=e[i];o!==void 0&&(!isNaN(o)||Array.isArray(o)?e[i]=r:o.fromArray&&o.fromArray(r))}},n._ApplyDeltaForEntity=function(t,e,i,r){for(var o=0,a=t;o<a.length;o++){var s=a[o];if(s.__state&&s.__state.id!==void 0){var l=i(s.__state.id);l&&this._ApplyPropertiesToEntity(s,l)}else if(s.__state&&s.__state.deleteId!==void 0){var u=i(s.__state.deleteId);u==null||u.dispose()}else r(s)}},n}(),hu;(function(n){var t=function(){function i(r,o,a,s){o===void 0&&(o=null),a===void 0&&(a=null),s===void 0&&(s=null),o=o??function(){return 1},a=a??function(){return 1},s=s??function(c,h){return c===h?0:1},this._characterToIdx=new Map,this._insertionCosts=new Array(r.length),this._deletionCosts=new Array(r.length),this._substitutionCosts=new Array(r.length);for(var l,u=0;u<r.length;++u){l=r[u],this._characterToIdx.set(l,u),this._insertionCosts[u]=o(l),this._deletionCosts[u]=a(l),this._substitutionCosts[u]=new Array(r.length);for(var f=u;f<r.length;++f)this._substitutionCosts[u][f]=s(l,r[f])}}return i.prototype.serialize=function(){var r={},o=new Array(this._characterToIdx.size);return this._characterToIdx.forEach(function(a,s){o[a]=s}),r.characters=o,r.insertionCosts=this._insertionCosts,r.deletionCosts=this._deletionCosts,r.substitutionCosts=this._substitutionCosts,JSON.stringify(r)},i.Deserialize=function(r){var o=JSON.parse(r),a=new i(o.characters);return a._insertionCosts=o.insertionCosts,a._deletionCosts=o.deletionCosts,a._substitutionCosts=o.substitutionCosts,a},i.prototype.getCharacterIdx=function(r){return this._characterToIdx.get(r)},i.prototype.getInsertionCost=function(r){return this._insertionCosts[r]},i.prototype.getDeletionCost=function(r){return this._deletionCosts[r]},i.prototype.getSubstitutionCost=function(r,o){var a=Math.min(r,o),s=Math.max(r,o);return this._substitutionCosts[a][s]},i}();n.Alphabet=t;var e=function(){function i(r,o){var a=this;if(r.length>i.MAX_SEQUENCE_LENGTH)throw new Error("Sequences longer than "+i.MAX_SEQUENCE_LENGTH+" not supported.");this._alphabet=o,this._characters=r.map(function(s){return a._alphabet.getCharacterIdx(s)})}return i.prototype.serialize=function(){return JSON.stringify(this._characters)},i.Deserialize=function(r,o){var a=new i([],o);return a._characters=JSON.parse(r),a},i.prototype.distance=function(r){return i._distance(this,r)},i._distance=function(r,o){var a=r._alphabet;if(a!==o._alphabet)throw new Error("Cannot Levenshtein compare Sequences built from different alphabets.");var s=r._characters,l=o._characters,u=s.length,f=l.length,c=i._costMatrix;c[0][0]=0;for(var h=0;h<u;++h)c[h+1][0]=c[h][0]+a.getInsertionCost(s[h]);for(var h=0;h<f;++h)c[0][h+1]=c[0][h]+a.getInsertionCost(l[h]);for(var p=0;p<u;++p)for(var _=0;_<f;++_)i._insertionCost=c[p+1][_]+a.getInsertionCost(l[_]),i._deletionCost=c[p][_+1]+a.getDeletionCost(s[p]),i._substitutionCost=c[p][_]+a.getSubstitutionCost(s[p],l[_]),c[p+1][_+1]=Math.min(i._insertionCost,i._deletionCost,i._substitutionCost);return c[u][f]},i.MAX_SEQUENCE_LENGTH=256,i._costMatrix=HM(Array(i.MAX_SEQUENCE_LENGTH+1)).map(function(r){return new Array(i.MAX_SEQUENCE_LENGTH+1)}),i}();n.Sequence=e})(hu||(hu={}));var F8=function(){function n(t){t===void 0&&(t=.01),this._points=[],this._segmentLength=t}return n.prototype.serialize=function(){return JSON.stringify(this)},n.Deserialize=function(t){var e=JSON.parse(t),i=new n(e._segmentLength);return i._points=e._points.map(function(r){return new y(r._x,r._y,r._z)}),i},n.prototype.getLength=function(){return this._points.length*this._segmentLength},n.prototype.add=function(t){var e=this,i=this._points.length;if(i===0)this._points.push(t.clone());else for(var r=function(){return e._segmentLength/y.Distance(e._points[i-1],t)},o=r();o<=1;o=r()){var a=this._points[i-1].scale(1-o);t.scaleAndAddToRef(o,a),this._points.push(a),++i}},n.prototype.resampleAtTargetResolution=function(t){var e=new n(this.getLength()/t);return this._points.forEach(function(i){e.add(i)}),e},n.prototype.tokenize=function(t){for(var e=[],i=new y,r=2;r<this._points.length;++r)n._transformSegmentDirToRef(this._points[r-2],this._points[r-1],this._points[r],i)&&e.push(n._tokenizeSegment(i,t));return e},n._transformSegmentDirToRef=function(t,e,i,r){var o=.98;return e.subtractToRef(t,n._forwardDir),n._forwardDir.normalize(),e.scaleToRef(-1,n._inverseFromVec),n._inverseFromVec.normalize(),Math.abs(y.Dot(n._forwardDir,n._inverseFromVec))>o?!1:(y.CrossToRef(n._forwardDir,n._inverseFromVec,n._upDir),n._upDir.normalize(),te.LookAtLHToRef(t,e,n._upDir,n._lookMatrix),i.subtractToRef(e,n._fromToVec),n._fromToVec.normalize(),y.TransformNormalToRef(n._fromToVec,n._lookMatrix,r),!0)},n._tokenizeSegment=function(t,e){n._bestMatch=0,n._score=y.Dot(t,e[0]),n._bestScore=n._score;for(var i=1;i<e.length;++i)n._score=y.Dot(t,e[i]),n._score>n._bestScore&&(n._bestMatch=i,n._bestScore=n._score);return n._bestMatch},n._forwardDir=new y,n._inverseFromVec=new y,n._upDir=new y,n._fromToVec=new y,n._lookMatrix=new te,n}(),kO=function(){function n(t){this.chars=new Array(t)}return n.Generate=function(t,e,i,r,o){t===void 0&&(t=64),e===void 0&&(e=256),i===void 0&&(i=.1),r===void 0&&(r=.001),o===void 0&&(o=[]);for(var a=.001,s=a*a,l=new n(t),u=0;u<t;++u)l.chars[u]=new y(Math.random()-.5,Math.random()-.5,Math.random()-.5),l.chars[u].normalize();for(var u=0;u<o.length;++u)l.chars[u].copyFrom(o[u]);for(var f,c,h=new y,p=new y,_=function(E,T,S){return(1-S)*E+S*T},g=0;g<e;++g){f=_(i,r,g/(e-1));for(var v=function(E){h.copyFromFloats(0,0,0),l.chars.forEach(function(T){l.chars[E].subtractToRef(T,p),c=p.lengthSquared(),c>s&&p.scaleAndAddToRef(1/(p.lengthSquared()*c),h)}),h.scaleInPlace(f),l.chars[E].addInPlace(h),l.chars[E].normalize()},u=o.length;u<l.chars.length;++u)v(u)}return l},n.prototype.serialize=function(){return JSON.stringify(this.chars)},n.Deserialize=function(t){for(var e=JSON.parse(t),i=new n(e.length),r=0;r<e.length;++r)i.chars[r]=new y(e[r]._x,e[r]._y,e[r]._z);return i},n}(),Ny=function(){function n(){this._sequences=[]}return n.prototype.serialize=function(){return JSON.stringify(this._sequences.map(function(t){return t.serialize()}))},n.Deserialize=function(t,e){var i=new n;return i._sequences=JSON.parse(t).map(function(r){return hu.Sequence.Deserialize(r,e)}),i},n.CreateFromTrajectory=function(t,e,i){return n.CreateFromTokenizationPyramid(n._getTokenizationPyramid(t,e),i)},n.CreateFromTokenizationPyramid=function(t,e){var i=new n;return i._sequences=t.map(function(r){return new hu.Sequence(r,e)}),i},n._getTokenizationPyramid=function(t,e,i){i===void 0&&(i=n.FINEST_DESCRIPTOR_RESOLUTION);for(var r=[],o=i;o>4;o=Math.floor(o/2))r.push(t.resampleAtTargetResolution(o).tokenize(e.chars));return r},n.prototype.distance=function(t){for(var e=0,i,r=0;r<this._sequences.length;++r)i=Math.pow(2,r),e+=i*this._sequences[r].distance(t._sequences[r]);return e},n.FINEST_DESCRIPTOR_RESOLUTION=32,n}(),zO=function(){function n(t){t===void 0&&(t=[]),this._descriptors=t,this._centroidIdx=-1,this._averageDistance=0,this._refreshDescription()}return n.prototype.serialize=function(){var t={};return t.descriptors=this._descriptors.map(function(e){return e.serialize()}),t.centroidIdx=this._centroidIdx,t.averageDistance=this._averageDistance,JSON.stringify(t)},n.Deserialize=function(t,e){var i=JSON.parse(t),r=new n;return r._descriptors=i.descriptors.map(function(o){return Ny.Deserialize(o,e)}),r._centroidIdx=i.centroidIdx,r._averageDistance=i.averageDistance,r},n.prototype.add=function(t){this._descriptors.push(t),this._refreshDescription()},n.prototype.getMatchCost=function(t){return t.distance(this._descriptors[this._centroidIdx])/this._averageDistance},n.prototype.getMatchMinimumDistance=function(t){return Math.min.apply(Math,this._descriptors.map(function(e){return e.distance(t)}))},n.prototype._refreshDescription=function(){var t=this;this._centroidIdx=-1;for(var e,i=this._descriptors.map(function(o){return e=0,t._descriptors.forEach(function(a){e+=o.distance(a)}),e}),r=0;r<i.length;++r)(this._centroidIdx<0||i[r]<i[this._centroidIdx])&&(this._centroidIdx=r);this._averageDistance=0,this._descriptors.forEach(function(o){t._averageDistance+=o.distance(t._descriptors[t._centroidIdx])}),this._descriptors.length>0&&(this._averageDistance=Math.max(this._averageDistance/this._descriptors.length,n.MIN_AVERAGE_DISTANCE))},n.MIN_AVERAGE_DISTANCE=1,n}(),B8=function(){function n(){this._maximumAllowableMatchCost=4,this._nameToDescribedTrajectory=new Map}return n.prototype.serialize=function(){var t={};return t.maximumAllowableMatchCost=this._maximumAllowableMatchCost,t.vector3Alphabet=this._vector3Alphabet.serialize(),t.levenshteinAlphabet=this._levenshteinAlphabet.serialize(),t.nameToDescribedTrajectory=[],this._nameToDescribedTrajectory.forEach(function(e,i){t.nameToDescribedTrajectory.push(i),t.nameToDescribedTrajectory.push(e.serialize())}),JSON.stringify(t)},n.Deserialize=function(t){var e=JSON.parse(t),i=new n;i._maximumAllowableMatchCost=e.maximumAllowableMatchCost,i._vector3Alphabet=kO.Deserialize(e.vector3Alphabet),i._levenshteinAlphabet=hu.Alphabet.Deserialize(e.levenshteinAlphabet);for(var r=0;r<e.nameToDescribedTrajectory.length;r+=2)i._nameToDescribedTrajectory.set(e.nameToDescribedTrajectory[r],zO.Deserialize(e.nameToDescribedTrajectory[r+1],i._levenshteinAlphabet));return i},n.Generate=function(){for(var t=kO.Generate(64,256,.1,.001,[y.Forward()]),e=new Array(t.chars.length),i=0;i<e.length;++i)e[i]=i;var r=new hu.Alphabet(e,function(a){return a===0?0:1},function(a){return a===0?0:1},function(a,s){return Math.min(1-y.Dot(t.chars[a],t.chars[s]),1)}),o=new n;return o._vector3Alphabet=t,o._levenshteinAlphabet=r,o},n.prototype.addTrajectoryToClassification=function(t,e){this._nameToDescribedTrajectory.has(e)||this._nameToDescribedTrajectory.set(e,new zO),this._nameToDescribedTrajectory.get(e).add(Ny.CreateFromTrajectory(t,this._vector3Alphabet,this._levenshteinAlphabet))},n.prototype.deleteClassification=function(t){return this._nameToDescribedTrajectory.delete(t)},n.prototype.classifyTrajectory=function(t){var e=this,i=Ny.CreateFromTrajectory(t,this._vector3Alphabet,this._levenshteinAlphabet),r=[];if(this._nameToDescribedTrajectory.forEach(function(u,f){u.getMatchCost(i)<e._maximumAllowableMatchCost&&r.push(f)}),r.length===0)return null;for(var o=0,a=this._nameToDescribedTrajectory.get(r[o]).getMatchMinimumDistance(i),s,l=0;l<r.length;++l)s=this._nameToDescribedTrajectory.get(r[l]).getMatchMinimumDistance(i),s<a&&(a=s,o=l);return r[o]},n}(),Yv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r.options=i,r._direction=new y(0,0,-1),r._mat=new te,r._onSelectEnabled=!1,r._origin=new y(0,0,0),r.lastNativeXRHitResults=[],r.onHitTestResultObservable=new ie,r._onHitTestResults=function(o){var a=o.map(function(s){var l=te.FromArray(s.hitMatrix);return r._xrSessionManager.scene.useRightHandedSystem||l.toggleModelMatrixHandInPlace(),r.options.worldParentNode&&l.multiplyToRef(r.options.worldParentNode.getWorldMatrix(),l),{xrHitResult:s,transformationMatrix:l}});r.lastNativeXRHitResults=o,r.onHitTestResultObservable.notifyObservers(a)},r._onSelect=function(o){r._onSelectEnabled&&t.XRHitTestWithSelectEvent(o,r._xrSessionManager.referenceSpace)},r.xrNativeFeatureName="hit-test",Ee.Warn("A newer version of this plugin is available"),r}return t.XRHitTestWithRay=function(e,i,r,o){return e.requestHitTest(i,r).then(function(a){var s=o||function(l){return!!l.hitMatrix};return a.filter(s)})},t.XRHitTestWithSelectEvent=function(e,i){var r=e.frame.getPose(e.inputSource.targetRaySpace,i);if(!r)return Promise.resolve([]);var o=new XRRay(r.transform);return this.XRHitTestWithRay(e.frame.session,o,i)},t.prototype.attach=function(){return n.prototype.attach.call(this)?(this.options.testOnPointerDownOnly&&this._xrSessionManager.session.addEventListener("select",this._onSelect,!1),!0):!1},t.prototype.detach=function(){return n.prototype.detach.call(this)?(this._onSelectEnabled=!1,this._xrSessionManager.session.removeEventListener("select",this._onSelect),!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){if(!(!this.attached||this.options.testOnPointerDownOnly)){var i=e.getViewerPose(this._xrSessionManager.referenceSpace);if(i){te.FromArrayToRef(i.transform.matrix,0,this._mat),y.TransformCoordinatesFromFloatsToRef(0,0,0,this._mat,this._origin),y.TransformCoordinatesFromFloatsToRef(0,0,-1,this._mat,this._direction),this._direction.subtractInPlace(this._origin),this._direction.normalize();var r=new XRRay({x:this._origin.x,y:this._origin.y,z:this._origin.z,w:0},{x:this._direction.x,y:this._direction.y,z:this._direction.z,w:0});t.XRHitTestWithRay(this._xrSessionManager.session,r,this._xrSessionManager.referenceSpace).then(this._onHitTestResults)}}},t.Name=Ko.HIT_TEST,t.Version=1,t}(qo);Oo.AddWebXRFeature(Yv.Name,function(n,t){return function(){return new Yv(n,t)}},Yv.Version,!1);var y5=0,Kv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r._options=i,r._lastFrameDetected=new Set,r._trackedAnchors=[],r._futureAnchors=[],r.onAnchorAddedObservable=new ie,r.onAnchorRemovedObservable=new ie,r.onAnchorUpdatedObservable=new ie,r._tmpVector=new y,r._tmpQuaternion=new Re,r.xrNativeFeatureName="anchors",r}return Object.defineProperty(t.prototype,"referenceSpaceForFrameAnchors",{set:function(e){this._referenceSpaceForFrameAnchors=e},enumerable:!1,configurable:!0}),t.prototype._populateTmpTransformation=function(e,i){return this._tmpVector.copyFrom(e),this._tmpQuaternion.copyFrom(i),this._xrSessionManager.scene.useRightHandedSystem||(this._tmpVector.z*=-1,this._tmpQuaternion.z*=-1,this._tmpQuaternion.w*=-1),{position:this._tmpVector,rotationQuaternion:this._tmpQuaternion}},t.prototype.addAnchorPointUsingHitTestResultAsync=function(e,i,r){return i===void 0&&(i=new y),r===void 0&&(r=new Re),eu(this,void 0,void 0,function(){var o,a,s,l=this;return tu(this,function(u){switch(u.label){case 0:if(this._populateTmpTransformation(i,r),o=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),e.xrHitResult.createAnchor)return[3,1];throw this.detach(),new Error("Anchors not enabled in this environment/browser");case 1:return u.trys.push([1,3,,4]),[4,e.xrHitResult.createAnchor(o)];case 2:return a=u.sent(),[2,new Promise(function(f,c){l._futureAnchors.push({nativeAnchor:a,resolved:!1,submitted:!0,xrTransformation:o,resolve:f,reject:c})})];case 3:throw s=u.sent(),new Error(s);case 4:return[2]}})})},t.prototype.addAnchorAtPositionAndRotationAsync=function(e,i,r){return i===void 0&&(i=new Re),r===void 0&&(r=!1),eu(this,void 0,void 0,function(){var o,a,s,l=this;return tu(this,function(u){switch(u.label){case 0:return this._populateTmpTransformation(e,i),o=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),r&&this.attached&&this._xrSessionManager.currentFrame?[4,this._createAnchorAtTransformation(o,this._xrSessionManager.currentFrame)]:[3,2];case 1:return s=u.sent(),[3,3];case 2:s=void 0,u.label=3;case 3:return a=s,[2,new Promise(function(f,c){l._futureAnchors.push({nativeAnchor:a,resolved:!1,submitted:!1,xrTransformation:o,resolve:f,reject:c})})]}})})},Object.defineProperty(t.prototype,"anchors",{get:function(){return this._trackedAnchors},enumerable:!1,configurable:!0}),t.prototype.detach=function(){if(!n.prototype.detach.call(this))return!1;if(!this._options.doNotRemoveAnchorsOnSessionEnded)for(;this._trackedAnchors.length;){var e=this._trackedAnchors.pop();if(e){try{e.remove()}catch{}this.onAnchorRemovedObservable.notifyObservers(e)}}return!0},t.prototype.dispose=function(){this._futureAnchors.length=0,n.prototype.dispose.call(this),this.onAnchorAddedObservable.clear(),this.onAnchorRemovedObservable.clear(),this.onAnchorUpdatedObservable.clear()},t.prototype._onXRFrame=function(e){var i=this;if(!(!this.attached||!e)){var r=e.trackedAnchors;if(r){var o=this._trackedAnchors.filter(function(s){return!r.has(s.xrAnchor)}).map(function(s){var l=i._trackedAnchors.indexOf(s);return l}),a=0;o.forEach(function(s){var l=i._trackedAnchors.splice(s-a,1)[0];i.onAnchorRemovedObservable.notifyObservers(l),a++}),r.forEach(function(s){if(i._lastFrameDetected.has(s)){var h=i._findIndexInAnchorArray(s),u=i._trackedAnchors[h];try{i._updateAnchorWithXRFrame(s,u,e),u.attachedNode&&(u.attachedNode.rotationQuaternion=u.attachedNode.rotationQuaternion||new Re,u.transformationMatrix.decompose(u.attachedNode.scaling,u.attachedNode.rotationQuaternion,u.attachedNode.position)),i.onAnchorUpdatedObservable.notifyObservers(u)}catch{Ee.Warn("Anchor could not be updated")}}else{var l={id:y5++,xrAnchor:s,remove:s.delete},u=i._updateAnchorWithXRFrame(s,l,e);i._trackedAnchors.push(u),i.onAnchorAddedObservable.notifyObservers(u);var f=i._futureAnchors.filter(function(p){return p.nativeAnchor===s}),c=f[0];c&&(c.resolve(u),c.resolved=!0)}}),this._lastFrameDetected=r}this._futureAnchors.forEach(function(s){!s.resolved&&!s.submitted&&(i._createAnchorAtTransformation(s.xrTransformation,e).then(function(l){s.nativeAnchor=l},function(l){s.resolved=!0,s.reject(l)}),s.submitted=!0)})}},t.prototype._findIndexInAnchorArray=function(e){for(var i=0;i<this._trackedAnchors.length;++i)if(this._trackedAnchors[i].xrAnchor===e)return i;return-1},t.prototype._updateAnchorWithXRFrame=function(e,i,r){var o=r.getPose(e.anchorSpace,this._xrSessionManager.referenceSpace);if(o){var a=i.transformationMatrix||new te;te.FromArrayToRef(o.transform.matrix,0,a),this._xrSessionManager.scene.useRightHandedSystem||a.toggleModelMatrixHandInPlace(),i.transformationMatrix=a,this._options.worldParentNode&&a.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),a)}return i},t.prototype._createAnchorAtTransformation=function(e,i){var r;return eu(this,void 0,void 0,function(){return tu(this,function(o){if(i.createAnchor)try{return[2,i.createAnchor(e,(r=this._referenceSpaceForFrameAnchors)!==null&&r!==void 0?r:this._xrSessionManager.referenceSpace)]}catch(a){throw new Error(a)}else throw this.detach(),new Error("Anchors are not enabled in your browser");return[2]})})},t.Name=Ko.ANCHOR_SYSTEM,t.Version=1,t}(qo);Oo.AddWebXRFeature(Kv.Name,function(n,t){return function(){return new Kv(n,t)}},Kv.Version);var b5=0,qv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r._options=i,r._detectedPlanes=[],r._enabled=!1,r._lastFrameDetected=new Set,r.onPlaneAddedObservable=new ie,r.onPlaneRemovedObservable=new ie,r.onPlaneUpdatedObservable=new ie,r.xrNativeFeatureName="plane-detection",r._xrSessionManager.session?r._init():r._xrSessionManager.onXRSessionInit.addOnce(function(){r._init()}),r}return t.prototype.detach=function(){if(!n.prototype.detach.call(this))return!1;if(!this._options.doNotRemovePlanesOnSessionEnded)for(;this._detectedPlanes.length;){var e=this._detectedPlanes.pop();e&&this.onPlaneRemovedObservable.notifyObservers(e)}return!0},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onPlaneAddedObservable.clear(),this.onPlaneRemovedObservable.clear(),this.onPlaneUpdatedObservable.clear()},t.prototype.isCompatible=function(){return typeof XRPlane<"u"},t.prototype._onXRFrame=function(e){var i=this;if(!(!this.attached||!this._enabled||!e)){var r=e.worldInformation.detectedPlanes;if(r){var o=this._detectedPlanes.filter(function(s){return!r.has(s.xrPlane)}).map(function(s){return i._detectedPlanes.indexOf(s)}),a=0;o.forEach(function(s){var l=i._detectedPlanes.splice(s-a,1)[0];i.onPlaneRemovedObservable.notifyObservers(l),a++}),r.forEach(function(s){if(i._lastFrameDetected.has(s)){if(s.lastChangedTime===i._xrSessionManager.currentTimestamp){var f=i.findIndexInPlaneArray(s),u=i._detectedPlanes[f];i._updatePlaneWithXRPlane(s,u,e),i.onPlaneUpdatedObservable.notifyObservers(u)}}else{var l={id:b5++,xrPlane:s,polygonDefinition:[]},u=i._updatePlaneWithXRPlane(s,l,e);i._detectedPlanes.push(u),i.onPlaneAddedObservable.notifyObservers(u)}}),this._lastFrameDetected=r}}},t.prototype._init=function(){var e=this,i,r,o=function(){e._enabled=!0,e._detectedPlanes.length&&(e._detectedPlanes.length=0)};if(!this._xrSessionManager.session.updateWorldTrackingState){var a=(r=(i=this._xrSessionManager.session.worldTrackingState)===null||i===void 0?void 0:i.planeDetectionState)===null||r===void 0?void 0:r.enabled;a&&o();return}this._xrSessionManager.session.updateWorldTrackingState({planeDetectionState:{enabled:!0}}),o()},t.prototype._updatePlaneWithXRPlane=function(e,i,r){var o=this;i.polygonDefinition=e.polygon.map(function(l){var u=o._xrSessionManager.scene.useRightHandedSystem?1:-1;return new y(l.x,l.y,l.z*u)});var a=r.getPose(e.planeSpace,this._xrSessionManager.referenceSpace);if(a){var s=i.transformationMatrix||new te;te.FromArrayToRef(a.transform.matrix,0,s),this._xrSessionManager.scene.useRightHandedSystem||s.toggleModelMatrixHandInPlace(),i.transformationMatrix=s,this._options.worldParentNode&&s.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),s)}return i},t.prototype.findIndexInPlaneArray=function(e){for(var i=0;i<this._detectedPlanes.length;++i)if(this._detectedPlanes[i].xrPlane===e)return i;return-1},t.Name=Ko.PLANE_DETECTION,t.Version=1,t}(qo);Oo.AddWebXRFeature(qv.Name,function(n,t){return function(){return new qv(n,t)}},qv.Version);var Qv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r.options=i,r.onBackgroundStateChangedObservable=new ie,r}return t.prototype.attach=function(){return this._setBackgroundState(!1),n.prototype.attach.call(this)},t.prototype.detach=function(){return this._setBackgroundState(!0),n.prototype.detach.call(this)},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onBackgroundStateChangedObservable.clear()},t.prototype._onXRFrame=function(e){},t.prototype._setBackgroundState=function(e){var i=this._xrSessionManager.scene;if(!this.options.ignoreEnvironmentHelper)if(this.options.environmentHelperRemovalFlags){if(this.options.environmentHelperRemovalFlags.skyBox){var r=i.getMeshByName("BackgroundSkybox");r&&r.setEnabled(e)}if(this.options.environmentHelperRemovalFlags.ground){var o=i.getMeshByName("BackgroundPlane");o&&o.setEnabled(e)}}else{var a=i.getMeshByName("BackgroundHelper");a&&a.setEnabled(e)}this.options.backgroundMeshes&&this.options.backgroundMeshes.forEach(function(s){return s.setEnabled(e)}),this.onBackgroundStateChangedObservable.notifyObservers(e)},t.Name=Ko.BACKGROUND_REMOVER,t.Version=1,t}(qo);Oo.AddWebXRFeature(Qv.Name,function(n,t){return function(){return new Qv(n,t)}},Qv.Version,!0);var V8=function(){function n(){}return n}(),$v=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r._options=i,r._attachController=function(o){if(!r._controllers[o.uniqueId])if(r._xrSessionManager.scene.isPhysicsEnabled()||de.Warn("physics engine not enabled, skipped. Please add this controller manually."),r._options.physicsProperties.useControllerMesh&&o.inputSource.gamepad)o.onMotionControllerInitObservable.addOnce(function(c){c.onModelLoadedObservable.addOnce(function(){var h=new It(c.rootMesh,It.MeshImpostor,Ot({mass:0},r._options.physicsProperties)),p=o.grip||o.pointer;r._controllers[o.uniqueId]={xrController:o,impostor:h,oldPos:p.position.clone(),oldRotation:p.rotationQuaternion.clone()}})});else{var a=r._options.physicsProperties.impostorType||It.SphereImpostor,s=r._options.physicsProperties.impostorSize||.1,l=tn.CreateSphere("impostor-mesh-"+o.uniqueId,{diameterX:typeof s=="number"?s:s.width,diameterY:typeof s=="number"?s:s.height,diameterZ:typeof s=="number"?s:s.depth});l.isVisible=r._debugMode,l.isPickable=!1,l.rotationQuaternion=new Re;var u=o.grip||o.pointer;l.position.copyFrom(u.position),l.rotationQuaternion.copyFrom(u.rotationQuaternion);var f=new It(l,a,Ot({mass:0},r._options.physicsProperties));r._controllers[o.uniqueId]={xrController:o,impostor:f,impostorMesh:l}}},r._controllers={},r._debugMode=!1,r._delta=0,r._lastTimestamp=0,r._tmpQuaternion=new Re,r._tmpVector=new y,r._options.physicsProperties||(r._options.physicsProperties={}),r}return t.prototype._enablePhysicsDebug=function(){var e=this;this._debugMode=!0,Object.keys(this._controllers).forEach(function(i){var r=e._controllers[i];r.impostorMesh&&(r.impostorMesh.isVisible=!0)})},t.prototype.addController=function(e){this._attachController(e)},t.prototype.attach=function(){var e=this;if(!n.prototype.attach.call(this))return!1;if(!this._options.xrInput)return!0;if(this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,function(o){e._detachController(o.uniqueId)}),this._options.enableHeadsetImpostor){var i=this._options.headsetImpostorParams||{impostorType:It.SphereImpostor,restitution:.8,impostorSize:.3},r=i.impostorSize||.3;this._headsetMesh=tn.CreateSphere("headset-mesh",{diameterX:typeof r=="number"?r:r.width,diameterY:typeof r=="number"?r:r.height,diameterZ:typeof r=="number"?r:r.depth}),this._headsetMesh.rotationQuaternion=new Re,this._headsetMesh.isVisible=!1,this._headsetImpostor=new It(this._headsetMesh,i.impostorType,Ot({mass:0},i))}return!0},t.prototype.detach=function(){var e=this;return n.prototype.detach.call(this)?(Object.keys(this._controllers).forEach(function(i){e._detachController(i)}),this._headsetMesh&&this._headsetMesh.dispose(),!0):!1},t.prototype.getHeadsetImpostor=function(){return this._headsetImpostor},t.prototype.getImpostorForController=function(e){var i=typeof e=="string"?e:e.uniqueId;return this._controllers[i]?this._controllers[i].impostor:null},t.prototype.setPhysicsProperties=function(e){this._options.physicsProperties=Ot(Ot({},this._options.physicsProperties),e)},t.prototype._onXRFrame=function(e){var i=this;this._delta=this._xrSessionManager.currentTimestamp-this._lastTimestamp,this._lastTimestamp=this._xrSessionManager.currentTimestamp,this._headsetMesh&&(this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.position),this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion)),Object.keys(this._controllers).forEach(function(r){var o=i._controllers[r],a=o.xrController.grip||o.xrController.pointer,s=o.oldPos||o.impostorMesh.position,l=o.oldRotation||o.impostorMesh.rotationQuaternion;if(a.position.subtractToRef(s,i._tmpVector),i._tmpVector.scaleInPlace(1e3/i._delta),o.impostor.setLinearVelocity(i._tmpVector),i._debugMode&&console.log(i._tmpVector,"linear"),!l.equalsWithEpsilon(a.rotationQuaternion)){l.conjugateInPlace().multiplyToRef(a.rotationQuaternion,i._tmpQuaternion);var u=Math.sqrt(i._tmpQuaternion.x*i._tmpQuaternion.x+i._tmpQuaternion.y*i._tmpQuaternion.y+i._tmpQuaternion.z*i._tmpQuaternion.z);if(i._tmpVector.set(i._tmpQuaternion.x,i._tmpQuaternion.y,i._tmpQuaternion.z),u<.001)i._tmpVector.scaleInPlace(2);else{var f=2*Math.atan2(u,i._tmpQuaternion.w);i._tmpVector.scaleInPlace(f/(u*(i._delta/1e3)))}o.impostor.setAngularVelocity(i._tmpVector),i._debugMode&&console.log(i._tmpVector,i._tmpQuaternion,"angular")}s.copyFrom(a.position),l.copyFrom(a.rotationQuaternion)})},t.prototype._detachController=function(e){var i=this._controllers[e];i&&(i.impostorMesh&&i.impostorMesh.dispose(),delete this._controllers[e])},t.Name=Ko.PHYSICS_CONTROLLERS,t.Version=1,t}(qo);Oo.AddWebXRFeature($v.Name,function(n,t){return function(){return new $v(n,t)}},$v.Version,!0);var Zv=function(n){j(t,n);function t(e,i){i===void 0&&(i={});var r=n.call(this,e)||this;return r.options=i,r._tmpMat=new te,r._tmpPos=new y,r._tmpQuat=new Re,r.initHitTestSource=function(o){if(o){var a=new XRRay(r.options.offsetRay||{}),s={space:r.options.useReferenceSpace?o:r._xrSessionManager.viewerReferenceSpace,offsetRay:a};if(r.options.entityTypes&&(s.entityTypes=r.options.entityTypes),!s.space){Ee.Warn("waiting for viewer reference space to initialize");return}r._xrSessionManager.session.requestHitTestSource(s).then(function(l){r._xrHitTestSource&&r._xrHitTestSource.cancel(),r._xrHitTestSource=l})}},r.autoCloneTransformation=!1,r.onHitTestResultObservable=new ie,r.paused=!1,r.xrNativeFeatureName="hit-test",Ee.Warn("Hit test is an experimental and unstable feature."),r}return t.prototype.attach=function(){var e=this;if(!n.prototype.attach.call(this)||!this._xrSessionManager.session.requestHitTestSource)return!1;if(this.options.disablePermanentHitTest||(this._xrSessionManager.referenceSpace&&this.initHitTestSource(this._xrSessionManager.referenceSpace),this._xrSessionManager.onXRReferenceSpaceChanged.add(this.initHitTestSource)),this.options.enableTransientHitTest){var i=new XRRay(this.options.transientOffsetRay||{});this._xrSessionManager.session.requestHitTestSourceForTransientInput({profile:"generic-touchscreen",offsetRay:i,entityTypes:this.options.entityTypes}).then(function(r){e._transientXrHitTestSource=r})}return!0},t.prototype.detach=function(){return n.prototype.detach.call(this)?(this._xrHitTestSource&&(this._xrHitTestSource.cancel(),this._xrHitTestSource=null),this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this.initHitTestSource),this._transientXrHitTestSource&&(this._transientXrHitTestSource.cancel(),this._transientXrHitTestSource=null),!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){var i=this;if(!(!this.attached||this.paused)){if(this._xrHitTestSource){var r=e.getHitTestResults(this._xrHitTestSource);this._processWebXRHitTestResult(r)}if(this._transientXrHitTestSource){var o=e.getHitTestResultsForTransientInput(this._transientXrHitTestSource);o.forEach(function(a){i._processWebXRHitTestResult(a.results,a.inputSource)})}}},t.prototype._processWebXRHitTestResult=function(e,i){var r=this,o=[];e.forEach(function(a){var s=a.getPose(r._xrSessionManager.referenceSpace);if(s){var l=s.transform.position,u=s.transform.orientation;r._tmpPos.set(l.x,l.y,l.z),r._tmpQuat.set(u.x,u.y,u.z,u.w),te.FromFloat32ArrayToRefScaled(s.transform.matrix,0,1,r._tmpMat),r._xrSessionManager.scene.useRightHandedSystem||(r._tmpPos.z*=-1,r._tmpQuat.z*=-1,r._tmpQuat.w*=-1,r._tmpMat.toggleModelMatrixHandInPlace());var f={position:r.autoCloneTransformation?r._tmpPos.clone():r._tmpPos,rotationQuaternion:r.autoCloneTransformation?r._tmpQuat.clone():r._tmpQuat,transformationMatrix:r.autoCloneTransformation?r._tmpMat.clone():r._tmpMat,inputSource:i,isTransient:!!i,xrHitResult:a};o.push(f)}}),this.onHitTestResultObservable.notifyObservers(o)},t.Name=Ko.HIT_TEST,t.Version=2,t}(qo);Oo.AddWebXRFeature(Zv.Name,function(n,t){return function(){return new Zv(n,t)}},Zv.Version,!1);var Jv=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i._enabled=!1,i._featurePointCloud=[],i.onFeaturePointsAddedObservable=new ie,i.onFeaturePointsUpdatedObservable=new ie,i.xrNativeFeatureName="bjsfeature-points",i._xrSessionManager.session?i._init():i._xrSessionManager.onXRSessionInit.addOnce(function(){i._init()}),i}return Object.defineProperty(t.prototype,"featurePointCloud",{get:function(){return this._featurePointCloud},enumerable:!1,configurable:!0}),t.prototype.detach=function(){return n.prototype.detach.call(this)?(this.featurePointCloud.length=0,!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this._featurePointCloud.length=0,this.onFeaturePointsUpdatedObservable.clear(),this.onFeaturePointsAddedObservable.clear()},t.prototype._onXRFrame=function(e){if(!(!this.attached||!this._enabled||!e)){var i=e.featurePointCloud;if(!(!i||i.length===0)){if(i.length%5!==0)throw new Error("Received malformed feature point cloud of length: "+i.length);for(var r=i.length/5,o=new Array,a=new Array,s=0;s<r;s++){var l=s*5,u=i[l+4];this._featurePointCloud[u]?o.push(u):(this._featurePointCloud[u]={position:new y,confidenceValue:0},a.push(u)),this._featurePointCloud[u].position.x=i[l],this._featurePointCloud[u].position.y=i[l+1],this._featurePointCloud[u].position.z=i[l+2],this._featurePointCloud[u].confidenceValue=i[l+3]}a.length>0&&this.onFeaturePointsAddedObservable.notifyObservers(a),o.length>0&&this.onFeaturePointsUpdatedObservable.notifyObservers(o)}}},t.prototype._init=function(){!this._xrSessionManager.session.trySetFeaturePointCloudEnabled||!this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0)||(this._enabled=!0)},t.Name=Ko.FEATURE_POINTS,t.Version=1,t}(qo);Oo.AddWebXRFeature(Jv.Name,function(n){return function(){return new Jv(n)}},Jv.Version);var E5=function(){function n(t,e,i,r,o){this.xrController=t,this.trackedMeshes=e,this._handMesh=i,this._rigMapping=r,this._defaultHandMesh=!1,this._transformNodeMapping=[],this.handPartsDefinition=this.generateHandPartsDefinition(t.inputSource.hand),this._scene=e[0].getScene(),this._handMesh&&this._rigMapping?this._defaultHandMesh=!1:o||this._generateDefaultHandMesh(),this.xrController.motionController&&(this.xrController.motionController.rootMesh?this.xrController.motionController.rootMesh.setEnabled(!1):this.xrController.motionController.onModelLoadedObservable.add(function(a){a.rootMesh&&a.rootMesh.setEnabled(!1)})),this.xrController.onMotionControllerInitObservable.add(function(a){a.onModelLoadedObservable.add(function(s){s.rootMesh&&s.rootMesh.setEnabled(!1)}),a.rootMesh&&a.rootMesh.setEnabled(!1)})}return n.prototype.generateHandPartsDefinition=function(t){var e;return e={},e.wrist=[t.WRIST],e.thumb=[t.THUMB_METACARPAL,t.THUMB_PHALANX_PROXIMAL,t.THUMB_PHALANX_DISTAL,t.THUMB_PHALANX_TIP],e.index=[t.INDEX_METACARPAL,t.INDEX_PHALANX_PROXIMAL,t.INDEX_PHALANX_INTERMEDIATE,t.INDEX_PHALANX_DISTAL,t.INDEX_PHALANX_TIP],e.middle=[t.MIDDLE_METACARPAL,t.MIDDLE_PHALANX_PROXIMAL,t.MIDDLE_PHALANX_INTERMEDIATE,t.MIDDLE_PHALANX_DISTAL,t.MIDDLE_PHALANX_TIP],e.ring=[t.RING_METACARPAL,t.RING_PHALANX_PROXIMAL,t.RING_PHALANX_INTERMEDIATE,t.RING_PHALANX_DISTAL,t.RING_PHALANX_TIP],e.little=[t.LITTLE_METACARPAL,t.LITTLE_PHALANX_PROXIMAL,t.LITTLE_PHALANX_INTERMEDIATE,t.LITTLE_PHALANX_DISTAL,t.LITTLE_PHALANX_TIP],e},n.prototype.updateFromXRFrame=function(t,e,i){var r=this;i===void 0&&(i=2);var o=this.xrController.inputSource.hand;o&&this.trackedMeshes.forEach(function(a,s){var l=o[s];if(l){var u=t.getJointPose(l,e);if(!u||!u.transform)return;var f=u.transform.position,c=u.transform.orientation;a.position.set(f.x,f.y,f.z),a.rotationQuaternion.set(c.x,c.y,c.z,c.w);var h=(u.radius||.008)*i;a.scaling.set(h,h,h),r._handMesh&&r._rigMapping&&r._rigMapping[s]&&(r._transformNodeMapping[s]=r._transformNodeMapping[s]||r._scene.getTransformNodeByName(r._rigMapping[s]),r._transformNodeMapping[s]&&(r._transformNodeMapping[s].position.copyFrom(a.position),r._transformNodeMapping[s].rotationQuaternion.copyFrom(a.rotationQuaternion),a.isVisible=!1)),a.getScene().useRightHandedSystem||(a.position.z*=-1,a.rotationQuaternion.z*=-1,a.rotationQuaternion.w*=-1)}})},n.prototype.getHandPartMeshes=function(t){var e=this;return this.handPartsDefinition[t].map(function(i){return e.trackedMeshes[i]})},n.prototype.dispose=function(){this.trackedMeshes.forEach(function(t){return t.dispose()}),this._defaultHandMesh&&this._handMesh&&this._handMesh.dispose()},n.prototype._generateDefaultHandMesh=function(){return eu(this,void 0,void 0,function(){var t,e,i,r,o,a,s,l;return tu(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),t=this.xrController.inputSource.handedness==="right"?"right":"left",e=(t==="right"?"r":"l")+"_hand_"+(this._scene.useRightHandedSystem?"r":"l")+"hs.glb",[4,$t.ImportMeshAsync("","https://assets.babylonjs.com/meshes/HandMeshes/",e,this._scene)];case 1:return i=u.sent(),r={base:_e.FromInts(116,63,203),fresnel:_e.FromInts(149,102,229),fingerColor:_e.FromInts(177,130,255),tipFresnel:_e.FromInts(220,200,255)},o=new Wb("leftHandShader",this._scene,{emitComments:!1}),[4,o.loadAsync("https://patrickryanms.github.io/BabylonJStextures/Demos/xrHandMesh/handsShader.json")];case 2:if(u.sent(),o.build(!1),o.needDepthPrePass=!0,o.transparencyMode=gt.MATERIAL_ALPHABLEND,o.alphaMode=Me.ALPHA_COMBINE,a={base:o.getBlockByName("baseColor"),fresnel:o.getBlockByName("fresnelColor"),fingerColor:o.getBlockByName("fingerColor"),tipFresnel:o.getBlockByName("tipFresnelColor")},a.base.value=r.base,a.fresnel.value=r.fresnel,a.fingerColor.value=r.fingerColor,a.tipFresnel.value=r.tipFresnel,i.meshes[1].material=o,this._defaultHandMesh=!0,this._handMesh=i.meshes[0],this._rigMapping=["wrist_","thumb_metacarpal_","thumb_proxPhalanx_","thumb_distPhalanx_","thumb_tip_","index_metacarpal_","index_proxPhalanx_","index_intPhalanx_","index_distPhalanx_","index_tip_","middle_metacarpal_","middle_proxPhalanx_","middle_intPhalanx_","middle_distPhalanx_","middle_tip_","ring_metacarpal_","ring_proxPhalanx_","ring_intPhalanx_","ring_distPhalanx_","ring_tip_","little_metacarpal_","little_proxPhalanx_","little_intPhalanx_","little_distPhalanx_","little_tip_"].map(function(f){return""+f+(t==="right"?"R":"L")}),s=this._scene.getTransformNodeByName(this._rigMapping[0]),s)s.parent&&s.parent.rotate(Mi.Y,Math.PI);else throw new Error("could not find the wrist node");return[3,4];case 3:return l=u.sent(),Ee.Error("error loading hand mesh"),console.log(l),[3,4];case 4:return[2]}})})},n}(),ey=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r.options=i,r.onHandAddedObservable=new ie,r.onHandRemovedObservable=new ie,r._hands={},r._attachHand=function(o){var a,s,l,u,f,c,h,p,_,g;if(!(!o.inputSource.hand||r._hands[o.uniqueId])){var v=o.inputSource.hand,E=[],T=((a=r.options.jointMeshes)===null||a===void 0?void 0:a.sourceMesh)||tn.CreateSphere("jointParent",{diameter:1});T.isVisible=!!(!((s=r.options.jointMeshes)===null||s===void 0)&&s.keepOriginalVisible);for(var S=0;S<v.length;++S){var C=T.createInstance(o.uniqueId+"-handJoint-"+S);if(!((l=r.options.jointMeshes)===null||l===void 0)&&l.onHandJointMeshGenerated){var O=r.options.jointMeshes.onHandJointMeshGenerated(C,S,o.uniqueId);O&&O!==C&&(C.dispose(),C=O)}if(C.isPickable=!1,!((u=r.options.jointMeshes)===null||u===void 0)&&u.enablePhysics){var A=r.options.jointMeshes.physicsProps||{},M=A.impostorType!==void 0?A.impostorType:It.SphereImpostor;C.physicsImpostor=new It(C,M,Ot({mass:0},A))}C.rotationQuaternion=new Re,!((f=r.options.jointMeshes)===null||f===void 0)&&f.invisible&&(C.isVisible=!1),E.push(C)}var D=o.inputSource.handedness==="right"?"right":"left",U=((c=r.options.jointMeshes)===null||c===void 0?void 0:c.handMeshes)&&((h=r.options.jointMeshes)===null||h===void 0?void 0:h.handMeshes[D]),V=((p=r.options.jointMeshes)===null||p===void 0?void 0:p.rigMapping)&&((_=r.options.jointMeshes)===null||_===void 0?void 0:_.rigMapping[D]),B=new E5(o,E,U,V,(g=r.options.jointMeshes)===null||g===void 0?void 0:g.disableDefaultHandMesh);r._hands[o.uniqueId]={handObject:B,id:t._idCounter++},r.onHandAddedObservable.notifyObservers(B)}},r.xrNativeFeatureName="hand-tracking",r}return t.prototype.isCompatible=function(){return typeof XRHand<"u"},t.prototype.attach=function(){var e=this;return n.prototype.attach.call(this)?(this.options.xrInput.controllers.forEach(this._attachHand),this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable,this._attachHand),this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable,function(i){e._detachHand(i.uniqueId)}),!0):!1},t.prototype.detach=function(){var e=this;return n.prototype.detach.call(this)?(Object.keys(this._hands).forEach(function(i){e._detachHand(i)}),!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onHandAddedObservable.clear()},t.prototype.getHandByControllerId=function(e){var i;return((i=this._hands[e])===null||i===void 0?void 0:i.handObject)||null},t.prototype.getHandByHandedness=function(e){var i=this,r=Object.keys(this._hands).map(function(a){return i._hands[a].handObject.xrController.inputSource.handedness}),o=r.indexOf(e);return o!==-1?this._hands[o].handObject:null},t.prototype._onXRFrame=function(e){var i=this;Object.keys(this._hands).forEach(function(r){var o;i._hands[r].handObject.updateFromXRFrame(e,i._xrSessionManager.referenceSpace,(o=i.options.jointMeshes)===null||o===void 0?void 0:o.scaleFactor)})},t.prototype._detachHand=function(e){this._hands[e]&&(this.onHandRemovedObservable.notifyObservers(this._hands[e].handObject),this._hands[e].handObject.dispose())},t._idCounter=0,t.Name=Ko.HAND_TRACKING,t.Version=1,t}(qo);Oo.AddWebXRFeature(ey.Name,function(n,t){return function(){return new ey(n,t)}},ey.Version,!1);var T5=function(n){j(t,n);function t(e,i,r){var o=n.call(this,e,S5["left-right"],i,r)||this;return o._mapping={defaultButton:{valueNodeName:"VALUE",unpressedNodeName:"UNPRESSED",pressedNodeName:"PRESSED"},defaultAxis:{valueNodeName:"VALUE",minNodeName:"MIN",maxNodeName:"MAX"},buttons:{"xr-standard-trigger":{rootNodeName:"SELECT",componentProperty:"button",states:["default","touched","pressed"]},"xr-standard-squeeze":{rootNodeName:"GRASP",componentProperty:"state",states:["pressed"]},"xr-standard-touchpad":{rootNodeName:"TOUCHPAD_PRESS",labelAnchorNodeName:"squeeze-label",touchPointNodeName:"TOUCH"},"xr-standard-thumbstick":{rootNodeName:"THUMBSTICK_PRESS",componentProperty:"state",states:["pressed"]}},axes:{"xr-standard-touchpad":{"x-axis":{rootNodeName:"TOUCHPAD_TOUCH_X"},"y-axis":{rootNodeName:"TOUCHPAD_TOUCH_Y"}},"xr-standard-thumbstick":{"x-axis":{rootNodeName:"THUMBSTICK_X"},"y-axis":{rootNodeName:"THUMBSTICK_Y"}}}},o.profileId="microsoft-mixed-reality",o}return t.prototype._getFilenameAndPath=function(){var e="";this.handedness==="left"?e=t.MODEL_LEFT_FILENAME:e=t.MODEL_RIGHT_FILENAME;var i="default",r=t.MODEL_BASE_URL+i+"/";return{filename:e,path:r}},t.prototype._getModelLoadingConstraints=function(){var e=$t.IsPluginForExtensionAvailable(".glb");return e||de.Warn("glTF / glb loaded was not registered, using generic controller instead"),e},t.prototype._processLoadedModel=function(e){var i=this;this.rootMesh&&(this.getComponentIds().forEach(function(r,o){if(!i.disableAnimation&&r&&i.rootMesh){var a=i._mapping.buttons[r],s=a.rootNodeName;if(!s){de.Log("Skipping unknown button at index: "+o+" with mapped name: "+r);return}var l=i._getChildByName(i.rootMesh,s);if(!l){de.Warn("Missing button mesh with name: "+s);return}if(a.valueMesh=i._getImmediateChildByName(l,i._mapping.defaultButton.valueNodeName),a.pressedMesh=i._getImmediateChildByName(l,i._mapping.defaultButton.pressedNodeName),a.unpressedMesh=i._getImmediateChildByName(l,i._mapping.defaultButton.unpressedNodeName),a.valueMesh&&a.pressedMesh&&a.unpressedMesh){var u=i.getComponent(r);u&&u.onButtonStateChangedObservable.add(function(f){i._lerpTransform(a,f.value)},void 0,!0)}else de.Warn("Missing button submesh under mesh with name: "+s)}}),this.getComponentIds().forEach(function(r,o){var a=i.getComponent(r);a.isAxes()&&["x-axis","y-axis"].forEach(function(s){if(i.rootMesh){var l=i._mapping.axes[r][s],u=i._getChildByName(i.rootMesh,l.rootNodeName);if(!u){de.Warn("Missing axis mesh with name: "+l.rootNodeName);return}l.valueMesh=i._getImmediateChildByName(u,i._mapping.defaultAxis.valueNodeName),l.minMesh=i._getImmediateChildByName(u,i._mapping.defaultAxis.minNodeName),l.maxMesh=i._getImmediateChildByName(u,i._mapping.defaultAxis.maxNodeName),l.valueMesh&&l.minMesh&&l.maxMesh?a&&a.onAxisValueChangedObservable.add(function(f){var c=s==="x-axis"?f.x:f.y;i._lerpTransform(l,c,!0)},void 0,!0):de.Warn("Missing axis submesh under mesh with name: "+l.rootNodeName)}})}))},t.prototype._setRootMesh=function(e){this.rootMesh=new ne(this.profileId+" "+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(var i,r=0;r<e.length;r++){var o=e[r];o.isPickable=!1,o.parent||(i=o)}i&&i.setParent(this.rootMesh),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=Re.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/microsoft/",t.MODEL_LEFT_FILENAME="left.glb",t.MODEL_RIGHT_FILENAME="right.glb",t}(cc);Gn.RegisterController("windows-mixed-reality",function(n,t){return new T5(t,n.gamepad,n.handedness)});var S5={},FI=function(n){j(t,n);function t(e,i,r,o,a){a===void 0&&(a=!1);var s=n.call(this,e,C5[r],i,r)||this;return s._forceLegacyControllers=a,s.profileId="oculus-touch",s}return t.prototype._getFilenameAndPath=function(){var e="";this.handedness==="left"?e=t.MODEL_LEFT_FILENAME:e=t.MODEL_RIGHT_FILENAME;var i=this._isQuest()?t.QUEST_MODEL_BASE_URL:t.MODEL_BASE_URL;return{filename:e,path:i}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var i=this,r=this._isQuest(),o=this.handedness==="right"?-1:1;this.getComponentIds().forEach(function(a){var s=a&&i.getComponent(a);s&&s.onButtonStateChangedObservable.add(function(l){if(!(!i.rootMesh||i.disableAnimation))switch(a){case"xr-standard-trigger":r||(i._modelRootNode.getChildren()[3].rotation.x=-l.value*.2,i._modelRootNode.getChildren()[3].position.y=-l.value*.005,i._modelRootNode.getChildren()[3].position.z=-l.value*.005);return;case"xr-standard-squeeze":r||(i._modelRootNode.getChildren()[4].position.x=o*l.value*.0035);return;case"xr-standard-thumbstick":return;case"a-button":case"x-button":r||(l.pressed?i._modelRootNode.getChildren()[1].position.y=-.001:i._modelRootNode.getChildren()[1].position.y=0);return;case"b-button":case"y-button":r||(l.pressed?i._modelRootNode.getChildren()[2].position.y=-.001:i._modelRootNode.getChildren()[2].position.y=0);return}},void 0,!0)})},t.prototype._setRootMesh=function(e){this.rootMesh=new ne(this.profileId+" "+this.handedness,this.scene),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=Re.FromEulerAngles(0,Math.PI,0)),e.forEach(function(i){i.isPickable=!1}),this._isQuest()?this._modelRootNode=e[0]:(this._modelRootNode=e[1],this.rootMesh.position.y=.034,this.rootMesh.position.z=.052),this._modelRootNode.parent=this.rootMesh},t.prototype._updateModel=function(){},t.prototype._isQuest=function(){return!!navigator.userAgent.match(/Quest/gi)&&!this._forceLegacyControllers},t.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",t.MODEL_LEFT_FILENAME="left.babylon",t.MODEL_RIGHT_FILENAME="right.babylon",t.QUEST_MODEL_BASE_URL="https://controllers.babylonjs.com/oculusQuest/",t}(cc);Gn.RegisterController("oculus-touch",function(n,t){return new FI(t,n.gamepad,n.handedness)});Gn.RegisterController("oculus-touch-legacy",function(n,t){return new FI(t,n.gamepad,n.handedness,!0)});var C5={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"x-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"x_button",visualResponses:{}},"y-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"y_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"a-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"a_button",visualResponses:{}},"b-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"b_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-right",assetPath:"right.glb"}},P5=function(n){j(t,n);function t(e,i,r){var o=n.call(this,e,A5[r],i,r)||this;return o.profileId="htc-vive",o}return t.prototype._getFilenameAndPath=function(){var e=t.MODEL_FILENAME,i=t.MODEL_BASE_URL;return{filename:e,path:i}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var i=this;this.getComponentIds().forEach(function(r){var o=r&&i.getComponent(r);o&&o.onButtonStateChangedObservable.add(function(a){if(!(!i.rootMesh||i.disableAnimation))switch(r){case"xr-standard-trigger":i._modelRootNode.getChildren()[6].rotation.x=-a.value*.15;return;case"xr-standard-touchpad":return;case"xr-standard-squeeze":return}},void 0,!0)})},t.prototype._setRootMesh=function(e){this.rootMesh=new ne(this.profileId+" "+this.handedness,this.scene),e.forEach(function(i){i.isPickable=!1}),this._modelRootNode=e[1],this._modelRootNode.parent=this.rootMesh,this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=Re.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/vive/",t.MODEL_FILENAME="wand.babylon",t}(cc);Gn.RegisterController("htc-vive",function(n,t){return new P5(t,n.gamepad,n.handedness)});var A5={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc-vive-none",assetPath:"none.glb"}};function ou(n){return n.startsWith("#")?n:"#"+n}function R5(n){return n.startsWith("#")?n.slice(1):n}function ty(n){return("0"+(n*255|0).toString(16)).slice(-2)}function au(n){return ty(n.r)+ty(n.g)+ty(n.b)}function Fy(n){const t=R5(n);return new _e(parseInt(t.slice(0,2),16)/256,parseInt(t.slice(2,4),16)/256,parseInt(t.slice(4,6),16)/256)}function BI(n,t){return n.bodyShapes.includes(t)}function O5(n){return BI(n,Ce.BodyShape.MALE)}function M5(n){return BI(n,Ce.BodyShape.FEMALE)}function Kb(n,t=Ce.BodyShape.MALE){const e=n.emoteDataADR74.representations.find(i=>i.bodyShapes.includes(t));if(!e)throw new Error(`Could not find a representation of bodyShape=${t} for emote="${n.id}"`);return e}function mu(n,t=Ce.BodyShape.MALE){switch(t){case Ce.BodyShape.FEMALE:{const e=n.data.representations.find(M5);if(!e)throw new Error(`Could not find a BaseFemale representation for wearable="${n.id}"`);return e}case Ce.BodyShape.MALE:{const e=n.data.representations.find(O5);if(!e)throw new Error(`Could not find a BaseMale representation for wearable="${n.id}"`);return e}}}function qb(n,t=Ce.BodyShape.MALE){if(Qb(n,t))return mu(n,t);if(n.data.representations.length>0)return n.data.representations[0];throw new Error(`The wearable="${n.id}" has no representation`)}function Qb(n,t=Ce.BodyShape.MALE){try{return mu(n,t),!0}catch{return!1}}function x5(n){const t=n.contents.find(e=>e.key===n.mainFile);if(!t)throw new Error("Could not find main file");return t.url}function yp(n){return n.mainFile.endsWith("png")}const VI=1,I5=2.8,D5=I5-VI;function w5(n){return Math.min(Math.max(n,0),100)/100*D5+VI}function L5(n){const t=n?parseFloat(n):null;return t===null||isNaN(t)?null:t}function N5(n){switch(n&&ko(n)?null:n==null?void 0:n.data.category){case Ce.WearableCategory.UPPER_BODY:return 2;case Ce.WearableCategory.SKIN:return 1.75;default:return 1.25}}const Nd="default",F5=6,GO="collections-thirdparty",B5=10;function V5(n){const t=n.split(":"),e=t.length;let i;return n.includes(GO)&&e===B5?i={assetUrn:t.slice(0,7).join(":"),tokenId:t[9],contractAddress:t[8],network:t[7]}:!n.includes(GO)&&e>F5&&(i={assetUrn:t.slice(0,-1).join(":"),tokenId:t[e-1]}),i??{assetUrn:n,tokenId:void 0}}async function U5(n,t){const[e,i]=await Zd([n],t);if(e.length===1)return e[0];if(i.length===1)return i[0];throw new Error(`Could not find wearable or emote for urn="${n}"`)}function k5(n){const t=n.map(r=>JSON.parse(atob(r))),e=t.filter(as),i=t.filter(ko);return[e,i]}function iy(n){return typeof n=="number"&&!isNaN(n)}function z5(n){return/^0x[a-fA-F0-9]{40}$/g.test(n)}function G5(n){return/^baf[a-z2-7]{56}$/.test(n)}function UI(n){return n?n===Nd?{type:"address",value:n}:n.startsWith(Nd)?isNaN(Number(n.replace(Nd,"")))?null:{type:"address",value:n}:z5(n)?{type:"address",value:n}:G5(n)?{type:"entity",value:n}:null:null}async function W5(n,t){if(!n)return[];const[e]=await Zd(n.avatar.wearables,t);return e}async function Zd(n,t){if(n.length===0)return[[],[]];const e=n.map(i=>i.replace(/^dcl:\/\/base-avatars\//,"urn:decentraland:off-chain:base-avatars:")).map(i=>V5(i).assetUrn);return Cb.fetchItems(e,t)}async function H5(n){if(n.length===0)return[[],[]];const t=n.map(o=>fetch(o).then(a=>a.json()).catch()),e=await Promise.all(t),i=e.filter(as),r=e.filter(ko);return[i,r]}const kI=YF();async function zI(n,t){return kI.memo(n,async()=>n===Nd?null:await Cb.fetchProfile(n,t).then(i=>i&&i.avatars.length>0?i.avatars[0]:null).catch(i=>console.log(`Failed to load profile="${n}"`,i))||null)}async function GI(n,t){return kI.memo(n,async()=>await Cb.fetchProfileEntity(n,t).then(i=>i&&i.avatars.length>0?i.avatars[0]:null).catch(i=>console.log(`Failed to load profile="${n}"`,i))||null)}async function WI(n){const{contractAddress:t,itemId:e,tokenId:i,peerUrl:r,marketplaceServerUrl:o}=n;if(!e&&!i)throw new Error("You need to provide an itemId or a tokenId");const a=Wf.get("NETWORK");let s=`urn:decentraland:${a}:collections-v2:${t}:${e}`;if(!e&&!i)throw new Error("You must provide either tokenId or itemId");if(!e&&i){const l=await VF.fetchNFT(t,i,o);s=l.network!==Ce.Network.ETHEREUM?`urn:decentraland:${a}:collections-v2:${t}:${l.itemId}`:l.image.split("contents/")[1].split("/thumbnail")[0]}return U5(s,r)}async function j5(n,t,e,i,r,o,a,s){const[l,[u,f],[c,h]]=await Promise.all([W5(n,s),Zd([r,...t],s),H5(e)]),[p,_]=k5(i);let g=[...l,...u,...c,...p];const v=[...f,...h,..._];g=g.filter(S=>Qb(S,r));const E=[],T=o&&a?GF():o?zF():a?kF():[];for(const S of T)if(!UF(g,S)){const O=WF(S,r);if(O)E.push(O);else throw new Error(`Could not get default URN for category="${S}"`)}if(E.length>0){const[S]=await Zd(E,s);g=[...g,...S]}return[g,v]}async function X5(n={}){const{contractAddress:t,tokenId:e,itemId:i}=n,r=n.peerUrl||Wf.get("PEER_URL"),o=n.marketplaceServerUrl||n.nftServerUrl||Wf.get("MARKETPLACE_SERVER_URL");let a=Promise.resolve();t&&(a=WI({contractAddress:t,tokenId:e,itemId:i,peerUrl:r,marketplaceServerUrl:o}));const s=UI(n.profile),l=s?s.type==="address"?zI(s.value,r):GI(s.value,r):Promise.resolve(null),[u,f]=await Promise.all([a,l]),c=n.bodyShape||f&&f.avatar.bodyShape||(u&&as(u)?HF(u):Ce.BodyShape.MALE),h=ou(n.skin||f&&au(f.avatar.skin.color)||"cc9b76"),p=ou(n.hair||f&&au(f.avatar.hair.color)||"000000"),_=ou(n.eyes||f&&au(f.avatar.eyes.color)||"000000"),g=[...n.urns||[]],v=n.urls||[],E=n.base64s||[],T=n.blob?Y5(n.blob):null;let S=[],C=[],O=1.75,A=Ce.PreviewType.WEARABLE,M={color:"#4b4852",transparent:n.disableBackground===!0};if(g.length>0||v.length>0||E.length>0||u&&ko(u)||n.profile){A=Ce.PreviewType.AVATAR;const[N,W]=await j5(f,g,v,E,c,!n.disableDefaultWearables&&!(f!=null&&f.avatar),!n.disableFace,r);S=N,C=W}if(u){if(O=S.length>0?O:N5(u),as(u)){const N=qb(u);yp(N)&&A!==Ce.PreviewType.AVATAR&&(A=Ce.PreviewType.TEXTURE)}if(M={...M,image:u.thumbnail},Ce.isStandard(u)){const N=Ce.Rarity.getColor(u.rarity);M={...M,image:u.thumbnail,color:N}}}let D=n.disableDefaultEmotes||ko(u)?null:n.emote?n.emote:Ce.PreviewEmote.IDLE;n.emote&&Object.values(Ce.PreviewEmote).includes(n.emote)&&(D=n.emote);let U=Ce.PreviewCamera.INTERACTIVE;n.camera&&Object.values(Ce.PreviewCamera).includes(n.camera)&&(U=n.camera);let V=Ce.PreviewProjection.PERSPECTIVE;n.projection&&Object.values(Ce.PreviewProjection).includes(n.projection)&&(V=n.projection);const B=typeof n.autoRotateSpeed=="number"&&!isNaN(n.autoRotateSpeed)?n.autoRotateSpeed:.2,z=!n.disableAutoCenter;let J=1,X=100,re=50;ry(n.wheelZoom)&&(J=Math.max(n.wheelZoom,1)),ry(n.wheelPrecision)&&(X=Math.max(n.wheelPrecision,1)),ry(n.wheelStart)&&(re=100-Math.min(Math.max(n.wheelStart,0),100)),n.background&&(M.color=n.background);let ae=0,se=0,H=0;switch(A){case Ce.PreviewType.WEARABLE:{ae=-2,se=2,H=2;break}case Ce.PreviewType.AVATAR:{ae=0,se=1,H=3.5;break}}iy(n.cameraX)&&(ae=n.cameraX),iy(n.cameraY)&&(se=n.cameraY),iy(n.cameraZ)&&(H=n.cameraZ);let Z=null;(n==null?void 0:n.type)===Ce.PreviewType.WEARABLE&&S.length>=2&&(A=n.type,Z=S[1]);const q=typeof n.zoomScale!="number"||isNaN(n.zoomScale)||n.zoomScale<=0?1:n.zoomScale;return{item:u??T??Z??C.pop(),wearables:S,bodyShape:c,forceRender:(f==null?void 0:f.avatar.forceRender)||[],skin:h,hair:p,eyes:_,type:A,background:M,face:n.disableFace!==!1,emote:D,camera:U,projection:V,autoRotateSpeed:n.disableAutoRotate?0:B,centerBoundingBox:z,offsetX:n.offsetX||0,offsetY:n.offsetY||0,offsetZ:n.offsetZ||0,cameraX:ae,cameraY:se,cameraZ:H,zoom:(typeof n.zoom=="number"?w5(n.zoom):O)*q,wheelZoom:J,wheelPrecision:X,wheelStart:re,fadeEffect:!n.disableFadeEffect,showSceneBoundaries:!!n.showSceneBoundaries,showThumbnailBoundaries:!!n.showThumbnailBoundaries,panning:!!n.panning,lockAlpha:!!n.lockAlpha,lockBeta:!!n.lockBeta,lockRadius:!!n.lockRadius,socialEmote:n.socialEmote||void 0}}function ry(n){return typeof n=="number"&&!isNaN(n)}function WO(n){return{...n,contents:n.contents.map(t=>({key:t.key,url:URL.createObjectURL(t.blob)}))}}function Y5(n){return"emoteDataADR74"in n?{...n,emoteDataADR74:{...n.emoteDataADR74,representations:n.emoteDataADR74.representations.map(WO)}}:{...n,data:{...n.data,representations:n.data.representations.map(WO)}}}const Fd={};function ny(n,t){return t===Fd[n]}function K5(n,t,e=[]){const[i,r]=Ct.useState(!1),[o,a]=Ct.useState(null),[s,l]=Ct.useState("");return typeof Fd[n]>"u"&&(Fd[n]=0),Ct.useEffect(()=>{const u=++Fd[n];r(!0),t().then(f=>{ny(n,u)&&a(f)}).catch(f=>{ny(n,u)&&l(f.message)}).finally(()=>{ny(n,u)&&r(!1)})},e),[o,i,s]}var q5=Jd();const Q5=ub(q5),HI=n=>{const t=Ct.useCallback(n,[]);Ct.useEffect(()=>{function e(i){t(i)}return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t])},$5=()=>{const[n,t]=Ct.useState({});return HI(e=>{if(e.data&&e.data.type===Ce.PreviewMessageType.UPDATE&&typeof e.data.payload=="object"&&typeof e.data.payload.options=="object"){const{options:i}=e.data.payload;Q5(n,i)||t(i)}}),n},$b=()=>{const[n,t]=Ct.useState(()=>new URLSearchParams(window.location.search)),e=Ct.useRef(window.location.search);Ct.useEffect(()=>{const a=window.location.search;a!==e.current&&(t(new URLSearchParams(a)),e.current=a)});const i=Ct.useMemo(()=>{const a=n.get("autoRotateSpeed"),s=n.get("offsetX"),l=n.get("offsetY"),u=n.get("offsetZ"),f=n.get("cameraX"),c=n.get("cameraY"),h=n.get("cameraZ"),p=n.get("zoomScale"),_=n.get("wheelZoom"),g=n.get("wheelPrecision"),v=n.get("wheelStart"),E=n.get("bodyShape"),T=n.get("panning"),S=n.get("lockAlpha"),C=n.get("lockBeta"),O=n.get("lockRadius"),A=n.has("transparentBackground");A&&console.warn('Deprecated: you are using the query param "transparentBackground" that has been deprecated in favor of "disableBackground". Please switch to the new query param since in the future this will not be supported.');const M=n.get("centerBoundingBox")!=="false";return{contractAddress:n.get("contract"),tokenId:n.get("token"),itemId:n.get("item"),skin:n.get("skin"),hair:n.get("hair"),eyes:n.get("eyes"),emote:n.get("emote"),camera:n.get("camera"),projection:n.get("projection"),background:n.get("background"),autoRotateSpeed:a?parseFloat(a):null,offsetX:s?parseFloat(s):null,offsetY:l?parseFloat(l):null,offsetZ:u?parseFloat(u):null,cameraX:f?parseFloat(f):null,cameraY:c?parseFloat(c):null,cameraZ:h?parseFloat(h):null,wheelZoom:_?parseFloat(_):null,wheelPrecision:g?parseFloat(g):null,wheelStart:v?parseFloat(v):null,zoom:L5(n.get("zoom")),zoomScale:p?parseFloat(p):null,bodyShape:E==="female"||E===Ce.BodyShape.FEMALE?Ce.BodyShape.FEMALE:E==="male"||E===Ce.BodyShape.MALE?Ce.BodyShape.MALE:null,urns:n.getAll("urn"),urls:n.getAll("url"),base64s:n.getAll("base64"),profile:n.get("profile"),showSceneBoundaries:n.has("showSceneBoundaries")||!1,showThumbnailBoundaries:n.has("showThumbnailBoundaries")||!1,disableBackground:n.has("disableBackground")||A,disableAutoCenter:n.has("disableAutoCenter")||!M,disableAutoRotate:n.has("disableAutoRotate")||!M,disableFace:n.has("disableFace"),disableDefaultWearables:n.has("disableDefaultWearables"),disableDefaultEmotes:n.has("disableDefaultEmotes"),disableFadeEffect:n.has("disableFadeEffect"),peerUrl:n.get("peerUrl"),marketplaceServerUrl:n.get("marketplaceServerUrl"),nftServerUrl:n.get("nftServerUrl"),type:n.get("type"),panning:T==="true"||T===null,lockAlpha:S==="true",lockBeta:C==="true",lockRadius:O==="true",unityMode:n.get("mode"),disableLoader:n.has("disableLoader"),username:n.get("username"),socialEmote:(()=>{const U=n.get("socialEmote");if(!U)return null;try{return JSON.parse(U)}catch{return null}})()}},[n]),r=$5();return Ct.useMemo(()=>{const a={...i,...r},s={};return Object.keys(r).forEach(l=>{r[l]!==void 0&&(s[l]=!0)}),{options:a,overrideSources:s}},[i,r])};function Z5(){const{options:n}=$b(),[t,e,i]=K5("useConfig",()=>X5(n),[n]);return[t,e,i]}function cn(){return window.parent||window}const jI=()=>{const[n,t]=Ct.useState(!1);Ct.useEffect(()=>{n||(Ce.sendMessage(cn(),Ce.PreviewMessageType.READY,null),t(!0))},[n])};function J5(n,t){Ce.sendMessage(cn(),Ce.PreviewMessageType.CONTROLLER_RESPONSE,{id:n,ok:!0,result:t})}function Sd(n,t){Ce.sendMessage(cn(),Ce.PreviewMessageType.CONTROLLER_RESPONSE,{id:n,ok:!1,error:t})}const XI=()=>{const n=Ct.useRef();return HI(async t=>{if(t.data&&t.data.type===Ce.PreviewMessageType.CONTROLLER_REQUEST&&typeof t.data.payload=="object"&&typeof t.data.payload.id=="string"&&typeof t.data.payload.namespace=="string"&&typeof t.data.payload.method=="string"&&typeof t.data.payload.params=="object"&&Array.isArray(t.data.payload.params)){const{id:e,method:i,namespace:r,params:o}=t.data.payload;if(n.current)if(r in n.current)if(i in n.current[r])try{const l=await n.current[r][i].apply(null,o);J5(e,l)}catch(a){Sd(e,a.message)}else Sd(e,"Invalid method");else Sd(e,"Invalid namespace");else Sd(e,"Controller not ready")}}),n};function eX(n){return t=>t.data.category===n}function lf(n){return t=>t.wearable.data.category===n||(t.wearable.data.hides||[]).includes(n)||(t.wearable.data.replaces||[]).includes(n)}function tX(n){return n.some(t=>{var o,a;const e=t.wearable.data.category===Ce.WearableCategory.UPPER_BODY,i=(o=t.wearable.data.hides)==null?void 0:o.includes(Ce.WearableCategory.UPPER_BODY),r=(a=t.wearable.data.removesDefaultHiding)==null?void 0:a.includes(Ce.BodyPartCategory.HANDS);return(e||i)&&!r})}function iX(n){return!!n}function YI(n){const t=qb(n);return!yp(t)}function rX(n){return!YI(n)}function nX(n,t){var s,l,u;const e=n.name.toLowerCase(),i=e.includes("prop")||e.includes("armature_prop"),r=e.includes("avatarother")||e.includes("armature_other"),o=e.includes("avatar")||e.includes("armature")||!i&&!r;return[((s=t==null?void 0:t.Armature_Prop)==null?void 0:s.animation.toLowerCase())===e&&i,((l=t==null?void 0:t.Armature_Other)==null?void 0:l.animation.toLowerCase())===e&&r,((u=t==null?void 0:t.Armature)==null?void 0:u.animation.toLowerCase())===e&&o,!(t!=null&&t.Armature)&&!(t!=null&&t.Armature_Other)&&!(t!=null&&t.Armature_Prop)].some(f=>f)}function oX(n){const t=[...n.transformNodes,...n.meshes],e=new Set(t);return t.filter(i=>!i.parent||!e.has(i.parent))}function aX(n,t){const e=new Map,i=oX(n),r=(a,s)=>{e.set(a,s);const l=a.getChildren(),u=s.getChildren(),f=Math.min(l.length,u.length);for(let c=0;c<f;c++)r(l[c],u[c])},o=Math.min(i.length,t.length);for(let a=0;a<o;a++)r(i[a],t[a]);return e}const sX=(n,t)=>{for(const e of n)e.getChildMeshes().forEach(i=>{if(!i.material)return;const r=i.material.clone(i.material.name+"_Other");if(!r)return;const o=r.name.toLowerCase().includes("skin");if(o&&r instanceof Ci){const a=r.albedoTexture;a&&a.dispose(),r.albedoTexture=void 0;const s=r.bumpTexture;s&&s.dispose(),r.bumpTexture=void 0;const l=r.metallicTexture;l&&l.dispose(),r.metallicTexture=void 0,r.albedoColor=t,r.specularIntensity=0,i.material=r}else if(o&&r instanceof Mt){const a=r.diffuseTexture;a&&a.dispose(),r.diffuseTexture=void 0;const s=r.bumpTexture;s&&s.dispose(),r.bumpTexture=void 0;const l=r.specularTexture;l&&l.dispose(),r.specularTexture=void 0,r.diffuseColor=t,r.specularColor=_e.Black(),i.material=r}else r.dispose(),i.visibility=0})};function lX(n){const t=n.find(l=>l.wearable.data.category===Ce.WearableCategory.BODY_SHAPE);if(!t)return null;const e=n.some(l=>l.wearable.data.category===Ce.WearableCategory.SKIN),i=e||n.some(lf(Ce.WearableCategory.UPPER_BODY)),r=e||n.some(lf(Ce.WearableCategory.LOWER_BODY)),o=e||n.some(lf(Ce.WearableCategory.FEET)),a=e||n.some(lf(Ce.BodyPartCategory.HEAD)),s=e||n.some(lf(Ce.BodyPartCategory.HANDS))||tX(n);for(const l of t.container.meshes){const u=l.name.toLowerCase();u.endsWith("ubody_basemesh")&&i&&l.setEnabled(!1),u.endsWith("lbody_basemesh")&&r&&l.setEnabled(!1),u.endsWith("feet_basemesh")&&o&&l.setEnabled(!1),u.endsWith("head")&&a&&l.setEnabled(!1),u.endsWith("head_basemesh")&&a&&l.setEnabled(!1),u.endsWith("mask_eyes")&&a&&l.setEnabled(!1),u.endsWith("mask_eyebrows")&&a&&l.setEnabled(!1),u.endsWith("mask_mouth")&&a&&l.setEnabled(!1),u.endsWith("hands_basemesh")&&s&&l.setEnabled(!1)}return t}const KI=[Ce.WearableCategory.HELMET,Ce.WearableCategory.HAIR,Ce.WearableCategory.FACIAL_HAIR,Ce.WearableCategory.MOUTH,Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.EYES,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET,Ce.WearableCategory.HANDS_WEAR,Ce.BodyPartCategory.HANDS],uX=[Ce.WearableCategory.SKIN,Ce.WearableCategory.UPPER_BODY,Ce.WearableCategory.HANDS_WEAR,Ce.WearableCategory.LOWER_BODY,Ce.WearableCategory.FEET,Ce.WearableCategory.HELMET,Ce.WearableCategory.HAT,Ce.WearableCategory.TOP_HEAD,Ce.WearableCategory.MASK,Ce.WearableCategory.EYEWEAR,Ce.WearableCategory.EARRING,Ce.WearableCategory.TIARA,Ce.WearableCategory.HAIR,Ce.WearableCategory.EYEBROWS,Ce.WearableCategory.EYES,Ce.WearableCategory.MOUTH,Ce.WearableCategory.FACIAL_HAIR,Ce.WearableCategory.BODY_SHAPE];function fX(n){const t=n.data.category,e=n.data.replaces||[],i=n.data.hides||[];return t===Ce.WearableCategory.SKIN&&i.push(...KI),Array.from(new Set([...e,...i])).filter(r=>r!==t)}function cX(n){const t=new Map;let e=[...n.wearables];if(n.item&&as(n.item)){e=[];for(const a of n.wearables){const{category:s,hides:l,replaces:u}=n.item.data;a.data.category==="skin"&&(KI.includes(s)||l&&l.includes(Ce.BodyPartCategory.HEAD)||u&&u.includes(Ce.BodyPartCategory.HEAD))||a.data.hides&&a.data.hides.includes(s)||a.data.replaces&&a.data.replaces.includes(s)||e.push(a)}e.push(n.item)}for(const a of e){const s=a.data.category;Qb(a,n.bodyShape)&&t.set(s,a)}const i=n.forceRender||[],r=new Set;for(const a of uX){const s=t.get(a);if(s&&!r.has(a))for(const l of fX(s))r.add(l)}const o=Array.from(r).filter(a=>!i.includes(a));for(const a of o)t.delete(a);return t}function qI(n,t){n&&(n.useAutoRotationBehavior=!0,n.autoRotationBehavior&&(n.autoRotationBehavior.idleRotationSpeed=t.autoRotateSpeed))}const hX="modulepreload",dX=function(n,t){return new URL(n,t).href},HO={},pX=function(t,e,i){let r=Promise.resolve();if(e&&e.length>0){let a=function(f){return Promise.all(f.map(c=>Promise.resolve(c).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const s=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=a(e.map(f=>{if(f=dX(f,i),f in HO)return;HO[f]=!0;const c=f.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(!!i)for(let g=s.length-1;g>=0;g--){const v=s[g];if(v.href===f&&(!c||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${h}`))return;const _=document.createElement("link");if(_.rel=c?"stylesheet":hX,c||(_.as="script"),_.crossOrigin="",_.href=f,u&&_.setAttribute("nonce",u),document.head.appendChild(_),c)return new Promise((g,v)=>{_.addEventListener("load",g),_.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return r.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};var zt=function(){function n(t,e,i){e===void 0&&(e=n.UNITMODE_PIXEL),i===void 0&&(i=!0),this.unit=e,this.negativeValueAllowed=i,this._value=1,this.ignoreAdaptiveScaling=!1,this._value=t,this._originalUnit=e}return Object.defineProperty(n.prototype,"isPercentage",{get:function(){return this.unit===n.UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isPixel",{get:function(){return this.unit===n.UNITMODE_PIXEL},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"internalValue",{get:function(){return this._value},enumerable:!1,configurable:!0}),n.prototype.getValueInPixel=function(t,e){return this.isPixel?this.getValue(t):this.getValue(t)*e},n.prototype.updateInPlace=function(t,e){return e===void 0&&(e=n.UNITMODE_PIXEL),this._value=t,this.unit=e,this},n.prototype.getValue=function(t){if(t&&!this.ignoreAdaptiveScaling&&this.unit!==n.UNITMODE_PERCENTAGE){var e=0,i=0;if(t.idealWidth&&(e=this._value*t.getSize().width/t.idealWidth),t.idealHeight&&(i=this._value*t.getSize().height/t.idealHeight),t.useSmallestIdeal&&t.idealWidth&&t.idealHeight)return window.innerWidth<window.innerHeight?e:i;if(t.idealWidth)return e;if(t.idealHeight)return i}return this._value},n.prototype.toString=function(t,e){switch(this.unit){case n.UNITMODE_PERCENTAGE:var i=this.getValue(t)*100;return(e?i.toFixed(e):i)+"%";case n.UNITMODE_PIXEL:var r=this.getValue(t);return(e?r.toFixed(e):r)+"px"}return this.unit.toString()},n.prototype.fromString=function(t){var e=n._Regex.exec(t.toString());if(!e||e.length===0)return!1;var i=parseFloat(e[1]),r=this._originalUnit;if(this.negativeValueAllowed||i<0&&(i=0),e.length===4)switch(e[3]){case"px":r=n.UNITMODE_PIXEL;break;case"%":r=n.UNITMODE_PERCENTAGE,i/=100;break}return i===this._value&&r===this.unit?!1:(this._value=i,this.unit=r,!0)},Object.defineProperty(n,"UNITMODE_PERCENTAGE",{get:function(){return n._UNITMODE_PERCENTAGE},enumerable:!1,configurable:!0}),Object.defineProperty(n,"UNITMODE_PIXEL",{get:function(){return n._UNITMODE_PIXEL},enumerable:!1,configurable:!0}),n._Regex=/(^-?\d*(\.\d+)?)(%|px)?/,n._UNITMODE_PERCENTAGE=0,n._UNITMODE_PIXEL=1,n}(),Vl=[new Ie(0,0),new Ie(0,0),new Ie(0,0),new Ie(0,0)],uf=[new Ie(0,0),new Ie(0,0),new Ie(0,0),new Ie(0,0)],ha=new Ie(0,0),Gs=new Ie(0,0),Jr=function(){function n(t,e,i,r){this.left=t,this.top=e,this.width=i,this.height=r}return n.prototype.copyFrom=function(t){this.left=t.left,this.top=t.top,this.width=t.width,this.height=t.height},n.prototype.copyFromFloats=function(t,e,i,r){this.left=t,this.top=e,this.width=i,this.height=r},n.CombineToRef=function(t,e,i){var r=Math.min(t.left,e.left),o=Math.min(t.top,e.top),a=Math.max(t.left+t.width,e.left+e.width),s=Math.max(t.top+t.height,e.top+e.height);i.left=r,i.top=o,i.width=a-r,i.height=s-o},n.prototype.addAndTransformToRef=function(t,e,i,r,o,a){var s=this.left+e,l=this.top+i,u=this.width+r,f=this.height+o;Vl[0].copyFromFloats(s,l),Vl[1].copyFromFloats(s+u,l),Vl[2].copyFromFloats(s+u,l+f),Vl[3].copyFromFloats(s,l+f),ha.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE),Gs.copyFromFloats(0,0);for(var c=0;c<4;c++)t.transformCoordinates(Vl[c].x,Vl[c].y,uf[c]),ha.x=Math.floor(Math.min(ha.x,uf[c].x)),ha.y=Math.floor(Math.min(ha.y,uf[c].y)),Gs.x=Math.ceil(Math.max(Gs.x,uf[c].x)),Gs.y=Math.ceil(Math.max(Gs.y,uf[c].y));a.left=ha.x,a.top=ha.y,a.width=Gs.x-ha.x,a.height=Gs.y-ha.y},n.prototype.transformToRef=function(t,e){this.addAndTransformToRef(t,0,0,0,0,e)},n.prototype.isEqualsTo=function(t){return!(this.left!==t.left||this.top!==t.top||this.width!==t.width||this.height!==t.height)},n.Empty=function(){return new n(0,0,0,0)},n}(),oy=function(n){j(t,n);function t(e,i){i===void 0&&(i=0);var r=n.call(this,e.x,e.y)||this;return r.buttonIndex=i,r}return t}(Ie),ay=function(){function n(t,e,i,r,o,a){this.m=new Float32Array(6),this.fromValues(t,e,i,r,o,a)}return n.prototype.fromValues=function(t,e,i,r,o,a){return this.m[0]=t,this.m[1]=e,this.m[2]=i,this.m[3]=r,this.m[4]=o,this.m[5]=a,this},n.prototype.determinant=function(){return this.m[0]*this.m[3]-this.m[1]*this.m[2]},n.prototype.invertToRef=function(t){var e=this.m[0],i=this.m[1],r=this.m[2],o=this.m[3],a=this.m[4],s=this.m[5],l=this.determinant();if(l<Zt*Zt)return t.m[0]=0,t.m[1]=0,t.m[2]=0,t.m[3]=0,t.m[4]=0,t.m[5]=0,this;var u=1/l,f=r*s-o*a,c=i*a-e*s;return t.m[0]=o*u,t.m[1]=-i*u,t.m[2]=-r*u,t.m[3]=e*u,t.m[4]=f*u,t.m[5]=c*u,this},n.prototype.multiplyToRef=function(t,e){var i=this.m[0],r=this.m[1],o=this.m[2],a=this.m[3],s=this.m[4],l=this.m[5],u=t.m[0],f=t.m[1],c=t.m[2],h=t.m[3],p=t.m[4],_=t.m[5];return e.m[0]=i*u+r*c,e.m[1]=i*f+r*h,e.m[2]=o*u+a*c,e.m[3]=o*f+a*h,e.m[4]=s*u+l*c+p,e.m[5]=s*f+l*h+_,this},n.prototype.transformCoordinates=function(t,e,i){return i.x=t*this.m[0]+e*this.m[2]+this.m[4],i.y=t*this.m[1]+e*this.m[3]+this.m[5],this},n.Identity=function(){return new n(1,0,0,1,0,0)},n.TranslationToRef=function(t,e,i){i.fromValues(1,0,0,1,t,e)},n.ScalingToRef=function(t,e,i){i.fromValues(t,0,0,e,0,0)},n.RotationToRef=function(t,e){var i=Math.sin(t),r=Math.cos(t);e.fromValues(r,i,-i,r,0,0)},n.ComposeToRef=function(t,e,i,r,o,a,s){n.TranslationToRef(t,e,n._TempPreTranslationMatrix),n.ScalingToRef(r,o,n._TempScalingMatrix),n.RotationToRef(i,n._TempRotationMatrix),n.TranslationToRef(-t,-e,n._TempPostTranslationMatrix),n._TempPreTranslationMatrix.multiplyToRef(n._TempScalingMatrix,n._TempCompose0),n._TempCompose0.multiplyToRef(n._TempRotationMatrix,n._TempCompose1),a?(n._TempCompose1.multiplyToRef(n._TempPostTranslationMatrix,n._TempCompose2),n._TempCompose2.multiplyToRef(a,s)):n._TempCompose1.multiplyToRef(n._TempPostTranslationMatrix,s)},n._TempPreTranslationMatrix=n.Identity(),n._TempPostTranslationMatrix=n.Identity(),n._TempRotationMatrix=n.Identity(),n._TempScalingMatrix=n.Identity(),n._TempCompose0=n.Identity(),n._TempCompose1=n.Identity(),n._TempCompose2=n.Identity(),n}(),ot=function(){function n(t){this.name=t,this._alpha=1,this._alphaSet=!1,this._zIndex=0,this._currentMeasure=Jr.Empty(),this._fontFamily="Arial",this._fontStyle="",this._fontWeight="",this._fontSize=new zt(18,zt.UNITMODE_PIXEL,!1),this._width=new zt(1,zt.UNITMODE_PERCENTAGE,!1),this._height=new zt(1,zt.UNITMODE_PERCENTAGE,!1),this._color="",this._style=null,this._horizontalAlignment=n.HORIZONTAL_ALIGNMENT_CENTER,this._verticalAlignment=n.VERTICAL_ALIGNMENT_CENTER,this._isDirty=!0,this._wasDirty=!1,this._tempParentMeasure=Jr.Empty(),this._prevCurrentMeasureTransformedIntoGlobalSpace=Jr.Empty(),this._cachedParentMeasure=Jr.Empty(),this._paddingLeft=new zt(0),this._paddingRight=new zt(0),this._paddingTop=new zt(0),this._paddingBottom=new zt(0),this._left=new zt(0),this._top=new zt(0),this._scaleX=1,this._scaleY=1,this._rotation=0,this._transformCenterX=.5,this._transformCenterY=.5,this._transformMatrix=ay.Identity(),this._invertTransformMatrix=ay.Identity(),this._transformedPosition=Ie.Zero(),this._isMatrixDirty=!0,this._isVisible=!0,this._isHighlighted=!1,this._fontSet=!1,this._dummyVector2=Ie.Zero(),this._downCount=0,this._enterCount=-1,this._doNotRender=!1,this._downPointerIds={},this._isEnabled=!0,this._disabledColor="#9a9a9a",this._disabledColorItem="#6a6a6a",this._rebuildLayout=!1,this._customData={},this._isClipped=!1,this._automaticSize=!1,this.metadata=null,this.isHitTestVisible=!0,this.isPointerBlocker=!1,this.isFocusInvisible=!1,this.clipChildren=!0,this.clipContent=!0,this.useBitmapCache=!1,this._shadowOffsetX=0,this._shadowOffsetY=0,this._shadowBlur=0,this._shadowColor="black",this.hoverCursor="",this._linkOffsetX=new zt(0),this._linkOffsetY=new zt(0),this.onWheelObservable=new ie,this.onPointerMoveObservable=new ie,this.onPointerOutObservable=new ie,this.onPointerDownObservable=new ie,this.onPointerUpObservable=new ie,this.onPointerClickObservable=new ie,this.onPointerEnterObservable=new ie,this.onDirtyObservable=new ie,this.onBeforeDrawObservable=new ie,this.onAfterDrawObservable=new ie,this.onDisposeObservable=new ie,this.fixedRatio=0,this._fixedRatioMasterIsWidth=!0,this._tmpMeasureA=new Jr(0,0,0,0)}return Object.defineProperty(n.prototype,"shadowOffsetX",{get:function(){return this._shadowOffsetX},set:function(t){this._shadowOffsetX!==t&&(this._shadowOffsetX=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shadowOffsetY",{get:function(){return this._shadowOffsetY},set:function(t){this._shadowOffsetY!==t&&(this._shadowOffsetY=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shadowBlur",{get:function(){return this._shadowBlur},set:function(t){this._shadowBlur!==t&&(this._shadowBlur=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shadowColor",{get:function(){return this._shadowColor},set:function(t){this._shadowColor!==t&&(this._shadowColor=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"typeName",{get:function(){return this._getTypeName()},enumerable:!1,configurable:!0}),n.prototype.getClassName=function(){return this._getTypeName()},Object.defineProperty(n.prototype,"host",{get:function(){return this._host},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontOffset",{get:function(){return this._fontOffset},set:function(t){this._fontOffset=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alphaSet=!0,this._alpha=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isHighlighted",{get:function(){return this._isHighlighted},set:function(t){this._isHighlighted!==t&&(this._isHighlighted=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"scaleX",{get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"scaleY",{get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transformCenterY",{get:function(){return this._transformCenterY},set:function(t){this._transformCenterY!==t&&(this._transformCenterY=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transformCenterX",{get:function(){return this._transformCenterX},set:function(t){this._transformCenterX!==t&&(this._transformCenterX=t,this._markAsDirty(),this._markMatrixAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"horizontalAlignment",{get:function(){return this._horizontalAlignment},set:function(t){this._horizontalAlignment!==t&&(this._horizontalAlignment=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"verticalAlignment",{get:function(){return this._verticalAlignment},set:function(t){this._verticalAlignment!==t&&(this._verticalAlignment=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(t){this._fixedRatioMasterIsWidth=!0,this._width.toString(this._host)!==t&&this._width.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"widthInPixels",{get:function(){return this._width.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this._fixedRatioMasterIsWidth=!0,this.width=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(t){this._fixedRatioMasterIsWidth=!1,this._height.toString(this._host)!==t&&this._height.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"heightInPixels",{get:function(){return this._height.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this._fixedRatioMasterIsWidth=!1,this.height=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontFamily",{get:function(){return this._fontSet?this._fontFamily:""},set:function(t){this._fontFamily!==t&&(this._fontFamily=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this._style},set:function(t){var e=this;this._style&&(this._style.onChangedObservable.remove(this._styleObserver),this._styleObserver=null),this._style=t,this._style&&(this._styleObserver=this._style.onChangedObservable.add(function(){e._markAsDirty(),e._resetFontCache()})),this._markAsDirty(),this._resetFontCache()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_isFontSizeInPercentage",{get:function(){return this._fontSize.isPercentage},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontSizeInPixels",{get:function(){var t=this._style?this._style._fontSize:this._fontSize;return t.isPixel?t.getValue(this._host):t.getValueInPixel(this._host,this._tempParentMeasure.height||this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.fontSize=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontSize",{get:function(){return this._fontSize.toString(this._host)},set:function(t){this._fontSize.toString(this._host)!==t&&this._fontSize.fromString(t)&&(this._markAsDirty(),this._resetFontCache())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this._color},set:function(t){this._color!==t&&(this._color=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this.zIndex!==t&&(this._zIndex=t,this.parent&&this.parent._reOrderControl(this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"notRenderable",{get:function(){return this._doNotRender},set:function(t){this._doNotRender!==t&&(this._doNotRender=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!==t&&(this._isVisible=t,this._markAsDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkedMesh",{get:function(){return this._linkedMesh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingLeft",{get:function(){return this._paddingLeft.toString(this._host)},set:function(t){this._paddingLeft.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingLeftInPixels",{get:function(){return this._paddingLeft.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.paddingLeft=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingRight",{get:function(){return this._paddingRight.toString(this._host)},set:function(t){this._paddingRight.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingRightInPixels",{get:function(){return this._paddingRight.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.paddingRight=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingTop",{get:function(){return this._paddingTop.toString(this._host)},set:function(t){this._paddingTop.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingTopInPixels",{get:function(){return this._paddingTop.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.paddingTop=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingBottom",{get:function(){return this._paddingBottom.toString(this._host)},set:function(t){this._paddingBottom.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"paddingBottomInPixels",{get:function(){return this._paddingBottom.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.paddingBottom=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"left",{get:function(){return this._left.toString(this._host)},set:function(t){this._left.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"leftInPixels",{get:function(){return this._left.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.left=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"top",{get:function(){return this._top.toString(this._host)},set:function(t){this._top.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"topInPixels",{get:function(){return this._top.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.top=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetX",{get:function(){return this._linkOffsetX.toString(this._host)},set:function(t){this._linkOffsetX.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetXInPixels",{get:function(){return this._linkOffsetX.getValueInPixel(this._host,this._cachedParentMeasure.width)},set:function(t){isNaN(t)||(this.linkOffsetX=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetY",{get:function(){return this._linkOffsetY.toString(this._host)},set:function(t){this._linkOffsetY.fromString(t)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"linkOffsetYInPixels",{get:function(){return this._linkOffsetY.getValueInPixel(this._host,this._cachedParentMeasure.height)},set:function(t){isNaN(t)||(this.linkOffsetY=t+"px")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"centerX",{get:function(){return this._currentMeasure.left+this._currentMeasure.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"centerY",{get:function(){return this._currentMeasure.top+this._currentMeasure.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(t){this._isEnabled!==t&&(this._isEnabled=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabledColor",{get:function(){return this._disabledColor},set:function(t){this._disabledColor!==t&&(this._disabledColor=t,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabledColorItem",{get:function(){return this._disabledColorItem},set:function(t){this._disabledColorItem!==t&&(this._disabledColorItem=t,this._markAsDirty())},enumerable:!1,configurable:!0}),n.prototype._getTypeName=function(){return"Control"},n.prototype.getAscendantOfClass=function(t){return this.parent?this.parent.getClassName()===t?this.parent:this.parent.getAscendantOfClass(t):null},n.prototype._resetFontCache=function(){this._fontSet=!0,this._markAsDirty()},n.prototype.isAscendant=function(t){return this.parent?this.parent===t?!0:this.parent.isAscendant(t):!1},n.prototype.getLocalCoordinates=function(t){var e=Ie.Zero();return this.getLocalCoordinatesToRef(t,e),e},n.prototype.getLocalCoordinatesToRef=function(t,e){return e.x=t.x-this._currentMeasure.left,e.y=t.y-this._currentMeasure.top,this},n.prototype.getParentLocalCoordinates=function(t){var e=Ie.Zero();return e.x=t.x-this._cachedParentMeasure.left,e.y=t.y-this._cachedParentMeasure.top,e},n.prototype.moveToVector3=function(t,e){if(!this._host||this.parent!==this._host._rootContainer){Ee.Error("Cannot move a control to a vector3 if the control is not at root level");return}this.horizontalAlignment=n.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=n.VERTICAL_ALIGNMENT_TOP;var i=this._host._getGlobalViewport(e),r=y.Project(t,te.Identity(),e.getTransformMatrix(),i);if(this._moveToProjectedPosition(r),r.z<0||r.z>1){this.notRenderable=!0;return}this.notRenderable=!1},n.prototype.getDescendantsToRef=function(t,e,i){},n.prototype.getDescendants=function(t,e){var i=new Array;return this.getDescendantsToRef(i,t,e),i},n.prototype.linkWithMesh=function(t){if(!this._host||this.parent&&this.parent!==this._host._rootContainer){t&&Ee.Error("Cannot link a control to a mesh if the control is not at root level");return}var e=this._host._linkedControls.indexOf(this);if(e!==-1){this._linkedMesh=t,t||this._host._linkedControls.splice(e,1);return}else if(!t)return;this.horizontalAlignment=n.HORIZONTAL_ALIGNMENT_LEFT,this.verticalAlignment=n.VERTICAL_ALIGNMENT_TOP,this._linkedMesh=t,this._host._linkedControls.push(this)},n.prototype._moveToProjectedPosition=function(t){var e=this._left.getValue(this._host),i=this._top.getValue(this._host),r=t.x+this._linkOffsetX.getValue(this._host)-this._currentMeasure.width/2,o=t.y+this._linkOffsetY.getValue(this._host)-this._currentMeasure.height/2;this._left.ignoreAdaptiveScaling&&this._top.ignoreAdaptiveScaling&&(Math.abs(r-e)<.5&&(r=e),Math.abs(o-i)<.5&&(o=i)),this.left=r+"px",this.top=o+"px",this._left.ignoreAdaptiveScaling=!0,this._top.ignoreAdaptiveScaling=!0,this._markAsDirty()},n.prototype._offsetLeft=function(t){this._isDirty=!0,this._currentMeasure.left+=t},n.prototype._offsetTop=function(t){this._isDirty=!0,this._currentMeasure.top+=t},n.prototype._markMatrixAsDirty=function(){this._isMatrixDirty=!0,this._flagDescendantsAsMatrixDirty()},n.prototype._flagDescendantsAsMatrixDirty=function(){},n.prototype._intersectsRect=function(t){return this._currentMeasure.transformToRef(this._transformMatrix,this._tmpMeasureA),!(this._tmpMeasureA.left>=t.left+t.width||this._tmpMeasureA.top>=t.top+t.height||this._tmpMeasureA.left+this._tmpMeasureA.width<=t.left||this._tmpMeasureA.top+this._tmpMeasureA.height<=t.top)},n.prototype.invalidateRect=function(){if(this._transform(),this.host&&this.host.useInvalidateRectOptimization)if(this._currentMeasure.transformToRef(this._transformMatrix,this._tmpMeasureA),Jr.CombineToRef(this._tmpMeasureA,this._prevCurrentMeasureTransformedIntoGlobalSpace,this._tmpMeasureA),this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY){var t=this.shadowOffsetX,e=this.shadowOffsetY,i=this.shadowBlur,r=Math.min(Math.min(t,0)-i*2,0),o=Math.max(Math.max(t,0)+i*2,0),a=Math.min(Math.min(e,0)-i*2,0),s=Math.max(Math.max(e,0)+i*2,0);this.host.invalidateRect(Math.floor(this._tmpMeasureA.left+r),Math.floor(this._tmpMeasureA.top+a),Math.ceil(this._tmpMeasureA.left+this._tmpMeasureA.width+o),Math.ceil(this._tmpMeasureA.top+this._tmpMeasureA.height+s))}else this.host.invalidateRect(Math.floor(this._tmpMeasureA.left),Math.floor(this._tmpMeasureA.top),Math.ceil(this._tmpMeasureA.left+this._tmpMeasureA.width),Math.ceil(this._tmpMeasureA.top+this._tmpMeasureA.height))},n.prototype._markAsDirty=function(t){t===void 0&&(t=!1),!(!this._isVisible&&!t)&&(this._isDirty=!0,this._host&&this._host.markAsDirty())},n.prototype._markAllAsDirty=function(){this._markAsDirty(),this._font&&this._prepareFont()},n.prototype._link=function(t){this._host=t,this._host&&(this.uniqueId=this._host.getScene().getUniqueId())},n.prototype._transform=function(t){if(!(!this._isMatrixDirty&&this._scaleX===1&&this._scaleY===1&&this._rotation===0)){var e=this._currentMeasure.width*this._transformCenterX+this._currentMeasure.left,i=this._currentMeasure.height*this._transformCenterY+this._currentMeasure.top;t&&(t.translate(e,i),t.rotate(this._rotation),t.scale(this._scaleX,this._scaleY),t.translate(-e,-i)),(this._isMatrixDirty||this._cachedOffsetX!==e||this._cachedOffsetY!==i)&&(this._cachedOffsetX=e,this._cachedOffsetY=i,this._isMatrixDirty=!1,this._flagDescendantsAsMatrixDirty(),ay.ComposeToRef(-e,-i,this._rotation,this._scaleX,this._scaleY,this.parent?this.parent._transformMatrix:null,this._transformMatrix),this._transformMatrix.invertToRef(this._invertTransformMatrix))}},n.prototype._renderHighlight=function(t){this.isHighlighted&&(t.save(),t.strokeStyle="#4affff",t.lineWidth=2,this._renderHighlightSpecific(t),t.restore())},n.prototype._renderHighlightSpecific=function(t){t.strokeRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)},n.prototype._applyStates=function(t){this._isFontSizeInPercentage&&(this._fontSet=!0),this._fontSet&&(this._prepareFont(),this._fontSet=!1),this._font&&(t.font=this._font),this._color&&(t.fillStyle=this._color),n.AllowAlphaInheritance?t.globalAlpha*=this._alpha:this._alphaSet&&(t.globalAlpha=this.parent?this.parent.alpha*this._alpha:this._alpha)},n.prototype._layout=function(t,e){if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;if(this._isDirty||!this._cachedParentMeasure.isEqualsTo(t)){this.host._numLayoutCalls++,this._currentMeasure.addAndTransformToRef(this._transformMatrix,-this.paddingLeftInPixels|0,-this.paddingTopInPixels|0,this.paddingRightInPixels|0,this.paddingBottomInPixels|0,this._prevCurrentMeasureTransformedIntoGlobalSpace),e.save(),this._applyStates(e);var i=0;do this._rebuildLayout=!1,this._processMeasures(t,e),i++;while(this._rebuildLayout&&i<3);i>=3&&de.Error("Layout cycle detected in GUI (Control name="+this.name+", uniqueId="+this.uniqueId+")"),e.restore(),this.invalidateRect(),this._evaluateClippingState(t)}return this._wasDirty=this._isDirty,this._isDirty=!1,!0},n.prototype._processMeasures=function(t,e){this._currentMeasure.copyFrom(t),this._preMeasure(t,e),this._measure(),this._computeAlignment(t,e),this._currentMeasure.left=this._currentMeasure.left|0,this._currentMeasure.top=this._currentMeasure.top|0,this._currentMeasure.width=this._currentMeasure.width|0,this._currentMeasure.height=this._currentMeasure.height|0,this._additionalProcessing(t,e),this._cachedParentMeasure.copyFrom(t),this.onDirtyObservable.hasObservers()&&this.onDirtyObservable.notifyObservers(this)},n.prototype._evaluateClippingState=function(t){if(this.parent&&this.parent.clipChildren){if(this._currentMeasure.left>t.left+t.width){this._isClipped=!0;return}if(this._currentMeasure.left+this._currentMeasure.width<t.left){this._isClipped=!0;return}if(this._currentMeasure.top>t.top+t.height){this._isClipped=!0;return}if(this._currentMeasure.top+this._currentMeasure.height<t.top){this._isClipped=!0;return}}this._isClipped=!1},n.prototype._measure=function(){this._width.isPixel?this._currentMeasure.width=this._width.getValue(this._host):this._currentMeasure.width*=this._width.getValue(this._host),this._height.isPixel?this._currentMeasure.height=this._height.getValue(this._host):this._currentMeasure.height*=this._height.getValue(this._host),this.fixedRatio!==0&&(this._fixedRatioMasterIsWidth?this._currentMeasure.height=this._currentMeasure.width*this.fixedRatio:this._currentMeasure.width=this._currentMeasure.height*this.fixedRatio)},n.prototype._computeAlignment=function(t,e){var i=this._currentMeasure.width,r=this._currentMeasure.height,o=t.width,a=t.height,s=0,l=0;switch(this.horizontalAlignment){case n.HORIZONTAL_ALIGNMENT_LEFT:s=0;break;case n.HORIZONTAL_ALIGNMENT_RIGHT:s=o-i;break;case n.HORIZONTAL_ALIGNMENT_CENTER:s=(o-i)/2;break}switch(this.verticalAlignment){case n.VERTICAL_ALIGNMENT_TOP:l=0;break;case n.VERTICAL_ALIGNMENT_BOTTOM:l=a-r;break;case n.VERTICAL_ALIGNMENT_CENTER:l=(a-r)/2;break}this._paddingLeft.isPixel?(this._currentMeasure.left+=this._paddingLeft.getValue(this._host),this._currentMeasure.width-=this._paddingLeft.getValue(this._host)):(this._currentMeasure.left+=o*this._paddingLeft.getValue(this._host),this._currentMeasure.width-=o*this._paddingLeft.getValue(this._host)),this._paddingRight.isPixel?this._currentMeasure.width-=this._paddingRight.getValue(this._host):this._currentMeasure.width-=o*this._paddingRight.getValue(this._host),this._paddingTop.isPixel?(this._currentMeasure.top+=this._paddingTop.getValue(this._host),this._currentMeasure.height-=this._paddingTop.getValue(this._host)):(this._currentMeasure.top+=a*this._paddingTop.getValue(this._host),this._currentMeasure.height-=a*this._paddingTop.getValue(this._host)),this._paddingBottom.isPixel?this._currentMeasure.height-=this._paddingBottom.getValue(this._host):this._currentMeasure.height-=a*this._paddingBottom.getValue(this._host),this._left.isPixel?this._currentMeasure.left+=this._left.getValue(this._host):this._currentMeasure.left+=o*this._left.getValue(this._host),this._top.isPixel?this._currentMeasure.top+=this._top.getValue(this._host):this._currentMeasure.top+=a*this._top.getValue(this._host),this._currentMeasure.left+=s,this._currentMeasure.top+=l},n.prototype._preMeasure=function(t,e){},n.prototype._additionalProcessing=function(t,e){},n.prototype._clipForChildren=function(t){},n.prototype._clip=function(t,e){if(t.beginPath(),n._ClipMeasure.copyFrom(this._currentMeasure),e){e.transformToRef(this._invertTransformMatrix,this._tmpMeasureA);var i=new Jr(0,0,0,0);i.left=Math.max(this._tmpMeasureA.left,this._currentMeasure.left),i.top=Math.max(this._tmpMeasureA.top,this._currentMeasure.top),i.width=Math.min(this._tmpMeasureA.left+this._tmpMeasureA.width,this._currentMeasure.left+this._currentMeasure.width)-i.left,i.height=Math.min(this._tmpMeasureA.top+this._tmpMeasureA.height,this._currentMeasure.top+this._currentMeasure.height)-i.top,n._ClipMeasure.copyFrom(i)}if(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY){var r=this.shadowOffsetX,o=this.shadowOffsetY,a=this.shadowBlur,s=Math.min(Math.min(r,0)-a*2,0),l=Math.max(Math.max(r,0)+a*2,0),u=Math.min(Math.min(o,0)-a*2,0),f=Math.max(Math.max(o,0)+a*2,0);t.rect(n._ClipMeasure.left+s,n._ClipMeasure.top+u,n._ClipMeasure.width+l-s,n._ClipMeasure.height+f-u)}else t.rect(n._ClipMeasure.left,n._ClipMeasure.top,n._ClipMeasure.width,n._ClipMeasure.height);t.clip()},n.prototype._render=function(t,e){return!this.isVisible||this.notRenderable||this._isClipped?(this._isDirty=!1,!1):(this.host._numRenderCalls++,t.save(),this._applyStates(t),this._transform(t),this.clipContent&&this._clip(t,e),this.onBeforeDrawObservable.hasObservers()&&this.onBeforeDrawObservable.notifyObservers(this),this.useBitmapCache&&!this._wasDirty&&this._cacheData?t.putImageData(this._cacheData,this._currentMeasure.left,this._currentMeasure.top):this._draw(t,e),this.useBitmapCache&&this._wasDirty&&(this._cacheData=t.getImageData(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._renderHighlight(t),this.onAfterDrawObservable.hasObservers()&&this.onAfterDrawObservable.notifyObservers(this),t.restore(),!0)},n.prototype._draw=function(t,e){},n.prototype.contains=function(t,e){return this._invertTransformMatrix.transformCoordinates(t,e,this._transformedPosition),t=this._transformedPosition.x,e=this._transformedPosition.y,t<this._currentMeasure.left||t>this._currentMeasure.left+this._currentMeasure.width||e<this._currentMeasure.top||e>this._currentMeasure.top+this._currentMeasure.height?!1:(this.isPointerBlocker&&(this._host._shouldBlockPointer=!0),!0)},n.prototype._processPicking=function(t,e,i,r,o,a,s,l){return!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this._doNotRender||!this.contains(t,e)?!1:(this._processObservables(r,t,e,i,o,a,s,l),!0)},n.prototype._onPointerMove=function(t,e,i,r){var o=this.onPointerMoveObservable.notifyObservers(e,-1,t,this,r);o&&this.parent!=null&&this.parent._onPointerMove(t,e,i,r)},n.prototype._onPointerEnter=function(t,e){if(!this._isEnabled||this._enterCount>0)return!1;this._enterCount===-1&&(this._enterCount=0),this._enterCount++;var i=this.onPointerEnterObservable.notifyObservers(this,-1,t,this,e);return i&&this.parent!=null&&this.parent._onPointerEnter(t,e),!0},n.prototype._onPointerOut=function(t,e,i){if(i===void 0&&(i=!1),!(!i&&(!this._isEnabled||t===this))){this._enterCount=0;var r=!0;t.isAscendant(this)||(r=this.onPointerOutObservable.notifyObservers(this,-1,t,this,e)),r&&this.parent!=null&&this.parent._onPointerOut(t,e,i)}},n.prototype._onPointerDown=function(t,e,i,r,o){if(this._onPointerEnter(this,o),this._downCount!==0)return!1;this._downCount++,this._downPointerIds[i]=!0;var a=this.onPointerDownObservable.notifyObservers(new oy(e,r),-1,t,this,o);return a&&this.parent!=null&&this.parent._onPointerDown(t,e,i,r,o),!0},n.prototype._onPointerUp=function(t,e,i,r,o,a){if(this._isEnabled){this._downCount=0,delete this._downPointerIds[i];var s=o;o&&(this._enterCount>0||this._enterCount===-1)&&(s=this.onPointerClickObservable.notifyObservers(new oy(e,r),-1,t,this,a));var l=this.onPointerUpObservable.notifyObservers(new oy(e,r),-1,t,this,a);l&&this.parent!=null&&this.parent._onPointerUp(t,e,i,r,s,a)}},n.prototype._forcePointerUp=function(t){if(t===void 0&&(t=null),t!==null)this._onPointerUp(this,Ie.Zero(),t,0,!0);else for(var e in this._downPointerIds)this._onPointerUp(this,Ie.Zero(),+e,0,!0)},n.prototype._onWheelScroll=function(t,e){if(this._isEnabled){var i=this.onWheelObservable.notifyObservers(new Ie(t,e));i&&this.parent!=null&&this.parent._onWheelScroll(t,e)}},n.prototype._onCanvasBlur=function(){},n.prototype._processObservables=function(t,e,i,r,o,a,s,l){if(!this._isEnabled)return!1;if(this._dummyVector2.copyFromFloats(e,i),t===He.POINTERMOVE){this._onPointerMove(this,this._dummyVector2,o,r);var u=this._host._lastControlOver[o];return u&&u!==this&&u._onPointerOut(this,r),u!==this&&this._onPointerEnter(this,r),this._host._lastControlOver[o]=this,!0}return t===He.POINTERDOWN?(this._onPointerDown(this,this._dummyVector2,o,a,r),this._host._registerLastControlDown(this,o),this._host._lastPickedControl=this,!0):t===He.POINTERUP?(this._host._lastControlDown[o]&&this._host._lastControlDown[o]._onPointerUp(this,this._dummyVector2,o,a,!0,r),delete this._host._lastControlDown[o],!0):t===He.POINTERWHEEL&&this._host._lastControlOver[o]?(this._host._lastControlOver[o]._onWheelScroll(s,l),!0):!1},n.prototype._prepareFont=function(){!this._font&&!this._fontSet||(this._style?this._font=this._style.fontStyle+" "+this._style.fontWeight+" "+this.fontSizeInPixels+"px "+this._style.fontFamily:this._font=this._fontStyle+" "+this._fontWeight+" "+this.fontSizeInPixels+"px "+this._fontFamily,this._fontOffset=n._GetFontOffset(this._font))},n.prototype.dispose=function(){if(this.onDirtyObservable.clear(),this.onBeforeDrawObservable.clear(),this.onAfterDrawObservable.clear(),this.onPointerDownObservable.clear(),this.onPointerEnterObservable.clear(),this.onPointerMoveObservable.clear(),this.onPointerOutObservable.clear(),this.onPointerUpObservable.clear(),this.onPointerClickObservable.clear(),this.onWheelObservable.clear(),this._styleObserver&&this._style&&(this._style.onChangedObservable.remove(this._styleObserver),this._styleObserver=null),this.parent&&(this.parent.removeControl(this),this.parent=null),this._host){var t=this._host._linkedControls.indexOf(this);t>-1&&this.linkWithMesh(null)}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},Object.defineProperty(n,"HORIZONTAL_ALIGNMENT_LEFT",{get:function(){return n._HORIZONTAL_ALIGNMENT_LEFT},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HORIZONTAL_ALIGNMENT_RIGHT",{get:function(){return n._HORIZONTAL_ALIGNMENT_RIGHT},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HORIZONTAL_ALIGNMENT_CENTER",{get:function(){return n._HORIZONTAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),Object.defineProperty(n,"VERTICAL_ALIGNMENT_TOP",{get:function(){return n._VERTICAL_ALIGNMENT_TOP},enumerable:!1,configurable:!0}),Object.defineProperty(n,"VERTICAL_ALIGNMENT_BOTTOM",{get:function(){return n._VERTICAL_ALIGNMENT_BOTTOM},enumerable:!1,configurable:!0}),Object.defineProperty(n,"VERTICAL_ALIGNMENT_CENTER",{get:function(){return n._VERTICAL_ALIGNMENT_CENTER},enumerable:!1,configurable:!0}),n._GetFontOffset=function(t){if(n._FontHeightSizes[t])return n._FontHeightSizes[t];var e=document.createElement("span");e.innerHTML="Hg",e.style.font=t;var i=document.createElement("div");i.style.display="inline-block",i.style.width="1px",i.style.height="0px",i.style.verticalAlign="bottom";var r=document.createElement("div");r.style.whiteSpace="nowrap",r.appendChild(e),r.appendChild(i),document.body.appendChild(r);var o=0,a=0;try{a=i.getBoundingClientRect().top-e.getBoundingClientRect().top,i.style.verticalAlign="baseline",o=i.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(r)}var s={ascent:o,height:a,descent:a-o};return n._FontHeightSizes[t]=s,s},n.drawEllipse=function(t,e,i,r,o){o.translate(t,e),o.scale(i,r),o.beginPath(),o.arc(0,0,1,0,2*Math.PI),o.closePath(),o.scale(1/i,1/r),o.translate(-t,-e)},n.AllowAlphaInheritance=!1,n._ClipMeasure=new Jr(0,0,0,0),n._HORIZONTAL_ALIGNMENT_LEFT=0,n._HORIZONTAL_ALIGNMENT_RIGHT=1,n._HORIZONTAL_ALIGNMENT_CENTER=2,n._VERTICAL_ALIGNMENT_TOP=0,n._VERTICAL_ALIGNMENT_BOTTOM=1,n._VERTICAL_ALIGNMENT_CENTER=2,n._FontHeightSizes={},n.AddHeader=function(){},n}();Ae.RegisteredTypes["BABYLON.GUI.Control"]=ot;var ao=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._children=new Array,i._measureForChildren=Jr.Empty(),i._background="",i._adaptWidthToChildren=!1,i._adaptHeightToChildren=!1,i.logLayoutCycleErrors=!1,i.maxLayoutCycle=3,i}return Object.defineProperty(t.prototype,"adaptHeightToChildren",{get:function(){return this._adaptHeightToChildren},set:function(e){this._adaptHeightToChildren!==e&&(this._adaptHeightToChildren=e,e&&(this.height="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adaptWidthToChildren",{get:function(){return this._adaptWidthToChildren},set:function(e){this._adaptWidthToChildren!==e&&(this._adaptWidthToChildren=e,e&&(this.width="100%"),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Container"},t.prototype._flagDescendantsAsMatrixDirty=function(){for(var e=0,i=this.children;e<i.length;e++){var r=i[e];r._markMatrixAsDirty()}},t.prototype.getChildByName=function(e){for(var i=0,r=this.children;i<r.length;i++){var o=r[i];if(o.name===e)return o}return null},t.prototype.getChildByType=function(e,i){for(var r=0,o=this.children;r<o.length;r++){var a=o[r];if(a.typeName===i)return a}return null},t.prototype.containsControl=function(e){return this.children.indexOf(e)!==-1},t.prototype.addControl=function(e){if(!e)return this;var i=this._children.indexOf(e);return i!==-1?this:(e._link(this._host),e._markAllAsDirty(),this._reOrderControl(e),this._markAsDirty(),this)},t.prototype.clearControls=function(){for(var e=this.children.slice(),i=0,r=e;i<r.length;i++){var o=r[i];this.removeControl(o)}return this},t.prototype.removeControl=function(e){var i=this._children.indexOf(e);return i!==-1&&(this._children.splice(i,1),e.parent=null),e.linkWithMesh(null),this._host&&this._host._cleanControlAfterRemoval(e),this._markAsDirty(),this},t.prototype._reOrderControl=function(e){this.removeControl(e);for(var i=!1,r=0;r<this._children.length;r++)if(this._children[r].zIndex>e.zIndex){this._children.splice(r,0,e),i=!0;break}i||this._children.push(e),e.parent=this,this._markAsDirty()},t.prototype._offsetLeft=function(e){n.prototype._offsetLeft.call(this,e);for(var i=0,r=this._children;i<r.length;i++){var o=r[i];o._offsetLeft(e)}},t.prototype._offsetTop=function(e){n.prototype._offsetTop.call(this,e);for(var i=0,r=this._children;i<r.length;i++){var o=r[i];o._offsetTop(e)}},t.prototype._markAllAsDirty=function(){n.prototype._markAllAsDirty.call(this);for(var e=0;e<this._children.length;e++)this._children[e]._markAllAsDirty()},t.prototype._localDraw=function(e){this._background&&(e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),e.fillStyle=this._background,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height),e.restore())},t.prototype._link=function(e){n.prototype._link.call(this,e);for(var i=0,r=this._children;i<r.length;i++){var o=r[i];o._link(e)}},t.prototype._beforeLayout=function(){},t.prototype._processMeasures=function(e,i){(this._isDirty||!this._cachedParentMeasure.isEqualsTo(e))&&(n.prototype._processMeasures.call(this,e,i),this._evaluateClippingState(e))},t.prototype._layout=function(e,i){if(!this.isDirty&&(!this.isVisible||this.notRenderable))return!1;this.host._numLayoutCalls++,this._isDirty&&this._currentMeasure.transformToRef(this._transformMatrix,this._prevCurrentMeasureTransformedIntoGlobalSpace);var r=0;i.save(),this._applyStates(i),this._beforeLayout();do{var o=-1,a=-1;if(this._rebuildLayout=!1,this._processMeasures(e,i),!this._isClipped){for(var s=0,l=this._children;s<l.length;s++){var u=l[s];u._tempParentMeasure.copyFrom(this._measureForChildren),u._layout(this._measureForChildren,i)&&(this.adaptWidthToChildren&&u._width.isPixel&&(o=Math.max(o,u._currentMeasure.width+u.paddingLeftInPixels+u.paddingRightInPixels)),this.adaptHeightToChildren&&u._height.isPixel&&(a=Math.max(a,u._currentMeasure.height+u.paddingTopInPixels+u.paddingBottomInPixels)))}this.adaptWidthToChildren&&o>=0&&(o+=this.paddingLeftInPixels+this.paddingRightInPixels,this.width!==o+"px"&&(this.width=o+"px",this._rebuildLayout=!0)),this.adaptHeightToChildren&&a>=0&&(a+=this.paddingTopInPixels+this.paddingBottomInPixels,this.height!==a+"px"&&(this.height=a+"px",this._rebuildLayout=!0)),this._postMeasure()}r++}while(this._rebuildLayout&&r<this.maxLayoutCycle);return r>=3&&this.logLayoutCycleErrors&&de.Error("Layout cycle detected in GUI (Container name="+this.name+", uniqueId="+this.uniqueId+")"),i.restore(),this._isDirty&&(this.invalidateRect(),this._isDirty=!1),!0},t.prototype._postMeasure=function(){},t.prototype._draw=function(e,i){this._localDraw(e),this.clipChildren&&this._clipForChildren(e);for(var r=0,o=this._children;r<o.length;r++){var a=o[r];i&&!a._intersectsRect(i)||a._render(e,i)}},t.prototype.getDescendantsToRef=function(e,i,r){if(i===void 0&&(i=!1),!!this.children)for(var o=0;o<this.children.length;o++){var a=this.children[o];(!r||r(a))&&e.push(a),i||a.getDescendantsToRef(e,!1,r)}},t.prototype._processPicking=function(e,i,r,o,a,s,l,u){if(!this._isEnabled||!this.isVisible||this.notRenderable||!n.prototype.contains.call(this,e,i))return!1;for(var f=this._children.length-1;f>=0;f--){var c=this._children[f];if(c._processPicking(e,i,r,o,a,s,l,u))return c.hoverCursor&&this._host._changeCursor(c.hoverCursor),!0}return this.isHitTestVisible?this._processObservables(o,e,i,r,a,s,l,u):!1},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.copyFrom(this._currentMeasure)},t.prototype.dispose=function(){n.prototype.dispose.call(this);for(var e=this.children.length-1;e>=0;e--)this.children[e].dispose()},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.Container"]=ao;var so=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._thickness=1,i._cornerRadius=0,i}return Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cornerRadius",{get:function(){return this._cornerRadius},set:function(e){e<0&&(e=0),this._cornerRadius!==e&&(this._cornerRadius=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Rectangle"},t.prototype._localDraw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._background&&(e.fillStyle=this._background,this._cornerRadius?(this._drawRoundedRect(e,this._thickness/2),e.fill()):e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),this._thickness&&((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this.color&&(e.strokeStyle=this.color),e.lineWidth=this._thickness,this._cornerRadius?(this._drawRoundedRect(e,this._thickness/2),e.stroke()):e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness)),e.restore()},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.width-=2*this._thickness,this._measureForChildren.height-=2*this._thickness,this._measureForChildren.left+=this._thickness,this._measureForChildren.top+=this._thickness},t.prototype._drawRoundedRect=function(e,i){i===void 0&&(i=0);var r=this._currentMeasure.left+i,o=this._currentMeasure.top+i,a=this._currentMeasure.width-i*2,s=this._currentMeasure.height-i*2,l=Math.min(s/2-2,Math.min(a/2-2,this._cornerRadius));e.beginPath(),e.moveTo(r+l,o),e.lineTo(r+a-l,o),e.quadraticCurveTo(r+a,o,r+a,o+l),e.lineTo(r+a,o+s-l),e.quadraticCurveTo(r+a,o+s,r+a-l,o+s),e.lineTo(r+l,o+s),e.quadraticCurveTo(r,o+s,r,o+s-l),e.lineTo(r,o+l),e.quadraticCurveTo(r,o,r+l,o),e.closePath()},t.prototype._clipForChildren=function(e){this._cornerRadius&&(this._drawRoundedRect(e,this._thickness),e.clip())},t}(ao);Ae.RegisteredTypes["BABYLON.GUI.Rectangle"]=so;var $l;(function(n){n[n.Clip=0]="Clip",n[n.WordWrap=1]="WordWrap",n[n.Ellipsis=2]="Ellipsis"})($l||($l={}));var Mn=function(n){j(t,n);function t(e,i){i===void 0&&(i="");var r=n.call(this,e)||this;return r.name=e,r._text="",r._textWrapping=$l.Clip,r._textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,r._textVerticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,r._resizeToFit=!1,r._lineSpacing=new zt(0),r._outlineWidth=0,r._outlineColor="white",r._underline=!1,r._lineThrough=!1,r.onTextChangedObservable=new ie,r.onLinesReadyObservable=new ie,r.text=i,r}return Object.defineProperty(t.prototype,"lines",{get:function(){return this._lines},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resizeToFit",{get:function(){return this._resizeToFit},set:function(e){this._resizeToFit!==e&&(this._resizeToFit=e,this._resizeToFit&&(this._width.ignoreAdaptiveScaling=!0,this._height.ignoreAdaptiveScaling=!0),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textWrapping",{get:function(){return this._textWrapping},set:function(e){this._textWrapping!==e&&(this._textWrapping=+e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._markAsDirty(),this.onTextChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textHorizontalAlignment",{get:function(){return this._textHorizontalAlignment},set:function(e){this._textHorizontalAlignment!==e&&(this._textHorizontalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textVerticalAlignment",{get:function(){return this._textVerticalAlignment},set:function(e){this._textVerticalAlignment!==e&&(this._textVerticalAlignment=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineSpacing",{get:function(){return this._lineSpacing.toString(this._host)},set:function(e){this._lineSpacing.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outlineWidth",{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underline",{get:function(){return this._underline},set:function(e){this._underline!==e&&(this._underline=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineThrough",{get:function(){return this._lineThrough},set:function(e){this._lineThrough!==e&&(this._lineThrough=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outlineColor",{get:function(){return this._outlineColor},set:function(e){this._outlineColor!==e&&(this._outlineColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"TextBlock"},t.prototype._processMeasures=function(e,i){this._fontOffset||(this._fontOffset=ot._GetFontOffset(i.font)),n.prototype._processMeasures.call(this,e,i),this._lines=this._breakLines(this._currentMeasure.width,i),this.onLinesReadyObservable.notifyObservers(this);for(var r=0,o=0;o<this._lines.length;o++){var a=this._lines[o];a.width>r&&(r=a.width)}if(this._resizeToFit){if(this._textWrapping===$l.Clip){var s=this.paddingLeftInPixels+this.paddingRightInPixels+r|0;s!==this._width.internalValue&&(this._width.updateInPlace(s,zt.UNITMODE_PIXEL),this._rebuildLayout=!0)}var l=this.paddingTopInPixels+this.paddingBottomInPixels+this._fontOffset.height*this._lines.length|0;if(this._lines.length>0&&this._lineSpacing.internalValue!==0){var u=0;this._lineSpacing.isPixel?u=this._lineSpacing.getValue(this._host):u=this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height),l+=(this._lines.length-1)*u}l!==this._height.internalValue&&(this._height.updateInPlace(l,zt.UNITMODE_PIXEL),this._rebuildLayout=!0)}},t.prototype._drawText=function(e,i,r,o){var a=this._currentMeasure.width,s=0;switch(this._textHorizontalAlignment){case ot.HORIZONTAL_ALIGNMENT_LEFT:s=0;break;case ot.HORIZONTAL_ALIGNMENT_RIGHT:s=a-i;break;case ot.HORIZONTAL_ALIGNMENT_CENTER:s=(a-i)/2;break}(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY),this.outlineWidth&&o.strokeText(e,this._currentMeasure.left+s,r),o.fillText(e,this._currentMeasure.left+s,r),this._underline&&(o.beginPath(),o.lineWidth=Math.round(this.fontSizeInPixels*.05),o.moveTo(this._currentMeasure.left+s,r+3),o.lineTo(this._currentMeasure.left+s+i,r+3),o.stroke(),o.closePath()),this._lineThrough&&(o.beginPath(),o.lineWidth=Math.round(this.fontSizeInPixels*.05),o.moveTo(this._currentMeasure.left+s,r-this.fontSizeInPixels/3),o.lineTo(this._currentMeasure.left+s+i,r-this.fontSizeInPixels/3),o.stroke(),o.closePath())},t.prototype._draw=function(e,i){e.save(),this._applyStates(e),this._renderLines(e),e.restore()},t.prototype._applyStates=function(e){n.prototype._applyStates.call(this,e),this.outlineWidth&&(e.lineWidth=this.outlineWidth,e.strokeStyle=this.outlineColor,e.lineJoin="miter",e.miterLimit=2)},t.prototype._breakLines=function(e,i){var r=[],o=this.text.split(`
|
|
13297
13297
|
`);if(this._textWrapping===$l.Ellipsis)for(var a=0,s=o;a<s.length;a++){var l=s[a];r.push(this._parseLineEllipsis(l,e,i))}else if(this._textWrapping===$l.WordWrap)for(var u=0,f=o;u<f.length;u++){var l=f[u];r.push.apply(r,this._parseLineWordWrap(l,e,i))}else for(var c=0,h=o;c<h.length;c++){var l=h[c];r.push(this._parseLine(l,i))}return r},t.prototype._parseLine=function(e,i){return e===void 0&&(e=""),{text:e,width:i.measureText(e).width}},t.prototype._parseLineEllipsis=function(e,i,r){e===void 0&&(e="");var o=r.measureText(e).width;o>i&&(e+="…");var a=Array.from&&Array.from(e);if(a)for(;a.length&&o>i;)a.pop(),e=a.join("")+"...",o=r.measureText(e).width;else for(;e.length>2&&o>i;)e=e.slice(0,-2)+"…",o=r.measureText(e).width;return{text:e,width:o}},t.prototype._parseLineWordWrap=function(e,i,r){e===void 0&&(e="");for(var o=[],a=this.wordSplittingFunction?this.wordSplittingFunction(e):e.split(" "),s=0,l=0;l<a.length;l++){var u=l>0?e+" "+a[l]:a[0],f=r.measureText(u),c=f.width;c>i&&l>0?(o.push({text:e,width:s}),e=a[l],s=r.measureText(e).width):(s=c,e=u)}return o.push({text:e,width:s}),o},t.prototype._renderLines=function(e){var i=this._currentMeasure.height,r=0;switch(this._textVerticalAlignment){case ot.VERTICAL_ALIGNMENT_TOP:r=this._fontOffset.ascent;break;case ot.VERTICAL_ALIGNMENT_BOTTOM:r=i-this._fontOffset.height*(this._lines.length-1)-this._fontOffset.descent;break;case ot.VERTICAL_ALIGNMENT_CENTER:r=this._fontOffset.ascent+(i-this._fontOffset.height*this._lines.length)/2;break}r+=this._currentMeasure.top;for(var o=0;o<this._lines.length;o++){var a=this._lines[o];o!==0&&this._lineSpacing.internalValue!==0&&(this._lineSpacing.isPixel?r+=this._lineSpacing.getValue(this._host):r=r+this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height)),this._drawText(a.text,a.width,r,e),r+=this._fontOffset.height}},t.prototype.computeExpectedHeight=function(){if(this.text&&this.widthInPixels){var e=document.createElement("canvas").getContext("2d");if(e){this._applyStates(e),this._fontOffset||(this._fontOffset=ot._GetFontOffset(e.font));var i=this._lines?this._lines:this._breakLines(this.widthInPixels-this.paddingLeftInPixels-this.paddingRightInPixels,e),r=this.paddingTopInPixels+this.paddingBottomInPixels+this._fontOffset.height*i.length;if(i.length>0&&this._lineSpacing.internalValue!==0){var o=0;this._lineSpacing.isPixel?o=this._lineSpacing.getValue(this._host):o=this._lineSpacing.getValue(this._host)*this._height.getValueInPixel(this._host,this._cachedParentMeasure.height),r+=(i.length-1)*o}return r}}return 0},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onTextChangedObservable.clear()},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.TextBlock"]=Mn;var Za=function(n){j(t,n);function t(e,i){i===void 0&&(i=null);var r=n.call(this,e)||this;return r.name=e,r._workingCanvas=null,r._loaded=!1,r._stretch=t.STRETCH_FILL,r._autoScale=!1,r._sourceLeft=0,r._sourceTop=0,r._sourceWidth=0,r._sourceHeight=0,r._svgAttributesComputationCompleted=!1,r._isSVG=!1,r._cellWidth=0,r._cellHeight=0,r._cellId=-1,r._populateNinePatchSlicesFromImage=!1,r._imageDataCache={data:null,key:""},r.onImageLoadedObservable=new ie,r.onSVGAttributesComputedObservable=new ie,r.source=i,r}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._loaded},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"populateNinePatchSlicesFromImage",{get:function(){return this._populateNinePatchSlicesFromImage},set:function(e){this._populateNinePatchSlicesFromImage!==e&&(this._populateNinePatchSlicesFromImage=e,this._populateNinePatchSlicesFromImage&&this._loaded&&this._extractNinePatchSliceDataFromImage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detectPointerOnOpaqueOnly",{get:function(){return this._detectPointerOnOpaqueOnly},set:function(e){this._detectPointerOnOpaqueOnly!==e&&(this._detectPointerOnOpaqueOnly=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceLeft",{get:function(){return this._sliceLeft},set:function(e){this._sliceLeft!==e&&(this._sliceLeft=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceRight",{get:function(){return this._sliceRight},set:function(e){this._sliceRight!==e&&(this._sliceRight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceTop",{get:function(){return this._sliceTop},set:function(e){this._sliceTop!==e&&(this._sliceTop=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sliceBottom",{get:function(){return this._sliceBottom},set:function(e){this._sliceBottom!==e&&(this._sliceBottom=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceLeft",{get:function(){return this._sourceLeft},set:function(e){this._sourceLeft!==e&&(this._sourceLeft=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceTop",{get:function(){return this._sourceTop},set:function(e){this._sourceTop!==e&&(this._sourceTop=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceWidth",{get:function(){return this._sourceWidth},set:function(e){this._sourceWidth!==e&&(this._sourceWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceHeight",{get:function(){return this._sourceHeight},set:function(e){this._sourceHeight!==e&&(this._sourceHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSVG",{get:function(){return this._isSVG},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"svgAttributesComputationCompleted",{get:function(){return this._svgAttributesComputationCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoScale",{get:function(){return this._autoScale},set:function(e){this._autoScale!==e&&(this._autoScale=e,e&&this._loaded&&this.synchronizeSizeWithContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stretch",{get:function(){return this._stretch},set:function(e){this._stretch!==e&&(this._stretch=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._rotate90=function(e,i){i===void 0&&(i=!1);var r=document.createElement("canvas"),o=r.getContext("2d"),a=this._domImage.width,s=this._domImage.height;r.width=s,r.height=a,o.translate(r.width/2,r.height/2),o.rotate(e*Math.PI/2),o.drawImage(this._domImage,0,0,a,s,-a/2,-s/2,a,s);var l=r.toDataURL("image/jpg"),u=new t(this.name+"rotated",l);return i&&(u._stretch=this._stretch,u._autoScale=this._autoScale,u._cellId=this._cellId,u._cellWidth=e%1?this._cellHeight:this._cellWidth,u._cellHeight=e%1?this._cellWidth:this._cellHeight),this._handleRotationForSVGImage(this,u,e),this._imageDataCache.data=null,u},t.prototype._handleRotationForSVGImage=function(e,i,r){var o=this;e._isSVG&&(e._svgAttributesComputationCompleted?(this._rotate90SourceProperties(e,i,r),this._markAsDirty()):e.onSVGAttributesComputedObservable.addOnce(function(){o._rotate90SourceProperties(e,i,r),o._markAsDirty()}))},t.prototype._rotate90SourceProperties=function(e,i,r){var o,a,s=e.sourceLeft,l=e.sourceTop,u=e.domImage.width,f=e.domImage.height,c=s,h=l,p=e.sourceWidth,_=e.sourceHeight;if(r!=0){var g=r<0?-1:1;r=r%4;for(var v=0;v<Math.abs(r);++v)c=-(l-f/2)*g+f/2,h=(s-u/2)*g+u/2,o=[_,p],p=o[0],_=o[1],r<0?h-=_:c-=p,s=c,l=h,a=[f,u],u=a[0],f=a[1]}i.sourceLeft=c,i.sourceTop=h,i.sourceWidth=p,i.sourceHeight=_},Object.defineProperty(t.prototype,"domImage",{get:function(){return this._domImage},set:function(e){var i=this;this._domImage=e,this._loaded=!1,this._imageDataCache.data=null,this._domImage.width?this._onImageLoaded():this._domImage.onload=function(){i._onImageLoaded()}},enumerable:!1,configurable:!0}),t.prototype._onImageLoaded=function(){this._imageDataCache.data=null,this._imageWidth=this._domImage.width,this._imageHeight=this._domImage.height,this._loaded=!0,this._populateNinePatchSlicesFromImage&&this._extractNinePatchSliceDataFromImage(),this._autoScale&&this.synchronizeSizeWithContent(),this.onImageLoadedObservable.notifyObservers(this),this._markAsDirty()},t.prototype._extractNinePatchSliceDataFromImage=function(){this._workingCanvas||(this._workingCanvas=document.createElement("canvas"));var e=this._workingCanvas,i=e.getContext("2d"),r=this._domImage.width,o=this._domImage.height;e.width=r,e.height=o,i.drawImage(this._domImage,0,0,r,o);var a=i.getImageData(0,0,r,o);this._sliceLeft=-1,this._sliceRight=-1;for(var s=0;s<r;s++){var l=a.data[s*4+3];if(l>127&&this._sliceLeft===-1){this._sliceLeft=s;continue}if(l<127&&this._sliceLeft>-1){this._sliceRight=s;break}}this._sliceTop=-1,this._sliceBottom=-1;for(var u=0;u<o;u++){var l=a.data[u*r*4+3];if(l>127&&this._sliceTop===-1){this._sliceTop=u;continue}if(l<127&&this._sliceTop>-1){this._sliceBottom=u;break}}},Object.defineProperty(t.prototype,"source",{set:function(e){var i=this;this._source!==e&&(this._loaded=!1,this._source=e,this._imageDataCache.data=null,e&&(e=this._svgCheck(e)),this._domImage=document.createElement("img"),this._domImage.onload=function(){i._onImageLoaded()},e&&(Ee.SetCorsBehavior(e,this._domImage),this._domImage.src=e))},enumerable:!1,configurable:!0}),t.prototype._svgCheck=function(e){var i=this;if(window.SVGSVGElement&&e.search(/.svg#/gi)!==-1&&e.indexOf("#")===e.lastIndexOf("#")){this._isSVG=!0;var r=e.split("#")[0],o=e.split("#")[1],a=document.body.querySelector('object[data="'+r+'"]');if(a){var s=a.contentDocument;if(s&&s.documentElement){var l=s.documentElement.getAttribute("viewBox"),u=Number(s.documentElement.getAttribute("width")),f=Number(s.documentElement.getAttribute("height")),c=s.getElementById(o);if(c&&l&&u&&f)return this._getSVGAttribs(a,o),e}a.addEventListener("load",function(){i._getSVGAttribs(a,o)})}else{var h=document.createElement("object");h.data=r,h.type="image/svg+xml",h.width="0%",h.height="0%",document.body.appendChild(h),h.onload=function(){var p=document.body.querySelector('object[data="'+r+'"]');p&&i._getSVGAttribs(p,o)}}return r}else return e},t.prototype._getSVGAttribs=function(e,i){var r=e.contentDocument;if(r&&r.documentElement){var o=r.documentElement.getAttribute("viewBox"),a=Number(r.documentElement.getAttribute("width")),s=Number(r.documentElement.getAttribute("height")),l=r.getElementById(i);if(o&&a&&s&&l){var u=Number(o.split(" ")[2]),f=Number(o.split(" ")[3]),c=l.getBBox(),h=1,p=1,_=0,g=0;l.transform&&l.transform.baseVal.consolidate()&&(h=l.transform.baseVal.consolidate().matrix.a,p=l.transform.baseVal.consolidate().matrix.d,_=l.transform.baseVal.consolidate().matrix.e,g=l.transform.baseVal.consolidate().matrix.f),this.sourceLeft=(h*c.x+_)*a/u,this.sourceTop=(p*c.y+g)*s/f,this.sourceWidth=c.width*h*(a/u),this.sourceHeight=c.height*p*(s/f),this._svgAttributesComputationCompleted=!0,this.onSVGAttributesComputedObservable.notifyObservers(this)}}},Object.defineProperty(t.prototype,"cellWidth",{get:function(){return this._cellWidth},set:function(e){this._cellWidth!==e&&(this._cellWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellHeight",{get:function(){return this._cellHeight},set:function(e){this._cellHeight!==e&&(this._cellHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellId",{get:function(){return this._cellId},set:function(e){this._cellId!==e&&(this._cellId=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype.contains=function(e,i){if(!n.prototype.contains.call(this,e,i))return!1;if(!this._detectPointerOnOpaqueOnly||!this._workingCanvas)return!0;var r=this._currentMeasure.width|0,o=this._currentMeasure.height|0,a=r+"_"+o,s=this._imageDataCache.data;if(!s||this._imageDataCache.key!==a){var l=this._workingCanvas,u=l.getContext("2d");this._imageDataCache.data=s=u.getImageData(0,0,r,o).data,this._imageDataCache.key=a}e=e-this._currentMeasure.left|0,i=i-this._currentMeasure.top|0;var f=s[(e+i*r)*4+3];return f>0},t.prototype._getTypeName=function(){return"Image"},t.prototype.synchronizeSizeWithContent=function(){this._loaded&&(this.width=this._domImage.width+"px",this.height=this._domImage.height+"px")},t.prototype._processMeasures=function(e,i){if(this._loaded)switch(this._stretch){case t.STRETCH_NONE:break;case t.STRETCH_FILL:break;case t.STRETCH_UNIFORM:break;case t.STRETCH_NINE_PATCH:break;case t.STRETCH_EXTEND:this._autoScale&&this.synchronizeSizeWithContent(),this.parent&&this.parent.parent&&(this.parent.adaptWidthToChildren=!0,this.parent.adaptHeightToChildren=!0);break}n.prototype._processMeasures.call(this,e,i)},t.prototype._prepareWorkingCanvasForOpaqueDetection=function(){if(this._detectPointerOnOpaqueOnly){this._workingCanvas||(this._workingCanvas=document.createElement("canvas"));var e=this._workingCanvas,i=this._currentMeasure.width,r=this._currentMeasure.height,o=e.getContext("2d");e.width=i,e.height=r,o.clearRect(0,0,i,r)}},t.prototype._drawImage=function(e,i,r,o,a,s,l,u,f){if(e.drawImage(this._domImage,i,r,o,a,s,l,u,f),!!this._detectPointerOnOpaqueOnly){var c=this._workingCanvas;e=c.getContext("2d"),e.drawImage(this._domImage,i,r,o,a,s-this._currentMeasure.left,l-this._currentMeasure.top,u,f)}},t.prototype._draw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY);var i,r,o,a;if(this.cellId==-1)i=this._sourceLeft,r=this._sourceTop,o=this._sourceWidth?this._sourceWidth:this._imageWidth,a=this._sourceHeight?this._sourceHeight:this._imageHeight;else{var s=this._domImage.naturalWidth/this.cellWidth,l=this.cellId/s>>0,u=this.cellId%s;i=this.cellWidth*u,r=this.cellHeight*l,o=this.cellWidth,a=this.cellHeight}if(this._prepareWorkingCanvasForOpaqueDetection(),this._applyStates(e),this._loaded)switch(this._stretch){case t.STRETCH_NONE:this._drawImage(e,i,r,o,a,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case t.STRETCH_FILL:this._drawImage(e,i,r,o,a,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case t.STRETCH_UNIFORM:var f=this._currentMeasure.width/o,c=this._currentMeasure.height/a,h=Math.min(f,c),p=(this._currentMeasure.width-o*h)/2,_=(this._currentMeasure.height-a*h)/2;this._drawImage(e,i,r,o,a,this._currentMeasure.left+p,this._currentMeasure.top+_,o*h,a*h);break;case t.STRETCH_EXTEND:this._drawImage(e,i,r,o,a,this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height);break;case t.STRETCH_NINE_PATCH:this._renderNinePatch(e);break}e.restore()},t.prototype._renderCornerPatch=function(e,i,r,o,a,s,l){this._drawImage(e,i,r,o,a,this._currentMeasure.left+s,this._currentMeasure.top+l,o,a)},t.prototype._renderNinePatch=function(e){var i=this._imageHeight,r=this._sliceLeft,o=this._sliceTop,a=this._imageHeight-this._sliceBottom,s=this._imageWidth-this._sliceRight,l=0,u=0;this._populateNinePatchSlicesFromImage&&(l=1,u=1,i-=2,r-=1,o-=1,a-=1,s-=1);var f=this._sliceRight-this._sliceLeft,c=this._currentMeasure.width-s-this.sliceLeft,h=this._currentMeasure.height-i+this._sliceBottom;this._renderCornerPatch(e,l,u,r,o,0,0),this._renderCornerPatch(e,l,this._sliceBottom,r,i-this._sliceBottom,0,h),this._renderCornerPatch(e,this._sliceRight,u,s,o,this._currentMeasure.width-s,0),this._renderCornerPatch(e,this._sliceRight,this._sliceBottom,s,i-this._sliceBottom,this._currentMeasure.width-s,h),this._drawImage(e,this._sliceLeft,this._sliceTop,f,this._sliceBottom-this._sliceTop,this._currentMeasure.left+r,this._currentMeasure.top+o,c,h-o),this._drawImage(e,l,this._sliceTop,r,this._sliceBottom-this._sliceTop,this._currentMeasure.left,this._currentMeasure.top+o,r,h-o),this._drawImage(e,this._sliceRight,this._sliceTop,r,this._sliceBottom-this._sliceTop,this._currentMeasure.left+this._currentMeasure.width-s,this._currentMeasure.top+o,r,h-o),this._drawImage(e,this._sliceLeft,u,f,o,this._currentMeasure.left+r,this._currentMeasure.top,c,o),this._drawImage(e,this._sliceLeft,this._sliceBottom,f,a,this._currentMeasure.left+r,this._currentMeasure.top+h,c,a)},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onImageLoadedObservable.clear(),this.onSVGAttributesComputedObservable.clear()},t.STRETCH_NONE=0,t.STRETCH_FILL=1,t.STRETCH_UNIFORM=2,t.STRETCH_EXTEND=3,t.STRETCH_NINE_PATCH=4,t}(ot);Ae.RegisteredTypes["BABYLON.GUI.Image"]=Za;var _a=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;i.name=e,i.delegatePickingToChildren=!1,i.thickness=1,i.isPointerBlocker=!0;var r=null;return i.pointerEnterAnimation=function(){r=i.alpha,i.alpha-=.1},i.pointerOutAnimation=function(){r!==null&&(i.alpha=r)},i.pointerDownAnimation=function(){i.scaleX-=.05,i.scaleY-=.05},i.pointerUpAnimation=function(){i.scaleX+=.05,i.scaleY+=.05},i}return Object.defineProperty(t.prototype,"image",{get:function(){return this._image},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBlock",{get:function(){return this._textBlock},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Button"},t.prototype._processPicking=function(e,i,r,o,a,s,l,u){if(!this._isEnabled||!this.isHitTestVisible||!this.isVisible||this.notRenderable||!n.prototype.contains.call(this,e,i))return!1;if(this.delegatePickingToChildren){for(var f=!1,c=this._children.length-1;c>=0;c--){var h=this._children[c];if(h.isEnabled&&h.isHitTestVisible&&h.isVisible&&!h.notRenderable&&h.contains(e,i)){f=!0;break}}if(!f)return!1}return this._processObservables(o,e,i,r,a,s,l,u),!0},t.prototype._onPointerEnter=function(e,i){return n.prototype._onPointerEnter.call(this,e,i)?(this.pointerEnterAnimation&&this.pointerEnterAnimation(),!0):!1},t.prototype._onPointerOut=function(e,i,r){r===void 0&&(r=!1),this.pointerOutAnimation&&this.pointerOutAnimation(),n.prototype._onPointerOut.call(this,e,i,r)},t.prototype._onPointerDown=function(e,i,r,o,a){return n.prototype._onPointerDown.call(this,e,i,r,o,a)?(this.pointerDownAnimation&&this.pointerDownAnimation(),!0):!1},t.prototype._onPointerUp=function(e,i,r,o,a,s){this.pointerUpAnimation&&this.pointerUpAnimation(),n.prototype._onPointerUp.call(this,e,i,r,o,a,s)},t.CreateImageButton=function(e,i,r){var o=new t(e),a=new Mn(e+"_button",i);a.textWrapping=!0,a.textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,a.paddingLeft="20%",o.addControl(a);var s=new Za(e+"_icon",r);return s.width="20%",s.stretch=Za.STRETCH_UNIFORM,s.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,o.addControl(s),o._image=s,o._textBlock=a,o},t.CreateImageOnlyButton=function(e,i){var r=new t(e),o=new Za(e+"_icon",i);return o.stretch=Za.STRETCH_FILL,o.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,r.addControl(o),r._image=o,r},t.CreateSimpleButton=function(e,i){var r=new t(e),o=new Mn(e+"_button",i);return o.textWrapping=!0,o.textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,r.addControl(o),r._textBlock=o,r},t.CreateImageWithCenterTextButton=function(e,i,r){var o=new t(e),a=new Za(e+"_icon",r);a.stretch=Za.STRETCH_FILL,o.addControl(a);var s=new Mn(e+"_button",i);return s.textWrapping=!0,s.textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,o.addControl(s),o._image=a,o._textBlock=s,o},t}(so);Ae.RegisteredTypes["BABYLON.GUI.Button"]=_a;var Pa=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._isVertical=!0,i._manualWidth=!1,i._manualHeight=!1,i._doNotTrackManualChanges=!1,i.ignoreLayoutWarnings=!1,i}return Object.defineProperty(t.prototype,"isVertical",{get:function(){return this._isVertical},set:function(e){this._isVertical!==e&&(this._isVertical=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(e){this._doNotTrackManualChanges||(this._manualWidth=!0),this._width.toString(this._host)!==e&&this._width.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(e){this._doNotTrackManualChanges||(this._manualHeight=!0),this._height.toString(this._host)!==e&&this._height.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"StackPanel"},t.prototype._preMeasure=function(e,i){for(var r=0,o=this._children;r<o.length;r++){var a=o[r];this._isVertical?a.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP:a.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT}n.prototype._preMeasure.call(this,e,i)},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.copyFrom(e),this._measureForChildren.left=this._currentMeasure.left,this._measureForChildren.top=this._currentMeasure.top,(!this.isVertical||this._manualWidth)&&(this._measureForChildren.width=this._currentMeasure.width),(this.isVertical||this._manualHeight)&&(this._measureForChildren.height=this._currentMeasure.height)},t.prototype._postMeasure=function(){for(var e=0,i=0,r=0,o=this._children;r<o.length;r++){var a=o[r];!a.isVisible||a.notRenderable||(this._isVertical?(a.top!==i+"px"&&(a.top=i+"px",this._rebuildLayout=!0,a._top.ignoreAdaptiveScaling=!0),a._height.isPercentage&&!a._automaticSize?this.ignoreLayoutWarnings||Ee.Warn("Control (Name:"+a.name+", UniqueId:"+a.uniqueId+") is using height in percentage mode inside a vertical StackPanel"):i+=a._currentMeasure.height+a.paddingTopInPixels+a.paddingBottomInPixels):(a.left!==e+"px"&&(a.left=e+"px",this._rebuildLayout=!0,a._left.ignoreAdaptiveScaling=!0),a._width.isPercentage&&!a._automaticSize?this.ignoreLayoutWarnings||Ee.Warn("Control (Name:"+a.name+", UniqueId:"+a.uniqueId+") is using width in percentage mode inside a horizontal StackPanel"):e+=a._currentMeasure.width+a.paddingLeftInPixels+a.paddingRightInPixels))}e+=this.paddingLeftInPixels+this.paddingRightInPixels,i+=this.paddingTopInPixels+this.paddingBottomInPixels,this._doNotTrackManualChanges=!0;var s=!1,l=!1;if(!this._manualHeight&&this._isVertical){var u=this.height;this.height=i+"px",l=u!==this.height||!this._height.ignoreAdaptiveScaling}if(!this._manualWidth&&!this._isVertical){var f=this.width;this.width=e+"px",s=f!==this.width||!this._width.ignoreAdaptiveScaling}l&&(this._height.ignoreAdaptiveScaling=!0),s&&(this._width.ignoreAdaptiveScaling=!0),this._doNotTrackManualChanges=!1,(s||l)&&(this._rebuildLayout=!0),n.prototype._postMeasure.call(this)},t}(ao);Ae.RegisteredTypes["BABYLON.GUI.StackPanel"]=Pa;var QI=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._isChecked=!1,i._background="black",i._checkSizeRatio=.8,i._thickness=1,i.onIsCheckedChangedObservable=new ie,i.isPointerBlocker=!0,i}return Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkSizeRatio",{get:function(){return this._checkSizeRatio},set:function(e){e=Math.max(Math.min(1,e),0),this._checkSizeRatio!==e&&(this._checkSizeRatio=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){this._isChecked!==e&&(this._isChecked=e,this._markAsDirty(),this.onIsCheckedChangedObservable.notifyObservers(e))},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Checkbox"},t.prototype._draw=function(e,i){e.save(),this._applyStates(e);var r=this._currentMeasure.width-this._thickness,o=this._currentMeasure.height-this._thickness;if((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),e.fillStyle=this._isEnabled?this._background:this._disabledColor,e.fillRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,r,o),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._isChecked){e.fillStyle=this._isEnabled?this.color:this._disabledColorItem;var a=r*this._checkSizeRatio,s=o*this._checkSizeRatio;e.fillRect(this._currentMeasure.left+this._thickness/2+(r-a)/2,this._currentMeasure.top+this._thickness/2+(o-s)/2,a,s)}e.strokeStyle=this.color,e.lineWidth=this._thickness,e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,r,o),e.restore()},t.prototype._onPointerDown=function(e,i,r,o,a){return n.prototype._onPointerDown.call(this,e,i,r,o,a)?(this.isChecked=!this.isChecked,!0):!1},t.AddCheckBoxWithHeader=function(e,i){var r=new Pa;r.isVertical=!1,r.height="30px";var o=new t;o.width="20px",o.height="20px",o.isChecked=!0,o.color="green",o.onIsCheckedChangedObservable.add(i),r.addControl(o);var a=new Mn;return a.text=e,a.width="180px",a.paddingLeft="5px",a.textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,a.color="white",r.addControl(a),r},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.Checkbox"]=QI;var By=function(){function n(){}return Object.defineProperty(n.prototype,"text",{get:function(){return this._characters?this._characters.join(""):this._text},set:function(t){this._text=t,this._characters=Array.from&&Array.from(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"length",{get:function(){return this._characters?this._characters.length:this._text.length},enumerable:!1,configurable:!0}),n.prototype.removePart=function(t,e,i){var r;if(this._text=this._text.slice(0,t)+(i||"")+this._text.slice(e),this._characters){var o=i?Array.from(i):[];(r=this._characters).splice.apply(r,HM([t,e-t],o))}},n.prototype.charAt=function(t){return this._characters?this._characters[t]:this._text.charAt(t)},n.prototype.substr=function(t,e){if(this._characters){isNaN(t)?t=0:t>=0?t=Math.min(t,this._characters.length):t=this._characters.length+Math.max(t,-this._characters.length),e===void 0?e=this._characters.length-t:(isNaN(e)||e<0)&&(e=0);for(var i=[];--e>=0;)i[e]=this._characters[t+e];return i.join("")}return this._text.substr(t,e)},n.prototype.substring=function(t,e){if(this._characters){isNaN(t)?t=0:t>this._characters.length?t=this._characters.length:t<0&&(t=0),e===void 0?e=this._characters.length:isNaN(e)?e=0:e>this._characters.length?e=this._characters.length:e<0&&(e=0);for(var i=[],r=0;t<e;)i[r++]=this._characters[t++];return i.join("")}return this._text.substring(t,e)},n.prototype.isWord=function(t){var e=/\w/g;return this._characters?this._characters[t].search(e)!==-1:this._text.search(e)!==-1},n}(),ma=function(n){j(t,n);function t(e,i){i===void 0&&(i="");var r=n.call(this,e)||this;return r.name=e,r._placeholderText="",r._background="#222222",r._focusedBackground="#000000",r._focusedColor="white",r._placeholderColor="gray",r._thickness=1,r._margin=new zt(10,zt.UNITMODE_PIXEL),r._autoStretchWidth=!0,r._maxWidth=new zt(1,zt.UNITMODE_PERCENTAGE,!1),r._isFocused=!1,r._blinkIsEven=!1,r._cursorOffset=0,r._deadKey=!1,r._addKey=!0,r._currentKey="",r._isTextHighlightOn=!1,r._textHighlightColor="#d5e0ff",r._highligherOpacity=.4,r._highlightedText="",r._startHighlightIndex=0,r._endHighlightIndex=0,r._cursorIndex=-1,r._onFocusSelectAll=!1,r._isPointerDown=!1,r.promptMessage="Please enter text:",r.disableMobilePrompt=!1,r.onTextChangedObservable=new ie,r.onBeforeKeyAddObservable=new ie,r.onFocusObservable=new ie,r.onBlurObservable=new ie,r.onTextHighlightObservable=new ie,r.onTextCopyObservable=new ie,r.onTextCutObservable=new ie,r.onTextPasteObservable=new ie,r.onKeyboardEventProcessedObservable=new ie,r.text=i,r.isPointerBlocker=!0,r}return Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth.toString(this._host)},set:function(e){this._maxWidth.toString(this._host)!==e&&this._maxWidth.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxWidthInPixels",{get:function(){return this._maxWidth.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highligherOpacity",{get:function(){return this._highligherOpacity},set:function(e){this._highligherOpacity!==e&&(this._highligherOpacity=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusSelectAll",{get:function(){return this._onFocusSelectAll},set:function(e){this._onFocusSelectAll!==e&&(this._onFocusSelectAll=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textHighlightColor",{get:function(){return this._textHighlightColor},set:function(e){this._textHighlightColor!==e&&(this._textHighlightColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return this._margin.toString(this._host)},set:function(e){this._margin.toString(this._host)!==e&&this._margin.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marginInPixels",{get:function(){return this._margin.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoStretchWidth",{get:function(){return this._autoStretchWidth},set:function(e){this._autoStretchWidth!==e&&(this._autoStretchWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"focusedBackground",{get:function(){return this._focusedBackground},set:function(e){this._focusedBackground!==e&&(this._focusedBackground=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"focusedColor",{get:function(){return this._focusedColor},set:function(e){this._focusedColor!==e&&(this._focusedColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholderColor",{get:function(){return this._placeholderColor},set:function(e){this._placeholderColor!==e&&(this._placeholderColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholderText",{get:function(){return this._placeholderText},set:function(e){this._placeholderText!==e&&(this._placeholderText=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deadKey",{get:function(){return this._deadKey},set:function(e){this._deadKey=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightedText",{get:function(){return this._highlightedText},set:function(e){this._highlightedText!==e&&(this._highlightedText=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"addKey",{get:function(){return this._addKey},set:function(e){this._addKey=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentKey",{get:function(){return this._currentKey},set:function(e){this._currentKey=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._textWrapper.text},set:function(e){var i=e.toString();this._textWrapper||(this._textWrapper=new By),this._textWrapper.text!==i&&(this._textWrapper.text=i,this._textHasChanged())},enumerable:!1,configurable:!0}),t.prototype._textHasChanged=function(){this._markAsDirty(),this.onTextChangedObservable.notifyObservers(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(e){this._width.toString(this._host)!==e&&(this._width.fromString(e)&&this._markAsDirty(),this.autoStretchWidth=!1)},enumerable:!1,configurable:!0}),t.prototype.onBlur=function(){this._isFocused=!1,this._scrollLeft=null,this._cursorOffset=0,clearTimeout(this._blinkTimeout),this._markAsDirty(),this.onBlurObservable.notifyObservers(this),this._host.unRegisterClipboardEvents(),this._onClipboardObserver&&this._host.onClipboardObservable.remove(this._onClipboardObserver);var e=this._host.getScene();this._onPointerDblTapObserver&&e&&e.onPointerObservable.remove(this._onPointerDblTapObserver)},t.prototype.onFocus=function(){var e=this;if(this._isEnabled){if(this._scrollLeft=null,this._isFocused=!0,this._blinkIsEven=!1,this._cursorOffset=0,this._markAsDirty(),this.onFocusObservable.notifyObservers(this),navigator.userAgent.indexOf("Mobile")!==-1&&!this.disableMobilePrompt){var i=prompt(this.promptMessage);i!==null&&(this.text=i),this._host.focusedControl=null;return}this._host.registerClipboardEvents(),this._onClipboardObserver=this._host.onClipboardObservable.add(function(o){switch(o.type){case Sa.COPY:e._onCopyText(o.event),e.onTextCopyObservable.notifyObservers(e);break;case Sa.CUT:e._onCutText(o.event),e.onTextCutObservable.notifyObservers(e);break;case Sa.PASTE:e._onPasteText(o.event),e.onTextPasteObservable.notifyObservers(e);break;default:return}});var r=this._host.getScene();r&&(this._onPointerDblTapObserver=r.onPointerObservable.add(function(o){e._isFocused&&o.type===He.POINTERDOUBLETAP&&e._processDblClick(o)})),this._onFocusSelectAll&&this._selectAllText()}},t.prototype._getTypeName=function(){return"InputText"},t.prototype.keepsFocusWith=function(){return this._connectedVirtualKeyboard?[this._connectedVirtualKeyboard]:null},t.prototype.processKey=function(e,i,r){if(!(r&&(r.ctrlKey||r.metaKey)&&(e===67||e===86||e===88))){if(r&&(r.ctrlKey||r.metaKey)&&e===65){this._selectAllText(),r.preventDefault();return}switch(e){case 32:i=" ";break;case 191:r&&r.preventDefault();break;case 8:if(this._textWrapper.text&&this._textWrapper.length>0){if(this._isTextHighlightOn){this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this._isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this._blinkIsEven=!1,r&&r.preventDefault();return}if(this._cursorOffset===0)this.text=this._textWrapper.substr(0,this._textWrapper.length-1);else{var o=this._textWrapper.length-this._cursorOffset;o>0&&(this._textWrapper.removePart(o-1,o),this._textHasChanged())}}r&&r.preventDefault();return;case 46:if(this._isTextHighlightOn){this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this._isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,r&&r.preventDefault();return}if(this._textWrapper.text&&this._textWrapper.length>0&&this._cursorOffset>0){var o=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(o,o+1),this._textHasChanged(),this._cursorOffset--}r&&r.preventDefault();return;case 13:this._host.focusedControl=null,this._isTextHighlightOn=!1;return;case 35:this._cursorOffset=0,this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._markAsDirty();return;case 36:this._cursorOffset=this._textWrapper.length,this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._markAsDirty();return;case 37:if(this._cursorOffset++,this._cursorOffset>this._textWrapper.length&&(this._cursorOffset=this._textWrapper.length),r&&r.shiftKey){if(this._blinkIsEven=!1,r.ctrlKey||r.metaKey){if(!this._isTextHighlightOn){if(this._textWrapper.length===this._cursorOffset)return;this._endHighlightIndex=this._textWrapper.length-this._cursorOffset+1}this._startHighlightIndex=0,this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=this._textWrapper.length,this._isTextHighlightOn=!0,this._markAsDirty();return}this._isTextHighlightOn?this._cursorIndex===-1&&(this._cursorIndex=this._textWrapper.length-this._endHighlightIndex,this._cursorOffset=this._startHighlightIndex===0?this._textWrapper.length:this._textWrapper.length-this._startHighlightIndex+1):(this._isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset>=this._textWrapper.length?this._textWrapper.length:this._cursorOffset-1),this._cursorIndex<this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorIndex,this._startHighlightIndex=this._textWrapper.length-this._cursorOffset):this._cursorIndex>this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this._isTextHighlightOn=!1,this._markAsDirty();return}this._isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this._isTextHighlightOn=!1),r&&(r.ctrlKey||r.metaKey)&&(this._cursorOffset=this._textWrapper.length,r.preventDefault()),this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._cursorIndex=-1,this._markAsDirty();return;case 39:if(this._cursorOffset--,this._cursorOffset<0&&(this._cursorOffset=0),r&&r.shiftKey){if(this._blinkIsEven=!1,r.ctrlKey||r.metaKey){if(!this._isTextHighlightOn){if(this._cursorOffset===0)return;this._startHighlightIndex=this._textWrapper.length-this._cursorOffset-1}this._endHighlightIndex=this._textWrapper.length,this._isTextHighlightOn=!0,this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=0,this._markAsDirty();return}this._isTextHighlightOn?this._cursorIndex===-1&&(this._cursorIndex=this._textWrapper.length-this._startHighlightIndex,this._cursorOffset=this._textWrapper.length===this._endHighlightIndex?0:this._textWrapper.length-this._endHighlightIndex-1):(this._isTextHighlightOn=!0,this._cursorIndex=this._cursorOffset<=0?0:this._cursorOffset+1),this._cursorIndex<this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorIndex,this._startHighlightIndex=this._textWrapper.length-this._cursorOffset):this._cursorIndex>this._cursorOffset?(this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex):this._isTextHighlightOn=!1,this._markAsDirty();return}this._isTextHighlightOn&&(this._cursorOffset=this._textWrapper.length-this._endHighlightIndex,this._isTextHighlightOn=!1),r&&(r.ctrlKey||r.metaKey)&&(this._cursorOffset=0,r.preventDefault()),this._blinkIsEven=!1,this._isTextHighlightOn=!1,this._cursorIndex=-1,this._markAsDirty();return;case 222:r&&r.preventDefault(),this._cursorIndex=-1,this.deadKey=!0;break}if(i&&(e===-1||e===32||e>47&&e<64||e>64&&e<91||e>159&&e<193||e>218&&e<223||e>95&&e<112)&&(this._currentKey=i,this.onBeforeKeyAddObservable.notifyObservers(this),i=this._currentKey,this._addKey))if(this._isTextHighlightOn)this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex,i),this._textHasChanged(),this._cursorOffset=this._textWrapper.length-(this._startHighlightIndex+1),this._isTextHighlightOn=!1,this._blinkIsEven=!1,this._markAsDirty();else if(this._cursorOffset===0)this.text+=i;else{var a=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(a,a,i),this._textHasChanged()}}},t.prototype._updateValueFromCursorIndex=function(e){if(this._blinkIsEven=!1,this._cursorIndex===-1)this._cursorIndex=e;else if(this._cursorIndex<this._cursorOffset)this._endHighlightIndex=this._textWrapper.length-this._cursorIndex,this._startHighlightIndex=this._textWrapper.length-this._cursorOffset;else if(this._cursorIndex>this._cursorOffset)this._endHighlightIndex=this._textWrapper.length-this._cursorOffset,this._startHighlightIndex=this._textWrapper.length-this._cursorIndex;else{this._isTextHighlightOn=!1,this._markAsDirty();return}this._isTextHighlightOn=!0,this._markAsDirty()},t.prototype._processDblClick=function(e){this._startHighlightIndex=this._textWrapper.length-this._cursorOffset,this._endHighlightIndex=this._startHighlightIndex;var i,r;do r=this._endHighlightIndex<this._textWrapper.length&&this._textWrapper.isWord(this._endHighlightIndex)?++this._endHighlightIndex:0,i=this._startHighlightIndex>0&&this._textWrapper.isWord(this._startHighlightIndex-1)?--this._startHighlightIndex:0;while(i||r);this._cursorOffset=this._textWrapper.length-this._startHighlightIndex,this.onTextHighlightObservable.notifyObservers(this),this._isTextHighlightOn=!0,this._clickedCoordinate=null,this._blinkIsEven=!0,this._cursorIndex=-1,this._markAsDirty()},t.prototype._selectAllText=function(){this._blinkIsEven=!0,this._isTextHighlightOn=!0,this._startHighlightIndex=0,this._endHighlightIndex=this._textWrapper.length,this._cursorOffset=this._textWrapper.length,this._cursorIndex=-1,this._markAsDirty()},t.prototype.processKeyboard=function(e){this.processKey(e.keyCode,e.key,e),this.onKeyboardEventProcessedObservable.notifyObservers(e)},t.prototype._onCopyText=function(e){this._isTextHighlightOn=!1;try{e.clipboardData&&e.clipboardData.setData("text/plain",this._highlightedText)}catch{}this._host.clipboardData=this._highlightedText},t.prototype._onCutText=function(e){if(this._highlightedText){this._textWrapper.removePart(this._startHighlightIndex,this._endHighlightIndex),this._textHasChanged(),this._isTextHighlightOn=!1,this._cursorOffset=this._textWrapper.length-this._startHighlightIndex;try{e.clipboardData&&e.clipboardData.setData("text/plain",this._highlightedText)}catch{}this._host.clipboardData=this._highlightedText,this._highlightedText=""}},t.prototype._onPasteText=function(e){var i="";e.clipboardData&&e.clipboardData.types.indexOf("text/plain")!==-1?i=e.clipboardData.getData("text/plain"):i=this._host.clipboardData;var r=this._textWrapper.length-this._cursorOffset;this._textWrapper.removePart(r,r,i),this._textHasChanged()},t.prototype._draw=function(e,i){var r=this;e.save(),this._applyStates(e),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._isFocused?this._focusedBackground&&(e.fillStyle=this._isEnabled?this._focusedBackground:this._disabledColor,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)):this._background&&(e.fillStyle=this._isEnabled?this._background:this._disabledColor,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height)),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._fontOffset||(this._fontOffset=ot._GetFontOffset(e.font));var o=this._currentMeasure.left+this._margin.getValueInPixel(this._host,this._tempParentMeasure.width);this.color&&(e.fillStyle=this.color);var a=this._beforeRenderText(this._textWrapper);!this._isFocused&&!this._textWrapper.text&&this._placeholderText&&(a=new By,a.text=this._placeholderText,this._placeholderColor&&(e.fillStyle=this._placeholderColor)),this._textWidth=e.measureText(a.text).width;var s=this._margin.getValueInPixel(this._host,this._tempParentMeasure.width)*2;this._autoStretchWidth&&(this.width=Math.min(this._maxWidth.getValueInPixel(this._host,this._tempParentMeasure.width),this._textWidth+s)+"px");var l=this._fontOffset.ascent+(this._currentMeasure.height-this._fontOffset.height)/2,u=this._width.getValueInPixel(this._host,this._tempParentMeasure.width)-s;if(e.save(),e.beginPath(),e.rect(o,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,u+2,this._currentMeasure.height),e.clip(),this._isFocused&&this._textWidth>u){var f=o-this._textWidth+u;this._scrollLeft||(this._scrollLeft=f)}else this._scrollLeft=o;if(e.fillText(a.text,this._scrollLeft,this._currentMeasure.top+l),this._isFocused){if(this._clickedCoordinate){var c=this._scrollLeft+this._textWidth,h=c-this._clickedCoordinate,p=0;this._cursorOffset=0;var _=0;do this._cursorOffset&&(_=Math.abs(h-p)),this._cursorOffset++,p=e.measureText(a.substr(a.length-this._cursorOffset,this._cursorOffset)).width;while(p<h&&a.length>=this._cursorOffset);Math.abs(h-p)>_&&this._cursorOffset--,this._blinkIsEven=!1,this._clickedCoordinate=null}if(!this._blinkIsEven){var g=a.substr(a.length-this._cursorOffset),v=e.measureText(g).width,E=this._scrollLeft+this._textWidth-v;E<o?(this._scrollLeft+=o-E,E=o,this._markAsDirty()):E>o+u&&(this._scrollLeft+=o+u-E,E=o+u,this._markAsDirty()),this._isTextHighlightOn||e.fillRect(E,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,2,this._fontOffset.height)}if(clearTimeout(this._blinkTimeout),this._blinkTimeout=setTimeout(function(){r._blinkIsEven=!r._blinkIsEven,r._markAsDirty()},500),this._isTextHighlightOn){clearTimeout(this._blinkTimeout);var T=e.measureText(a.substring(this._startHighlightIndex)).width,S=this._scrollLeft+this._textWidth-T;this._highlightedText=a.substring(this._startHighlightIndex,this._endHighlightIndex);var C=e.measureText(a.substring(this._startHighlightIndex,this._endHighlightIndex)).width;S<o&&(C=C-(o-S),C||(C=e.measureText(a.charAt(a.length-this._cursorOffset)).width),S=o),e.globalAlpha=this._highligherOpacity,e.fillStyle=this._textHighlightColor,e.fillRect(S,this._currentMeasure.top+(this._currentMeasure.height-this._fontOffset.height)/2,C,this._fontOffset.height),e.globalAlpha=1}}e.restore(),this._thickness&&(this._isFocused?this.focusedColor&&(e.strokeStyle=this.focusedColor):this.color&&(e.strokeStyle=this.color),e.lineWidth=this._thickness,e.strokeRect(this._currentMeasure.left+this._thickness/2,this._currentMeasure.top+this._thickness/2,this._currentMeasure.width-this._thickness,this._currentMeasure.height-this._thickness)),e.restore()},t.prototype._onPointerDown=function(e,i,r,o,a){return n.prototype._onPointerDown.call(this,e,i,r,o,a)?(this._clickedCoordinate=i.x,this._isTextHighlightOn=!1,this._highlightedText="",this._cursorIndex=-1,this._isPointerDown=!0,this._host._capturingControl[r]=this,this._host.focusedControl===this?(clearTimeout(this._blinkTimeout),this._markAsDirty(),!0):this._isEnabled?(this._host.focusedControl=this,!0):!1):!1},t.prototype._onPointerMove=function(e,i,r,o){this._host.focusedControl===this&&this._isPointerDown&&(this._clickedCoordinate=i.x,this._markAsDirty(),this._updateValueFromCursorIndex(this._cursorOffset)),n.prototype._onPointerMove.call(this,e,i,r,o)},t.prototype._onPointerUp=function(e,i,r,o,a){this._isPointerDown=!1,delete this._host._capturingControl[r],n.prototype._onPointerUp.call(this,e,i,r,o,a)},t.prototype._beforeRenderText=function(e){return e},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.onBlurObservable.clear(),this.onFocusObservable.clear(),this.onTextChangedObservable.clear(),this.onTextCopyObservable.clear(),this.onTextCutObservable.clear(),this.onTextPasteObservable.clear(),this.onTextHighlightObservable.clear(),this.onKeyboardEventProcessedObservable.clear()},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.InputText"]=ma;var un=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._rowDefinitions=new Array,i._columnDefinitions=new Array,i._cells={},i._childControls=new Array,i}return Object.defineProperty(t.prototype,"columnCount",{get:function(){return this._columnDefinitions.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rowCount",{get:function(){return this._rowDefinitions.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._childControls},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return this._cells},enumerable:!1,configurable:!0}),t.prototype.getRowDefinition=function(e){return e<0||e>=this._rowDefinitions.length?null:this._rowDefinitions[e]},t.prototype.getColumnDefinition=function(e){return e<0||e>=this._columnDefinitions.length?null:this._columnDefinitions[e]},t.prototype.addRowDefinition=function(e,i){return i===void 0&&(i=!1),this._rowDefinitions.push(new zt(e,i?zt.UNITMODE_PIXEL:zt.UNITMODE_PERCENTAGE)),this._markAsDirty(),this},t.prototype.addColumnDefinition=function(e,i){return i===void 0&&(i=!1),this._columnDefinitions.push(new zt(e,i?zt.UNITMODE_PIXEL:zt.UNITMODE_PERCENTAGE)),this._markAsDirty(),this},t.prototype.setRowDefinition=function(e,i,r){if(r===void 0&&(r=!1),e<0||e>=this._rowDefinitions.length)return this;var o=this._rowDefinitions[e];return o&&o.isPixel===r&&o.internalValue===i?this:(this._rowDefinitions[e]=new zt(i,r?zt.UNITMODE_PIXEL:zt.UNITMODE_PERCENTAGE),this._markAsDirty(),this)},t.prototype.setColumnDefinition=function(e,i,r){if(r===void 0&&(r=!1),e<0||e>=this._columnDefinitions.length)return this;var o=this._columnDefinitions[e];return o&&o.isPixel===r&&o.internalValue===i?this:(this._columnDefinitions[e]=new zt(i,r?zt.UNITMODE_PIXEL:zt.UNITMODE_PERCENTAGE),this._markAsDirty(),this)},t.prototype.getChildrenAt=function(e,i){var r=this._cells[e+":"+i];return r?r.children:null},t.prototype.getChildCellInfo=function(e){return e._tag},t.prototype._removeCell=function(e,i){if(e){n.prototype.removeControl.call(this,e);for(var r=0,o=e.children;r<o.length;r++){var a=o[r],s=this._childControls.indexOf(a);s!==-1&&this._childControls.splice(s,1)}delete this._cells[i]}},t.prototype._offsetCell=function(e,i){if(this._cells[i]){this._cells[e]=this._cells[i];for(var r=0,o=this._cells[e].children;r<o.length;r++){var a=o[r];a._tag=e}delete this._cells[i]}},t.prototype.removeColumnDefinition=function(e){if(e<0||e>=this._columnDefinitions.length)return this;for(var i=0;i<this._rowDefinitions.length;i++){var r=i+":"+e,o=this._cells[r];this._removeCell(o,r)}for(var i=0;i<this._rowDefinitions.length;i++)for(var a=e+1;a<this._columnDefinitions.length;a++){var s=i+":"+(a-1),r=i+":"+a;this._offsetCell(s,r)}return this._columnDefinitions.splice(e,1),this._markAsDirty(),this},t.prototype.removeRowDefinition=function(e){if(e<0||e>=this._rowDefinitions.length)return this;for(var i=0;i<this._columnDefinitions.length;i++){var r=e+":"+i,o=this._cells[r];this._removeCell(o,r)}for(var i=0;i<this._columnDefinitions.length;i++)for(var a=e+1;a<this._rowDefinitions.length;a++){var s=a-1+":"+i,r=a+":"+i;this._offsetCell(s,r)}return this._rowDefinitions.splice(e,1),this._markAsDirty(),this},t.prototype.addControl=function(e,i,r){if(i===void 0&&(i=0),r===void 0&&(r=0),this._rowDefinitions.length===0&&this.addRowDefinition(1,!1),this._columnDefinitions.length===0&&this.addColumnDefinition(1,!1),this._childControls.indexOf(e)!==-1)return Ee.Warn("Control (Name:"+e.name+", UniqueId:"+e.uniqueId+") is already associated with this grid. You must remove it before reattaching it"),this;var o=Math.min(i,this._rowDefinitions.length-1),a=Math.min(r,this._columnDefinitions.length-1),s=o+":"+a,l=this._cells[s];return l||(l=new ao(s),this._cells[s]=l,l.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,l.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,n.prototype.addControl.call(this,l)),l.addControl(e),this._childControls.push(e),e._tag=s,e.parent=this,this._markAsDirty(),this},t.prototype.removeControl=function(e){var i=this._childControls.indexOf(e);i!==-1&&this._childControls.splice(i,1);var r=this._cells[e._tag];return r&&(r.removeControl(e),e._tag=null),this._markAsDirty(),this},t.prototype._getTypeName=function(){return"Grid"},t.prototype._getGridDefinitions=function(e){for(var i=[],r=[],o=[],a=[],s=this._currentMeasure.width,l=0,u=this._currentMeasure.height,f=0,c=0,h=0,p=this._rowDefinitions;h<p.length;h++){var _=p[h];if(_.isPixel){var g=_.getValue(this._host);u-=g,r[c]=g}else f+=_.internalValue;c++}var v=0;c=0;for(var E=0,T=this._rowDefinitions;E<T.length;E++){var _=T[E];if(a.push(v),_.isPixel)v+=_.getValue(this._host);else{var g=_.internalValue/f*u;v+=g,r[c]=g}c++}c=0;for(var S=0,C=this._columnDefinitions;S<C.length;S++){var _=C[S];if(_.isPixel){var O=_.getValue(this._host);s-=O,i[c]=O}else l+=_.internalValue;c++}var A=0;c=0;for(var M=0,D=this._columnDefinitions;M<D.length;M++){var _=D[M];if(o.push(A),_.isPixel)A+=_.getValue(this._host);else{var O=_.internalValue/l*s;A+=O,i[c]=O}c++}e(o,a,i,r)},t.prototype._additionalProcessing=function(e,i){var r=this;this._getGridDefinitions(function(o,a,s,l){for(var u in r._cells)if(r._cells.hasOwnProperty(u)){var f=u.split(":"),c=parseInt(f[0]),h=parseInt(f[1]),p=r._cells[u];p.left=o[h]+"px",p.top=a[c]+"px",p.width=s[h]+"px",p.height=l[c]+"px",p._left.ignoreAdaptiveScaling=!0,p._top.ignoreAdaptiveScaling=!0,p._width.ignoreAdaptiveScaling=!0,p._height.ignoreAdaptiveScaling=!0}}),n.prototype._additionalProcessing.call(this,e,i)},t.prototype._flagDescendantsAsMatrixDirty=function(){for(var e in this._cells)if(this._cells.hasOwnProperty(e)){var i=this._cells[e];i._markMatrixAsDirty()}},t.prototype._renderHighlightSpecific=function(e){var i=this;n.prototype._renderHighlightSpecific.call(this,e),this._getGridDefinitions(function(r,o,a,s){for(var l=0;l<r.length;l++){var u=i._currentMeasure.left+r[l]+a[l];e.beginPath(),e.moveTo(u,i._currentMeasure.top),e.lineTo(u,i._currentMeasure.top+i._currentMeasure.height),e.stroke()}for(var l=0;l<o.length;l++){var f=i._currentMeasure.top+o[l]+s[l];e.beginPath(),e.moveTo(i._currentMeasure.left,f),e.lineTo(i._currentMeasure.left+i._currentMeasure.width,f),e.stroke()}}),e.restore()},t.prototype.dispose=function(){n.prototype.dispose.call(this);for(var e=0,i=this._childControls;e<i.length;e++){var r=i[e];r.dispose()}this._childControls=[]},t}(ao);Ae.RegisteredTypes["BABYLON.GUI.Grid"]=un;var _X=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._value=_e.Red(),i._tmpColor=new _e,i._pointerStartedOnSquare=!1,i._pointerStartedOnWheel=!1,i._squareLeft=0,i._squareTop=0,i._squareSize=0,i._h=360,i._s=1,i._v=1,i._lastPointerDownID=-1,i.onValueChangedObservable=new ie,i._pointerIsDown=!1,i.value=new _e(.88,.1,.1),i.size="200px",i.isPointerBlocker=!0,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){this._value.equals(e)||(this._value.copyFrom(e),this._value.toHSVToRef(this._tmpColor),this._h=this._tmpColor.r,this._s=Math.max(this._tmpColor.g,1e-5),this._v=Math.max(this._tmpColor.b,1e-5),this._markAsDirty(),this._value.r<=t._Epsilon&&(this._value.r=0),this._value.g<=t._Epsilon&&(this._value.g=0),this._value.b<=t._Epsilon&&(this._value.b=0),this._value.r>=1-t._Epsilon&&(this._value.r=1),this._value.g>=1-t._Epsilon&&(this._value.g=1),this._value.b>=1-t._Epsilon&&(this._value.b=1),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width.toString(this._host)},set:function(e){this._width.toString(this._host)!==e&&this._width.fromString(e)&&(this._height.fromString(e),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height.toString(this._host)},set:function(e){this._height.toString(this._host)!==e&&this._height.fromString(e)&&(this._width.fromString(e),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.width},set:function(e){this.width=e},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"ColorPicker"},t.prototype._preMeasure=function(e,i){e.width<e.height?this._currentMeasure.height=e.width:this._currentMeasure.width=e.height},t.prototype._updateSquareProps=function(){var e=Math.min(this._currentMeasure.width,this._currentMeasure.height)*.5,i=e*.2,r=(e-i)*2,o=r/Math.sqrt(2),a=e-o*.5;this._squareLeft=this._currentMeasure.left+a,this._squareTop=this._currentMeasure.top+a,this._squareSize=o},t.prototype._drawGradientSquare=function(e,i,r,o,a,s){var l=s.createLinearGradient(i,r,o+i,r);l.addColorStop(0,"#fff"),l.addColorStop(1,"hsl("+e+", 100%, 50%)"),s.fillStyle=l,s.fillRect(i,r,o,a);var u=s.createLinearGradient(i,r,i,a+r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"#000"),s.fillStyle=u,s.fillRect(i,r,o,a)},t.prototype._drawCircle=function(e,i,r,o){o.beginPath(),o.arc(e,i,r+1,0,2*Math.PI,!1),o.lineWidth=3,o.strokeStyle="#333333",o.stroke(),o.beginPath(),o.arc(e,i,r,0,2*Math.PI,!1),o.lineWidth=3,o.strokeStyle="#ffffff",o.stroke()},t.prototype._createColorWheelCanvas=function(e,i){var r=document.createElement("canvas");r.width=e*2,r.height=e*2;for(var o=r.getContext("2d"),a=o.getImageData(0,0,e*2,e*2),s=a.data,l=this._tmpColor,u=e*e,f=e-i,c=f*f,h=-e;h<e;h++)for(var p=-e;p<e;p++){var _=h*h+p*p;if(!(_>u||_<c)){var g=Math.sqrt(_),v=Math.atan2(p,h);_e.HSVtoRGBToRef(v*180/Math.PI+180,g/e,1,l);var E=(h+e+(p+e)*2*e)*4;s[E]=l.r*255,s[E+1]=l.g*255,s[E+2]=l.b*255;var M=(g-f)/(e-f),T=.2,S=.2,C=.04,O=50,A=150;e<O?T=S:e>A?T=C:T=(C-S)*(e-O)/(A-O)+S;var M=(g-f)/(e-f);M<T?s[E+3]=255*(M/T):M>1-T?s[E+3]=255*(1-(M-(1-T))/T):s[E+3]=255}}return o.putImageData(a,0,0),r},t.prototype._draw=function(e){e.save(),this._applyStates(e);var i=Math.min(this._currentMeasure.width,this._currentMeasure.height)*.5,r=i*.2,o=this._currentMeasure.left,a=this._currentMeasure.top;(!this._colorWheelCanvas||this._colorWheelCanvas.width!=i*2)&&(this._colorWheelCanvas=this._createColorWheelCanvas(i,r)),this._updateSquareProps(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY,e.fillRect(this._squareLeft,this._squareTop,this._squareSize,this._squareSize)),e.drawImage(this._colorWheelCanvas,o,a),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._drawGradientSquare(this._h,this._squareLeft,this._squareTop,this._squareSize,this._squareSize,e);var s=this._squareLeft+this._squareSize*this._s,l=this._squareTop+this._squareSize*(1-this._v);this._drawCircle(s,l,i*.04,e);var u=i-r*.5;s=o+i+Math.cos((this._h-180)*Math.PI/180)*u,l=a+i+Math.sin((this._h-180)*Math.PI/180)*u,this._drawCircle(s,l,r*.35,e),e.restore()},t.prototype._updateValueFromPointer=function(e,i){if(this._pointerStartedOnWheel){var r=Math.min(this._currentMeasure.width,this._currentMeasure.height)*.5,o=r+this._currentMeasure.left,a=r+this._currentMeasure.top;this._h=Math.atan2(i-a,e-o)*180/Math.PI+180}else this._pointerStartedOnSquare&&(this._updateSquareProps(),this._s=(e-this._squareLeft)/this._squareSize,this._v=1-(i-this._squareTop)/this._squareSize,this._s=Math.min(this._s,1),this._s=Math.max(this._s,t._Epsilon),this._v=Math.min(this._v,1),this._v=Math.max(this._v,t._Epsilon));_e.HSVtoRGBToRef(this._h,this._s,this._v,this._tmpColor),this.value=this._tmpColor},t.prototype._isPointOnSquare=function(e,i){this._updateSquareProps();var r=this._squareLeft,o=this._squareTop,a=this._squareSize;return e>=r&&e<=r+a&&i>=o&&i<=o+a},t.prototype._isPointOnWheel=function(e,i){var r=Math.min(this._currentMeasure.width,this._currentMeasure.height)*.5,o=r+this._currentMeasure.left,a=r+this._currentMeasure.top,s=r*.2,l=r-s,u=r*r,f=l*l,c=e-o,h=i-a,p=c*c+h*h;return p<=u&&p>=f},t.prototype._onPointerDown=function(e,i,r,o,a){if(!n.prototype._onPointerDown.call(this,e,i,r,o,a))return!1;this._pointerIsDown=!0,this._pointerStartedOnSquare=!1,this._pointerStartedOnWheel=!1,this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var s=this._transformedPosition.x,l=this._transformedPosition.y;return this._isPointOnSquare(s,l)?this._pointerStartedOnSquare=!0:this._isPointOnWheel(s,l)&&(this._pointerStartedOnWheel=!0),this._updateValueFromPointer(s,l),this._host._capturingControl[r]=this,this._lastPointerDownID=r,!0},t.prototype._onPointerMove=function(e,i,r,o){if(r==this._lastPointerDownID){this._invertTransformMatrix.transformCoordinates(i.x,i.y,this._transformedPosition);var a=this._transformedPosition.x,s=this._transformedPosition.y;this._pointerIsDown&&this._updateValueFromPointer(a,s),n.prototype._onPointerMove.call(this,e,i,r,o)}},t.prototype._onPointerUp=function(e,i,r,o,a,s){this._pointerIsDown=!1,delete this._host._capturingControl[r],n.prototype._onPointerUp.call(this,e,i,r,o,a,s)},t.prototype._onCanvasBlur=function(){this._forcePointerUp(),n.prototype._onCanvasBlur.call(this)},t.ShowPickerDialogAsync=function(e,i){return new Promise(function(r,o){i.pickerWidth=i.pickerWidth||"640px",i.pickerHeight=i.pickerHeight||"400px",i.headerHeight=i.headerHeight||"35px",i.lastColor=i.lastColor||"#000000",i.swatchLimit=i.swatchLimit||20,i.numSwatchesPerLine=i.numSwatchesPerLine||10;var a=i.swatchLimit/i.numSwatchesPerLine,s=parseFloat(i.pickerWidth)/i.numSwatchesPerLine,l=Math.floor(s*.25),u=l*(i.numSwatchesPerLine+1),f=Math.floor((parseFloat(i.pickerWidth)-u)/i.numSwatchesPerLine),c=f*a+l*(a+1),h=(parseInt(i.pickerHeight)+c+Math.floor(f*.25)).toString()+"px",p="#c0c0c0",_="#535353",g="#414141",v="515151",E="#555555",T="#454545",S="#404040",C=_e.FromHexString("#dddddd"),O=C.r+C.g+C.b,A="#aaaaaa",M="#ffffff",D,U,V,B,z,J=["R","G","B"],X="#454545",re="#f0f0f0",ae,se,H,Z=!1,q,N,W,$,L,G,Y,Q,fe,Se,ee;function pe(Ge,$e){ee=$e;var qe=Ge.toHexString();if(fe.background=qe,N.name!=ee&&(N.text=Math.floor(Ge.r*255).toString()),W.name!=ee&&(W.text=Math.floor(Ge.g*255).toString()),$.name!=ee&&($.text=Math.floor(Ge.b*255).toString()),L.name!=ee&&(L.text=Ge.r.toString()),G.name!=ee&&(G.text=Ge.g.toString()),Y.name!=ee&&(Y.text=Ge.b.toString()),Q.name!=ee){var Ft=qe.split("#");Q.text=Ft[1]}q.name!=ee&&(q.value=Ge)}function Pe(Ge,$e){var qe=Ge.text,Ft=/[^0-9]/g.test(qe);if(Ft){Ge.text=Se;return}else qe!=""&&(Math.floor(parseInt(qe))<0?qe="0":Math.floor(parseInt(qe))>255?qe="255":isNaN(parseInt(qe))&&(qe="0")),ee==Ge.name&&(Se=qe);if(qe!=""){qe=parseInt(qe).toString(),Ge.text=qe;var xt=_e.FromHexString(fe.background);ee==Ge.name&&($e=="r"?pe(new _e(parseInt(qe)/255,xt.g,xt.b),Ge.name):$e=="g"?pe(new _e(xt.r,parseInt(qe)/255,xt.b),Ge.name):pe(new _e(xt.r,xt.g,parseInt(qe)/255),Ge.name))}}function xe(Ge,$e){var qe=Ge.text,Ft=/[^0-9\.]/g.test(qe);if(Ft){Ge.text=Se;return}else qe!=""&&qe!="."&&parseFloat(qe)!=0&&(parseFloat(qe)<0?qe="0.0":parseFloat(qe)>1?qe="1.0":isNaN(parseFloat(qe))&&(qe="0.0")),ee==Ge.name&&(Se=qe);qe!=""&&qe!="."&&parseFloat(qe)!=0?(qe=parseFloat(qe).toString(),Ge.text=qe):qe="0.0";var xt=_e.FromHexString(fe.background);ee==Ge.name&&($e=="r"?pe(new _e(parseFloat(qe),xt.g,xt.b),Ge.name):$e=="g"?pe(new _e(xt.r,parseFloat(qe),xt.b),Ge.name):pe(new _e(xt.r,xt.g,parseFloat(qe)),Ge.name))}function We(Ge){i.savedColors&&i.savedColors.splice(Ge,1),i.savedColors&&i.savedColors.length==0&&(we(!1),Z=!1)}function je(){if(i.savedColors&&i.savedColors[se]){if(Z)var Ge="b";else var Ge="";var $e=_a.CreateSimpleButton("Swatch_"+se,Ge);$e.fontFamily="BabylonJSglyphs";var qe=_e.FromHexString(i.savedColors[se]),Ft=qe.r+qe.g+qe.b;Ft>O?$e.color=A:$e.color=M,$e.fontSize=Math.floor(f*.7),$e.textBlock.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,$e.height=$e.width=f.toString()+"px",$e.background=i.savedColors[se],$e.thickness=2;var xt=se;return $e.pointerDownAnimation=function(){$e.thickness=4},$e.pointerUpAnimation=function(){$e.thickness=3},$e.pointerEnterAnimation=function(){$e.thickness=3},$e.pointerOutAnimation=function(){$e.thickness=2},$e.onPointerClickObservable.add(function(){Z?(We(xt),ft("",ri)):i.savedColors&&pe(_e.FromHexString(i.savedColors[xt]),$e.name)}),$e}else return null}function Xe(Ge){if(Ge!==void 0&&(Z=Ge),Z){for(var $e=0;$e<H.children.length;$e++){var qe=H.children[$e];qe.textBlock.text="b"}V!==void 0&&(V.textBlock.text="Done")}else{for(var $e=0;$e<H.children.length;$e++){var qe=H.children[$e];qe.textBlock.text=""}V!==void 0&&(V.textBlock.text="Edit")}}function ft(Ge,$e){if(i.savedColors){Ge!=""&&i.savedColors.push(Ge),se=0,H.clearControls();var qe=Math.ceil(i.savedColors.length/i.numSwatchesPerLine);if(qe==0)var Ft=0;else var Ft=qe+1;if(H.rowCount!=qe+Ft){for(var xt=H.rowCount,Bt=0;Bt<xt;Bt++)H.removeRowDefinition(0);for(var Bt=0;Bt<qe+Ft;Bt++)Bt%2?H.addRowDefinition(f,!0):H.addRowDefinition(l,!0)}H.height=(f*qe+Ft*l).toString()+"px";for(var ai=1,yi=1;ai<qe+Ft;ai+=2,yi++){if(i.savedColors.length>yi*i.numSwatchesPerLine)var Dt=i.numSwatchesPerLine;else var Dt=i.savedColors.length-(yi-1)*i.numSwatchesPerLine;for(var pi=Math.min(Math.max(Dt,0),i.numSwatchesPerLine),Di=0,Ei=1;Di<pi;Di++)if(!(Di>i.numSwatchesPerLine)){var ci=je();if(ci!=null)H.addControl(ci,ai,Ei),Ei+=2,se++;else continue}}i.savedColors.length>=i.swatchLimit?Ye($e,!0):Ye($e,!1)}}function we(Ge){Ge?(V=_a.CreateSimpleButton("butEdit","Edit"),V.width=B,V.height=z,V.left=Math.floor(parseInt(B)*.1).toString()+"px",V.top=(parseFloat(V.left)*-1).toString()+"px",V.verticalAlignment=ot.VERTICAL_ALIGNMENT_BOTTOM,V.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,V.thickness=2,V.color=p,V.fontSize=U,V.background=_,V.onPointerEnterObservable.add(function(){V.background=g}),V.onPointerOutObservable.add(function(){V.background=_}),V.pointerDownAnimation=function(){V.background=v},V.pointerUpAnimation=function(){V.background=g},V.onPointerClickObservable.add(function(){Z?Z=!1:Z=!0,Xe()}),er.addControl(V,1,0)):er.removeControl(V)}function Ye(Ge,$e){$e?(Ge.color=E,Ge.background=T):(Ge.color=p,Ge.background=_)}function tt(Ge){i.savedColors&&i.savedColors.length>0?r({savedColors:i.savedColors,pickedColor:Ge}):r({pickedColor:Ge}),e.removeControl(lt)}var lt=new un;if(lt.name="Dialog Container",lt.width=i.pickerWidth,i.savedColors){lt.height=h;var yt=parseInt(i.pickerHeight)/parseInt(h);lt.addRowDefinition(yt,!1),lt.addRowDefinition(1-yt,!1)}else lt.height=i.pickerHeight,lt.addRowDefinition(1,!1);if(e.addControl(lt),i.savedColors){H=new un,H.name="Swatch Drawer",H.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,H.background=_,H.width=i.pickerWidth;var bt=i.savedColors.length/i.numSwatchesPerLine;if(bt==0)var Yt=0;else var Yt=bt+1;H.height=(f*bt+Yt*l).toString()+"px",H.top=Math.floor(f*.25).toString()+"px";for(var Ut=0;Ut<Math.ceil(i.savedColors.length/i.numSwatchesPerLine)*2+1;Ut++)Ut%2!=0?H.addRowDefinition(f,!0):H.addRowDefinition(l,!0);for(var Ut=0;Ut<i.numSwatchesPerLine*2+1;Ut++)Ut%2!=0?H.addColumnDefinition(f,!0):H.addColumnDefinition(l,!0);lt.addControl(H,1,0)}var ei=new un;ei.name="Picker Panel",ei.height=i.pickerHeight;var ar=parseInt(i.headerHeight)/parseInt(i.pickerHeight),xi=[ar,1-ar];ei.addRowDefinition(xi[0],!1),ei.addRowDefinition(xi[1],!1),lt.addControl(ei,0,0);var si=new so;si.name="Dialogue Header Bar",si.background="#cccccc",si.thickness=0,ei.addControl(si,0,0);var Kt=_a.CreateSimpleButton("closeButton","a");Kt.fontFamily="BabylonJSglyphs";var sr=_e.FromHexString(si.background);D=new _e(1-sr.r,1-sr.g,1-sr.b),Kt.color=D.toHexString(),Kt.fontSize=Math.floor(parseInt(i.headerHeight)*.6),Kt.textBlock.textVerticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,Kt.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_RIGHT,Kt.height=Kt.width=i.headerHeight,Kt.background=si.background,Kt.thickness=0,Kt.pointerDownAnimation=function(){},Kt.pointerUpAnimation=function(){Kt.background=si.background},Kt.pointerEnterAnimation=function(){Kt.color=si.background,Kt.background="red"},Kt.pointerOutAnimation=function(){Kt.color=D.toHexString(),Kt.background=si.background},Kt.onPointerClickObservable.add(function(){tt(Fi.background)}),ei.addControl(Kt,0,0);var Wt=new un;Wt.name="Dialogue Body",Wt.background=_;var lr=[.4375,.5625];Wt.addRowDefinition(1,!1),Wt.addColumnDefinition(lr[0],!1),Wt.addColumnDefinition(lr[1],!1),ei.addControl(Wt,1,0);var er=new un;er.name="Picker Grid",er.addRowDefinition(.85,!1),er.addRowDefinition(.15,!1),Wt.addControl(er,0,0),q=new t,q.name="GUI Color Picker",i.pickerHeight<i.pickerWidth?q.width=.89:q.height=.89,q.value=_e.FromHexString(i.lastColor),q.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,q.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,q.onPointerDownObservable.add(function(){ee=q.name,Se="",Xe(!1)}),q.onValueChangedObservable.add(function(Ge){ee==q.name&&pe(Ge,q.name)}),er.addControl(q,0,0);var Pi=new un;Pi.name="Dialogue Right Half",Pi.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT;var Yi=[.514,.486];Pi.addRowDefinition(Yi[0],!1),Pi.addRowDefinition(Yi[1],!1),Wt.addControl(Pi,1,1);var Ai=new un;Ai.name="Swatches and Buttons";var nn=[.417,.583];Ai.addRowDefinition(1,!1),Ai.addColumnDefinition(nn[0],!1),Ai.addColumnDefinition(nn[1],!1),Pi.addControl(Ai,0,0);var ur=new un;ur.name="New and Current Swatches";var pr=[.04,.16,.64,.16];ur.addRowDefinition(pr[0],!1),ur.addRowDefinition(pr[1],!1),ur.addRowDefinition(pr[2],!1),ur.addRowDefinition(pr[3],!1),Ai.addControl(ur,0,0);var zi=new un;zi.name="Active Swatches",zi.width=.67,zi.addRowDefinition(.5,!1),zi.addRowDefinition(.5,!1),ur.addControl(zi,2,0);var Sr=Math.floor(parseInt(i.pickerWidth)*lr[1]*nn[0]*.11),dn=Math.floor(parseInt(i.pickerHeight)*xi[1]*Yi[0]*pr[1]*.5);if(i.pickerWidth>i.pickerHeight)var tr=dn;else var tr=Sr;var kr=new Mn;kr.text="new",kr.name="New Color Label",kr.color=p,kr.fontSize=tr,ur.addControl(kr,1,0),fe=new so,fe.name="New Color Swatch",fe.background=i.lastColor,fe.thickness=0,zi.addControl(fe,0,0);var Fi=_a.CreateSimpleButton("currentSwatch","");Fi.background=i.lastColor,Fi.thickness=0,Fi.onPointerClickObservable.add(function(){var Ge=_e.FromHexString(Fi.background);pe(Ge,Fi.name),Xe(!1)}),Fi.pointerDownAnimation=function(){},Fi.pointerUpAnimation=function(){},Fi.pointerEnterAnimation=function(){},Fi.pointerOutAnimation=function(){},zi.addControl(Fi,1,0);var Lr=new so;Lr.name="Swatch Outline",Lr.width=.67,Lr.thickness=2,Lr.color=S,Lr.isHitTestVisible=!1,ur.addControl(Lr,2,0);var Ki=new Mn;Ki.name="Current Color Label",Ki.text="current",Ki.color=p,Ki.fontSize=tr,ur.addControl(Ki,3,0);var Ii=new un;Ii.name="Button Grid",Ii.height=.8;var _r=1/3;Ii.addRowDefinition(_r,!1),Ii.addRowDefinition(_r,!1),Ii.addRowDefinition(_r,!1),Ai.addControl(Ii,0,1),B=Math.floor(parseInt(i.pickerWidth)*lr[1]*nn[1]*.67).toString()+"px",z=Math.floor(parseInt(i.pickerHeight)*xi[1]*Yi[0]*(parseFloat(Ii.height.toString())/100)*_r*.7).toString()+"px",parseFloat(B)>parseFloat(z)?U=Math.floor(parseFloat(z)*.45):U=Math.floor(parseFloat(B)*.11);var vi=_a.CreateSimpleButton("butOK","OK");vi.width=B,vi.height=z,vi.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,vi.thickness=2,vi.color=p,vi.fontSize=U,vi.background=_,vi.onPointerEnterObservable.add(function(){vi.background=g}),vi.onPointerOutObservable.add(function(){vi.background=_}),vi.pointerDownAnimation=function(){vi.background=v},vi.pointerUpAnimation=function(){vi.background=g},vi.onPointerClickObservable.add(function(){Xe(!1),tt(fe.background)}),Ii.addControl(vi,0,0);var fi=_a.CreateSimpleButton("butCancel","Cancel");if(fi.width=B,fi.height=z,fi.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,fi.thickness=2,fi.color=p,fi.fontSize=U,fi.background=_,fi.onPointerEnterObservable.add(function(){fi.background=g}),fi.onPointerOutObservable.add(function(){fi.background=_}),fi.pointerDownAnimation=function(){fi.background=v},fi.pointerUpAnimation=function(){fi.background=g},fi.onPointerClickObservable.add(function(){Xe(!1),tt(Fi.background)}),Ii.addControl(fi,1,0),i.savedColors){var ri=_a.CreateSimpleButton("butSave","Save");ri.width=B,ri.height=z,ri.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,ri.thickness=2,ri.fontSize=U,i.savedColors.length<i.swatchLimit?(ri.color=p,ri.background=_):Ye(ri,!0),ri.onPointerEnterObservable.add(function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(ri.background=g)}),ri.onPointerOutObservable.add(function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(ri.background=_)}),ri.pointerDownAnimation=function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(ri.background=v)},ri.pointerUpAnimation=function(){i.savedColors&&i.savedColors.length<i.swatchLimit&&(ri.background=g)},ri.onPointerClickObservable.add(function(){i.savedColors&&(i.savedColors.length==0&&we(!0),i.savedColors.length<i.swatchLimit&&ft(fe.background,ri),Xe(!1))}),i.savedColors.length>0&&we(!0),Ii.addControl(ri,2,0)}var ve=new un;ve.name="Dialog Lower Right",ve.addRowDefinition(.02,!1),ve.addRowDefinition(.63,!1),ve.addRowDefinition(.21,!1),ve.addRowDefinition(.14,!1),Pi.addControl(ve,1,0),ae=_e.FromHexString(i.lastColor);var le=new un;le.name="RGB Values",le.width=.82,le.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,le.addRowDefinition(1/3,!1),le.addRowDefinition(1/3,!1),le.addRowDefinition(1/3,!1),le.addColumnDefinition(.1,!1),le.addColumnDefinition(.2,!1),le.addColumnDefinition(.7,!1),ve.addControl(le,1,0);for(var Ut=0;Ut<J.length;Ut++){var Le=new Mn;Le.text=J[Ut],Le.color=p,Le.fontSize=U,le.addControl(Le,Ut,0)}N=new ma,N.width=.83,N.height=.72,N.name="rIntField",N.fontSize=U,N.text=(ae.r*255).toString(),N.color=re,N.background=X,N.onFocusObservable.add(function(){ee=N.name,Se=N.text,Xe(!1)}),N.onBlurObservable.add(function(){N.text==""&&(N.text="0"),Pe(N,"r"),ee==N.name&&(ee="")}),N.onTextChangedObservable.add(function(){ee==N.name&&Pe(N,"r")}),le.addControl(N,0,1),W=new ma,W.width=.83,W.height=.72,W.name="gIntField",W.fontSize=U,W.text=(ae.g*255).toString(),W.color=re,W.background=X,W.onFocusObservable.add(function(){ee=W.name,Se=W.text,Xe(!1)}),W.onBlurObservable.add(function(){W.text==""&&(W.text="0"),Pe(W,"g"),ee==W.name&&(ee="")}),W.onTextChangedObservable.add(function(){ee==W.name&&Pe(W,"g")}),le.addControl(W,1,1),$=new ma,$.width=.83,$.height=.72,$.name="bIntField",$.fontSize=U,$.text=(ae.b*255).toString(),$.color=re,$.background=X,$.onFocusObservable.add(function(){ee=$.name,Se=$.text,Xe(!1)}),$.onBlurObservable.add(function(){$.text==""&&($.text="0"),Pe($,"b"),ee==$.name&&(ee="")}),$.onTextChangedObservable.add(function(){ee==$.name&&Pe($,"b")}),le.addControl($,2,1),L=new ma,L.width=.95,L.height=.72,L.name="rDecField",L.fontSize=U,L.text=ae.r.toString(),L.color=re,L.background=X,L.onFocusObservable.add(function(){ee=L.name,Se=L.text,Xe(!1)}),L.onBlurObservable.add(function(){(parseFloat(L.text)==0||L.text=="")&&(L.text="0",xe(L,"r")),ee==L.name&&(ee="")}),L.onTextChangedObservable.add(function(){ee==L.name&&xe(L,"r")}),le.addControl(L,0,2),G=new ma,G.width=.95,G.height=.72,G.name="gDecField",G.fontSize=U,G.text=ae.g.toString(),G.color=re,G.background=X,G.onFocusObservable.add(function(){ee=G.name,Se=G.text,Xe(!1)}),G.onBlurObservable.add(function(){(parseFloat(G.text)==0||G.text=="")&&(G.text="0",xe(G,"g")),ee==G.name&&(ee="")}),G.onTextChangedObservable.add(function(){ee==G.name&&xe(G,"g")}),le.addControl(G,1,2),Y=new ma,Y.width=.95,Y.height=.72,Y.name="bDecField",Y.fontSize=U,Y.text=ae.b.toString(),Y.color=re,Y.background=X,Y.onFocusObservable.add(function(){ee=Y.name,Se=Y.text,Xe(!1)}),Y.onBlurObservable.add(function(){(parseFloat(Y.text)==0||Y.text=="")&&(Y.text="0",xe(Y,"b")),ee==Y.name&&(ee="")}),Y.onTextChangedObservable.add(function(){ee==Y.name&&xe(Y,"b")}),le.addControl(Y,2,2);var be=new un;be.name="Hex Value",be.width=.82,be.addRowDefinition(1,!1),be.addColumnDefinition(.1,!1),be.addColumnDefinition(.9,!1),ve.addControl(be,2,0);var Le=new Mn;Le.text="#",Le.color=p,Le.fontSize=U,be.addControl(Le,0,0),Q=new ma,Q.width=.96,Q.height=.72,Q.name="hexField",Q.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,Q.fontSize=U;var Ne=i.lastColor.split("#");Q.text=Ne[1],Q.color=re,Q.background=X,Q.onFocusObservable.add(function(){ee=Q.name,Se=Q.text,Xe(!1)}),Q.onBlurObservable.add(function(){if(Q.text.length==3){var Ge=Q.text.split("");Q.text=Ge[0]+Ge[0]+Ge[1]+Ge[1]+Ge[2]+Ge[2]}Q.text==""&&(Q.text="000000",pe(_e.FromHexString(Q.text),"b")),ee==Q.name&&(ee="")}),Q.onTextChangedObservable.add(function(){var Ge=Q.text,$e=/[^0-9A-F]/i.test(Ge);if((Q.text.length>6||$e)&&ee==Q.name)Q.text=Se;else{if(Q.text.length<6)for(var qe=6-Q.text.length,Ft=0;Ft<qe;Ft++)Ge="0"+Ge;if(Q.text.length==3){var xt=Q.text.split("");Ge=xt[0]+xt[0]+xt[1]+xt[1]+xt[2]+xt[2]}Ge="#"+Ge,ee==Q.name&&(Se=Q.text,pe(_e.FromHexString(Ge),Q.name))}}),be.addControl(Q,0,1),i.savedColors&&i.savedColors.length>0&&ft("",ri)})},t._Epsilon=1e-6,t}(ot);Ae.RegisteredTypes["BABYLON.GUI.ColorPicker"]=_X;var mX=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._thickness=1,i}return Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Ellipse"},t.prototype._localDraw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),ot.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,e),this._background&&(e.fillStyle=this._background,e.fill()),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),this._thickness&&(this.color&&(e.strokeStyle=this.color),e.lineWidth=this._thickness,e.stroke()),e.restore()},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._measureForChildren.width-=2*this._thickness,this._measureForChildren.height-=2*this._thickness,this._measureForChildren.left+=this._thickness,this._measureForChildren.top+=this._thickness},t.prototype._clipForChildren=function(e){ot.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2,this._currentMeasure.height/2,e),e.clip()},t}(ao);Ae.RegisteredTypes["BABYLON.GUI.Ellipse"]=mX;var gX=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype._beforeRenderText=function(e){for(var i=new By,r="",o=0;o<e.length;o++)r+="•";return i.text=r,i},t}(ma);Ae.RegisteredTypes["BABYLON.GUI.InputPassword"]=gX;var vX=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._lineWidth=1,i._x1=new zt(0),i._y1=new zt(0),i._x2=new zt(0),i._y2=new zt(0),i._dash=new Array,i._automaticSize=!0,i.isHitTestVisible=!1,i._horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,i._verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,i}return Object.defineProperty(t.prototype,"dash",{get:function(){return this._dash},set:function(e){this._dash!==e&&(this._dash=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectedControl",{get:function(){return this._connectedControl},set:function(e){var i=this;this._connectedControl!==e&&(this._connectedControlDirtyObserver&&this._connectedControl&&(this._connectedControl.onDirtyObservable.remove(this._connectedControlDirtyObserver),this._connectedControlDirtyObserver=null),e&&(this._connectedControlDirtyObserver=e.onDirtyObservable.add(function(){return i._markAsDirty()})),this._connectedControl=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x1",{get:function(){return this._x1.toString(this._host)},set:function(e){this._x1.toString(this._host)!==e&&this._x1.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y1",{get:function(){return this._y1.toString(this._host)},set:function(e){this._y1.toString(this._host)!==e&&this._y1.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x2",{get:function(){return this._x2.toString(this._host)},set:function(e){this._x2.toString(this._host)!==e&&this._x2.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y2",{get:function(){return this._y2.toString(this._host)},set:function(e){this._y2.toString(this._host)!==e&&this._y2.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(e){this._lineWidth!==e&&(this._lineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_effectiveX2",{get:function(){return(this._connectedControl?this._connectedControl.centerX:0)+this._x2.getValue(this._host)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_effectiveY2",{get:function(){return(this._connectedControl?this._connectedControl.centerY:0)+this._y2.getValue(this._host)},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Line"},t.prototype._draw=function(e){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._applyStates(e),e.strokeStyle=this.color,e.lineWidth=this._lineWidth,e.setLineDash(this._dash),e.beginPath(),e.moveTo(this._cachedParentMeasure.left+this._x1.getValue(this._host),this._cachedParentMeasure.top+this._y1.getValue(this._host)),e.lineTo(this._cachedParentMeasure.left+this._effectiveX2,this._cachedParentMeasure.top+this._effectiveY2),e.stroke(),e.restore()},t.prototype._measure=function(){this._currentMeasure.width=Math.abs(this._x1.getValue(this._host)-this._effectiveX2)+this._lineWidth,this._currentMeasure.height=Math.abs(this._y1.getValue(this._host)-this._effectiveY2)+this._lineWidth},t.prototype._computeAlignment=function(e,i){this._currentMeasure.left=e.left+Math.min(this._x1.getValue(this._host),this._effectiveX2)-this._lineWidth/2,this._currentMeasure.top=e.top+Math.min(this._y1.getValue(this._host),this._effectiveY2)-this._lineWidth/2},t.prototype.moveToVector3=function(e,i,r){if(r===void 0&&(r=!1),!this._host||this.parent!==this._host._rootContainer){Ee.Error("Cannot move a control to a vector3 if the control is not at root level");return}var o=this._host._getGlobalViewport(i),a=y.Project(e,te.Identity(),i.getTransformMatrix(),o);if(this._moveToProjectedPosition(a,r),a.z<0||a.z>1){this.notRenderable=!0;return}this.notRenderable=!1},t.prototype._moveToProjectedPosition=function(e,i){i===void 0&&(i=!1);var r=e.x+this._linkOffsetX.getValue(this._host)+"px",o=e.y+this._linkOffsetY.getValue(this._host)+"px";i?(this.x2=r,this.y2=o,this._x2.ignoreAdaptiveScaling=!0,this._y2.ignoreAdaptiveScaling=!0):(this.x1=r,this.y1=o,this._x1.ignoreAdaptiveScaling=!0,this._y1.ignoreAdaptiveScaling=!0)},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.Line"]=vX;var jO=function(){function n(t){this._multiLine=t,this._x=new zt(0),this._y=new zt(0),this._point=new y(0,0,0)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x.toString(this._multiLine._host)},set:function(t){this._x.toString(this._multiLine._host)!==t&&this._x.fromString(t)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y.toString(this._multiLine._host)},set:function(t){this._y.toString(this._multiLine._host)!==t&&this._y.fromString(t)&&this._multiLine._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"control",{get:function(){return this._control},set:function(t){this._control!==t&&(this._control&&this._controlObserver&&(this._control.onDirtyObservable.remove(this._controlObserver),this._controlObserver=null),this._control=t,this._control&&(this._controlObserver=this._control.onDirtyObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mesh",{get:function(){return this._mesh},set:function(t){this._mesh!==t&&(this._mesh&&this._meshObserver&&this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver),this._mesh=t,this._mesh&&(this._meshObserver=this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate)),this._multiLine._markAsDirty())},enumerable:!1,configurable:!0}),n.prototype.resetLinks=function(){this.control=null,this.mesh=null},n.prototype.translate=function(){return this._point=this._translatePoint(),this._point},n.prototype._translatePoint=function(){if(this._mesh!=null)return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center,this._mesh.getWorldMatrix());if(this._control!=null)return new y(this._control.centerX,this._control.centerY,1-Zt);var t=this._multiLine._host,e=this._x.getValueInPixel(t,Number(t._canvas.width)),i=this._y.getValueInPixel(t,Number(t._canvas.height));return new y(e,i,1-Zt)},n.prototype.dispose=function(){this.resetLinks()},n}(),yX=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._lineWidth=1,i.onPointUpdate=function(){i._markAsDirty()},i._automaticSize=!0,i.isHitTestVisible=!1,i._horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,i._verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,i._dash=[],i._points=[],i}return Object.defineProperty(t.prototype,"dash",{get:function(){return this._dash},set:function(e){this._dash!==e&&(this._dash=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype.getAt=function(e){return this._points[e]||(this._points[e]=new jO(this)),this._points[e]},t.prototype.add=function(){for(var e=this,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return i.map(function(o){return e.push(o)})},t.prototype.push=function(e){var i=this.getAt(this._points.length);return e==null||(e instanceof Ht?i.mesh=e:e instanceof ot?i.control=e:e.x!=null&&e.y!=null&&(i.x=e.x,i.y=e.y)),i},t.prototype.remove=function(e){var i;if(e instanceof jO){if(i=this._points.indexOf(e),i===-1)return}else i=e;var r=this._points[i];r&&(r.dispose(),this._points.splice(i,1))},t.prototype.reset=function(){for(;this._points.length>0;)this.remove(this._points.length-1)},t.prototype.resetLinks=function(){this._points.forEach(function(e){e!=null&&e.resetLinks()})},Object.defineProperty(t.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(e){this._lineWidth!==e&&(this._lineWidth=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalAlignment",{set:function(e){},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"MultiLine"},t.prototype._draw=function(e,i){e.save(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._applyStates(e),e.strokeStyle=this.color,e.lineWidth=this._lineWidth,e.setLineDash(this._dash),e.beginPath();var r=!0,o;this._points.forEach(function(a){a&&(r?(e.moveTo(a._point.x,a._point.y),r=!1):a._point.z<1&&o.z<1?e.lineTo(a._point.x,a._point.y):e.moveTo(a._point.x,a._point.y),o=a._point)}),e.stroke(),e.restore()},t.prototype._additionalProcessing=function(e,i){var r=this;this._minX=null,this._minY=null,this._maxX=null,this._maxY=null,this._points.forEach(function(o,a){o&&(o.translate(),(r._minX==null||o._point.x<r._minX)&&(r._minX=o._point.x),(r._minY==null||o._point.y<r._minY)&&(r._minY=o._point.y),(r._maxX==null||o._point.x>r._maxX)&&(r._maxX=o._point.x),(r._maxY==null||o._point.y>r._maxY)&&(r._maxY=o._point.y))}),this._minX==null&&(this._minX=0),this._minY==null&&(this._minY=0),this._maxX==null&&(this._maxX=0),this._maxY==null&&(this._maxY=0)},t.prototype._measure=function(){this._minX==null||this._maxX==null||this._minY==null||this._maxY==null||(this._currentMeasure.width=Math.abs(this._maxX-this._minX)+this._lineWidth,this._currentMeasure.height=Math.abs(this._maxY-this._minY)+this._lineWidth)},t.prototype._computeAlignment=function(e,i){this._minX==null||this._minY==null||(this._currentMeasure.left=this._minX-this._lineWidth/2,this._currentMeasure.top=this._minY-this._lineWidth/2)},t.prototype.dispose=function(){this.reset(),n.prototype.dispose.call(this)},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.MultiLine"]=yX;var $I=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._isChecked=!1,i._background="black",i._checkSizeRatio=.8,i._thickness=1,i.group="",i.onIsCheckedChangedObservable=new ie,i.isPointerBlocker=!0,i}return Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness!==e&&(this._thickness=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkSizeRatio",{get:function(){return this._checkSizeRatio},set:function(e){e=Math.max(Math.min(1,e),0),this._checkSizeRatio!==e&&(this._checkSizeRatio=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){return this._isChecked},set:function(e){var i=this;this._isChecked!==e&&(this._isChecked=e,this._markAsDirty(),this.onIsCheckedChangedObservable.notifyObservers(e),this._isChecked&&this._host&&this._host.executeOnAllControls(function(r){if(r!==i&&r.group!==void 0){var o=r;o.group===i.group&&(o.isChecked=!1)}}))},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"RadioButton"},t.prototype._draw=function(e){e.save(),this._applyStates(e);var i=this._currentMeasure.width-this._thickness,r=this._currentMeasure.height-this._thickness;if((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),ot.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,this._currentMeasure.width/2-this._thickness/2,this._currentMeasure.height/2-this._thickness/2,e),e.fillStyle=this._isEnabled?this._background:this._disabledColor,e.fill(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.strokeStyle=this.color,e.lineWidth=this._thickness,e.stroke(),this._isChecked){e.fillStyle=this._isEnabled?this.color:this._disabledColor;var o=i*this._checkSizeRatio,a=r*this._checkSizeRatio;ot.drawEllipse(this._currentMeasure.left+this._currentMeasure.width/2,this._currentMeasure.top+this._currentMeasure.height/2,o/2-this._thickness/2,a/2-this._thickness/2,e),e.fill()}e.restore()},t.prototype._onPointerDown=function(e,i,r,o,a){return n.prototype._onPointerDown.call(this,e,i,r,o,a)?(this.isChecked||(this.isChecked=!0),!0):!1},t.AddRadioButtonWithHeader=function(e,i,r,o){var a=new Pa;a.isVertical=!1,a.height="30px";var s=new t;s.width="20px",s.height="20px",s.isChecked=r,s.color="green",s.group=i,s.onIsCheckedChangedObservable.add(function(u){return o(s,u)}),a.addControl(s);var l=new Mn;return l.text=e,l.width="180px",l.paddingLeft="5px",l.textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,l.color="white",a.addControl(l),a},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.RadioButton"]=$I;var bp=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._thumbWidth=new zt(20,zt.UNITMODE_PIXEL,!1),i._minimum=0,i._maximum=100,i._value=50,i._isVertical=!1,i._barOffset=new zt(5,zt.UNITMODE_PIXEL,!1),i._isThumbClamped=!1,i._displayThumb=!0,i._step=0,i._lastPointerDownID=-1,i._effectiveBarOffset=0,i.onValueChangedObservable=new ie,i._pointerIsDown=!1,i.isPointerBlocker=!0,i}return Object.defineProperty(t.prototype,"displayThumb",{get:function(){return this._displayThumb},set:function(e){this._displayThumb!==e&&(this._displayThumb=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"step",{get:function(){return this._step},set:function(e){this._step!==e&&(this._step=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barOffset",{get:function(){return this._barOffset.toString(this._host)},set:function(e){this._barOffset.toString(this._host)!==e&&this._barOffset.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barOffsetInPixels",{get:function(){return this._barOffset.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbWidth",{get:function(){return this._thumbWidth.toString(this._host)},set:function(e){this._thumbWidth.toString(this._host)!==e&&this._thumbWidth.fromString(e)&&this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbWidthInPixels",{get:function(){return this._thumbWidth.getValueInPixel(this._host,this._cachedParentMeasure.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minimum",{get:function(){return this._minimum},set:function(e){this._minimum!==e&&(this._minimum=e,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maximum",{get:function(){return this._maximum},set:function(e){this._maximum!==e&&(this._maximum=e,this._markAsDirty(),this.value=Math.max(Math.min(this.value,this._maximum),this._minimum))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){e=Math.max(Math.min(e,this._maximum),this._minimum),this._value!==e&&(this._value=e,this._markAsDirty(),this.onValueChangedObservable.notifyObservers(this._value))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVertical",{get:function(){return this._isVertical},set:function(e){this._isVertical!==e&&(this._isVertical=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isThumbClamped",{get:function(){return this._isThumbClamped},set:function(e){this._isThumbClamped!==e&&(this._isThumbClamped=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"BaseSlider"},t.prototype._getThumbPosition=function(){return this.isVertical?(this.maximum-this.value)/(this.maximum-this.minimum)*this._backgroundBoxLength:(this.value-this.minimum)/(this.maximum-this.minimum)*this._backgroundBoxLength},t.prototype._getThumbThickness=function(e){var i=0;switch(e){case"circle":this._thumbWidth.isPixel?i=Math.max(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):i=this._backgroundBoxThickness*this._thumbWidth.getValue(this._host);break;case"rectangle":this._thumbWidth.isPixel?i=Math.min(this._thumbWidth.getValue(this._host),this._backgroundBoxThickness):i=this._backgroundBoxThickness*this._thumbWidth.getValue(this._host)}return i},t.prototype._prepareRenderingData=function(e){if(this._effectiveBarOffset=0,this._renderLeft=this._currentMeasure.left,this._renderTop=this._currentMeasure.top,this._renderWidth=this._currentMeasure.width,this._renderHeight=this._currentMeasure.height,this._backgroundBoxLength=Math.max(this._currentMeasure.width,this._currentMeasure.height),this._backgroundBoxThickness=Math.min(this._currentMeasure.width,this._currentMeasure.height),this._effectiveThumbThickness=this._getThumbThickness(e),this.displayThumb&&(this._backgroundBoxLength-=this._effectiveThumbThickness),this.isVertical&&this._currentMeasure.height<this._currentMeasure.width){console.error("Height should be greater than width");return}this._barOffset.isPixel?this._effectiveBarOffset=Math.min(this._barOffset.getValue(this._host),this._backgroundBoxThickness):this._effectiveBarOffset=this._backgroundBoxThickness*this._barOffset.getValue(this._host),this._backgroundBoxThickness-=this._effectiveBarOffset*2,this.isVertical?(this._renderLeft+=this._effectiveBarOffset,!this.isThumbClamped&&this.displayThumb&&(this._renderTop+=this._effectiveThumbThickness/2),this._renderHeight=this._backgroundBoxLength,this._renderWidth=this._backgroundBoxThickness):(this._renderTop+=this._effectiveBarOffset,!this.isThumbClamped&&this.displayThumb&&(this._renderLeft+=this._effectiveThumbThickness/2),this._renderHeight=this._backgroundBoxThickness,this._renderWidth=this._backgroundBoxLength)},t.prototype._updateValueFromPointer=function(e,i){this.rotation!=0&&(this._invertTransformMatrix.transformCoordinates(e,i,this._transformedPosition),e=this._transformedPosition.x,i=this._transformedPosition.y);var r;this._isVertical?r=this._minimum+(1-(i-this._currentMeasure.top)/this._currentMeasure.height)*(this._maximum-this._minimum):r=this._minimum+(e-this._currentMeasure.left)/this._currentMeasure.width*(this._maximum-this._minimum);var o=1/this._step|0;this.value=this._step?(r*o|0)/o:r},t.prototype._onPointerDown=function(e,i,r,o,a){return n.prototype._onPointerDown.call(this,e,i,r,o,a)?(this._pointerIsDown=!0,this._updateValueFromPointer(i.x,i.y),this._host._capturingControl[r]=this,this._lastPointerDownID=r,!0):!1},t.prototype._onPointerMove=function(e,i,r,o){r==this._lastPointerDownID&&(this._pointerIsDown&&this._updateValueFromPointer(i.x,i.y),n.prototype._onPointerMove.call(this,e,i,r,o))},t.prototype._onPointerUp=function(e,i,r,o,a){this._pointerIsDown=!1,delete this._host._capturingControl[r],n.prototype._onPointerUp.call(this,e,i,r,o,a)},t.prototype._onCanvasBlur=function(){this._forcePointerUp(),n.prototype._onCanvasBlur.call(this)},t}(ot),ZI=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._background="black",i._borderColor="white",i._thumbColor="",i._isThumbCircle=!1,i._displayValueBar=!0,i}return Object.defineProperty(t.prototype,"displayValueBar",{get:function(){return this._displayValueBar},set:function(e){this._displayValueBar!==e&&(this._displayValueBar=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"borderColor",{get:function(){return this._borderColor},set:function(e){this._borderColor!==e&&(this._borderColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbColor",{get:function(){return this._thumbColor},set:function(e){this._thumbColor!==e&&(this._thumbColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isThumbCircle",{get:function(){return this._isThumbCircle},set:function(e){this._isThumbCircle!==e&&(this._isThumbCircle=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Slider"},t.prototype._draw=function(e,i){e.save(),this._applyStates(e),this._prepareRenderingData(this.isThumbCircle?"circle":"rectangle");var r=this._renderLeft,o=this._renderTop,a=this._renderWidth,s=this._renderHeight,l=0;this.isThumbClamped&&this.isThumbCircle?(this.isVertical?o+=this._effectiveThumbThickness/2:r+=this._effectiveThumbThickness/2,l=this._backgroundBoxThickness/2):l=(this._effectiveThumbThickness-this._effectiveBarOffset)/2,(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY);var u=this._getThumbPosition();e.fillStyle=this._background,this.isVertical?this.isThumbClamped?this.isThumbCircle?(e.beginPath(),e.arc(r+this._backgroundBoxThickness/2,o,l,Math.PI,2*Math.PI),e.fill(),e.fillRect(r,o,a,s)):e.fillRect(r,o,a,s+this._effectiveThumbThickness):e.fillRect(r,o,a,s):this.isThumbClamped?this.isThumbCircle?(e.beginPath(),e.arc(r+this._backgroundBoxLength,o+this._backgroundBoxThickness/2,l,0,2*Math.PI),e.fill(),e.fillRect(r,o,a,s)):e.fillRect(r,o,a+this._effectiveThumbThickness,s):e.fillRect(r,o,a,s),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.fillStyle=this.color,this._displayValueBar&&(this.isVertical?this.isThumbClamped?this.isThumbCircle?(e.beginPath(),e.arc(r+this._backgroundBoxThickness/2,o+this._backgroundBoxLength,l,0,2*Math.PI),e.fill(),e.fillRect(r,o+u,a,s-u)):e.fillRect(r,o+u,a,s-u+this._effectiveThumbThickness):e.fillRect(r,o+u,a,s-u):(this.isThumbClamped&&this.isThumbCircle&&(e.beginPath(),e.arc(r,o+this._backgroundBoxThickness/2,l,0,2*Math.PI),e.fill()),e.fillRect(r,o,u,s))),e.fillStyle=this._thumbColor||this.color,this.displayThumb&&((this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur,e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY),this._isThumbCircle?(e.beginPath(),this.isVertical?e.arc(r+this._backgroundBoxThickness/2,o+u,l,0,2*Math.PI):e.arc(r+u,o+this._backgroundBoxThickness/2,l,0,2*Math.PI),e.fill(),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.strokeStyle=this._borderColor,e.stroke()):(this.isVertical?e.fillRect(r-this._effectiveBarOffset,this._currentMeasure.top+u,this._currentMeasure.width,this._effectiveThumbThickness):e.fillRect(this._currentMeasure.left+u,this._currentMeasure.top,this._effectiveThumbThickness,this._currentMeasure.height),(this.shadowBlur||this.shadowOffsetX||this.shadowOffsetY)&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.strokeStyle=this._borderColor,this.isVertical?e.strokeRect(r-this._effectiveBarOffset,this._currentMeasure.top+u,this._currentMeasure.width,this._effectiveThumbThickness):e.strokeRect(this._currentMeasure.left+u,this._currentMeasure.top,this._effectiveThumbThickness,this._currentMeasure.height))),e.restore()},t}(bp);Ae.RegisteredTypes["BABYLON.GUI.Slider"]=ZI;var Zb=function(){function n(t){this.name=t,this._groupPanel=new Pa,this._selectors=new Array,this._groupPanel.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,this._groupPanel.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,this._groupHeader=this._addGroupHeader(t)}return Object.defineProperty(n.prototype,"groupPanel",{get:function(){return this._groupPanel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectors",{get:function(){return this._selectors},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"header",{get:function(){return this._groupHeader.text},set:function(t){this._groupHeader.text!=="label"&&(this._groupHeader.text=t)},enumerable:!1,configurable:!0}),n.prototype._addGroupHeader=function(t){var e=new Mn("groupHead",t);return e.width=.9,e.height="30px",e.textWrapping=!0,e.color="black",e.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,e.textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,e.left="2px",this._groupPanel.addControl(e),e},n.prototype._getSelector=function(t){if(!(t<0||t>=this._selectors.length))return this._selectors[t]},n.prototype.removeSelector=function(t){t<0||t>=this._selectors.length||(this._groupPanel.removeControl(this._selectors[t]),this._selectors.splice(t,1))},n}(),U8=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.addCheckbox=function(e,i,o){i===void 0&&(i=function(l){}),o===void 0&&(o=!1);var o=o||!1,a=new QI;a.width="20px",a.height="20px",a.color="#364249",a.background="#CCCCCC",a.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,a.onIsCheckedChangedObservable.add(function(l){i(l)});var s=ot.AddHeader(a,e,"200px",{isHorizontal:!0,controlFirst:!0});s.height="30px",s.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,s.left="4px",this.groupPanel.addControl(s),this.selectors.push(s),a.isChecked=o,this.groupPanel.parent&&this.groupPanel.parent.parent&&(a.color=this.groupPanel.parent.parent.buttonColor,a.background=this.groupPanel.parent.parent.buttonBackground)},t.prototype._setSelectorLabel=function(e,i){this.selectors[e].children[1].text=i},t.prototype._setSelectorLabelColor=function(e,i){this.selectors[e].children[1].color=i},t.prototype._setSelectorButtonColor=function(e,i){this.selectors[e].children[0].color=i},t.prototype._setSelectorButtonBackground=function(e,i){this.selectors[e].children[0].background=i},t}(Zb),k8=function(n){j(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e._selectNb=0,e}return t.prototype.addRadio=function(e,i,r){i===void 0&&(i=function(l){}),r===void 0&&(r=!1);var o=this._selectNb++,a=new $I;a.name=e,a.width="20px",a.height="20px",a.color="#364249",a.background="#CCCCCC",a.group=this.name,a.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,a.onIsCheckedChangedObservable.add(function(l){l&&i(o)});var s=ot.AddHeader(a,e,"200px",{isHorizontal:!0,controlFirst:!0});s.height="30px",s.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,s.left="4px",this.groupPanel.addControl(s),this.selectors.push(s),a.isChecked=r,this.groupPanel.parent&&this.groupPanel.parent.parent&&(a.color=this.groupPanel.parent.parent.buttonColor,a.background=this.groupPanel.parent.parent.buttonBackground)},t.prototype._setSelectorLabel=function(e,i){this.selectors[e].children[1].text=i},t.prototype._setSelectorLabelColor=function(e,i){this.selectors[e].children[1].color=i},t.prototype._setSelectorButtonColor=function(e,i){this.selectors[e].children[0].color=i},t.prototype._setSelectorButtonBackground=function(e,i){this.selectors[e].children[0].background=i},t}(Zb),z8=function(n){j(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.addSlider=function(e,i,r,o,a,s,l){i===void 0&&(i=function(c){}),r===void 0&&(r="Units"),o===void 0&&(o=0),a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=function(c){return c|0});var u=new ZI;u.name=r,u.value=s,u.minimum=o,u.maximum=a,u.width=.9,u.height="20px",u.color="#364249",u.background="#CCCCCC",u.borderColor="black",u.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,u.left="4px",u.paddingBottom="4px",u.onValueChangedObservable.add(function(c){u.parent.children[0].text=u.parent.children[0].name+": "+l(c)+" "+u.name,i(c)});var f=ot.AddHeader(u,e+": "+l(s)+" "+r,"30px",{isHorizontal:!1,controlFirst:!1});f.height="60px",f.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,f.left="4px",f.children[0].name=e,this.groupPanel.addControl(f),this.selectors.push(f),this.groupPanel.parent&&this.groupPanel.parent.parent&&(u.color=this.groupPanel.parent.parent.buttonColor,u.background=this.groupPanel.parent.parent.buttonBackground)},t.prototype._setSelectorLabel=function(e,i){this.selectors[e].children[0].name=i,this.selectors[e].children[0].text=i+": "+this.selectors[e].children[1].value+" "+this.selectors[e].children[1].name},t.prototype._setSelectorLabelColor=function(e,i){this.selectors[e].children[0].color=i},t.prototype._setSelectorButtonColor=function(e,i){this.selectors[e].children[1].color=i},t.prototype._setSelectorButtonBackground=function(e,i){this.selectors[e].children[1].background=i},t}(Zb),G8=function(n){j(t,n);function t(e,i){i===void 0&&(i=[]);var r=n.call(this,e)||this;if(r.name=e,r.groups=i,r._buttonColor="#364249",r._buttonBackground="#CCCCCC",r._headerColor="black",r._barColor="white",r._barHeight="2px",r._spacerHeight="20px",r._bars=new Array,r._groups=i,r.thickness=2,r._panel=new Pa,r._panel.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,r._panel.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,r._panel.top=5,r._panel.left=5,r._panel.width=.95,i.length>0){for(var o=0;o<i.length-1;o++)r._panel.addControl(i[o].groupPanel),r._addSpacer();r._panel.addControl(i[i.length-1].groupPanel)}return r.addControl(r._panel),r}return t.prototype._getTypeName=function(){return"SelectionPanel"},Object.defineProperty(t.prototype,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"headerColor",{get:function(){return this._headerColor},set:function(e){this._headerColor!==e&&(this._headerColor=e,this._setHeaderColor())},enumerable:!1,configurable:!0}),t.prototype._setHeaderColor=function(){for(var e=0;e<this._groups.length;e++)this._groups[e].groupPanel.children[0].color=this._headerColor},Object.defineProperty(t.prototype,"buttonColor",{get:function(){return this._buttonColor},set:function(e){this._buttonColor!==e&&(this._buttonColor=e,this._setbuttonColor())},enumerable:!1,configurable:!0}),t.prototype._setbuttonColor=function(){for(var e=0;e<this._groups.length;e++)for(var i=0;i<this._groups[e].selectors.length;i++)this._groups[e]._setSelectorButtonColor(i,this._buttonColor)},Object.defineProperty(t.prototype,"labelColor",{get:function(){return this._labelColor},set:function(e){this._labelColor!==e&&(this._labelColor=e,this._setLabelColor())},enumerable:!1,configurable:!0}),t.prototype._setLabelColor=function(){for(var e=0;e<this._groups.length;e++)for(var i=0;i<this._groups[e].selectors.length;i++)this._groups[e]._setSelectorLabelColor(i,this._labelColor)},Object.defineProperty(t.prototype,"buttonBackground",{get:function(){return this._buttonBackground},set:function(e){this._buttonBackground!==e&&(this._buttonBackground=e,this._setButtonBackground())},enumerable:!1,configurable:!0}),t.prototype._setButtonBackground=function(){for(var e=0;e<this._groups.length;e++)for(var i=0;i<this._groups[e].selectors.length;i++)this._groups[e]._setSelectorButtonBackground(i,this._buttonBackground)},Object.defineProperty(t.prototype,"barColor",{get:function(){return this._barColor},set:function(e){this._barColor!==e&&(this._barColor=e,this._setBarColor())},enumerable:!1,configurable:!0}),t.prototype._setBarColor=function(){for(var e=0;e<this._bars.length;e++)this._bars[e].children[0].background=this._barColor},Object.defineProperty(t.prototype,"barHeight",{get:function(){return this._barHeight},set:function(e){this._barHeight!==e&&(this._barHeight=e,this._setBarHeight())},enumerable:!1,configurable:!0}),t.prototype._setBarHeight=function(){for(var e=0;e<this._bars.length;e++)this._bars[e].children[0].height=this._barHeight},Object.defineProperty(t.prototype,"spacerHeight",{get:function(){return this._spacerHeight},set:function(e){this._spacerHeight!==e&&(this._spacerHeight=e,this._setSpacerHeight())},enumerable:!1,configurable:!0}),t.prototype._setSpacerHeight=function(){for(var e=0;e<this._bars.length;e++)this._bars[e].height=this._spacerHeight},t.prototype._addSpacer=function(){var e=new ao;e.width=1,e.height=this._spacerHeight,e.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT;var i=new so;i.width=1,i.height=this._barHeight,i.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,i.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,i.background=this._barColor,i.color="transparent",e.addControl(i),this._panel.addControl(e),this._bars.push(e)},t.prototype.addGroup=function(e){this._groups.length>0&&this._addSpacer(),this._panel.addControl(e.groupPanel),this._groups.push(e),e.groupPanel.children[0].color=this._headerColor;for(var i=0;i<e.selectors.length;i++)e._setSelectorButtonColor(i,this._buttonColor),e._setSelectorButtonBackground(i,this._buttonBackground)},t.prototype.removeGroup=function(e){if(!(e<0||e>=this._groups.length)){var i=this._groups[e];this._panel.removeControl(i.groupPanel),this._groups.splice(e,1),e<this._bars.length&&(this._panel.removeControl(this._bars[e]),this._bars.splice(e,1))}},t.prototype.setHeaderName=function(e,i){if(!(i<0||i>=this._groups.length)){var r=this._groups[i];r.groupPanel.children[0].text=e}},t.prototype.relabel=function(e,i,r){if(!(i<0||i>=this._groups.length)){var o=this._groups[i];r<0||r>=o.selectors.length||o._setSelectorLabel(r,e)}},t.prototype.removeFromGroupSelector=function(e,i){if(!(e<0||e>=this._groups.length)){var r=this._groups[e];i<0||i>=r.selectors.length||r.removeSelector(i)}},t.prototype.addToGroupCheckbox=function(e,i,r,o){if(r===void 0&&(r=function(){}),o===void 0&&(o=!1),!(e<0||e>=this._groups.length)){var a=this._groups[e];a.addCheckbox(i,r,o)}},t.prototype.addToGroupRadio=function(e,i,r,o){if(r===void 0&&(r=function(){}),o===void 0&&(o=!1),!(e<0||e>=this._groups.length)){var a=this._groups[e];a.addRadio(i,r,o)}},t.prototype.addToGroupSlider=function(e,i,r,o,a,s,l,u){if(r===void 0&&(r=function(){}),o===void 0&&(o="Units"),a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=0),u===void 0&&(u=function(c){return c|0}),!(e<0||e>=this._groups.length)){var f=this._groups[e];f.addSlider(i,r,o,a,s,l,u)}},t}(so),bX=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i._freezeControls=!1,i._bucketWidth=0,i._bucketHeight=0,i._buckets={},i}return Object.defineProperty(t.prototype,"freezeControls",{get:function(){return this._freezeControls},set:function(e){if(this._freezeControls!==e){e||this._restoreMeasures(),this._freezeControls=!1;var i=this.host.getSize(),r=i.width,o=i.height,a=this.host.getContext(),s=new Jr(0,0,r,o);this.host._numLayoutCalls=0,this.host._rootContainer._layout(s,a),e&&(this._updateMeasures(),this._useBuckets()&&this._makeBuckets()),this._freezeControls=e,this.host.markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketWidth",{get:function(){return this._bucketWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketHeight",{get:function(){return this._bucketHeight},enumerable:!1,configurable:!0}),t.prototype.setBucketSizes=function(e,i){this._bucketWidth=e,this._bucketHeight=i,this._useBuckets()?this._freezeControls&&this._makeBuckets():this._buckets={}},t.prototype._useBuckets=function(){return this._bucketWidth>0&&this._bucketHeight>0},t.prototype._makeBuckets=function(){this._buckets={},this._bucketLen=Math.ceil(this.widthInPixels/this._bucketWidth),this._dispatchInBuckets(this._children),this._oldLeft=null,this._oldTop=null},t.prototype._dispatchInBuckets=function(e){for(var i=0;i<e.length;++i){for(var r=e[i],o=Math.max(0,Math.floor((r._customData._origLeft-this._customData.origLeft)/this._bucketWidth)),a=Math.floor((r._customData._origLeft-this._customData.origLeft+r._currentMeasure.width-1)/this._bucketWidth),s=Math.max(0,Math.floor((r._customData._origTop-this._customData.origTop)/this._bucketHeight)),l=Math.floor((r._customData._origTop-this._customData.origTop+r._currentMeasure.height-1)/this._bucketHeight);s<=l;){for(var u=o;u<=a;++u){var f=s*this._bucketLen+u,c=this._buckets[f];c||(c=[],this._buckets[f]=c),c.push(r)}s++}r instanceof ao&&r._children.length>0&&this._dispatchInBuckets(r._children)}},t.prototype._updateMeasures=function(){var e=this.leftInPixels|0,i=this.topInPixels|0;this._measureForChildren.left-=e,this._measureForChildren.top-=i,this._currentMeasure.left-=e,this._currentMeasure.top-=i,this._customData.origLeftForChildren=this._measureForChildren.left,this._customData.origTopForChildren=this._measureForChildren.top,this._customData.origLeft=this._currentMeasure.left,this._customData.origTop=this._currentMeasure.top,this._updateChildrenMeasures(this._children,e,i)},t.prototype._updateChildrenMeasures=function(e,i,r){for(var o=0;o<e.length;++o){var a=e[o];a._currentMeasure.left-=i,a._currentMeasure.top-=r,a._customData._origLeft=a._currentMeasure.left,a._customData._origTop=a._currentMeasure.top,a instanceof ao&&a._children.length>0&&this._updateChildrenMeasures(a._children,i,r)}},t.prototype._restoreMeasures=function(){var e=this.leftInPixels|0,i=this.topInPixels|0;this._measureForChildren.left=this._customData.origLeftForChildren+e,this._measureForChildren.top=this._customData.origTopForChildren+i,this._currentMeasure.left=this._customData.origLeft+e,this._currentMeasure.top=this._customData.origTop+i},t.prototype._getTypeName=function(){return"ScrollViewerWindow"},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._parentMeasure=e,this._measureForChildren.left=this._currentMeasure.left,this._measureForChildren.top=this._currentMeasure.top,this._measureForChildren.width=e.width,this._measureForChildren.height=e.height},t.prototype._layout=function(e,i){return this._freezeControls?(this.invalidateRect(),!1):n.prototype._layout.call(this,e,i)},t.prototype._scrollChildren=function(e,i,r){for(var o=0;o<e.length;++o){var a=e[o];a._currentMeasure.left=a._customData._origLeft+i,a._currentMeasure.top=a._customData._origTop+r,a._isClipped=!1,a instanceof ao&&a._children.length>0&&this._scrollChildren(a._children,i,r)}},t.prototype._scrollChildrenWithBuckets=function(e,i,r,o){for(var a=Math.max(0,Math.floor(-e/this._bucketWidth)),s=Math.floor((-e+this._parentMeasure.width-1)/this._bucketWidth),l=Math.max(0,Math.floor(-i/this._bucketHeight)),u=Math.floor((-i+this._parentMeasure.height-1)/this._bucketHeight);l<=u;){for(var f=a;f<=s;++f){var c=l*this._bucketLen+f,h=this._buckets[c];if(h)for(var p=0;p<h.length;++p){var _=h[p];_._currentMeasure.left=_._customData._origLeft+r,_._currentMeasure.top=_._customData._origTop+o,_._isClipped=!1}}l++}},t.prototype._draw=function(e,i){if(!this._freezeControls){n.prototype._draw.call(this,e,i);return}this._localDraw(e),this.clipChildren&&this._clipForChildren(e);var r=this.leftInPixels|0,o=this.topInPixels|0;this._useBuckets()?this._oldLeft!==null&&this._oldTop!==null?(this._scrollChildrenWithBuckets(this._oldLeft,this._oldTop,r,o),this._scrollChildrenWithBuckets(r,o,r,o)):this._scrollChildren(this._children,r,o):this._scrollChildren(this._children,r,o),this._oldLeft=r,this._oldTop=o;for(var a=0,s=this._children;a<s.length;a++){var l=s[a];l._intersectsRect(this._parentMeasure)&&l._render(e,this._parentMeasure)}},t.prototype._postMeasure=function(){if(this._freezeControls){n.prototype._postMeasure.call(this);return}for(var e=this.parentClientWidth,i=this.parentClientHeight,r=0,o=this.children;r<o.length;r++){var a=o[r];!a.isVisible||a.notRenderable||(a.horizontalAlignment===ot.HORIZONTAL_ALIGNMENT_CENTER&&a._offsetLeft(this._currentMeasure.left-a._currentMeasure.left),a.verticalAlignment===ot.VERTICAL_ALIGNMENT_CENTER&&a._offsetTop(this._currentMeasure.top-a._currentMeasure.top),e=Math.max(e,a._currentMeasure.left-this._currentMeasure.left+a._currentMeasure.width+a.paddingRightInPixels),i=Math.max(i,a._currentMeasure.top-this._currentMeasure.top+a._currentMeasure.height+a.paddingBottomInPixels))}this._currentMeasure.width!==e&&(this._width.updateInPlace(e,zt.UNITMODE_PIXEL),this._currentMeasure.width=e,this._rebuildLayout=!0,this._isDirty=!0),this._currentMeasure.height!==i&&(this._height.updateInPlace(i,zt.UNITMODE_PIXEL),this._currentMeasure.height=i,this._rebuildLayout=!0,this._isDirty=!0),n.prototype._postMeasure.call(this)},t}(ao),XO=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._background="black",i._borderColor="white",i._tempMeasure=new Jr(0,0,0,0),i}return Object.defineProperty(t.prototype,"borderColor",{get:function(){return this._borderColor},set:function(e){this._borderColor!==e&&(this._borderColor=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"Scrollbar"},t.prototype._getThumbThickness=function(){var e=0;return this._thumbWidth.isPixel?e=this._thumbWidth.getValue(this._host):e=this._backgroundBoxThickness*this._thumbWidth.getValue(this._host),e},t.prototype._draw=function(e){e.save(),this._applyStates(e),this._prepareRenderingData("rectangle");var i=this._renderLeft,r=this._getThumbPosition();e.fillStyle=this._background,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height),e.fillStyle=this.color,this.isVertical?(this._tempMeasure.left=i-this._effectiveBarOffset,this._tempMeasure.top=this._currentMeasure.top+r,this._tempMeasure.width=this._currentMeasure.width,this._tempMeasure.height=this._effectiveThumbThickness):(this._tempMeasure.left=this._currentMeasure.left+r,this._tempMeasure.top=this._currentMeasure.top,this._tempMeasure.width=this._effectiveThumbThickness,this._tempMeasure.height=this._currentMeasure.height),e.fillRect(this._tempMeasure.left,this._tempMeasure.top,this._tempMeasure.width,this._tempMeasure.height),e.restore()},t.prototype._updateValueFromPointer=function(e,i){this.rotation!=0&&(this._invertTransformMatrix.transformCoordinates(e,i,this._transformedPosition),e=this._transformedPosition.x,i=this._transformedPosition.y),this._first&&(this._first=!1,this._originX=e,this._originY=i,(e<this._tempMeasure.left||e>this._tempMeasure.left+this._tempMeasure.width||i<this._tempMeasure.top||i>this._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(i-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(e-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var r=0;this.isVertical?r=-((i-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness)):r=(e-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=r*(this.maximum-this.minimum),this._originX=e,this._originY=i},t.prototype._onPointerDown=function(e,i,r,o,a){return this._first=!0,n.prototype._onPointerDown.call(this,e,i,r,o,a)},t}(bp),YO=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._thumbLength=.5,i._thumbHeight=1,i._barImageHeight=1,i._tempMeasure=new Jr(0,0,0,0),i.num90RotationInVerticalMode=1,i}return Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this._backgroundBaseImage},set:function(e){var i=this;this._backgroundBaseImage!==e&&(this._backgroundBaseImage=e,this.isVertical&&this.num90RotationInVerticalMode!==0?e.isLoaded?(this._backgroundImage=e._rotate90(this.num90RotationInVerticalMode,!0),this._markAsDirty()):e.onImageLoadedObservable.addOnce(function(){var r=e._rotate90(i.num90RotationInVerticalMode,!0);i._backgroundImage=r,r.isLoaded||r.onImageLoadedObservable.addOnce(function(){i._markAsDirty()}),i._markAsDirty()}):(this._backgroundImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce(function(){i._markAsDirty()}),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbImage",{get:function(){return this._thumbBaseImage},set:function(e){var i=this;this._thumbBaseImage!==e&&(this._thumbBaseImage=e,this.isVertical&&this.num90RotationInVerticalMode!==0?e.isLoaded?(this._thumbImage=e._rotate90(-this.num90RotationInVerticalMode,!0),this._markAsDirty()):e.onImageLoadedObservable.addOnce(function(){var r=e._rotate90(-i.num90RotationInVerticalMode,!0);i._thumbImage=r,r.isLoaded||r.onImageLoadedObservable.addOnce(function(){i._markAsDirty()}),i._markAsDirty()}):(this._thumbImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce(function(){i._markAsDirty()}),this._markAsDirty()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(e){this._thumbLength!==e&&(this._thumbLength=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(e){this._thumbLength!==e&&(this._thumbHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(e){this._barImageHeight!==e&&(this._barImageHeight=e,this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"ImageScrollBar"},t.prototype._getThumbThickness=function(){var e=0;return this._thumbWidth.isPixel?e=this._thumbWidth.getValue(this._host):e=this._backgroundBoxThickness*this._thumbWidth.getValue(this._host),e},t.prototype._draw=function(e){e.save(),this._applyStates(e),this._prepareRenderingData("rectangle");var i=this._getThumbPosition(),r=this._renderLeft,o=this._renderTop,a=this._renderWidth,s=this._renderHeight;this._backgroundImage&&(this._tempMeasure.copyFromFloats(r,o,a,s),this.isVertical?(this._tempMeasure.copyFromFloats(r+a*(1-this._barImageHeight)*.5,this._currentMeasure.top,a*this._barImageHeight,s),this._tempMeasure.height+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)):(this._tempMeasure.copyFromFloats(this._currentMeasure.left,o+s*(1-this._barImageHeight)*.5,a,s*this._barImageHeight),this._tempMeasure.width+=this._effectiveThumbThickness,this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure)),this._backgroundImage._draw(e)),this.isVertical?this._tempMeasure.copyFromFloats(r-this._effectiveBarOffset+this._currentMeasure.width*(1-this._thumbHeight)*.5,this._currentMeasure.top+i,this._currentMeasure.width*this._thumbHeight,this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(this._currentMeasure.left+i,this._currentMeasure.top+this._currentMeasure.height*(1-this._thumbHeight)*.5,this._effectiveThumbThickness,this._currentMeasure.height*this._thumbHeight),this._thumbImage&&(this._thumbImage._currentMeasure.copyFrom(this._tempMeasure),this._thumbImage._draw(e)),e.restore()},t.prototype._updateValueFromPointer=function(e,i){this.rotation!=0&&(this._invertTransformMatrix.transformCoordinates(e,i,this._transformedPosition),e=this._transformedPosition.x,i=this._transformedPosition.y),this._first&&(this._first=!1,this._originX=e,this._originY=i,(e<this._tempMeasure.left||e>this._tempMeasure.left+this._tempMeasure.width||i<this._tempMeasure.top||i>this._tempMeasure.top+this._tempMeasure.height)&&(this.isVertical?this.value=this.minimum+(1-(i-this._currentMeasure.top)/this._currentMeasure.height)*(this.maximum-this.minimum):this.value=this.minimum+(e-this._currentMeasure.left)/this._currentMeasure.width*(this.maximum-this.minimum)));var r=0;this.isVertical?r=-((i-this._originY)/(this._currentMeasure.height-this._effectiveThumbThickness)):r=(e-this._originX)/(this._currentMeasure.width-this._effectiveThumbThickness),this.value+=r*(this.maximum-this.minimum),this._originX=e,this._originY=i},t.prototype._onPointerDown=function(e,i,r,o,a){return this._first=!0,n.prototype._onPointerDown.call(this,e,i,r,o,a)},t}(bp),EX=function(n){j(t,n);function t(e,i){var r=n.call(this,e)||this;return r._barSize=20,r._pointerIsOver=!1,r._wheelPrecision=.05,r._thumbLength=.5,r._thumbHeight=1,r._barImageHeight=1,r._horizontalBarImageHeight=1,r._verticalBarImageHeight=1,r._oldWindowContentsWidth=0,r._oldWindowContentsHeight=0,r._forceHorizontalBar=!1,r._forceVerticalBar=!1,r._useImageBar=i||!1,r.onDirtyObservable.add(function(){r._horizontalBarSpace.color=r.color,r._verticalBarSpace.color=r.color,r._dragSpace.color=r.color}),r.onPointerEnterObservable.add(function(){r._pointerIsOver=!0}),r.onPointerOutObservable.add(function(){r._pointerIsOver=!1}),r._grid=new un,r._useImageBar?(r._horizontalBar=new YO,r._verticalBar=new YO):(r._horizontalBar=new XO,r._verticalBar=new XO),r._window=new bX("scrollViewer_window"),r._window.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,r._window.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,r._grid.addColumnDefinition(1),r._grid.addColumnDefinition(0,!0),r._grid.addRowDefinition(1),r._grid.addRowDefinition(0,!0),n.prototype.addControl.call(r,r._grid),r._grid.addControl(r._window,0,0),r._verticalBarSpace=new so,r._verticalBarSpace.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,r._verticalBarSpace.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,r._verticalBarSpace.thickness=1,r._grid.addControl(r._verticalBarSpace,0,1),r._addBar(r._verticalBar,r._verticalBarSpace,!0,Math.PI),r._horizontalBarSpace=new so,r._horizontalBarSpace.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,r._horizontalBarSpace.verticalAlignment=ot.VERTICAL_ALIGNMENT_TOP,r._horizontalBarSpace.thickness=1,r._grid.addControl(r._horizontalBarSpace,1,0),r._addBar(r._horizontalBar,r._horizontalBarSpace,!1,0),r._dragSpace=new so,r._dragSpace.thickness=1,r._grid.addControl(r._dragSpace,1,1),r._useImageBar||(r.barColor="grey",r.barBackground="transparent"),r}return Object.defineProperty(t.prototype,"horizontalBar",{get:function(){return this._horizontalBar},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalBar",{get:function(){return this._verticalBar},enumerable:!1,configurable:!0}),t.prototype.addControl=function(e){return e?(this._window.addControl(e),this):this},t.prototype.removeControl=function(e){return this._window.removeControl(e),this},Object.defineProperty(t.prototype,"children",{get:function(){return this._window.children},enumerable:!1,configurable:!0}),t.prototype._flagDescendantsAsMatrixDirty=function(){for(var e=0,i=this._children;e<i.length;e++){var r=i[e];r._markMatrixAsDirty()}},Object.defineProperty(t.prototype,"freezeControls",{get:function(){return this._window.freezeControls},set:function(e){this._window.freezeControls=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketWidth",{get:function(){return this._window.bucketWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucketHeight",{get:function(){return this._window.bucketHeight},enumerable:!1,configurable:!0}),t.prototype.setBucketSizes=function(e,i){this._window.setBucketSizes(e,i)},Object.defineProperty(t.prototype,"forceHorizontalBar",{get:function(){return this._forceHorizontalBar},set:function(e){this._grid.setRowDefinition(1,e?this._barSize:0,!0),this._horizontalBar.isVisible=e,this._forceHorizontalBar=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forceVerticalBar",{get:function(){return this._forceVerticalBar},set:function(e){this._grid.setColumnDefinition(1,e?this._barSize:0,!0),this._verticalBar.isVisible=e,this._forceVerticalBar=e},enumerable:!1,configurable:!0}),t.prototype.resetWindow=function(){this._window.width="100%",this._window.height="100%"},t.prototype._getTypeName=function(){return"ScrollViewer"},t.prototype._buildClientSizes=function(){var e=this.host.idealRatio;this._window.parentClientWidth=this._currentMeasure.width-(this._verticalBar.isVisible||this.forceVerticalBar?this._barSize*e:0)-2*this.thickness,this._window.parentClientHeight=this._currentMeasure.height-(this._horizontalBar.isVisible||this.forceHorizontalBar?this._barSize*e:0)-2*this.thickness,this._clientWidth=this._window.parentClientWidth,this._clientHeight=this._window.parentClientHeight},t.prototype._additionalProcessing=function(e,i){n.prototype._additionalProcessing.call(this,e,i),this._buildClientSizes()},t.prototype._postMeasure=function(){n.prototype._postMeasure.call(this),this._updateScroller(),this._setWindowPosition(!1)},Object.defineProperty(t.prototype,"wheelPrecision",{get:function(){return this._wheelPrecision},set:function(e){this._wheelPrecision!==e&&(e<0&&(e=0),e>1&&(e=1),this._wheelPrecision=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scrollBackground",{get:function(){return this._horizontalBarSpace.background},set:function(e){this._horizontalBarSpace.background!==e&&(this._horizontalBarSpace.background=e,this._verticalBarSpace.background=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barColor",{get:function(){return this._barColor},set:function(e){this._barColor!==e&&(this._barColor=e,this._horizontalBar.color=e,this._verticalBar.color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbImage",{get:function(){return this._barImage},set:function(e){if(this._barImage!==e){this._barImage=e;var i=this._horizontalBar,r=this._verticalBar;i.thumbImage=e,r.thumbImage=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalThumbImage",{get:function(){return this._horizontalBarImage},set:function(e){if(this._horizontalBarImage!==e){this._horizontalBarImage=e;var i=this._horizontalBar;i.thumbImage=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalThumbImage",{get:function(){return this._verticalBarImage},set:function(e){if(this._verticalBarImage!==e){this._verticalBarImage=e;var i=this._verticalBar;i.thumbImage=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barSize",{get:function(){return this._barSize},set:function(e){this._barSize!==e&&(this._barSize=e,this._markAsDirty(),this._horizontalBar.isVisible&&this._grid.setRowDefinition(1,this._barSize,!0),this._verticalBar.isVisible&&this._grid.setColumnDefinition(1,this._barSize,!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbLength",{get:function(){return this._thumbLength},set:function(e){if(this._thumbLength!==e){e<=0&&(e=.1),e>1&&(e=1),this._thumbLength=e;var i=this._horizontalBar,r=this._verticalBar;i.thumbLength=e,r.thumbLength=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbHeight",{get:function(){return this._thumbHeight},set:function(e){if(this._thumbHeight!==e){e<=0&&(e=.1),e>1&&(e=1),this._thumbHeight=e;var i=this._horizontalBar,r=this._verticalBar;i.thumbHeight=e,r.thumbHeight=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barImageHeight",{get:function(){return this._barImageHeight},set:function(e){if(this._barImageHeight!==e){e<=0&&(e=.1),e>1&&(e=1),this._barImageHeight=e;var i=this._horizontalBar,r=this._verticalBar;i.barImageHeight=e,r.barImageHeight=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalBarImageHeight",{get:function(){return this._horizontalBarImageHeight},set:function(e){if(this._horizontalBarImageHeight!==e){e<=0&&(e=.1),e>1&&(e=1),this._horizontalBarImageHeight=e;var i=this._horizontalBar;i.barImageHeight=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalBarImageHeight",{get:function(){return this._verticalBarImageHeight},set:function(e){if(this._verticalBarImageHeight!==e){e<=0&&(e=.1),e>1&&(e=1),this._verticalBarImageHeight=e;var i=this._verticalBar;i.barImageHeight=e,this._markAsDirty()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barBackground",{get:function(){return this._barBackground},set:function(e){if(this._barBackground!==e){this._barBackground=e;var i=this._horizontalBar,r=this._verticalBar;i.background=e,r.background=e,this._dragSpace.background=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"barImage",{get:function(){return this._barBackgroundImage},set:function(e){this._barBackgroundImage,this._barBackgroundImage=e;var i=this._horizontalBar,r=this._verticalBar;i.backgroundImage=e,r.backgroundImage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalBarImage",{get:function(){return this._horizontalBarBackgroundImage},set:function(e){this._horizontalBarBackgroundImage,this._horizontalBarBackgroundImage=e;var i=this._horizontalBar;i.backgroundImage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalBarImage",{get:function(){return this._verticalBarBackgroundImage},set:function(e){this._verticalBarBackgroundImage,this._verticalBarBackgroundImage=e;var i=this._verticalBar;i.backgroundImage=e},enumerable:!1,configurable:!0}),t.prototype._setWindowPosition=function(e){e===void 0&&(e=!0);var i=this.host.idealRatio,r=this._window._currentMeasure.width,o=this._window._currentMeasure.height;if(!(!e&&this._oldWindowContentsWidth===r&&this._oldWindowContentsHeight===o)){this._oldWindowContentsWidth=r,this._oldWindowContentsHeight=o;var a=this._clientWidth-r,s=this._clientHeight-o,l=this._horizontalBar.value/i*a+"px",u=this._verticalBar.value/i*s+"px";l!==this._window.left&&(this._window.left=l,this.freezeControls||(this._rebuildLayout=!0)),u!==this._window.top&&(this._window.top=u,this.freezeControls||(this._rebuildLayout=!0))}},t.prototype._updateScroller=function(){var e=this._window._currentMeasure.width,i=this._window._currentMeasure.height;this._horizontalBar.isVisible&&e<=this._clientWidth&&!this.forceHorizontalBar?(this._grid.setRowDefinition(1,0,!0),this._horizontalBar.isVisible=!1,this._horizontalBar.value=0,this._rebuildLayout=!0):!this._horizontalBar.isVisible&&(e>this._clientWidth||this.forceHorizontalBar)&&(this._grid.setRowDefinition(1,this._barSize,!0),this._horizontalBar.isVisible=!0,this._rebuildLayout=!0),this._verticalBar.isVisible&&i<=this._clientHeight&&!this.forceVerticalBar?(this._grid.setColumnDefinition(1,0,!0),this._verticalBar.isVisible=!1,this._verticalBar.value=0,this._rebuildLayout=!0):!this._verticalBar.isVisible&&(i>this._clientHeight||this.forceVerticalBar)&&(this._grid.setColumnDefinition(1,this._barSize,!0),this._verticalBar.isVisible=!0,this._rebuildLayout=!0),this._buildClientSizes();var r=this.host.idealRatio;this._horizontalBar.thumbWidth=this._thumbLength*.9*(this._clientWidth/r)+"px",this._verticalBar.thumbWidth=this._thumbLength*.9*(this._clientHeight/r)+"px"},t.prototype._link=function(e){n.prototype._link.call(this,e),this._attachWheel()},t.prototype._addBar=function(e,i,r,o){var a=this;e.paddingLeft=0,e.width="100%",e.height="100%",e.barOffset=0,e.value=0,e.maximum=1,e.horizontalAlignment=ot.HORIZONTAL_ALIGNMENT_CENTER,e.verticalAlignment=ot.VERTICAL_ALIGNMENT_CENTER,e.isVertical=r,e.rotation=o,e.isVisible=!1,i.addControl(e),e.onValueChangedObservable.add(function(s){a._setWindowPosition()})},t.prototype._attachWheel=function(){var e=this;!this._host||this._onWheelObserver||(this._onWheelObserver=this.onWheelObservable.add(function(i){e._pointerIsOver&&(e._verticalBar.isVisible==!0&&(i.y<0&&e._verticalBar.value>0?e._verticalBar.value-=e._wheelPrecision:i.y>0&&e._verticalBar.value<e._verticalBar.maximum&&(e._verticalBar.value+=e._wheelPrecision)),e._horizontalBar.isVisible==!0&&(i.x<0&&e._horizontalBar.value<e._horizontalBar.maximum?e._horizontalBar.value+=e._wheelPrecision:i.x>0&&e._horizontalBar.value>0&&(e._horizontalBar.value-=e._wheelPrecision)))}))},t.prototype._renderHighlightSpecific=function(e){this.isHighlighted&&(n.prototype._renderHighlightSpecific.call(this,e),this._grid._renderHighlightSpecific(e),e.restore())},t.prototype.dispose=function(){this.onWheelObservable.remove(this._onWheelObserver),this._onWheelObserver=null,n.prototype.dispose.call(this)},t}(so);Ae.RegisteredTypes["BABYLON.GUI.ScrollViewer"]=EX;var W8=function(){function n(){}return n}(),TX=function(n){j(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.onKeyPressObservable=new ie,e.defaultButtonWidth="40px",e.defaultButtonHeight="40px",e.defaultButtonPaddingLeft="2px",e.defaultButtonPaddingRight="2px",e.defaultButtonPaddingTop="2px",e.defaultButtonPaddingBottom="2px",e.defaultButtonColor="#DDD",e.defaultButtonBackground="#070707",e.shiftButtonColor="#7799FF",e.selectedShiftThickness=1,e.shiftState=0,e._currentlyConnectedInputText=null,e._connectedInputTexts=[],e._onKeyPressObserver=null,e}return t.prototype._getTypeName=function(){return"VirtualKeyboard"},t.prototype._createKey=function(e,i){var r=this,o=_a.CreateSimpleButton(e,e);return o.width=i&&i.width?i.width:this.defaultButtonWidth,o.height=i&&i.height?i.height:this.defaultButtonHeight,o.color=i&&i.color?i.color:this.defaultButtonColor,o.background=i&&i.background?i.background:this.defaultButtonBackground,o.paddingLeft=i&&i.paddingLeft?i.paddingLeft:this.defaultButtonPaddingLeft,o.paddingRight=i&&i.paddingRight?i.paddingRight:this.defaultButtonPaddingRight,o.paddingTop=i&&i.paddingTop?i.paddingTop:this.defaultButtonPaddingTop,o.paddingBottom=i&&i.paddingBottom?i.paddingBottom:this.defaultButtonPaddingBottom,o.thickness=0,o.isFocusInvisible=!0,o.shadowColor=this.shadowColor,o.shadowBlur=this.shadowBlur,o.shadowOffsetX=this.shadowOffsetX,o.shadowOffsetY=this.shadowOffsetY,o.onPointerUpObservable.add(function(){r.onKeyPressObservable.notifyObservers(e)}),o},t.prototype.addKeysRow=function(e,i){var r=new Pa;r.isVertical=!1,r.isFocusInvisible=!0;for(var o=null,a=0;a<e.length;a++){var s=null;i&&i.length===e.length&&(s=i[a]);var l=this._createKey(e[a],s);(!o||l.heightInPixels>o.heightInPixels)&&(o=l),r.addControl(l)}r.height=o?o.height:this.defaultButtonHeight,this.addControl(r)},t.prototype.applyShiftState=function(e){if(this.children)for(var i=0;i<this.children.length;i++){var r=this.children[i];if(!(!r||!r.children))for(var o=r,a=0;a<o.children.length;a++){var s=o.children[a];if(!(!s||!s.children[0])){var l=s.children[0];l.text==="⇧"&&(s.color=e?this.shiftButtonColor:this.defaultButtonColor,s.thickness=e>1?this.selectedShiftThickness:0),l.text=e>0?l.text.toUpperCase():l.text.toLowerCase()}}}},Object.defineProperty(t.prototype,"connectedInputText",{get:function(){return this._currentlyConnectedInputText},enumerable:!1,configurable:!0}),t.prototype.connect=function(e){var i=this,r=this._connectedInputTexts.some(function(s){return s.input===e});if(!r){this._onKeyPressObserver===null&&(this._onKeyPressObserver=this.onKeyPressObservable.add(function(s){if(i._currentlyConnectedInputText){switch(i._currentlyConnectedInputText._host.focusedControl=i._currentlyConnectedInputText,s){case"⇧":i.shiftState++,i.shiftState>2&&(i.shiftState=0),i.applyShiftState(i.shiftState);return;case"←":i._currentlyConnectedInputText.processKey(8);return;case"↵":i._currentlyConnectedInputText.processKey(13);return}i._currentlyConnectedInputText.processKey(-1,i.shiftState?s.toUpperCase():s),i.shiftState===1&&(i.shiftState=0,i.applyShiftState(i.shiftState))}})),this.isVisible=!1,this._currentlyConnectedInputText=e,e._connectedVirtualKeyboard=this;var o=e.onFocusObservable.add(function(){i._currentlyConnectedInputText=e,e._connectedVirtualKeyboard=i,i.isVisible=!0}),a=e.onBlurObservable.add(function(){e._connectedVirtualKeyboard=null,i._currentlyConnectedInputText=null,i.isVisible=!1});this._connectedInputTexts.push({input:e,onBlurObserver:a,onFocusObserver:o})}},t.prototype.disconnect=function(e){var i=this;if(e){var r=this._connectedInputTexts.filter(function(o){return o.input===e});r.length===1&&(this._removeConnectedInputObservables(r[0]),this._connectedInputTexts=this._connectedInputTexts.filter(function(o){return o.input!==e}),this._currentlyConnectedInputText===e&&(this._currentlyConnectedInputText=null))}else this._connectedInputTexts.forEach(function(o){i._removeConnectedInputObservables(o)}),this._connectedInputTexts=[];this._connectedInputTexts.length===0&&(this._currentlyConnectedInputText=null,this.onKeyPressObservable.remove(this._onKeyPressObserver),this._onKeyPressObserver=null)},t.prototype._removeConnectedInputObservables=function(e){e.input._connectedVirtualKeyboard=null,e.input.onFocusObservable.remove(e.onFocusObserver),e.input.onBlurObservable.remove(e.onBlurObserver)},t.prototype.dispose=function(){n.prototype.dispose.call(this),this.disconnect()},t.CreateDefaultLayout=function(e){var i=new t(e);return i.addKeysRow(["1","2","3","4","5","6","7","8","9","0","←"]),i.addKeysRow(["q","w","e","r","t","y","u","i","o","p"]),i.addKeysRow(["a","s","d","f","g","h","j","k","l",";","'","↵"]),i.addKeysRow(["⇧","z","x","c","v","b","n","m",",",".","/"]),i.addKeysRow([" "],[{width:"200px"}]),i},t}(Pa);Ae.RegisteredTypes["BABYLON.GUI.VirtualKeyboard"]=TX;var SX=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._cellWidth=20,i._cellHeight=20,i._minorLineTickness=1,i._minorLineColor="DarkGray",i._majorLineTickness=2,i._majorLineColor="White",i._majorLineFrequency=5,i._background="Black",i._displayMajorLines=!0,i._displayMinorLines=!0,i}return Object.defineProperty(t.prototype,"displayMinorLines",{get:function(){return this._displayMinorLines},set:function(e){this._displayMinorLines!==e&&(this._displayMinorLines=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayMajorLines",{get:function(){return this._displayMajorLines},set:function(e){this._displayMajorLines!==e&&(this._displayMajorLines=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellWidth",{get:function(){return this._cellWidth},set:function(e){this._cellWidth=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellHeight",{get:function(){return this._cellHeight},set:function(e){this._cellHeight=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minorLineTickness",{get:function(){return this._minorLineTickness},set:function(e){this._minorLineTickness=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minorLineColor",{get:function(){return this._minorLineColor},set:function(e){this._minorLineColor=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"majorLineTickness",{get:function(){return this._majorLineTickness},set:function(e){this._majorLineTickness=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"majorLineColor",{get:function(){return this._majorLineColor},set:function(e){this._majorLineColor=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"majorLineFrequency",{get:function(){return this._majorLineFrequency},set:function(e){this._majorLineFrequency=e,this._markAsDirty()},enumerable:!1,configurable:!0}),t.prototype._draw=function(e,i){if(e.save(),this._applyStates(e),this._isEnabled){this._background&&(e.fillStyle=this._background,e.fillRect(this._currentMeasure.left,this._currentMeasure.top,this._currentMeasure.width,this._currentMeasure.height));var r=this._currentMeasure.width/this._cellWidth,o=this._currentMeasure.height/this._cellHeight,a=this._currentMeasure.left+this._currentMeasure.width/2,s=this._currentMeasure.top+this._currentMeasure.height/2;if(this._displayMinorLines){e.strokeStyle=this._minorLineColor,e.lineWidth=this._minorLineTickness;for(var l=-r/2;l<r/2;l++){var u=a+l*this.cellWidth;e.beginPath(),e.moveTo(u,this._currentMeasure.top),e.lineTo(u,this._currentMeasure.top+this._currentMeasure.height),e.stroke()}for(var f=-o/2;f<o/2;f++){var c=s+f*this.cellHeight;e.beginPath(),e.moveTo(this._currentMeasure.left,c),e.lineTo(this._currentMeasure.left+this._currentMeasure.width,c),e.stroke()}}if(this._displayMajorLines){e.strokeStyle=this._majorLineColor,e.lineWidth=this._majorLineTickness;for(var l=-r/2+this._majorLineFrequency;l<r/2;l+=this._majorLineFrequency){var u=a+l*this.cellWidth;e.beginPath(),e.moveTo(u,this._currentMeasure.top),e.lineTo(u,this._currentMeasure.top+this._currentMeasure.height),e.stroke()}for(var f=-o/2+this._majorLineFrequency;f<o/2;f+=this._majorLineFrequency){var c=s+f*this.cellHeight;e.moveTo(this._currentMeasure.left,c),e.lineTo(this._currentMeasure.left+this._currentMeasure.width,c),e.closePath(),e.stroke()}}}e.restore()},t.prototype._getTypeName=function(){return"DisplayGrid"},t}(ot);Ae.RegisteredTypes["BABYLON.GUI.DisplayGrid"]=SX;var CX=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i.name=e,i._tempMeasure=new Jr(0,0,0,0),i}return Object.defineProperty(t.prototype,"displayThumb",{get:function(){return this._displayThumb&&this.thumbImage!=null},set:function(e){this._displayThumb!==e&&(this._displayThumb=e,this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this._backgroundImage},set:function(e){var i=this;this._backgroundImage!==e&&(this._backgroundImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce(function(){return i._markAsDirty()}),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valueBarImage",{get:function(){return this._valueBarImage},set:function(e){var i=this;this._valueBarImage!==e&&(this._valueBarImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce(function(){return i._markAsDirty()}),this._markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbImage",{get:function(){return this._thumbImage},set:function(e){var i=this;this._thumbImage!==e&&(this._thumbImage=e,e&&!e.isLoaded&&e.onImageLoadedObservable.addOnce(function(){return i._markAsDirty()}),this._markAsDirty())},enumerable:!1,configurable:!0}),t.prototype._getTypeName=function(){return"ImageBasedSlider"},t.prototype._draw=function(e,i){e.save(),this._applyStates(e),this._prepareRenderingData("rectangle");var r=this._getThumbPosition(),o=this._renderLeft,a=this._renderTop,s=this._renderWidth,l=this._renderHeight;this._backgroundImage&&(this._tempMeasure.copyFromFloats(o,a,s,l),this.isThumbClamped&&this.displayThumb&&(this.isVertical?this._tempMeasure.height+=this._effectiveThumbThickness:this._tempMeasure.width+=this._effectiveThumbThickness),this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure),this._backgroundImage._draw(e)),this._valueBarImage&&(this.isVertical?this.isThumbClamped&&this.displayThumb?this._tempMeasure.copyFromFloats(o,a+r,s,l-r+this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(o,a+r,s,l-r):this.isThumbClamped&&this.displayThumb?this._tempMeasure.copyFromFloats(o,a,r+this._effectiveThumbThickness/2,l):this._tempMeasure.copyFromFloats(o,a,r,l),this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure),this._valueBarImage._draw(e)),this.displayThumb&&(this.isVertical?this._tempMeasure.copyFromFloats(o-this._effectiveBarOffset,this._currentMeasure.top+r,this._currentMeasure.width,this._effectiveThumbThickness):this._tempMeasure.copyFromFloats(this._currentMeasure.left+r,this._currentMeasure.top,this._effectiveThumbThickness,this._currentMeasure.height),this._thumbImage._currentMeasure.copyFrom(this._tempMeasure),this._thumbImage._draw(e)),e.restore()},t}(bp);Ae.RegisteredTypes["BABYLON.GUI.ImageBasedSlider"]=CX;var H8="Statics";ot.AddHeader=function(n,t,e,i){var r=new Pa("panel"),o=i?i.isHorizontal:!0,a=i?i.controlFirst:!0;r.isVertical=!o;var s=new Mn("header");return s.text=t,s.textHorizontalAlignment=ot.HORIZONTAL_ALIGNMENT_LEFT,o?s.width=e:s.height=e,a?(r.addControl(n),r.addControl(s),s.paddingLeft="5px"):(r.addControl(s),r.addControl(n),s.paddingRight="5px"),s.shadowBlur=n.shadowBlur,s.shadowColor=n.shadowColor,s.shadowOffsetX=n.shadowOffsetX,s.shadowOffsetY=n.shadowOffsetY,r};var PX=function(){function n(t){this._fontFamily="Arial",this._fontStyle="",this._fontWeight="",this._fontSize=new zt(18,zt.UNITMODE_PIXEL,!1),this.onChangedObservable=new ie,this._host=t}return Object.defineProperty(n.prototype,"fontSize",{get:function(){return this._fontSize.toString(this._host)},set:function(t){this._fontSize.toString(this._host)!==t&&this._fontSize.fromString(t)&&this.onChangedObservable.notifyObservers(this)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this._fontFamily!==t&&(this._fontFamily=t,this.onChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.onChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.onChangedObservable.notifyObservers(this))},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){this.onChangedObservable.clear()},n}(),Jb=function(n){j(t,n);function t(e,i,r,o,a,s,l){i===void 0&&(i=0),r===void 0&&(r=0),a===void 0&&(a=!1),s===void 0&&(s=he.NEAREST_SAMPLINGMODE);var u=n.call(this,e,{width:i,height:r},o,a,s,To.TEXTUREFORMAT_RGBA,l)||this;return u._isDirty=!1,u._rootContainer=new ao("root"),u._lastControlOver={},u._lastControlDown={},u._capturingControl={},u._linkedControls=new Array,u._isFullscreen=!1,u._fullscreenViewport=new Dn(0,0,1,1),u._idealWidth=0,u._idealHeight=0,u._useSmallestIdeal=!1,u._renderAtIdealSize=!1,u._blockNextFocusCheck=!1,u._renderScale=1,u._cursorChanged=!1,u._defaultMousePointerId=0,u._numLayoutCalls=0,u._numRenderCalls=0,u._clipboardData="",u.onClipboardObservable=new ie,u.onControlPickedObservable=new ie,u.onBeginLayoutObservable=new ie,u.onEndLayoutObservable=new ie,u.onBeginRenderObservable=new ie,u.onEndRenderObservable=new ie,u.premulAlpha=!1,u.applyYInversionOnUpdate=!0,u._useInvalidateRectOptimization=!0,u._invalidatedRectangle=null,u._clearMeasure=new Jr(0,0,0,0),u.onClipboardCopy=function(f){var c=f,h=new Pv(Sa.COPY,c);u.onClipboardObservable.notifyObservers(h),c.preventDefault()},u.onClipboardCut=function(f){var c=f,h=new Pv(Sa.CUT,c);u.onClipboardObservable.notifyObservers(h),c.preventDefault()},u.onClipboardPaste=function(f){var c=f,h=new Pv(Sa.PASTE,c);u.onClipboardObservable.notifyObservers(h),c.preventDefault()},o=u.getScene(),!o||!u._texture||(u._rootElement=o.getEngine().getInputElement(),u._renderObserver=o.onBeforeCameraRenderObservable.add(function(f){return u._checkUpdate(f)}),u._preKeyboardObserver=o.onPreKeyboardObservable.add(function(f){u._focusedControl&&(f.type===$s.KEYDOWN&&u._focusedControl.processKeyboard(f.event),f.skipOnPointerObservable=!0)}),u._rootContainer._link(u),u.hasAlpha=!0,(!i||!r)&&(u._resizeObserver=o.getEngine().onResizeObservable.add(function(){return u._onResize()}),u._onResize()),u._texture.isReady=!0),u}return Object.defineProperty(t.prototype,"numLayoutCalls",{get:function(){return this._numLayoutCalls},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"numRenderCalls",{get:function(){return this._numRenderCalls},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderScale",{get:function(){return this._renderScale},set:function(e){e!==this._renderScale&&(this._renderScale=e,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"background",{get:function(){return this._background},set:function(e){this._background!==e&&(this._background=e,this.markAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idealWidth",{get:function(){return this._idealWidth},set:function(e){this._idealWidth!==e&&(this._idealWidth=e,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idealHeight",{get:function(){return this._idealHeight},set:function(e){this._idealHeight!==e&&(this._idealHeight=e,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useSmallestIdeal",{get:function(){return this._useSmallestIdeal},set:function(e){this._useSmallestIdeal!==e&&(this._useSmallestIdeal=e,this.markAsDirty(),this._rootContainer._markAllAsDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderAtIdealSize",{get:function(){return this._renderAtIdealSize},set:function(e){this._renderAtIdealSize!==e&&(this._renderAtIdealSize=e,this._onResize())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idealRatio",{get:function(){var e=0,i=0;return this._idealWidth&&(e=this.getSize().width/this._idealWidth),this._idealHeight&&(i=this.getSize().height/this._idealHeight),this._useSmallestIdeal&&this._idealWidth&&this._idealHeight?window.innerWidth<window.innerHeight?e:i:this._idealWidth?e:this._idealHeight?i:1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._layerToDispose},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rootContainer",{get:function(){return this._rootContainer},enumerable:!1,configurable:!0}),t.prototype.getChildren=function(){return[this._rootContainer]},t.prototype.getDescendants=function(e,i){return this._rootContainer.getDescendants(e,i)},Object.defineProperty(t.prototype,"focusedControl",{get:function(){return this._focusedControl},set:function(e){this._focusedControl!=e&&(this._focusedControl&&this._focusedControl.onBlur(),e&&e.onFocus(),this._focusedControl=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isForeground",{get:function(){return this.layer?!this.layer.isBackground:!0},set:function(e){this.layer&&this.layer.isBackground!==!e&&(this.layer.isBackground=!e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipboardData",{get:function(){return this._clipboardData},set:function(e){this._clipboardData=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"AdvancedDynamicTexture"},t.prototype.executeOnAllControls=function(e,i){i||(i=this._rootContainer),e(i);for(var r=0,o=i.children;r<o.length;r++){var a=o[r];if(a.children){this.executeOnAllControls(e,a);continue}e(a)}},Object.defineProperty(t.prototype,"useInvalidateRectOptimization",{get:function(){return this._useInvalidateRectOptimization},set:function(e){this._useInvalidateRectOptimization=e},enumerable:!1,configurable:!0}),t.prototype.invalidateRect=function(e,i,r,o){if(this._useInvalidateRectOptimization)if(!this._invalidatedRectangle)this._invalidatedRectangle=new Jr(e,i,r-e+1,o-i+1);else{var a=Math.ceil(Math.max(this._invalidatedRectangle.left+this._invalidatedRectangle.width-1,r)),s=Math.ceil(Math.max(this._invalidatedRectangle.top+this._invalidatedRectangle.height-1,o));this._invalidatedRectangle.left=Math.floor(Math.min(this._invalidatedRectangle.left,e)),this._invalidatedRectangle.top=Math.floor(Math.min(this._invalidatedRectangle.top,i)),this._invalidatedRectangle.width=a-this._invalidatedRectangle.left+1,this._invalidatedRectangle.height=s-this._invalidatedRectangle.top+1}},t.prototype.markAsDirty=function(){this._isDirty=!0},t.prototype.createStyle=function(){return new PX(this)},t.prototype.addControl=function(e){return this._rootContainer.addControl(e),this},t.prototype.removeControl=function(e){return this._rootContainer.removeControl(e),this},t.prototype.dispose=function(){var e=this.getScene();e&&(this._rootElement=null,e.onBeforeCameraRenderObservable.remove(this._renderObserver),this._resizeObserver&&e.getEngine().onResizeObservable.remove(this._resizeObserver),this._pointerMoveObserver&&e.onPrePointerObservable.remove(this._pointerMoveObserver),this._pointerObserver&&e.onPointerObservable.remove(this._pointerObserver),this._preKeyboardObserver&&e.onPreKeyboardObservable.remove(this._preKeyboardObserver),this._canvasPointerOutObserver&&e.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver),this._canvasBlurObserver&&e.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver),this._layerToDispose&&(this._layerToDispose.texture=null,this._layerToDispose.dispose(),this._layerToDispose=null),this._rootContainer.dispose(),this.onClipboardObservable.clear(),this.onControlPickedObservable.clear(),this.onBeginRenderObservable.clear(),this.onEndRenderObservable.clear(),this.onBeginLayoutObservable.clear(),this.onEndLayoutObservable.clear(),n.prototype.dispose.call(this))},t.prototype._onResize=function(){var e=this.getScene();if(e){var i=e.getEngine(),r=this.getSize(),o=i.getRenderWidth()*this._renderScale,a=i.getRenderHeight()*this._renderScale;this._renderAtIdealSize&&(this._idealWidth?(a=a*this._idealWidth/o,o=this._idealWidth):this._idealHeight&&(o=o*this._idealHeight/a,a=this._idealHeight)),(r.width!==o||r.height!==a)&&(this.scaleTo(o,a),this.markAsDirty(),(this._idealWidth||this._idealHeight)&&this._rootContainer._markAllAsDirty()),this.invalidateRect(0,0,r.width-1,r.height-1)}},t.prototype._getGlobalViewport=function(e){var i=e.getEngine();return this._fullscreenViewport.toGlobal(i.getRenderWidth(),i.getRenderHeight())},t.prototype.getProjectedPosition=function(e,i){var r=this.getScene();if(!r)return Ie.Zero();var o=this._getGlobalViewport(r),a=y.Project(e,i,r.getTransformMatrix(),o);return a.scaleInPlace(this.renderScale),new Ie(a.x,a.y)},t.prototype.getProjectedPositionWithZ=function(e,i){var r=this.getScene();if(!r)return y.Zero();var o=this._getGlobalViewport(r),a=y.Project(e,i,r.getTransformMatrix(),o);return a.scaleInPlace(this.renderScale),new y(a.x,a.y,a.z)},t.prototype._checkUpdate=function(e){if(!(this._layerToDispose&&(e.layerMask&this._layerToDispose.layerMask)===0)){if(this._isFullscreen&&this._linkedControls.length){var i=this.getScene();if(!i)return;for(var r=this._getGlobalViewport(i),o=function(f){if(!f.isVisible)return"continue";var c=f._linkedMesh;if(!c||c.isDisposed())return Ee.SetImmediate(function(){f.linkWithMesh(null)}),"continue";var h=c.getBoundingInfo?c.getBoundingInfo().boundingSphere.center:y.ZeroReadOnly,p=y.Project(h,c.getWorldMatrix(),i.getTransformMatrix(),r);if(p.z<0||p.z>1)return f.notRenderable=!0,"continue";f.notRenderable=!1,p.scaleInPlace(a.renderScale),f._moveToProjectedPosition(p)},a=this,s=0,l=this._linkedControls;s<l.length;s++){var u=l[s];o(u)}}!this._isDirty&&!this._rootContainer.isDirty||(this._isDirty=!1,this._render(),this.update(this.applyYInversionOnUpdate,this.premulAlpha))}},t.prototype._render=function(){var e=this.getSize(),i=e.width,r=e.height,o=this.getContext();o.font="18px Arial",o.strokeStyle="white",this.onBeginLayoutObservable.notifyObservers(this);var a=new Jr(0,0,i,r);this._numLayoutCalls=0,this._rootContainer._layout(a,o),this.onEndLayoutObservable.notifyObservers(this),this._isDirty=!1,this._invalidatedRectangle?this._clearMeasure.copyFrom(this._invalidatedRectangle):this._clearMeasure.copyFromFloats(0,0,i,r),o.clearRect(this._clearMeasure.left,this._clearMeasure.top,this._clearMeasure.width,this._clearMeasure.height),this._background&&(o.save(),o.fillStyle=this._background,o.fillRect(this._clearMeasure.left,this._clearMeasure.top,this._clearMeasure.width,this._clearMeasure.height),o.restore()),this.onBeginRenderObservable.notifyObservers(this),this._numRenderCalls=0,this._rootContainer._render(o,this._invalidatedRectangle),this.onEndRenderObservable.notifyObservers(this),this._invalidatedRectangle=null},t.prototype._changeCursor=function(e){this._rootElement&&(this._rootElement.style.cursor=e,this._cursorChanged=!0)},t.prototype._registerLastControlDown=function(e,i){this._lastControlDown[i]=e,this.onControlPickedObservable.notifyObservers(e)},t.prototype._doPicking=function(e,i,r,o,a,s,l,u){var f=this.getScene();if(f){var c=f.getEngine(),h=this.getSize();if(this._isFullscreen){var p=f.cameraToUseForPointers||f.activeCamera,_=p.viewport;e=e*(h.width/(c.getRenderWidth()*_.width)),i=i*(h.height/(c.getRenderHeight()*_.height))}if(this._capturingControl[a]){this._capturingControl[a]._processObservables(o,e,i,r,a,s);return}this._cursorChanged=!1,this._rootContainer._processPicking(e,i,r,o,a,s,l,u)||(this._changeCursor(""),o===He.POINTERMOVE&&this._lastControlOver[a]&&(this._lastControlOver[a]._onPointerOut(this._lastControlOver[a],r),delete this._lastControlOver[a])),this._cursorChanged||this._changeCursor(""),this._manageFocus()}},t.prototype._cleanControlAfterRemovalFromList=function(e,i){for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];o===i&&delete e[r]}},t.prototype._cleanControlAfterRemoval=function(e){this._cleanControlAfterRemovalFromList(this._lastControlDown,e),this._cleanControlAfterRemovalFromList(this._lastControlOver,e)},t.prototype.attach=function(){var e=this,i=this.getScene();if(i){var r=new Dn(0,0,0,0);this._pointerMoveObserver=i.onPrePointerObservable.add(function(o,a){if(!i.isPointerCaptured(o.event.pointerId)&&!(o.type!==He.POINTERMOVE&&o.type!==He.POINTERUP&&o.type!==He.POINTERDOWN&&o.type!==He.POINTERWHEEL)&&i){o.type===He.POINTERMOVE&&o.event.pointerId&&(e._defaultMousePointerId=o.event.pointerId);var s=i.cameraToUseForPointers||i.activeCamera,l=i.getEngine();s?s.viewport.toGlobalToRef(l.getRenderWidth(),l.getRenderHeight(),r):(r.x=0,r.y=0,r.width=l.getRenderWidth(),r.height=l.getRenderHeight());var u=i.pointerX/l.getHardwareScalingLevel()-r.x,f=i.pointerY/l.getHardwareScalingLevel()-(l.getRenderHeight()-r.y-r.height);e._shouldBlockPointer=!1;var c=o.event.pointerId||e._defaultMousePointerId;e._doPicking(u,f,o,o.type,c,o.event.button,o.event.deltaX,o.event.deltaY),e._shouldBlockPointer&&(o.skipOnPointerObservable=e._shouldBlockPointer)}}),this._attachToOnPointerOut(i),this._attachToOnBlur(i)}},t.prototype.registerClipboardEvents=function(){self.addEventListener("copy",this.onClipboardCopy,!1),self.addEventListener("cut",this.onClipboardCut,!1),self.addEventListener("paste",this.onClipboardPaste,!1)},t.prototype.unRegisterClipboardEvents=function(){self.removeEventListener("copy",this.onClipboardCopy),self.removeEventListener("cut",this.onClipboardCut),self.removeEventListener("paste",this.onClipboardPaste)},t.prototype.attachToMesh=function(e,i){var r=this;i===void 0&&(i=!0);var o=this.getScene();o&&(this._pointerObserver=o.onPointerObservable.add(function(a,s){if(!(a.type!==He.POINTERMOVE&&a.type!==He.POINTERUP&&a.type!==He.POINTERDOWN)){var l=a.event.pointerId||r._defaultMousePointerId;if(a.pickInfo&&a.pickInfo.hit&&a.pickInfo.pickedMesh===e){var u=a.pickInfo.getTextureCoordinates();if(u){var f=r.getSize();r._doPicking(u.x*f.width,(r.applyYInversionOnUpdate?1-u.y:u.y)*f.height,a,a.type,l,a.event.button)}}else if(a.type===He.POINTERUP){if(r._lastControlDown[l]&&r._lastControlDown[l]._forcePointerUp(l),delete r._lastControlDown[l],r.focusedControl){var c=r.focusedControl.keepsFocusWith(),h=!0;if(c)for(var p=0,_=c;p<_.length;p++){var g=_[p];if(r!==g._host){var v=g._host;if(v._lastControlOver[l]&&v._lastControlOver[l].isAscendant(g)){h=!1;break}}}h&&(r.focusedControl=null)}}else a.type===He.POINTERMOVE&&(r._lastControlOver[l]&&r._lastControlOver[l]._onPointerOut(r._lastControlOver[l],a,!0),delete r._lastControlOver[l])}}),e.enablePointerMoveEvents=i,this._attachToOnPointerOut(o),this._attachToOnBlur(o))},t.prototype.moveFocusToControl=function(e){this.focusedControl=e,this._lastPickedControl=e,this._blockNextFocusCheck=!0},t.prototype._manageFocus=function(){if(this._blockNextFocusCheck){this._blockNextFocusCheck=!1,this._lastPickedControl=this._focusedControl;return}if(this._focusedControl&&this._focusedControl!==this._lastPickedControl){if(this._lastPickedControl.isFocusInvisible)return;this.focusedControl=null}},t.prototype._attachToOnPointerOut=function(e){var i=this;this._canvasPointerOutObserver=e.getEngine().onCanvasPointerOutObservable.add(function(r){i._lastControlOver[r.pointerId]&&i._lastControlOver[r.pointerId]._onPointerOut(i._lastControlOver[r.pointerId],null),delete i._lastControlOver[r.pointerId],i._lastControlDown[r.pointerId]&&i._lastControlDown[r.pointerId]!==i._capturingControl[r.pointerId]&&(i._lastControlDown[r.pointerId]._forcePointerUp(),delete i._lastControlDown[r.pointerId])})},t.prototype._attachToOnBlur=function(e){var i=this;this._canvasBlurObserver=e.getEngine().onCanvasBlurObservable.add(function(r){Object.entries(i._lastControlDown).forEach(function(o){o[0];var a=o[1];a._onCanvasBlur()}),i._lastControlDown={}})},t.CreateForMesh=function(e,i,r,o,a,s){i===void 0&&(i=1024),r===void 0&&(r=1024),o===void 0&&(o=!0),a===void 0&&(a=!1);var l=new t(e.name+" AdvancedDynamicTexture",i,r,e.getScene(),!0,he.TRILINEAR_SAMPLINGMODE,s),u=new Mt("AdvancedDynamicTextureMaterial",e.getScene());return u.backFaceCulling=!1,u.diffuseColor=_e.Black(),u.specularColor=_e.Black(),a?(u.diffuseTexture=l,u.emissiveTexture=l,l.hasAlpha=!0):(u.emissiveTexture=l,u.opacityTexture=l),e.material=u,l.attachToMesh(e,o),l},t.CreateForMeshTexture=function(e,i,r,o,a){i===void 0&&(i=1024),r===void 0&&(r=1024),o===void 0&&(o=!0);var s=new t(e.name+" AdvancedDynamicTexture",i,r,e.getScene(),!0,he.TRILINEAR_SAMPLINGMODE,a);return s.attachToMesh(e,o),s},t.CreateFullscreenUI=function(e,i,r,o){i===void 0&&(i=!0),r===void 0&&(r=null),o===void 0&&(o=he.BILINEAR_SAMPLINGMODE);var a=new t(e,0,0,r,!1,o),s=new qz(e+"_layer",null,r,!i);return s.texture=a,a._layerToDispose=s,a._isFullscreen=!0,a.attach(),a},t}(Co),j8=function(){function n(t){this.texture=t,this._captureRenderTime=!1,this._renderTime=new Or,this._captureLayoutTime=!1,this._layoutTime=new Or,this._onBeginRenderObserver=null,this._onEndRenderObserver=null,this._onBeginLayoutObserver=null,this._onEndLayoutObserver=null}return Object.defineProperty(n.prototype,"renderTimeCounter",{get:function(){return this._renderTime},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layoutTimeCounter",{get:function(){return this._layoutTime},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"captureRenderTime",{get:function(){return this._captureRenderTime},set:function(t){var e=this;t!==this._captureRenderTime&&(this._captureRenderTime=t,t?(this._onBeginRenderObserver=this.texture.onBeginRenderObservable.add(function(){e._renderTime.beginMonitoring()}),this._onEndRenderObserver=this.texture.onEndRenderObservable.add(function(){e._renderTime.endMonitoring(!0)})):(this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"captureLayoutTime",{get:function(){return this._captureLayoutTime},set:function(t){var e=this;t!==this._captureLayoutTime&&(this._captureLayoutTime=t,t?(this._onBeginLayoutObserver=this.texture.onBeginLayoutObservable.add(function(){e._layoutTime.beginMonitoring()}),this._onEndLayoutObserver=this.texture.onEndLayoutObservable.add(function(){e._layoutTime.endMonitoring(!0)})):(this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null))},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver),this._onBeginRenderObserver=null,this.texture.onEndRenderObservable.remove(this._onEndRenderObserver),this._onEndRenderObserver=null,this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver),this._onBeginLayoutObserver=null,this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver),this._onEndLayoutObserver=null,this.texture=null},n}(),X8=function(){function n(t){t===void 0&&(t=null),this._nodes={},this._nodeTypes={element:1,attribute:2,text:3},this._isLoaded=!1,this._objectAttributes={textHorizontalAlignment:1,textVerticalAlignment:2,horizontalAlignment:3,verticalAlignment:4,stretch:5},t&&(this._parentClass=t)}return n.prototype._getChainElement=function(t){var e=window;this._parentClass&&(e=this._parentClass);var i=t;i=i.split(".");for(var r=0;r<i.length;r++)e=e[i[r]];return e},n.prototype._getClassAttribute=function(t){var e=t.split("."),i=Ae.GetClass("BABYLON.GUI."+e[0]);return i[e[1]]},n.prototype._createGuiElement=function(t,e,i){i===void 0&&(i=!0);try{var r=Ae.GetClass("BABYLON.GUI."+t.nodeName),o=new r;e&&i&&e.addControl(o);for(var a=0;a<t.attributes.length;a++)if(!t.attributes[a].name.toLowerCase().includes("datasource"))if(t.attributes[a].name.toLowerCase().includes("observable")){var s=this._getChainElement(t.attributes[a].value);o[t.attributes[a].name].add(s);continue}else if(t.attributes[a].name=="linkWithMesh")this._parentClass?o.linkWithMesh(this._parentClass[t.attributes[a].value]):o.linkWithMesh(window[t.attributes[a].value]);else if(t.attributes[a].value.startsWith("{{")&&t.attributes[a].value.endsWith("}}")){var s=this._getChainElement(t.attributes[a].value.substring(2,t.attributes[a].value.length-2));o[t.attributes[a].name]=s}else this._objectAttributes[t.attributes[a].name]?o[t.attributes[a].name]=this._getClassAttribute(t.attributes[a].value):t.attributes[a].value=="true"||t.attributes[a].value=="false"?o[t.attributes[a].name]=t.attributes[a].value=="true":o[t.attributes[a].name]=isNaN(Number(t.attributes[a].value))?t.attributes[a].value:Number(t.attributes[a].value);if(!t.attributes.getNamedItem("id"))return this._nodes[t.nodeName+Object.keys(this._nodes).length+"_gen"]=o,o;var l=t.attributes.getNamedItem("id").value;if(l.startsWith("{{")&&l.endsWith("}}")&&(l=this._getChainElement(l.substring(2,l.length-2))),!this._nodes[l])this._nodes[l]=o;else throw"XmlLoader Exception : Duplicate ID, every element should have an unique ID attribute";return o}catch(u){throw"XmlLoader Exception : Error parsing Control "+t.nodeName+","+u+"."}},n.prototype._parseGrid=function(t,e,i){for(var r,o,a,s=t.children,l,u=!1,f,c=-1,h=-1,p=0,_=0;_<s.length;_++)if(s[_].nodeType==this._nodeTypes.element){if(s[_].nodeName!="Row")throw"XmlLoader Exception : Expecting Row node, received "+s[_].nodeName;if(c+=1,a=s[_].children,!s[_].attributes.getNamedItem("height"))throw"XmlLoader Exception : Height must be defined for grid rows";o=Number(s[_].attributes.getNamedItem("height").nodeValue),u=s[_].attributes.getNamedItem("isPixel")?JSON.parse(s[_].attributes.getNamedItem("isPixel").nodeValue):!1,e.addRowDefinition(o,u);for(var g=0;g<a.length;g++)if(a[g].nodeType==this._nodeTypes.element){if(a[g].nodeName!="Column")throw"XmlLoader Exception : Expecting Column node, received "+a[g].nodeName;if(h+=1,c>0&&h>p)throw"XmlLoader Exception : In the Grid element, the number of columns is defined in the first row, do not add more columns in the subsequent rows.";if(c==0){if(!a[g].attributes.getNamedItem("width"))throw"XmlLoader Exception : Width must be defined for all the grid columns in the first row";r=Number(a[g].attributes.getNamedItem("width").nodeValue),u=a[g].attributes.getNamedItem("isPixel")?JSON.parse(a[g].attributes.getNamedItem("isPixel").nodeValue):!1,e.addColumnDefinition(r,u)}l=a[g].children;for(var v=0;v<l.length;v++)l[v].nodeType==this._nodeTypes.element&&(f=this._createGuiElement(l[v],e,!1),e.addControl(f,c,h),l[v].firstChild&&this._parseXml(l[v].firstChild,f))}c==0&&(p=h),h=-1}t.nextSibling&&this._parseXml(t.nextSibling,i)},n.prototype._parseElement=function(t,e,i){t.firstChild&&this._parseXml(t.firstChild,e),t.nextSibling&&this._parseXml(t.nextSibling,i)},n.prototype._prepareSourceElement=function(t,e,i,r,o){this._parentClass?this._parentClass[i]=r[o]:window[i]=r[o],t.firstChild&&this._parseXml(t.firstChild,e,!0)},n.prototype._parseElementsFromSource=function(t,e,i){var r=t.attributes.getNamedItem("dataSource").value;if(r.includes(" in ")){var o=!0,a=r.split(" in ");if(a.length<2)throw"XmlLoader Exception : Malformed XML, Data Source must an iterator and a source";var s=a[1];if(s.startsWith("{")&&s.endsWith("}")&&(o=!1),(!o||s.startsWith("[")&&s.endsWith("]"))&&(s=s.substring(1,s.length-1)),this._parentClass?s=this._parentClass[s]:s=window[s],o)for(var l=0;l<s.length;l++)this._prepareSourceElement(t,e,a[0],s,l);else for(var l in s)this._prepareSourceElement(t,e,a[0],s,l);t.nextSibling&&this._parseXml(t.nextSibling,i)}else throw"XmlLoader Exception : Malformed XML, Data Source must include an in"},n.prototype._parseXml=function(t,e,i){if(i===void 0&&(i=!1),t.nodeType!=this._nodeTypes.element){t.nextSibling&&this._parseXml(t.nextSibling,e,i);return}i&&t.setAttribute("id",e.id+(e._children.length+1));var r=this._createGuiElement(t,e);t.nodeName=="Grid"?this._parseGrid(t,r,e):t.attributes.getNamedItem("dataSource")?this._parseElementsFromSource(t,r,e):this._parseElement(t,r,e)},n.prototype.isLoaded=function(){return this._isLoaded},n.prototype.getNodeById=function(t){return this._nodes[t]},n.prototype.getNodes=function(){return this._nodes},n.prototype.loadLayout=function(t,e,i){var r=new XMLHttpRequest;r.onreadystatechange=(function(){if(r.readyState==4&&r.status==200){if(!r.responseXML)throw"XmlLoader Exception : XML file is malformed or corrupted.";var o=r.responseXML.documentElement;this._parseXml(o.firstChild,e),this._isLoaded=!0,i&&i()}}).bind(this),r.open("GET",t,!0),r.send()},n}(),sy=function(n){j(t,n);function t(e,i){i===void 0&&(i=0);var r=n.call(this,e.x,e.y,e.z)||this;return r.buttonIndex=i,r}return t}(y),JI=function(){function n(t){this.name=t,this._downCount=0,this._enterCount=-1,this._downPointerIds={},this._isVisible=!0,this.onPointerMoveObservable=new ie,this.onPointerOutObservable=new ie,this.onPointerDownObservable=new ie,this.onPointerUpObservable=new ie,this.onPointerClickObservable=new ie,this.onPointerEnterObservable=new ie,this._behaviors=new Array}return Object.defineProperty(n.prototype,"position",{get:function(){return this._node?this._node.position:y.Zero()},set:function(t){this._node&&(this._node.position=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"scaling",{get:function(){return this._node?this._node.scaling:new y(1,1,1)},set:function(t){this._node&&(this._node.scaling=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),n.prototype.addBehavior=function(t){var e=this,i=this._behaviors.indexOf(t);if(i!==-1)return this;t.init();var r=this._host.scene;return r.isLoading?r.onDataLoadedObservable.addOnce(function(){t.attach(e)}):t.attach(this),this._behaviors.push(t),this},n.prototype.removeBehavior=function(t){var e=this._behaviors.indexOf(t);return e===-1?this:(this._behaviors[e].detach(),this._behaviors.splice(e,1),this)},n.prototype.getBehaviorByName=function(t){for(var e=0,i=this._behaviors;e<i.length;e++){var r=i[e];if(r.name===t)return r}return null},Object.defineProperty(n.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){if(this._isVisible!==t){this._isVisible=t;var e=this.mesh;e&&e.setEnabled(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"typeName",{get:function(){return this._getTypeName()},enumerable:!1,configurable:!0}),n.prototype.getClassName=function(){return this._getTypeName()},n.prototype._getTypeName=function(){return"Control3D"},Object.defineProperty(n.prototype,"node",{get:function(){return this._node},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mesh",{get:function(){return this._node instanceof Ht?this._node:null},enumerable:!1,configurable:!0}),n.prototype.linkToTransformNode=function(t){return this._node&&(this._node.parent=t),this},n.prototype._prepareNode=function(t){if(!this._node){if(this._node=this._createNode(t),!this.node)return;this._node.metadata=this,this._node.position=this.position,this._node.scaling=this.scaling;var e=this.mesh;e&&(e.isPickable=!0,this._affectMaterial(e))}},n.prototype._createNode=function(t){return null},n.prototype._affectMaterial=function(t){t.material=null},n.prototype._onPointerMove=function(t,e){this.onPointerMoveObservable.notifyObservers(e,-1,t,this)},n.prototype._onPointerEnter=function(t){return this._enterCount>0?!1:(this._enterCount===-1&&(this._enterCount=0),this._enterCount++,this.onPointerEnterObservable.notifyObservers(this,-1,t,this),this.pointerEnterAnimation&&this.pointerEnterAnimation(),!0)},n.prototype._onPointerOut=function(t){this._enterCount=0,this.onPointerOutObservable.notifyObservers(this,-1,t,this),this.pointerOutAnimation&&this.pointerOutAnimation()},n.prototype._onPointerDown=function(t,e,i,r){return this._downCount!==0?(this._downCount++,!1):(this._downCount++,this._downPointerIds[i]=!0,this.onPointerDownObservable.notifyObservers(new sy(e,r),-1,t,this),this.pointerDownAnimation&&this.pointerDownAnimation(),!0)},n.prototype._onPointerUp=function(t,e,i,r,o){if(this._downCount--,delete this._downPointerIds[i],this._downCount<0){this._downCount=0;return}this._downCount==0&&(o&&(this._enterCount>0||this._enterCount===-1)&&this.onPointerClickObservable.notifyObservers(new sy(e,r),-1,t,this),this.onPointerUpObservable.notifyObservers(new sy(e,r),-1,t,this),this.pointerUpAnimation&&this.pointerUpAnimation())},n.prototype.forcePointerUp=function(t){if(t===void 0&&(t=null),t!==null)this._onPointerUp(this,y.Zero(),t,0,!0);else{for(var e in this._downPointerIds)this._onPointerUp(this,y.Zero(),+e,0,!0);this._downCount>0&&(this._downCount=1,this._onPointerUp(this,y.Zero(),0,0,!0))}},n.prototype._processObservables=function(t,e,i,r){if(t===He.POINTERMOVE){this._onPointerMove(this,e);var o=this._host._lastControlOver[i];return o&&o!==this&&o._onPointerOut(this),o!==this&&this._onPointerEnter(this),this._host._lastControlOver[i]=this,!0}return t===He.POINTERDOWN?(this._onPointerDown(this,e,i,r),this._host._lastControlDown[i]=this,this._host._lastPickedControl=this,!0):t===He.POINTERUP||t===He.POINTERDOUBLETAP?(this._host._lastControlDown[i]&&this._host._lastControlDown[i]._onPointerUp(this,e,i,r,!0),delete this._host._lastControlDown[i],!0):!1},n.prototype._disposeNode=function(){this._node&&(this._node.dispose(),this._node=null)},n.prototype.dispose=function(){this.onPointerDownObservable.clear(),this.onPointerEnterObservable.clear(),this.onPointerMoveObservable.clear(),this.onPointerOutObservable.clear(),this.onPointerUpObservable.clear(),this.onPointerClickObservable.clear(),this._disposeNode();for(var t=0,e=this._behaviors;t<e.length;t++){var i=e[t];i.detach()}},n}(),AX=function(n){j(t,n);function t(e){return n.call(this,e)||this}return t.prototype._getTypeName=function(){return"AbstractButton3D"},t.prototype._createNode=function(e){return new nr("button"+this.name)},t}(JI),eD=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i._contentResolution=512,i._contentScaleRatio=2,i.pointerEnterAnimation=function(){i.mesh&&(i._currentMaterial.emissiveColor=_e.Red())},i.pointerOutAnimation=function(){i._currentMaterial.emissiveColor=_e.Black()},i.pointerDownAnimation=function(){i.mesh&&i.mesh.scaling.scaleInPlace(.95)},i.pointerUpAnimation=function(){i.mesh&&i.mesh.scaling.scaleInPlace(1/.95)},i}return Object.defineProperty(t.prototype,"contentResolution",{get:function(){return this._contentResolution},set:function(e){this._contentResolution!==e&&(this._contentResolution=e,this._resetContent())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentScaleRatio",{get:function(){return this._contentScaleRatio},set:function(e){this._contentScaleRatio!==e&&(this._contentScaleRatio=e,this._resetContent())},enumerable:!1,configurable:!0}),t.prototype._disposeFacadeTexture=function(){this._facadeTexture&&(this._facadeTexture.dispose(),this._facadeTexture=null)},t.prototype._resetContent=function(){this._disposeFacadeTexture(),this.content=this._content},Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(e){this._content=e,!(!this._host||!this._host.utilityLayer)&&(this._facadeTexture?this._facadeTexture.rootContainer.clearControls():(this._facadeTexture=new Jb("Facade",this._contentResolution,this._contentResolution,this._host.utilityLayer.utilityLayerScene,!0,he.TRILINEAR_SAMPLINGMODE),this._facadeTexture.rootContainer.scaleX=this._contentScaleRatio,this._facadeTexture.rootContainer.scaleY=this._contentScaleRatio,this._facadeTexture.premulAlpha=!0),this._facadeTexture.addControl(e),this._applyFacade(this._facadeTexture))},enumerable:!1,configurable:!0}),t.prototype._applyFacade=function(e){this._currentMaterial.emissiveTexture=e},t.prototype._getTypeName=function(){return"Button3D"},t.prototype._createNode=function(e){for(var i=new Array(6),r=0;r<6;r++)i[r]=new ni(0,0,0,0);i[1]=new ni(0,0,1,1);var o=Xo.CreateBox(this.name+"_rootMesh",{width:1,height:1,depth:.08,faceUV:i},e);return o},t.prototype._affectMaterial=function(e){var i=new Mt(this.name+"Material",e.getScene());i.specularColor=_e.Black(),e.material=i,this._currentMaterial=i,this._resetContent()},t.prototype.dispose=function(){n.prototype.dispose.call(this),this._disposeFacadeTexture(),this._currentMaterial&&this._currentMaterial.dispose()},t}(AX),br=function(n){j(t,n);function t(e){var i=n.call(this,e)||this;return i._blockLayout=!1,i._children=new Array,i}return Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blockLayout",{get:function(){return this._blockLayout},set:function(e){this._blockLayout!==e&&(this._blockLayout=e,this._blockLayout||this._arrangeChildren())},enumerable:!1,configurable:!0}),t.prototype.updateLayout=function(){return this._arrangeChildren(),this},t.prototype.containsControl=function(e){return this._children.indexOf(e)!==-1},t.prototype.addControl=function(e){var i=this._children.indexOf(e);return i!==-1?this:(e.parent=this,e._host=this._host,this._children.push(e),this._host.utilityLayer&&(e._prepareNode(this._host.utilityLayer.utilityLayerScene),e.node&&(e.node.parent=this.node),this.blockLayout||this._arrangeChildren()),this)},t.prototype._arrangeChildren=function(){},t.prototype._createNode=function(e){return new nr("ContainerNode",e)},t.prototype.removeControl=function(e){var i=this._children.indexOf(e);return i!==-1&&(this._children.splice(i,1),e.parent=null,e._disposeNode()),this},t.prototype._getTypeName=function(){return"Container3D"},t.prototype.dispose=function(){for(var e=0,i=this._children;e<i.length;e++){var r=i[e];r.dispose()}this._children=[],n.prototype.dispose.call(this)},t.UNSET_ORIENTATION=0,t.FACEORIGIN_ORIENTATION=1,t.FACEORIGINREVERSED_ORIENTATION=2,t.FACEFORWARD_ORIENTATION=3,t.FACEFORWARDREVERSED_ORIENTATION=4,t}(JI),Ep=function(n){j(t,n);function t(){var e=n.call(this)||this;return e._columns=10,e._rows=0,e._rowThenColum=!0,e._orientation=br.FACEORIGIN_ORIENTATION,e.margin=0,e}return Object.defineProperty(t.prototype,"orientation",{get:function(){return this._orientation},set:function(e){var i=this;this._orientation!==e&&(this._orientation=e,Ee.SetImmediate(function(){i._arrangeChildren()}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this._columns},set:function(e){var i=this;this._columns!==e&&(this._columns=e,this._rowThenColum=!0,Ee.SetImmediate(function(){i._arrangeChildren()}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._rows},set:function(e){var i=this;this._rows!==e&&(this._rows=e,this._rowThenColum=!1,Ee.SetImmediate(function(){i._arrangeChildren()}))},enumerable:!1,configurable:!0}),t.prototype._arrangeChildren=function(){this._cellWidth=0,this._cellHeight=0;for(var e=0,i=0,r=0,o=te.Invert(this.node.computeWorldMatrix(!0)),a=0,s=this._children;a<s.length;a++){var l=s[a];if(l.mesh){r++,l.mesh.computeWorldMatrix(!0);var u=l.mesh.getHierarchyBoundingVectors(),f=me.Vector3[0],c=me.Vector3[1];u.max.subtractToRef(u.min,c),c.scaleInPlace(.5),y.TransformNormalToRef(c,o,f),this._cellWidth=Math.max(this._cellWidth,f.x*2),this._cellHeight=Math.max(this._cellHeight,f.y*2)}}this._cellWidth+=this.margin*2,this._cellHeight+=this.margin*2,this._rowThenColum?(i=this._columns,e=Math.ceil(r/this._columns)):(e=this._rows,i=Math.ceil(r/this._rows));var h=i*.5*this._cellWidth,p=e*.5*this._cellHeight,_=[],g=0;if(this._rowThenColum)for(var v=0;v<e;v++)for(var E=0;E<i&&(_.push(new y(E*this._cellWidth-h+this._cellWidth/2,v*this._cellHeight-p+this._cellHeight/2,0)),g++,!(g>r));E++);else for(var E=0;E<i;E++)for(var v=0;v<e&&(_.push(new y(E*this._cellWidth-h+this._cellWidth/2,v*this._cellHeight-p+this._cellHeight/2,0)),g++,!(g>r));v++);g=0;for(var T=0,S=this._children;T<S.length;T++){var l=S[T];l.mesh&&(this._mapGridNode(l,_[g]),g++)}this._finalProcessing()},t.prototype._finalProcessing=function(){},t}(br),Y8=function(n){j(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e._radius=5,e}return Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},set:function(e){var i=this;this._radius!==e&&(this._radius=e,Ee.SetImmediate(function(){i._arrangeChildren()}))},enumerable:!1,configurable:!0}),t.prototype._mapGridNode=function(e,i){var r=e.mesh;if(r){var o=this._cylindricalMapping(i);switch(e.position=o,this.orientation){case br.FACEORIGIN_ORIENTATION:r.lookAt(new y(2*o.x,o.y,2*o.z));break;case br.FACEORIGINREVERSED_ORIENTATION:r.lookAt(new y(-o.x,o.y,-o.z));break;case br.FACEFORWARD_ORIENTATION:break;case br.FACEFORWARDREVERSED_ORIENTATION:r.rotate(Mi.Y,Math.PI,St.LOCAL);break}}},t.prototype._cylindricalMapping=function(e){var i=new y(0,e.y,this._radius),r=e.x/this._radius;return te.RotationYawPitchRollToRef(r,0,0,me.Matrix[0]),y.TransformNormal(i,me.Matrix[0])},t}(Ep),RX="fluentVertexShader",OX=`precision highp float;
|
|
13298
13298
|
|
|
13299
13299
|
attribute vec3 position;
|
|
@@ -16063,7 +16063,7 @@ vReflectionMapTexCoord.z=worldPos.w;
|
|
|
16063
16063
|
#endif
|
|
16064
16064
|
#include<logDepthVertex>
|
|
16065
16065
|
}
|
|
16066
|
-
`;ce.ShadersStore[J6]=eK;var tK=function(n){j(t,n);function t(){var e=n.call(this)||this;return e.BUMP=!1,e.REFLECTION=!1,e.CLIPPLANE=!1,e.CLIPPLANE2=!1,e.CLIPPLANE3=!1,e.CLIPPLANE4=!1,e.CLIPPLANE5=!1,e.CLIPPLANE6=!1,e.ALPHATEST=!1,e.DEPTHPREPASS=!1,e.POINTSIZE=!1,e.FOG=!1,e.NORMAL=!1,e.UV1=!1,e.UV2=!1,e.VERTEXCOLOR=!1,e.VERTEXALPHA=!1,e.NUM_BONE_INFLUENCERS=0,e.BonesPerMesh=0,e.INSTANCES=!1,e.SPECULARTERM=!1,e.LOGARITHMICDEPTH=!1,e.FRESNELSEPARATE=!1,e.BUMPSUPERIMPOSE=!1,e.BUMPAFFECTSREFLECTION=!1,e.IMAGEPROCESSING=!1,e.VIGNETTE=!1,e.VIGNETTEBLENDMODEMULTIPLY=!1,e.VIGNETTEBLENDMODEOPAQUE=!1,e.TONEMAPPING=!1,e.TONEMAPPING_ACES=!1,e.CONTRAST=!1,e.EXPOSURE=!1,e.COLORCURVES=!1,e.COLORGRADING=!1,e.COLORGRADING3D=!1,e.SAMPLER3DGREENDEPTH=!1,e.SAMPLER3DBGRMAP=!1,e.IMAGEPROCESSINGPOSTPROCESS=!1,e.rebuild(),e}return t}(Er),iK=function(n){j(t,n);function t(e,i,r){r===void 0&&(r=new Ie(512,512));var o=n.call(this,e,i)||this;return o.renderTargetSize=r,o.diffuseColor=new _e(1,1,1),o.specularColor=new _e(0,0,0),o.specularPower=64,o._disableLighting=!1,o._maxSimultaneousLights=4,o.windForce=6,o.windDirection=new Ie(0,1),o.waveHeight=.4,o.bumpHeight=.4,o._bumpSuperimpose=!1,o._fresnelSeparate=!1,o._bumpAffectsReflection=!1,o.waterColor=new _e(.1,.1,.6),o.colorBlendFactor=.2,o.waterColor2=new _e(.1,.1,.6),o.colorBlendFactor2=.2,o.waveLength=.1,o.waveSpeed=1,o.waveCount=20,o.disableClipPlane=!1,o._renderTargets=new yr(16),o._mesh=null,o._reflectionTransform=te.Zero(),o._lastTime=0,o._lastDeltaTime=0,o._createRenderTargets(i,r),o.getRenderTargetTextures=function(){return o._renderTargets.reset(),o._renderTargets.push(o._reflectionRTT),o._renderTargets.push(o._refractionRTT),o._renderTargets},o._imageProcessingConfiguration=o.getScene().imageProcessingConfiguration,o._imageProcessingConfiguration&&(o._imageProcessingObserver=o._imageProcessingConfiguration.onUpdateParameters.add(function(){o._markAllSubMeshesAsImageProcessingDirty()})),o}return Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported,this._markAllSubMeshesAsMiscDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this._refractionRTT},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionTexture",{get:function(){return this._reflectionRTT},enumerable:!1,configurable:!0}),t.prototype.addToRenderList=function(e){this._refractionRTT&&this._refractionRTT.renderList&&this._refractionRTT.renderList.push(e),this._reflectionRTT&&this._reflectionRTT.renderList&&this._reflectionRTT.renderList.push(e)},t.prototype.enableRenderTargets=function(e){var i=e?1:0;this._refractionRTT&&(this._refractionRTT.refreshRate=i),this._reflectionRTT&&(this._reflectionRTT.refreshRate=i)},t.prototype.getRenderList=function(){return this._refractionRTT?this._refractionRTT.renderList:[]},Object.defineProperty(t.prototype,"renderTargetsEnabled",{get:function(){return!(this._refractionRTT&&this._refractionRTT.refreshRate===0)},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,i,r){if(this.isFrozen&&i.effect&&i.effect._wasPreviouslyReady)return!0;i._materialDefines||(i._materialDefines=new tK);var o=i._materialDefines,a=this.getScene();if(this._isReadyForSubMesh(i))return!0;var s=a.getEngine();if(o._areTexturesDirty&&(o._needUVs=!1,a.texturesEnabled)){if(this.bumpTexture&&ke.BumpTextureEnabled)if(this.bumpTexture.isReady())o._needUVs=!0,o.BUMP=!0;else return!1;ke.ReflectionTextureEnabled&&(o.REFLECTION=!0)}if(oe.PrepareDefinesForFrameBoundValues(a,s,o,!!r),oe.PrepareDefinesForMisc(e,a,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),o._areMiscDirty&&(this._fresnelSeparate&&(o.FRESNELSEPARATE=!0),this._bumpSuperimpose&&(o.BUMPSUPERIMPOSE=!0),this._bumpAffectsReflection&&(o.BUMPAFFECTSREFLECTION=!0)),o._needNormals=oe.PrepareDefinesForLights(a,e,o,!0,this._maxSimultaneousLights,this._disableLighting),o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o),o.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,o.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}if(oe.PrepareDefinesForAttributes(e,o,!0,!0),this._mesh=e,this._waitingRenderList){for(var l=0;l<this._waitingRenderList.length;l++)this.addToRenderList(a.getNodeByID(this._waitingRenderList[l]));this._waitingRenderList=null}if(o.isDirty){o.markAsProcessed(),a.resetCachedMaterial();var u=new Tr;o.FOG&&u.addFallback(1,"FOG"),o.LOGARITHMICDEPTH&&u.addFallback(0,"LOGARITHMICDEPTH"),oe.HandleFallbacksForShadows(o,u,this.maxSimultaneousLights),o.NUM_BONE_INFLUENCERS>0&&u.addCPUSkinningFallback(0,e);var f=[I.PositionKind];o.NORMAL&&f.push(I.NormalKind),o.UV1&&f.push(I.UVKind),o.UV2&&f.push(I.UV2Kind),o.VERTEXCOLOR&&f.push(I.ColorKind),oe.PrepareAttributesForBones(f,e,o,u),oe.PrepareAttributesForInstances(f,o);var c="water",h=o.toString(),p=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","vNormalInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","normalMatrix","logarithmicDepthConstant","worldReflectionViewProjection","windDirection","waveLength","time","windForce","cameraPosition","bumpHeight","waveHeight","waterColor","waterColor2","colorBlendFactor","colorBlendFactor2","waveSpeed","waveCount"],_=["normalSampler","refractionSampler","reflectionSampler"],g=new Array;Hi&&(Hi.PrepareUniforms(p,o),Hi.PrepareSamplers(_,o)),oe.PrepareUniformsAndSamplersList({uniformsNames:p,uniformBuffersNames:g,samplers:_,defines:o,maxSimultaneousLights:this.maxSimultaneousLights}),i.setEffect(a.getEngine().createEffect(c,{attributes:f,uniformsNames:p,uniformBuffersNames:g,samplers:_,defines:h,fallbacks:u,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},s),o)}return!i.effect||!i.effect.isReady()?!1:(o._renderId=a.getRenderId(),i.effect._wasPreviouslyReady=!0,!0)},t.prototype.bindForSubMesh=function(e,i,r){var o=this.getScene(),a=r._materialDefines;if(a){var s=r.effect;if(!(!s||!this._mesh)){this._activeEffect=s,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),oe.BindBonesParameters(i,this._activeEffect),this._mustRebind(o,s)&&(this.bumpTexture&&ke.BumpTextureEnabled&&(this._activeEffect.setTexture("normalSampler",this.bumpTexture),this._activeEffect.setFloat2("vNormalInfos",this.bumpTexture.coordinatesIndex,this.bumpTexture.level),this._activeEffect.setMatrix("normalMatrix",this.bumpTexture.getTextureMatrix())),oe.BindClipPlane(this._activeEffect,o),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),oe.BindEyePosition(s,o)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*i.visibility),a.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),o.lightsEnabled&&!this.disableLighting&&oe.BindLights(o,i,this._activeEffect,a,this.maxSimultaneousLights),o.fogEnabled&&i.applyFog&&o.fogMode!==Ke.FOGMODE_NONE&&this._activeEffect.setMatrix("view",o.getViewMatrix()),oe.BindFogParameters(o,i,this._activeEffect),oe.BindLogDepth(a,this._activeEffect,o),ke.ReflectionTextureEnabled&&(this._activeEffect.setTexture("refractionSampler",this._refractionRTT),this._activeEffect.setTexture("reflectionSampler",this._reflectionRTT));var l=this._mesh.getWorldMatrix().multiply(this._reflectionTransform).multiply(o.getProjectionMatrix()),u=o.getEngine().getDeltaTime();u!==this._lastDeltaTime&&(this._lastDeltaTime=u,this._lastTime+=this._lastDeltaTime),this._activeEffect.setMatrix("worldReflectionViewProjection",l),this._activeEffect.setVector2("windDirection",this.windDirection),this._activeEffect.setFloat("waveLength",this.waveLength),this._activeEffect.setFloat("time",this._lastTime/1e5),this._activeEffect.setFloat("windForce",this.windForce),this._activeEffect.setFloat("waveHeight",this.waveHeight),this._activeEffect.setFloat("bumpHeight",this.bumpHeight),this._activeEffect.setColor4("waterColor",this.waterColor,1),this._activeEffect.setFloat("colorBlendFactor",this.colorBlendFactor),this._activeEffect.setColor4("waterColor2",this.waterColor2,1),this._activeEffect.setFloat("colorBlendFactor2",this.colorBlendFactor2),this._activeEffect.setFloat("waveSpeed",this.waveSpeed),this._activeEffect.setFloat("waveCount",this.waveCount),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect),this._afterBind(i,this._activeEffect)}}},t.prototype._createRenderTargets=function(e,i){var r=this;this._refractionRTT=new ji(name+"_refraction",{width:i.x,height:i.y},e,!1,!0),this._refractionRTT.wrapU=To.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.wrapV=To.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.ignoreCameraViewport=!0,this._reflectionRTT=new ji(name+"_reflection",{width:i.x,height:i.y},e,!1,!0),this._reflectionRTT.wrapU=To.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.wrapV=To.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.ignoreCameraViewport=!0;var o,a=null,s,l=te.Zero();this._refractionRTT.onBeforeRender=function(){if(r._mesh&&(o=r._mesh.isVisible,r._mesh.isVisible=!1),!r.disableClipPlane){a=e.clipPlane;var u=r._mesh?r._mesh.position.y:0;e.clipPlane=zo.FromPositionAndNormal(new y(0,u+.05,0),new y(0,1,0))}},this._refractionRTT.onAfterRender=function(){r._mesh&&(r._mesh.isVisible=o),r.disableClipPlane||(e.clipPlane=a)},this._reflectionRTT.onBeforeRender=function(){if(r._mesh&&(o=r._mesh.isVisible,r._mesh.isVisible=!1),!r.disableClipPlane){a=e.clipPlane;var u=r._mesh?r._mesh.position.y:0;e.clipPlane=zo.FromPositionAndNormal(new y(0,u-.05,0),new y(0,-1,0)),te.ReflectionToRef(e.clipPlane,l)}s=e.getViewMatrix(),l.multiplyToRef(s,r._reflectionTransform),e.setTransformMatrix(r._reflectionTransform,e.getProjectionMatrix()),e.getEngine().cullBackFaces=!1,e._mirroredCameraPosition=y.TransformCoordinates(e.activeCamera.position,l)},this._reflectionRTT.onAfterRender=function(){r._mesh&&(r._mesh.isVisible=o),e.clipPlane=a,e.setTransformMatrix(s,e.getProjectionMatrix()),e.getEngine().cullBackFaces=!0,e._mirroredCameraPosition=null}},t.prototype.getAnimatables=function(){var e=[];return this.bumpTexture&&this.bumpTexture.animations&&this.bumpTexture.animations.length>0&&e.push(this.bumpTexture),this._reflectionRTT&&this._reflectionRTT.animations&&this._reflectionRTT.animations.length>0&&e.push(this._reflectionRTT),this._refractionRTT&&this._refractionRTT.animations&&this._refractionRTT.animations.length>0&&e.push(this._refractionRTT),e},t.prototype.getActiveTextures=function(){var e=n.prototype.getActiveTextures.call(this);return this._bumpTexture&&e.push(this._bumpTexture),e},t.prototype.hasTexture=function(e){return!!(n.prototype.hasTexture.call(this,e)||this._bumpTexture===e)},t.prototype.dispose=function(e){this.bumpTexture&&this.bumpTexture.dispose();var i=this.getScene().customRenderTargets.indexOf(this._refractionRTT);i!=-1&&this.getScene().customRenderTargets.splice(i,1),i=-1,i=this.getScene().customRenderTargets.indexOf(this._reflectionRTT),i!=-1&&this.getScene().customRenderTargets.splice(i,1),this._reflectionRTT&&this._reflectionRTT.dispose(),this._refractionRTT&&this._refractionRTT.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),n.prototype.dispose.call(this,e)},t.prototype.clone=function(e){var i=this;return Be.Clone(function(){return new t(e,i.getScene())},this)},t.prototype.serialize=function(){var e=Be.Serialize(this);if(e.customType="BABYLON.WaterMaterial",e.renderList=[],this._refractionRTT&&this._refractionRTT.renderList)for(var i=0;i<this._refractionRTT.renderList.length;i++)e.renderList.push(this._refractionRTT.renderList[i].id);return e},t.prototype.getClassName=function(){return"WaterMaterial"},t.Parse=function(e,i,r){var o=Be.Parse(function(){return new t(e.name,i)},e,i,r);return o._waitingRenderList=e.renderList,o},t.CreateDefaultMesh=function(e,i){var r=ne.CreateGround(e,512,512,32,i,!1);return r},R([at("bumpTexture")],t.prototype,"_bumpTexture",void 0),R([ye("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),R([Vt()],t.prototype,"diffuseColor",void 0),R([Vt()],t.prototype,"specularColor",void 0),R([w()],t.prototype,"specularPower",void 0),R([w("disableLighting")],t.prototype,"_disableLighting",void 0),R([ye("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),R([w("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),R([ye("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),R([w()],t.prototype,"windForce",void 0),R([Pb()],t.prototype,"windDirection",void 0),R([w()],t.prototype,"waveHeight",void 0),R([w()],t.prototype,"bumpHeight",void 0),R([w("bumpSuperimpose")],t.prototype,"_bumpSuperimpose",void 0),R([ye("_markAllSubMeshesAsMiscDirty")],t.prototype,"bumpSuperimpose",void 0),R([w("fresnelSeparate")],t.prototype,"_fresnelSeparate",void 0),R([ye("_markAllSubMeshesAsMiscDirty")],t.prototype,"fresnelSeparate",void 0),R([w("bumpAffectsReflection")],t.prototype,"_bumpAffectsReflection",void 0),R([ye("_markAllSubMeshesAsMiscDirty")],t.prototype,"bumpAffectsReflection",void 0),R([Vt()],t.prototype,"waterColor",void 0),R([w()],t.prototype,"colorBlendFactor",void 0),R([Vt()],t.prototype,"waterColor2",void 0),R([w()],t.prototype,"colorBlendFactor2",void 0),R([w()],t.prototype,"waveLength",void 0),R([w()],t.prototype,"waveSpeed",void 0),R([w()],t.prototype,"waveCount",void 0),R([w()],t.prototype,"disableClipPlane",void 0),R([w()],t.prototype,"useLogarithmicDepth",null),t}(wr);Ae.RegisteredTypes["BABYLON.WaterMaterial"]=iK;function rK(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)}const nK=["data:EnvironmentBRDFTexture0","GlowLayerBlurRTT","GlowLayerBlurRTT2","HighlightLayerMainRTT"];function oK(n,t,e){async function i(u,f){return Ee.CreateScreenshotUsingRenderTargetAsync(n,e,{width:u,height:f},void 0,void 0,!0)}async function r(u){e.inertialRadiusOffset=e.inertialRadiusOffset+u}async function o(u){const{x:f,y:c,z:h}=u;e.target.x=f||0,e.target.y=c||0,e.target.z=h||0}async function a(u){const{alpha:f,beta:c,radius:h}=u;f&&(e.alpha=e.alpha+f),c&&(e.beta=e.beta+c),h&&(e.radius=e.radius+h)}async function s(){const u=t.meshes.filter(p=>!p.name.toLowerCase().includes("collider")).reduce((p,_)=>p+Math.floor(_.getTotalIndices()/3),0),f=t.materials.length,c=t.meshes.length,h=t.textures.filter(p=>p.name&&!nK.includes(p.name)).length;return{triangles:u,materials:f,meshes:c,textures:h,bodies:c,entities:1}}async function l(){}return{getScreenshot:i,getMetrics:s,panCamera:o,changeZoom:r,changeCameraPosition:a,cleanup:l}}var aK={};const aD=aK.VITE_REACT_APP_DEBUG;let tM=!1;const sK=async()=>{aD&&!tM&&(await pX(()=>import("./babylon.inspector.bundle.max-BeSzUjE_.js").then(n=>n.b),[],import.meta.url),tM=!0)};function lK(n){const t=n.getChildren().filter(e=>e.id!=="__root__");if(t.length>0){const e=t[0];let i=e.getBoundingInfo(),r=i.boundingBox.minimumWorld.add(e.position),o=i.boundingBox.maximumWorld.add(e.position);for(let a=1;a<t.length;a++){const s=t[a];i=s.getBoundingInfo();const l=i.boundingBox.minimumWorld.add(s.position),u=i.boundingBox.maximumWorld.add(s.position);r=y.Minimize(r,l),o=y.Maximize(o,u)}n.setBoundingInfo(new hr(r,o))}}let Ul;async function uK(n,t){Ul&&Ul.dispose(),Ul=new Me(n,!0,{preserveDrawingBuffer:!0,stencil:!0,antialias:!0});const e=new Ke(Ul);if(e.autoClear=!0,e.clearColor=t.background.transparent?new Je(0,0,0,0):Fy(t.background.color).toColor4(),e.ambientColor=new _e(1,1,1),e.preventDefaultOnPointerDown=!1,t.showSceneBoundaries){const s=Vv.CreateGround("ground",{width:6,height:6},e),l=Vv.CreateGround("ground",{width:6,height:6},e);l.rotate(Mi.Z,Math.PI),l.position.y=-.05;const u=new oD("groundMaterial",e);u.mainColor=new _e(1,1,1),u.lineColor=new _e(0,0,0),u.majorUnitFrequency=0,s.material=u,l.material=u;const f=Vv.CreateCylinder("boundaries",{diameter:2,height:3}),c=new Mt("boundariesMaterial",e);c.alpha=.3,c.diffuseColor=new _e(1,45/255,85/255),f.material=c,f.position.y=1.51}if(t.showThumbnailBoundaries){const s=Jb.CreateFullscreenUI("UI"),l=new so;l.width=.5,l.height=1,l.color="#736E7D",l.thickness=2,s.addControl(l)}const i=new tl("camera",0,0,0,new y(0,0,0),e);switch(i.position=new y(t.cameraX,t.cameraY,t.cameraZ),i.minZ=.1,t.projection){case Ce.PreviewProjection.PERSPECTIVE:{i.mode=dt.PERSPECTIVE_CAMERA;break}case Ce.PreviewProjection.ORTHOGRAPHIC:{i.mode=dt.ORTHOGRAPHIC_CAMERA,i.orthoTop=1,i.orthoBottom=-1,i.orthoLeft=-1,i.orthoRight=1;break}}t.type===Ce.PreviewType.WEARABLE&&qI(i,t),t.camera===Ce.PreviewCamera.INTERACTIVE&&i.attachControl(n,!0);const r=new y(t.offsetX,t.offsetY,t.offsetZ);if(i.position.addInPlace(r),i.setTarget(r),i.lowerRadiusLimit=i.radius/t.zoom,i.upperRadiusLimit=i.lowerRadiusLimit*t.wheelZoom,i.radius=i.lowerRadiusLimit+(i.upperRadiusLimit-i.lowerRadiusLimit)*t.wheelStart/100,i.wheelPrecision=t.wheelPrecision,t.panning||(i.panningSensibility=0),t.lockBeta&&(i.lowerBetaLimit=i.beta,i.upperBetaLimit=i.beta),t.lockAlpha&&(i.lowerAlphaLimit=i.alpha,i.upperAlphaLimit=i.alpha),t.lockRadius&&(i.lowerRadiusLimit=i.radius,i.upperRadiusLimit=i.radius),t.type===Ce.PreviewType.WEARABLE){const s=new pu("directional",new y(0,0,1),e);s.intensity=1;const l=new _u("spot",new y(-2,2,2),new y(2,-2,-2),Math.PI/2,1e3,e);l.intensity=1}const o=new jo("top",new y(0,-1,0),e);o.intensity=1;const a=new jo("bottom",new y(0,1,0),e);if(a.intensity=1,!rK()){const s=new pp("glow",e);s.intensity=2}return Ul.runRenderLoop(()=>{e.render()}),aD&&(await sK(),e.debugLayer.show({showExplorer:!0,embedMode:!0})),[e,oK(Ul,e,i)]}async function fK(n,t,e){const i=t.id,o=mu(t,e).contents.find(a=>a.key.toLowerCase().endsWith("_mask.png"));return o?new Promise((a,s)=>{const l=new Xb(i,o.url,!0,!1);l.onError=()=>s(l.errorObject),l.onSuccess=()=>{a(l.texture)},l.run(n,()=>a(l.texture),s)}):null}async function cK(n,t,e){const i=t.id,o=mu(t,e).contents.find(a=>a.key.toLowerCase().endsWith(".png")&&!a.key.toLowerCase().endsWith("_mask.png"));return o?new Promise((a,s)=>{const l=new Xb(i,o.url,!0,!1);l.onError=()=>s(l.errorObject),l.onSuccess=()=>{a(l.texture)},l.run(n,()=>a(l.texture),s)}):null}function hK(n,t,e){return new Promise((i,r)=>{var u;const o=(u=t.contents.find(f=>e!==null?e?f.key.toLowerCase().endsWith(e.toLowerCase()):null:f.key.toLowerCase().endsWith(".mp3")||f.key.toLowerCase().endsWith("ogg")))==null?void 0:u.url;if(!o)return i(null);const a=new LI("Sound task",o),s=()=>i(new iu("music",a.data,n,null,{spatialSound:!0})),l=f=>r(f);a.run(n,s,l)})}async function sD(n,t){const e=async(i,r)=>$t.LoadAssetContainerAsync(i,"",n,null,r);try{return await e(t,".glb")}catch{return await e(t,".gltf")}}function dK(n){const t=new ne("parent",n);for(const a of n.meshes)a!==t&&a.setParent(t);lK(t);const i=t.getBoundingInfo().boundingBox.extendSize.length(),r=new y(1/i,1/i,1/i);t.scaling=r;const o=t.getBoundingInfo().boundingBox.center.multiply(r);t.position.subtractInPlace(o)}const pK=[Ce.PreviewEmote.IDLE,Ce.PreviewEmote.MONEY,Ce.PreviewEmote.CLAP,Ce.PreviewEmote.WALK,Ce.PreviewEmote.RUN,Ce.PreviewEmote.JUMP];let Cd;function _K(n){return pK.includes(n)}function mK(n){let t="";t.endsWith("/")||(t+="/");const e=`./emotes/${n}.glb`;return t.startsWith("http")?new URL(e,t).href:e}async function lD(n,t){const e=await sD(n,t);if(e.animationGroups.length===0)throw new Error(`No animation groups found for emote with url=${t}`);return e}async function gK(n,t,e){const i=Kb(t,e.bodyShape),r=i.contents.find(o=>o.key===i.mainFile);if(!r)throw new Error(`Could not find a valid content in representation for emote=${t.id} and bodyShape=${e.bodyShape}`);return lD(n,r.url)}function vK(n,t,e){const i=Kb(t,e.bodyShape),r=e.socialEmote?e.socialEmote.audio:null;return hK(n,i,r)}async function yK(n,t,e,i){var u,f,c;let r,o=!!e.emote&&_K(e.emote),a=null;if(e.item&&ko(e.item))try{r=await gK(n,e.item,e),o=e.socialEmote?e.socialEmote.loop:e.item.emoteDataADR74.loop,a=await vK(n,e.item,e)}catch{console.warn(`Could not load emote=${e.item.id}`)}if(!r&&e.emote){const h=mK(e.emote);r=await lD(n,h)}r&&r.animationGroups.length>1&&(r.addAllToScene(),n.stopAllAnimations());const s=new Rb("emote",n);function l(){if(e.camera!==Ce.PreviewCamera.STATIC){const h=n.cameras[0];qI(h,e)}}try{for(const p of t){const _=new Map,g=[...p.container.transformNodes,...p.container.meshes];for(const v of g){const E=v.name.replace(/\.\d+$/,""),T=_.get(E)||[];T.push(v),_.set(E,T)}if(r&&r.animationGroups.length>0){for(const v of r.animationGroups)if(!(e.socialEmote&&!nX(v,e.socialEmote)))for(const E of v.targetedAnimations){const T=E.animation.clone(),S=E.target,C=E.animation.getKeys();if(T.setKeys([...C]),e.socialEmote){const O=((u=e.socialEmote.Armature)==null?void 0:u.animation)&&v.name.toLowerCase().startsWith(e.socialEmote.Armature.animation.toLowerCase()),A=((f=e.socialEmote.Armature_Other)==null?void 0:f.animation)&&v.name.toLowerCase().startsWith(e.socialEmote.Armature_Other.animation.toLowerCase()),M=((c=e.socialEmote.Armature_Prop)==null?void 0:c.animation)&&v.name.toLowerCase().startsWith(e.socialEmote.Armature_Prop.animation.toLowerCase());if(O&&!A&&!M){const D=S.name.replace(/\.\d+$/,""),U=_.get(D)||[];if(U.length>0)for(const V of U){const B=T.clone();B.setKeys([...C]),s.addTargetedAnimation(B,V)}else console.warn("No matching bone found for",S.name)}else if(A){const D=S.name.replace(/\.\d+$/,""),U=_.get(D)||[];if(U.length>0)for(const V of U){const B=i==null?void 0:i.get(V);if(!B)continue;const z=T.clone();z.setKeys([...C]),s.addTargetedAnimation(z,B)}else console.warn("No matching bone found for",S.name)}else M&&s.addTargetedAnimation(T,S)}else if(r.animationGroups.length===1||v.name.toLowerCase().includes("avatar")||S.name.startsWith("Avatar_")){const A=S.name.replace(/\.\d+$/,""),M=_.get(A)||[];if(M.length>0)for(const D of M){const U=T.clone();U.setKeys([...C]),s.addTargetedAnimation(U,D)}else console.warn("No matching bone found for",S.name)}else s.addTargetedAnimation(T,S)}}}s.onAnimationGroupEndObservable.addOnce(l);const h=bK(s,o,a,e.item);return e.camera===Ce.PreviewCamera.STATIC&&h.stop(),h}catch(h){console.warn(`Could not play emote=${e.emote}`,h)}}function bK(n,t,e,i){Me.audioEngine.useCustomUnlockedButton=!0,Me.audioEngine.setGlobalVolume(0);let r,o=!1;async function a(){return Math.max(n.to,0)}async function s(){return n.isPlaying}async function l(){return!!e}async function u(C){o=!0;const O=await s();O&&n.pause(),n.stop(),n.start(!1,1,C,C,!1),r=C,o=!0,O&&f()}async function f(){await s()||(r?(n.start(t,1,r,await a(),!1),e&&(e.stop(),e._startOffset=r,e.play()),r=0):(n.play(t),e==null||e.play()))}async function c(){await s()&&(n.pause(),e==null||e.pause())}async function h(){n.goToFrame(0),n.stop(),e==null||e.stop()}async function p(){e&&(Me.audioEngine.unlock(),Me.audioEngine.setGlobalVolume(1),n.isPlaying&&!e.isPlaying&&e.play(void 0,n.targetedAnimations[0].animation.runtimeAnimations[0].currentFrame))}async function _(){e&&Me.audioEngine.setGlobalVolume(0)}async function g(){return i&&i.emoteDataADR74&&!!i.emoteDataADR74.startAnimation&&!!i.emoteDataADR74.outcomes&&i.emoteDataADR74.outcomes.length>0}async function v(){return await g()?[{title:"Start Animation",...i.emoteDataADR74.startAnimation},...i.emoteDataADR74.outcomes.map(C=>({title:C.title,loop:C.loop,audio:C.audio,...C.clips}))]:null}const E=Sb(),T=()=>(Cd&&clearInterval(Cd),window.setInterval(async()=>{var C;if(await s()&&n.animatables[0].masterFrame>0)return E.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,{length:(C=n.animatables[0])==null?void 0:C.masterFrame})},10)),S=()=>{clearInterval(Cd),o||E.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,{length:n.to})};return n.onAnimationGroupPlayObservable.add(()=>(Cd=T(),E.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAY))),n.onAnimationGroupPauseObservable.add(()=>{E.emit(Ce.PreviewEmoteEventType.ANIMATION_PAUSE)}),n.onAnimationGroupLoopObservable.add(()=>(e==null||e.stop(),e==null||e.play(),o&&(h(),f(),o=!1),E.emit(Ce.PreviewEmoteEventType.ANIMATION_LOOP))),n.onAnimationGroupEndObservable.add(()=>(S(),t||(o=!1),E.emit(Ce.PreviewEmoteEventType.ANIMATION_END))),{getLength:a,isPlaying:s,goTo:u,play:f,pause:c,stop:h,enableSound:p,disableSound:_,hasSound:l,events:E,emote:i,isSocialEmote:g,getSocialEmoteAnimations:v}}function EK(n,t,e){return async i=>{const r=t.find(eX(i));return r?Promise.all([cK(n,r,e),fK(n,r,e)]):[null,null]}}async function TK(n,t,e){const i=EK(n,t,e),[r,o,a]=await Promise.all([i(Ce.WearableCategory.EYES),i(Ce.WearableCategory.EYEBROWS),i(Ce.WearableCategory.MOUTH)]);return{eyes:r,eyebrows:o,mouth:a}}async function SK(n,t,e,i,r,o){for(const a of t.container.meshes){if(a.name.toLowerCase().endsWith("mask_eyes")){const[s,l]=e;s?fy(n,"eyes",a,s,o.eyes,l,"#ffffff"):a.setEnabled(!1)}if(a.name.toLowerCase().endsWith("mask_eyebrows")){const[s,l]=i;s?fy(n,"eyebrows",a,s,o.hair,l,o.hair):a.setEnabled(!1)}if(a.name.toLowerCase().endsWith("mask_mouth")){const[s,l]=r;s?fy(n,"mouth",a,s,o.skin,l,o.skin):a.setEnabled(!1)}}}function fy(n,t,e,i,r,o,a){const s=new Mt(`${t}_standard_material`,n);s.alphaMode=Ci.PBRMATERIAL_ALPHABLEND,s.backFaceCulling=!0,s.specularColor=_e.Black(),i.hasAlpha=!0,s.sideOrientation=qs.CW,s.diffuseTexture=i,s.diffuseColor=o?_e.Black():Fy(a),o&&(s.emissiveTexture=o,s.diffuseColor=Fy(r)),e.material=s}function CK(n,t,e=Ce.BodyShape.MALE){const i={};for(const r of n)try{const o=mu(r,e);for(const a of o.contents)i[a.key]=a.url}catch{console.warn(`Skipping generation of mappings for wearable="${r.id}" since it lacks a representation for bodyShape="${e}"`);continue}if(t){const r=Kb(t,e);for(const o of r.contents)i[o.key]=o.url}return i}function PK(n){const t=as(n.item)?[n.item,...n.wearables]:n.wearables,e=ko(n.item)?n.item:void 0,i=CK(t,e,n.bodyShape);$t.OnPluginActivatedObservable.add(r=>{if(r.name==="gltf"){const o=r;o.preprocessUrlAsync=async a=>{const l=a.split("/").pop();if(!l)return a;const f=Object.keys(i).find(c=>c.endsWith(l));return i[f]||a}}})}const AK=`float angleY = 3.14 / 2.0;
|
|
16066
|
+
`;ce.ShadersStore[J6]=eK;var tK=function(n){j(t,n);function t(){var e=n.call(this)||this;return e.BUMP=!1,e.REFLECTION=!1,e.CLIPPLANE=!1,e.CLIPPLANE2=!1,e.CLIPPLANE3=!1,e.CLIPPLANE4=!1,e.CLIPPLANE5=!1,e.CLIPPLANE6=!1,e.ALPHATEST=!1,e.DEPTHPREPASS=!1,e.POINTSIZE=!1,e.FOG=!1,e.NORMAL=!1,e.UV1=!1,e.UV2=!1,e.VERTEXCOLOR=!1,e.VERTEXALPHA=!1,e.NUM_BONE_INFLUENCERS=0,e.BonesPerMesh=0,e.INSTANCES=!1,e.SPECULARTERM=!1,e.LOGARITHMICDEPTH=!1,e.FRESNELSEPARATE=!1,e.BUMPSUPERIMPOSE=!1,e.BUMPAFFECTSREFLECTION=!1,e.IMAGEPROCESSING=!1,e.VIGNETTE=!1,e.VIGNETTEBLENDMODEMULTIPLY=!1,e.VIGNETTEBLENDMODEOPAQUE=!1,e.TONEMAPPING=!1,e.TONEMAPPING_ACES=!1,e.CONTRAST=!1,e.EXPOSURE=!1,e.COLORCURVES=!1,e.COLORGRADING=!1,e.COLORGRADING3D=!1,e.SAMPLER3DGREENDEPTH=!1,e.SAMPLER3DBGRMAP=!1,e.IMAGEPROCESSINGPOSTPROCESS=!1,e.rebuild(),e}return t}(Er),iK=function(n){j(t,n);function t(e,i,r){r===void 0&&(r=new Ie(512,512));var o=n.call(this,e,i)||this;return o.renderTargetSize=r,o.diffuseColor=new _e(1,1,1),o.specularColor=new _e(0,0,0),o.specularPower=64,o._disableLighting=!1,o._maxSimultaneousLights=4,o.windForce=6,o.windDirection=new Ie(0,1),o.waveHeight=.4,o.bumpHeight=.4,o._bumpSuperimpose=!1,o._fresnelSeparate=!1,o._bumpAffectsReflection=!1,o.waterColor=new _e(.1,.1,.6),o.colorBlendFactor=.2,o.waterColor2=new _e(.1,.1,.6),o.colorBlendFactor2=.2,o.waveLength=.1,o.waveSpeed=1,o.waveCount=20,o.disableClipPlane=!1,o._renderTargets=new yr(16),o._mesh=null,o._reflectionTransform=te.Zero(),o._lastTime=0,o._lastDeltaTime=0,o._createRenderTargets(i,r),o.getRenderTargetTextures=function(){return o._renderTargets.reset(),o._renderTargets.push(o._reflectionRTT),o._renderTargets.push(o._refractionRTT),o._renderTargets},o._imageProcessingConfiguration=o.getScene().imageProcessingConfiguration,o._imageProcessingConfiguration&&(o._imageProcessingObserver=o._imageProcessingConfiguration.onUpdateParameters.add(function(){o._markAllSubMeshesAsImageProcessingDirty()})),o}return Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported,this._markAllSubMeshesAsMiscDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this._refractionRTT},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionTexture",{get:function(){return this._reflectionRTT},enumerable:!1,configurable:!0}),t.prototype.addToRenderList=function(e){this._refractionRTT&&this._refractionRTT.renderList&&this._refractionRTT.renderList.push(e),this._reflectionRTT&&this._reflectionRTT.renderList&&this._reflectionRTT.renderList.push(e)},t.prototype.enableRenderTargets=function(e){var i=e?1:0;this._refractionRTT&&(this._refractionRTT.refreshRate=i),this._reflectionRTT&&(this._reflectionRTT.refreshRate=i)},t.prototype.getRenderList=function(){return this._refractionRTT?this._refractionRTT.renderList:[]},Object.defineProperty(t.prototype,"renderTargetsEnabled",{get:function(){return!(this._refractionRTT&&this._refractionRTT.refreshRate===0)},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,i,r){if(this.isFrozen&&i.effect&&i.effect._wasPreviouslyReady)return!0;i._materialDefines||(i._materialDefines=new tK);var o=i._materialDefines,a=this.getScene();if(this._isReadyForSubMesh(i))return!0;var s=a.getEngine();if(o._areTexturesDirty&&(o._needUVs=!1,a.texturesEnabled)){if(this.bumpTexture&&ke.BumpTextureEnabled)if(this.bumpTexture.isReady())o._needUVs=!0,o.BUMP=!0;else return!1;ke.ReflectionTextureEnabled&&(o.REFLECTION=!0)}if(oe.PrepareDefinesForFrameBoundValues(a,s,o,!!r),oe.PrepareDefinesForMisc(e,a,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),o._areMiscDirty&&(this._fresnelSeparate&&(o.FRESNELSEPARATE=!0),this._bumpSuperimpose&&(o.BUMPSUPERIMPOSE=!0),this._bumpAffectsReflection&&(o.BUMPAFFECTSREFLECTION=!0)),o._needNormals=oe.PrepareDefinesForLights(a,e,o,!0,this._maxSimultaneousLights,this._disableLighting),o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o),o.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,o.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}if(oe.PrepareDefinesForAttributes(e,o,!0,!0),this._mesh=e,this._waitingRenderList){for(var l=0;l<this._waitingRenderList.length;l++)this.addToRenderList(a.getNodeByID(this._waitingRenderList[l]));this._waitingRenderList=null}if(o.isDirty){o.markAsProcessed(),a.resetCachedMaterial();var u=new Tr;o.FOG&&u.addFallback(1,"FOG"),o.LOGARITHMICDEPTH&&u.addFallback(0,"LOGARITHMICDEPTH"),oe.HandleFallbacksForShadows(o,u,this.maxSimultaneousLights),o.NUM_BONE_INFLUENCERS>0&&u.addCPUSkinningFallback(0,e);var f=[I.PositionKind];o.NORMAL&&f.push(I.NormalKind),o.UV1&&f.push(I.UVKind),o.UV2&&f.push(I.UV2Kind),o.VERTEXCOLOR&&f.push(I.ColorKind),oe.PrepareAttributesForBones(f,e,o,u),oe.PrepareAttributesForInstances(f,o);var c="water",h=o.toString(),p=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","vNormalInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","normalMatrix","logarithmicDepthConstant","worldReflectionViewProjection","windDirection","waveLength","time","windForce","cameraPosition","bumpHeight","waveHeight","waterColor","waterColor2","colorBlendFactor","colorBlendFactor2","waveSpeed","waveCount"],_=["normalSampler","refractionSampler","reflectionSampler"],g=new Array;Hi&&(Hi.PrepareUniforms(p,o),Hi.PrepareSamplers(_,o)),oe.PrepareUniformsAndSamplersList({uniformsNames:p,uniformBuffersNames:g,samplers:_,defines:o,maxSimultaneousLights:this.maxSimultaneousLights}),i.setEffect(a.getEngine().createEffect(c,{attributes:f,uniformsNames:p,uniformBuffersNames:g,samplers:_,defines:h,fallbacks:u,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},s),o)}return!i.effect||!i.effect.isReady()?!1:(o._renderId=a.getRenderId(),i.effect._wasPreviouslyReady=!0,!0)},t.prototype.bindForSubMesh=function(e,i,r){var o=this.getScene(),a=r._materialDefines;if(a){var s=r.effect;if(!(!s||!this._mesh)){this._activeEffect=s,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),oe.BindBonesParameters(i,this._activeEffect),this._mustRebind(o,s)&&(this.bumpTexture&&ke.BumpTextureEnabled&&(this._activeEffect.setTexture("normalSampler",this.bumpTexture),this._activeEffect.setFloat2("vNormalInfos",this.bumpTexture.coordinatesIndex,this.bumpTexture.level),this._activeEffect.setMatrix("normalMatrix",this.bumpTexture.getTextureMatrix())),oe.BindClipPlane(this._activeEffect,o),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),oe.BindEyePosition(s,o)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*i.visibility),a.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),o.lightsEnabled&&!this.disableLighting&&oe.BindLights(o,i,this._activeEffect,a,this.maxSimultaneousLights),o.fogEnabled&&i.applyFog&&o.fogMode!==Ke.FOGMODE_NONE&&this._activeEffect.setMatrix("view",o.getViewMatrix()),oe.BindFogParameters(o,i,this._activeEffect),oe.BindLogDepth(a,this._activeEffect,o),ke.ReflectionTextureEnabled&&(this._activeEffect.setTexture("refractionSampler",this._refractionRTT),this._activeEffect.setTexture("reflectionSampler",this._reflectionRTT));var l=this._mesh.getWorldMatrix().multiply(this._reflectionTransform).multiply(o.getProjectionMatrix()),u=o.getEngine().getDeltaTime();u!==this._lastDeltaTime&&(this._lastDeltaTime=u,this._lastTime+=this._lastDeltaTime),this._activeEffect.setMatrix("worldReflectionViewProjection",l),this._activeEffect.setVector2("windDirection",this.windDirection),this._activeEffect.setFloat("waveLength",this.waveLength),this._activeEffect.setFloat("time",this._lastTime/1e5),this._activeEffect.setFloat("windForce",this.windForce),this._activeEffect.setFloat("waveHeight",this.waveHeight),this._activeEffect.setFloat("bumpHeight",this.bumpHeight),this._activeEffect.setColor4("waterColor",this.waterColor,1),this._activeEffect.setFloat("colorBlendFactor",this.colorBlendFactor),this._activeEffect.setColor4("waterColor2",this.waterColor2,1),this._activeEffect.setFloat("colorBlendFactor2",this.colorBlendFactor2),this._activeEffect.setFloat("waveSpeed",this.waveSpeed),this._activeEffect.setFloat("waveCount",this.waveCount),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect),this._afterBind(i,this._activeEffect)}}},t.prototype._createRenderTargets=function(e,i){var r=this;this._refractionRTT=new ji(name+"_refraction",{width:i.x,height:i.y},e,!1,!0),this._refractionRTT.wrapU=To.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.wrapV=To.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.ignoreCameraViewport=!0,this._reflectionRTT=new ji(name+"_reflection",{width:i.x,height:i.y},e,!1,!0),this._reflectionRTT.wrapU=To.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.wrapV=To.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.ignoreCameraViewport=!0;var o,a=null,s,l=te.Zero();this._refractionRTT.onBeforeRender=function(){if(r._mesh&&(o=r._mesh.isVisible,r._mesh.isVisible=!1),!r.disableClipPlane){a=e.clipPlane;var u=r._mesh?r._mesh.position.y:0;e.clipPlane=zo.FromPositionAndNormal(new y(0,u+.05,0),new y(0,1,0))}},this._refractionRTT.onAfterRender=function(){r._mesh&&(r._mesh.isVisible=o),r.disableClipPlane||(e.clipPlane=a)},this._reflectionRTT.onBeforeRender=function(){if(r._mesh&&(o=r._mesh.isVisible,r._mesh.isVisible=!1),!r.disableClipPlane){a=e.clipPlane;var u=r._mesh?r._mesh.position.y:0;e.clipPlane=zo.FromPositionAndNormal(new y(0,u-.05,0),new y(0,-1,0)),te.ReflectionToRef(e.clipPlane,l)}s=e.getViewMatrix(),l.multiplyToRef(s,r._reflectionTransform),e.setTransformMatrix(r._reflectionTransform,e.getProjectionMatrix()),e.getEngine().cullBackFaces=!1,e._mirroredCameraPosition=y.TransformCoordinates(e.activeCamera.position,l)},this._reflectionRTT.onAfterRender=function(){r._mesh&&(r._mesh.isVisible=o),e.clipPlane=a,e.setTransformMatrix(s,e.getProjectionMatrix()),e.getEngine().cullBackFaces=!0,e._mirroredCameraPosition=null}},t.prototype.getAnimatables=function(){var e=[];return this.bumpTexture&&this.bumpTexture.animations&&this.bumpTexture.animations.length>0&&e.push(this.bumpTexture),this._reflectionRTT&&this._reflectionRTT.animations&&this._reflectionRTT.animations.length>0&&e.push(this._reflectionRTT),this._refractionRTT&&this._refractionRTT.animations&&this._refractionRTT.animations.length>0&&e.push(this._refractionRTT),e},t.prototype.getActiveTextures=function(){var e=n.prototype.getActiveTextures.call(this);return this._bumpTexture&&e.push(this._bumpTexture),e},t.prototype.hasTexture=function(e){return!!(n.prototype.hasTexture.call(this,e)||this._bumpTexture===e)},t.prototype.dispose=function(e){this.bumpTexture&&this.bumpTexture.dispose();var i=this.getScene().customRenderTargets.indexOf(this._refractionRTT);i!=-1&&this.getScene().customRenderTargets.splice(i,1),i=-1,i=this.getScene().customRenderTargets.indexOf(this._reflectionRTT),i!=-1&&this.getScene().customRenderTargets.splice(i,1),this._reflectionRTT&&this._reflectionRTT.dispose(),this._refractionRTT&&this._refractionRTT.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),n.prototype.dispose.call(this,e)},t.prototype.clone=function(e){var i=this;return Be.Clone(function(){return new t(e,i.getScene())},this)},t.prototype.serialize=function(){var e=Be.Serialize(this);if(e.customType="BABYLON.WaterMaterial",e.renderList=[],this._refractionRTT&&this._refractionRTT.renderList)for(var i=0;i<this._refractionRTT.renderList.length;i++)e.renderList.push(this._refractionRTT.renderList[i].id);return e},t.prototype.getClassName=function(){return"WaterMaterial"},t.Parse=function(e,i,r){var o=Be.Parse(function(){return new t(e.name,i)},e,i,r);return o._waitingRenderList=e.renderList,o},t.CreateDefaultMesh=function(e,i){var r=ne.CreateGround(e,512,512,32,i,!1);return r},R([at("bumpTexture")],t.prototype,"_bumpTexture",void 0),R([ye("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),R([Vt()],t.prototype,"diffuseColor",void 0),R([Vt()],t.prototype,"specularColor",void 0),R([w()],t.prototype,"specularPower",void 0),R([w("disableLighting")],t.prototype,"_disableLighting",void 0),R([ye("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),R([w("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),R([ye("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),R([w()],t.prototype,"windForce",void 0),R([Pb()],t.prototype,"windDirection",void 0),R([w()],t.prototype,"waveHeight",void 0),R([w()],t.prototype,"bumpHeight",void 0),R([w("bumpSuperimpose")],t.prototype,"_bumpSuperimpose",void 0),R([ye("_markAllSubMeshesAsMiscDirty")],t.prototype,"bumpSuperimpose",void 0),R([w("fresnelSeparate")],t.prototype,"_fresnelSeparate",void 0),R([ye("_markAllSubMeshesAsMiscDirty")],t.prototype,"fresnelSeparate",void 0),R([w("bumpAffectsReflection")],t.prototype,"_bumpAffectsReflection",void 0),R([ye("_markAllSubMeshesAsMiscDirty")],t.prototype,"bumpAffectsReflection",void 0),R([Vt()],t.prototype,"waterColor",void 0),R([w()],t.prototype,"colorBlendFactor",void 0),R([Vt()],t.prototype,"waterColor2",void 0),R([w()],t.prototype,"colorBlendFactor2",void 0),R([w()],t.prototype,"waveLength",void 0),R([w()],t.prototype,"waveSpeed",void 0),R([w()],t.prototype,"waveCount",void 0),R([w()],t.prototype,"disableClipPlane",void 0),R([w()],t.prototype,"useLogarithmicDepth",null),t}(wr);Ae.RegisteredTypes["BABYLON.WaterMaterial"]=iK;function rK(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)}const nK=["data:EnvironmentBRDFTexture0","GlowLayerBlurRTT","GlowLayerBlurRTT2","HighlightLayerMainRTT"];function oK(n,t,e){async function i(u,f){return Ee.CreateScreenshotUsingRenderTargetAsync(n,e,{width:u,height:f},void 0,void 0,!0)}async function r(u){e.inertialRadiusOffset=e.inertialRadiusOffset+u}async function o(u){const{x:f,y:c,z:h}=u;e.target.x=f||0,e.target.y=c||0,e.target.z=h||0}async function a(u){const{alpha:f,beta:c,radius:h}=u;f&&(e.alpha=e.alpha+f),c&&(e.beta=e.beta+c),h&&(e.radius=e.radius+h)}async function s(){const u=t.meshes.filter(p=>!p.name.toLowerCase().includes("collider")).reduce((p,_)=>p+Math.floor(_.getTotalIndices()/3),0),f=t.materials.length,c=t.meshes.length,h=t.textures.filter(p=>p.name&&!nK.includes(p.name)).length;return{triangles:u,materials:f,meshes:c,textures:h,bodies:c,entities:1}}async function l(){}return{getScreenshot:i,getMetrics:s,panCamera:o,changeZoom:r,changeCameraPosition:a,cleanup:l}}var aK={};const aD=aK.VITE_REACT_APP_DEBUG;let tM=!1;const sK=async()=>{aD&&!tM&&(await pX(()=>import("./babylon.inspector.bundle.max-O86_PLqu.js").then(n=>n.b),[],import.meta.url),tM=!0)};function lK(n){const t=n.getChildren().filter(e=>e.id!=="__root__");if(t.length>0){const e=t[0];let i=e.getBoundingInfo(),r=i.boundingBox.minimumWorld.add(e.position),o=i.boundingBox.maximumWorld.add(e.position);for(let a=1;a<t.length;a++){const s=t[a];i=s.getBoundingInfo();const l=i.boundingBox.minimumWorld.add(s.position),u=i.boundingBox.maximumWorld.add(s.position);r=y.Minimize(r,l),o=y.Maximize(o,u)}n.setBoundingInfo(new hr(r,o))}}let Ul;async function uK(n,t){Ul&&Ul.dispose(),Ul=new Me(n,!0,{preserveDrawingBuffer:!0,stencil:!0,antialias:!0});const e=new Ke(Ul);if(e.autoClear=!0,e.clearColor=t.background.transparent?new Je(0,0,0,0):Fy(t.background.color).toColor4(),e.ambientColor=new _e(1,1,1),e.preventDefaultOnPointerDown=!1,t.showSceneBoundaries){const s=Vv.CreateGround("ground",{width:6,height:6},e),l=Vv.CreateGround("ground",{width:6,height:6},e);l.rotate(Mi.Z,Math.PI),l.position.y=-.05;const u=new oD("groundMaterial",e);u.mainColor=new _e(1,1,1),u.lineColor=new _e(0,0,0),u.majorUnitFrequency=0,s.material=u,l.material=u;const f=Vv.CreateCylinder("boundaries",{diameter:2,height:3}),c=new Mt("boundariesMaterial",e);c.alpha=.3,c.diffuseColor=new _e(1,45/255,85/255),f.material=c,f.position.y=1.51}if(t.showThumbnailBoundaries){const s=Jb.CreateFullscreenUI("UI"),l=new so;l.width=.5,l.height=1,l.color="#736E7D",l.thickness=2,s.addControl(l)}const i=new tl("camera",0,0,0,new y(0,0,0),e);switch(i.position=new y(t.cameraX,t.cameraY,t.cameraZ),i.minZ=.1,t.projection){case Ce.PreviewProjection.PERSPECTIVE:{i.mode=dt.PERSPECTIVE_CAMERA;break}case Ce.PreviewProjection.ORTHOGRAPHIC:{i.mode=dt.ORTHOGRAPHIC_CAMERA,i.orthoTop=1,i.orthoBottom=-1,i.orthoLeft=-1,i.orthoRight=1;break}}t.type===Ce.PreviewType.WEARABLE&&qI(i,t),t.camera===Ce.PreviewCamera.INTERACTIVE&&i.attachControl(n,!0);const r=new y(t.offsetX,t.offsetY,t.offsetZ);if(i.position.addInPlace(r),i.setTarget(r),i.lowerRadiusLimit=i.radius/t.zoom,i.upperRadiusLimit=i.lowerRadiusLimit*t.wheelZoom,i.radius=i.lowerRadiusLimit+(i.upperRadiusLimit-i.lowerRadiusLimit)*t.wheelStart/100,i.wheelPrecision=t.wheelPrecision,t.panning||(i.panningSensibility=0),t.lockBeta&&(i.lowerBetaLimit=i.beta,i.upperBetaLimit=i.beta),t.lockAlpha&&(i.lowerAlphaLimit=i.alpha,i.upperAlphaLimit=i.alpha),t.lockRadius&&(i.lowerRadiusLimit=i.radius,i.upperRadiusLimit=i.radius),t.type===Ce.PreviewType.WEARABLE){const s=new pu("directional",new y(0,0,1),e);s.intensity=1;const l=new _u("spot",new y(-2,2,2),new y(2,-2,-2),Math.PI/2,1e3,e);l.intensity=1}const o=new jo("top",new y(0,-1,0),e);o.intensity=1;const a=new jo("bottom",new y(0,1,0),e);if(a.intensity=1,!rK()){const s=new pp("glow",e);s.intensity=2}return Ul.runRenderLoop(()=>{e.render()}),aD&&(await sK(),e.debugLayer.show({showExplorer:!0,embedMode:!0})),[e,oK(Ul,e,i)]}async function fK(n,t,e){const i=t.id,o=mu(t,e).contents.find(a=>a.key.toLowerCase().endsWith("_mask.png"));return o?new Promise((a,s)=>{const l=new Xb(i,o.url,!0,!1);l.onError=()=>s(l.errorObject),l.onSuccess=()=>{a(l.texture)},l.run(n,()=>a(l.texture),s)}):null}async function cK(n,t,e){const i=t.id,o=mu(t,e).contents.find(a=>a.key.toLowerCase().endsWith(".png")&&!a.key.toLowerCase().endsWith("_mask.png"));return o?new Promise((a,s)=>{const l=new Xb(i,o.url,!0,!1);l.onError=()=>s(l.errorObject),l.onSuccess=()=>{a(l.texture)},l.run(n,()=>a(l.texture),s)}):null}function hK(n,t,e){return new Promise((i,r)=>{var u;const o=(u=t.contents.find(f=>e!==null?e?f.key.toLowerCase().endsWith(e.toLowerCase()):null:f.key.toLowerCase().endsWith(".mp3")||f.key.toLowerCase().endsWith("ogg")))==null?void 0:u.url;if(!o)return i(null);const a=new LI("Sound task",o),s=()=>i(new iu("music",a.data,n,null,{spatialSound:!0})),l=f=>r(f);a.run(n,s,l)})}async function sD(n,t){const e=async(i,r)=>$t.LoadAssetContainerAsync(i,"",n,null,r);try{return await e(t,".glb")}catch{return await e(t,".gltf")}}function dK(n){const t=new ne("parent",n);for(const a of n.meshes)a!==t&&a.setParent(t);lK(t);const i=t.getBoundingInfo().boundingBox.extendSize.length(),r=new y(1/i,1/i,1/i);t.scaling=r;const o=t.getBoundingInfo().boundingBox.center.multiply(r);t.position.subtractInPlace(o)}const pK=[Ce.PreviewEmote.IDLE,Ce.PreviewEmote.MONEY,Ce.PreviewEmote.CLAP,Ce.PreviewEmote.WALK,Ce.PreviewEmote.RUN,Ce.PreviewEmote.JUMP];let Cd;function _K(n){return pK.includes(n)}function mK(n){let t="";t.endsWith("/")||(t+="/");const e=`./emotes/${n}.glb`;return t.startsWith("http")?new URL(e,t).href:e}async function lD(n,t){const e=await sD(n,t);if(e.animationGroups.length===0)throw new Error(`No animation groups found for emote with url=${t}`);return e}async function gK(n,t,e){const i=Kb(t,e.bodyShape),r=i.contents.find(o=>o.key===i.mainFile);if(!r)throw new Error(`Could not find a valid content in representation for emote=${t.id} and bodyShape=${e.bodyShape}`);return lD(n,r.url)}function vK(n,t,e){const i=Kb(t,e.bodyShape),r=e.socialEmote?e.socialEmote.audio:null;return hK(n,i,r)}async function yK(n,t,e,i){var u,f,c;let r,o=!!e.emote&&_K(e.emote),a=null;if(e.item&&ko(e.item))try{r=await gK(n,e.item,e),o=e.socialEmote?e.socialEmote.loop:e.item.emoteDataADR74.loop,a=await vK(n,e.item,e)}catch{console.warn(`Could not load emote=${e.item.id}`)}if(!r&&e.emote){const h=mK(e.emote);r=await lD(n,h)}r&&r.animationGroups.length>1&&(r.addAllToScene(),n.stopAllAnimations());const s=new Rb("emote",n);function l(){if(e.camera!==Ce.PreviewCamera.STATIC){const h=n.cameras[0];qI(h,e)}}try{for(const p of t){const _=new Map,g=[...p.container.transformNodes,...p.container.meshes];for(const v of g){const E=v.name.replace(/\.\d+$/,""),T=_.get(E)||[];T.push(v),_.set(E,T)}if(r&&r.animationGroups.length>0){for(const v of r.animationGroups)if(!(e.socialEmote&&!nX(v,e.socialEmote)))for(const E of v.targetedAnimations){const T=E.animation.clone(),S=E.target,C=E.animation.getKeys();if(T.setKeys([...C]),e.socialEmote){const O=((u=e.socialEmote.Armature)==null?void 0:u.animation)&&v.name.toLowerCase().startsWith(e.socialEmote.Armature.animation.toLowerCase()),A=((f=e.socialEmote.Armature_Other)==null?void 0:f.animation)&&v.name.toLowerCase().startsWith(e.socialEmote.Armature_Other.animation.toLowerCase()),M=((c=e.socialEmote.Armature_Prop)==null?void 0:c.animation)&&v.name.toLowerCase().startsWith(e.socialEmote.Armature_Prop.animation.toLowerCase());if(O&&!A&&!M){const D=S.name.replace(/\.\d+$/,""),U=_.get(D)||[];if(U.length>0)for(const V of U){const B=T.clone();B.setKeys([...C]),s.addTargetedAnimation(B,V)}else console.warn("No matching bone found for",S.name)}else if(A){const D=S.name.replace(/\.\d+$/,""),U=_.get(D)||[];if(U.length>0)for(const V of U){const B=i==null?void 0:i.get(V);if(!B)continue;const z=T.clone();z.setKeys([...C]),s.addTargetedAnimation(z,B)}else console.warn("No matching bone found for",S.name)}else M&&s.addTargetedAnimation(T,S)}else if(r.animationGroups.length===1||v.name.toLowerCase().includes("avatar")||S.name.startsWith("Avatar_")){const A=S.name.replace(/\.\d+$/,""),M=_.get(A)||[];if(M.length>0)for(const D of M){const U=T.clone();U.setKeys([...C]),s.addTargetedAnimation(U,D)}else console.warn("No matching bone found for",S.name)}else s.addTargetedAnimation(T,S)}}}s.onAnimationGroupEndObservable.addOnce(l);const h=bK(s,o,a,e.item);return e.camera===Ce.PreviewCamera.STATIC&&h.stop(),h}catch(h){console.warn(`Could not play emote=${e.emote}`,h)}}function bK(n,t,e,i){Me.audioEngine.useCustomUnlockedButton=!0,Me.audioEngine.setGlobalVolume(1);let r,o=!1;async function a(){return Math.max(n.to,0)}async function s(){return n.isPlaying}async function l(){return!!e}async function u(C){o=!0;const O=await s();O&&n.pause(),n.stop(),n.start(!1,1,C,C,!1),r=C,o=!0,O&&f()}async function f(){await s()||(r?(n.start(t,1,r,await a(),!1),e&&(e.stop(),e._startOffset=r,e.play()),r=0):(n.play(t),e==null||e.play()))}async function c(){await s()&&(n.pause(),e==null||e.pause())}async function h(){n.goToFrame(0),n.stop(),e==null||e.stop()}async function p(){e&&(Me.audioEngine.unlock(),Me.audioEngine.setGlobalVolume(1),n.isPlaying&&!e.isPlaying&&e.play(void 0,n.targetedAnimations[0].animation.runtimeAnimations[0].currentFrame))}async function _(){e&&Me.audioEngine.setGlobalVolume(0)}async function g(){return i&&i.emoteDataADR74&&!!i.emoteDataADR74.startAnimation&&!!i.emoteDataADR74.outcomes&&i.emoteDataADR74.outcomes.length>0}async function v(){return await g()?[{title:"Start Animation",...i.emoteDataADR74.startAnimation},...i.emoteDataADR74.outcomes.map(C=>({title:C.title,loop:C.loop,audio:C.audio,...C.clips}))]:null}const E=Sb(),T=()=>(Cd&&clearInterval(Cd),window.setInterval(async()=>{var C;if(await s()&&n.animatables[0].masterFrame>0)return E.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,{length:(C=n.animatables[0])==null?void 0:C.masterFrame})},10)),S=()=>{clearInterval(Cd),o||E.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,{length:n.to})};return n.onAnimationGroupPlayObservable.add(()=>(Cd=T(),E.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAY))),n.onAnimationGroupPauseObservable.add(()=>{E.emit(Ce.PreviewEmoteEventType.ANIMATION_PAUSE)}),n.onAnimationGroupLoopObservable.add(()=>(e==null||e.stop(),e==null||e.play(),o&&(h(),f(),o=!1),E.emit(Ce.PreviewEmoteEventType.ANIMATION_LOOP))),n.onAnimationGroupEndObservable.add(()=>(S(),t||(o=!1),E.emit(Ce.PreviewEmoteEventType.ANIMATION_END))),{getLength:a,isPlaying:s,goTo:u,play:f,pause:c,stop:h,enableSound:p,disableSound:_,hasSound:l,events:E,emote:i,isSocialEmote:g,getSocialEmoteAnimations:v}}function EK(n,t,e){return async i=>{const r=t.find(eX(i));return r?Promise.all([cK(n,r,e),fK(n,r,e)]):[null,null]}}async function TK(n,t,e){const i=EK(n,t,e),[r,o,a]=await Promise.all([i(Ce.WearableCategory.EYES),i(Ce.WearableCategory.EYEBROWS),i(Ce.WearableCategory.MOUTH)]);return{eyes:r,eyebrows:o,mouth:a}}async function SK(n,t,e,i,r,o){for(const a of t.container.meshes){if(a.name.toLowerCase().endsWith("mask_eyes")){const[s,l]=e;s?fy(n,"eyes",a,s,o.eyes,l,"#ffffff"):a.setEnabled(!1)}if(a.name.toLowerCase().endsWith("mask_eyebrows")){const[s,l]=i;s?fy(n,"eyebrows",a,s,o.hair,l,o.hair):a.setEnabled(!1)}if(a.name.toLowerCase().endsWith("mask_mouth")){const[s,l]=r;s?fy(n,"mouth",a,s,o.skin,l,o.skin):a.setEnabled(!1)}}}function fy(n,t,e,i,r,o,a){const s=new Mt(`${t}_standard_material`,n);s.alphaMode=Ci.PBRMATERIAL_ALPHABLEND,s.backFaceCulling=!0,s.specularColor=_e.Black(),i.hasAlpha=!0,s.sideOrientation=qs.CW,s.diffuseTexture=i,s.diffuseColor=o?_e.Black():Fy(a),o&&(s.emissiveTexture=o,s.diffuseColor=Fy(r)),e.material=s}function CK(n,t,e=Ce.BodyShape.MALE){const i={};for(const r of n)try{const o=mu(r,e);for(const a of o.contents)i[a.key]=a.url}catch{console.warn(`Skipping generation of mappings for wearable="${r.id}" since it lacks a representation for bodyShape="${e}"`);continue}if(t){const r=Kb(t,e);for(const o of r.contents)i[o.key]=o.url}return i}function PK(n){const t=as(n.item)?[n.item,...n.wearables]:n.wearables,e=ko(n.item)?n.item:void 0,i=CK(t,e,n.bodyShape);$t.OnPluginActivatedObservable.add(r=>{if(r.name==="gltf"){const o=r;o.preprocessUrlAsync=async a=>{const l=a.split("/").pop();if(!l)return a;const f=Object.keys(i).find(c=>c.endsWith(l));return i[f]||a}}})}const AK=`float angleY = 3.14 / 2.0;
|
|
16067
16067
|
|
|
16068
16068
|
mat3 rotateY = mat3(
|
|
16069
16069
|
cos(angleY), 0, sin(angleY),
|
|
@@ -16105,4 +16105,4 @@ else
|
|
|
16105
16105
|
}
|
|
16106
16106
|
`,cy="#include<pbrBlockFinalColorComposition>",iM="#include<customToonShading>";if(ce.ShadersStore.pbrPixelShader.includes(cy))ce.ShadersStore.pbrPixelShader.includes(iM)||(ce.ShadersStore.pbrPixelShader=ce.ShadersStore.pbrPixelShader.replace(cy,cy+`
|
|
16107
16107
|
`+iM+`
|
|
16108
|
-
`));else throw new Error("could not patch the pbrPixelShader");ce.IncludesShadersStore.customToonShading=AK;async function hy(n,t,e=Ce.BodyShape.MALE,i,r){const o=mu(t,e);if(yp(o))throw new Error(`The wearable="${t.id}" is a texture`);const a=x5(o),s=await sD(n,a);for(const l of s.meshes)l.name.toLowerCase().includes("collider")&&(l.isVisible=!1,n.removeMesh(l));for(const l of s.materials)if(l instanceof Ci){const u=l;u.specularIntensity=0,u.metallic&&(u.metallic=0,u.metallicF0Factor=0),u.name.toLowerCase().includes("hair")&&(r?(u.albedoColor=_e.FromHexString(r).toLinearSpace(),u.specularIntensity=0,u.alpha=1):(u.alpha=0,n.removeMaterial(u))),u.name.toLowerCase().includes("skin")&&(i?(u.albedoColor=_e.FromHexString(i).toLinearSpace(),u.specularIntensity=0,u.alpha=1):(u.alpha=0,n.removeMaterial(u)))}for(const l of s.animationGroups)l.stop(),l.reset(),l.dispose();return{container:s,wearable:t}}async function RK(n,t){const[e,i]=await uK(n,t);try{PK(t);let r;const o=[];if(t.type===Ce.PreviewType.AVATAR){const s=cX(t),l=Array.from(s.values());for(const p of l.filter(YI)){const _=hy(e,p,t.bodyShape,t.skin,t.hair).catch(g=>{console.warn(g.message)});o.push(_)}let u=null;t.socialEmote&&t.socialEmote.Armature_Other&&(u=new ne("parent_other",e));const f=new Map,c=(await Promise.all(o)).filter(iX);for(const p of c)if(p.container.addAllToScene(),u){const _=p.container.instantiateModelsToScene(S=>`${S}_Other`),v=_e.FromHexString("#c9c9c9").toLinearSpace(),E=_.rootNodes;for(const S of E)S.setParent(u);sX(E,v);const T=aX(p.container,E);for(const[S,C]of T)f.set(S,C)}const h=lX(c);if(h){const p=l.filter(rX),{eyes:_,eyebrows:g,mouth:v}=await TK(e,p,t.bodyShape);SK(e,h,_,g,v,t)}r=await yK(e,c,t,f)||CR()}else{const s=t.item;if(s&&!ko(s))try{(await hy(e,s,t.bodyShape,t.skin,t.hair)).container.addAllToScene()}catch{(await hy(e,s,t.bodyShape===Ce.BodyShape.MALE?Ce.BodyShape.FEMALE:Ce.BodyShape.MALE,t.skin,t.hair)).container.addAllToScene()}r=CR()}return t.centerBoundingBox&&dK(e),{scene:i,emote:r}}catch(r){throw e.clearColor=new Je(0,0,0,0),r}}function OK(n){const t=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_PLAY,payload:void 0})},e=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_PAUSE,payload:void 0})},i=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_LOOP,payload:void 0})},r=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_END,payload:void 0})},o=a=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_PLAYING,payload:a})};return n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_PLAY,t),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_PAUSE,e),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_LOOP,i),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_END,r),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,o),()=>{n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_PLAY,t),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_PAUSE,e),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_LOOP,i),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_END,r),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,o)}}const MK=()=>{const[n,t]=Ct.useState(""),{width:e,height:i}=WM(),[r,o]=Ct.useState({}),[a,s]=Ct.useState(!1),[l,u]=Ct.useState(!0),[f,c]=Ct.useState(!1),h=Ct.useRef(null),p=XI(),[_,g,v]=Z5(),[E,T]=Ct.useState(""),[S,C]=Ct.useState(!0),[O,A]=Ct.useState(!1),M=n||v,D=(l||g)&&!M,U=!!E&&!S&&!D,V=S&&!D;return Ct.useEffect(()=>{let B=()=>{};if(h.current&&_){let z={opacity:1};_.background.image&&(T(_.background.image),z.opacity=1,!_.background.transparent&&_.type===Ce.PreviewType.TEXTURE&&(z.backgroundColor=_.background.color)),o(z),_.type===Ce.PreviewType.TEXTURE?(C(!1),u(!1),c(!0)):RK(h.current,_).then(J=>{p.current=J,B=OK(p.current)}).catch(J=>t(J.message)).finally(()=>{u(!1),c(!0)})}return()=>{B()}},[h.current,_]),Ct.useEffect(()=>{var B;O||(f?(Ce.sendMessage(cn(),Ce.PreviewMessageType.LOAD,{renderer:Ce.PreviewRenderer.BABYLON}),A(!0),((_==null?void 0:_.type)===Ce.PreviewType.AVATAR||_!=null&&_.emote&&_.emote!==Ce.PreviewEmote.IDLE)&&((B=p.current)==null||B.emote.play())):M&&(Ce.sendMessage(cn(),Ce.PreviewMessageType.ERROR,{message:M}),A(!0)))},[f,M,O,p,_==null?void 0:_.type,_==null?void 0:_.emote]),Ct.useEffect(()=>{if(g){let B=!1;l||(u(!0),B=!0),O&&(A(!1),B=!0),B&&f&&c(!1)}},[g,l,O,f]),jI(),On.jsxs("div",{className:Zl("Preview",{"is-dragging":a,"is-loading":D,"is-loaded":f,"is-3d":S&&(_==null?void 0:_.camera)===Ce.PreviewCamera.INTERACTIVE,"has-error":!!M,"no-fade-effect":_&&!_.fadeEffect}),style:r,children:[On.jsx("img",{src:E,className:Zl("thumbnail",{"is-visible":U}),alt:"preview"}),On.jsx("canvas",{id:"wearable-preview",className:Zl({"is-visible":V}),width:e,height:i,ref:h,onMouseDown:()=>s(S&&!M),onMouseUp:()=>s(!1)}),M&&On.jsx("div",{className:"error",children:M})]})},xK=aM.memo(MK);var uD=(n=>(n.SET_MODE="SetMode",n.SET_PROFILE="SetProfile",n.SET_EMOTE="SetEmote",n.SET_URNS="SetUrns",n.SET_BACKGROUND="SetBackground",n.SET_SKIN_COLOR="SetSkinColor",n.SET_HAIR_COLOR="SetHairColor",n.SET_EYE_COLOR="SetEyeColor",n.SET_BODY_SHAPE="SetBodyShape",n.SET_SHOW_ANIMATION_REFERENCE="SetShowAnimationReference",n.SET_PROJECTION="SetProjection",n.ADD_BASE64="AddBase64",n.CLEAR_BASE64="ClearBase64",n.SET_CONTRACT="SetContract",n.SET_ITEM_ID="SetItemID",n.SET_TOKEN_ID="SetTokenID",n.SET_DISABLE_LOADER="SetDisableLoader",n.RELOAD="Reload",n.CLEANUP="Cleanup",n))(uD||{});const IK={unityMode:"SetMode",profile:"SetProfile",emote:"SetEmote",urns:"SetUrns",background:"SetBackground",skin:"SetSkinColor",hair:"SetHairColor",eyes:"SetEyeColor",bodyShape:"SetBodyShape",showAnimationReference:"SetShowAnimationReference",projection:"SetProjection",base64s:"AddBase64",contractAddress:"SetContract",itemId:"SetItemID",tokenId:"SetTokenID",disableLoader:"SetDisableLoader"},DK={unityMode:n=>String(n),profile:n=>String(n),emote:n=>String(n),urns:n=>Array.isArray(n)?n.join(","):String(n),background:n=>typeof n=="string"?n.replace("#",""):String(n),skin:n=>typeof n=="string"?n.replace("#",""):String(n),hair:n=>typeof n=="string"?n.replace("#",""):String(n),eyes:n=>typeof n=="string"?n.replace("#",""):String(n),bodyShape:n=>String(n),showAnimationReference:n=>String(n),projection:n=>String(n),contractAddress:n=>String(n),itemId:n=>String(n),tokenId:n=>String(n),disableLoader:n=>String(n)},Pd=(n,t,e)=>{if(n)try{const i=String(t);Object.values(uD).includes(i)||console.warn(`Unknown Unity method: ${i}. Sending anyway...`),e!==void 0?n.SendMessage("JSBridge",i,e):n.SendMessage("JSBridge",i)}catch(i){console.error(`Failed to send Unity message ${t}:`,i)}else console.warn(`Unity instance not ready, cannot send message: ${t}`)},wK=(n,t,e)=>{if(!n){console.warn("Unity instance not available, cannot send override messages");return}let i=0;t.base64s!==void 0&&e.base64s&&(Pd(n,"ClearBase64"),i++,Array.isArray(t.base64s)&&t.base64s.length>0&&t.base64s.forEach(r=>{Pd(n,"AddBase64",r),i++})),Object.entries(t).forEach(([r,o])=>{if(r!=="base64s"&&e[r]&&o!==void 0){const a=IK[r];if(a){const s=DK[r],l=s?s(o):String(o);Pd(n,a,l),i++}else console.warn(`No Unity method mapping found for property: ${r}`)}}),i>0&&Pd(n,"Reload")};var LK={VITE_BASE_URL:""};const dy=new Map,kl=(n,t)=>t;function NK(n){if(dy.has(n))return dy.get(n);const t=new Promise((e,i)=>{const r=document.querySelector(`script[src="${n}"]`);if(r){r.addEventListener("load",()=>e(r)),r.addEventListener("error",a=>i(a));return}const o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>e(o),o.onerror=a=>i(a),document.body.appendChild(o)});return dy.set(n,t),t}const FK=async(n,t,e,i,r,o,a,s,l,u,f,c)=>{try{const h=LK.VITE_BASE_URL||"";return await NK(kl(h,t)),await createUnityInstance(n,{dataUrl:kl(h,e),frameworkUrl:kl(h,i),codeUrl:kl(h,r),streamingAssetsUrl:kl(h,a),symbolUrl:kl(h,o),companyName:s,productName:l,productVersion:u,matchWebGLToCanvasSize:f,arguments:c})}catch(h){throw console.error("❌ Failed to load Unity instance:",h),h}};function BK(n){return{getScreenshot:()=>new Promise(t=>{if(!n){t("");return}n.SendMessage("JSBridge","TakeScreenshot",""),window.addEventListener("message",function e(i){if(i.data.type==="unity-renderer"){const{type:r,payload:o}=i.data.payload;r==="screenshot"&&(window.removeEventListener("message",e),t(o))}})}),getMetrics:()=>new Promise(t=>{if(!n){t({triangles:0,materials:0,textures:0,meshes:0,bodies:0,entities:0});return}n.SendMessage("JSBridge","GetMetrics",""),window.addEventListener("message",function e(i){if(i.data.type==="unity-renderer"){const{type:r,payload:o}=i.data.payload;r==="metrics"&&(window.removeEventListener("message",e),t(o))}})}),changeZoom:async t=>{n&&n.SendMessage("JSBridge","SetZoom",t.toString())},panCamera:async t=>{if(!n)return;const e=t.x??0,i=t.y??0,r=t.z??0;n.SendMessage("JSBridge","SetOffset",`${e},${i},${r}`)},changeCameraPosition:async t=>{if(!n)return;const e=t.alpha??0,i=t.beta??0,r=t.radius??0;n.SendMessage("JSBridge","SetCameraPosition",`${e},${i},${r}`)},setUsername:async t=>{n&&n.SendMessage("JSBridge","SetUsername",t)},cleanup:async()=>{n&&n.SendMessage("JSBridge","Cleanup","")}}}function VK(n){const t=Sb();return{getLength:async()=>new Promise(e=>{if(!n){e(0);return}n.SendMessage("JSBridge","GetEmoteLength",""),window.addEventListener("message",function i(r){if(r.data.type==="unity-renderer"){const{type:o,payload:a}=r.data.payload;o==="emoteLength"&&(window.removeEventListener("message",i),e(a))}})}),isPlaying:async()=>new Promise(e=>{if(!n){e(!1);return}n.SendMessage("JSBridge","IsEmotePlaying",""),window.addEventListener("message",function i(r){if(r.data.type==="unity-renderer"){const{type:o,payload:a}=r.data.payload;o==="isEmotePlaying"&&(window.removeEventListener("message",i),e(a))}})}),goTo:async e=>{n&&(n.SendMessage("JSBridge","GoToEmote",e.toString()),t.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,{length:e}))},play:async()=>{n&&(n.SendMessage("JSBridge","PlayEmote",""),t.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAY))},pause:async()=>{n&&(n.SendMessage("JSBridge","PauseEmote",""),t.emit(Ce.PreviewEmoteEventType.ANIMATION_PAUSE))},stop:async()=>{n&&(n.SendMessage("JSBridge","StopEmote",""),t.emit(Ce.PreviewEmoteEventType.ANIMATION_END))},enableSound:async()=>{n&&n.SendMessage("JSBridge","EnableSound","")},disableSound:async()=>{n&&n.SendMessage("JSBridge","DisableSound","")},hasSound:async()=>new Promise(e=>{if(!n){e(!1);return}n.SendMessage("JSBridge","HasSound",""),window.addEventListener("message",function i(r){if(r.data.type==="unity-renderer"){const{type:o,payload:a}=r.data.payload;o==="hasSound"&&(window.removeEventListener("message",i),e(a))}})}),events:t}}async function UK(n){let t=null;try{if(t=await FK(n,"/unity/Build/aang-renderer.loader.js","/unity/Build/aang-renderer.data.br","/unity/Build/aang-renderer.framework.js.br","/unity/Build/aang-renderer.wasm.br","/unity/Build/aang-renderer.symbols.json.br","/emotes","Decentraland","AangRenderer","2.2.1",!0,[]),!t)throw new Error("Failed to load Unity instance");const e=BK(t),i=VK(t);return{scene:e,emote:i,unity:t}}catch(e){if(console.error("Unity render failed:",e),t!=null&&t.Quit)try{t.Quit()}catch(i){console.error("Error quitting Unity instance:",i)}throw e}}const kK=()=>Math.floor(Math.random()*159)+1,fD=()=>`default${kK()}`,zK=(n,t)=>{var e,i,r,o,a,s;return{eyes:ou(t.eyes||((i=(e=n==null?void 0:n.avatar)==null?void 0:e.eyes)==null?void 0:i.color)&&au(n.avatar.eyes.color)||"#000000"),hair:ou(t.hair||((o=(r=n==null?void 0:n.avatar)==null?void 0:r.hair)==null?void 0:o.color)&&au(n.avatar.hair.color)||"#000000"),skin:ou(t.skin||((s=(a=n==null?void 0:n.avatar)==null?void 0:a.skin)==null?void 0:s.color)&&au(n.avatar.skin.color)||"#cc9b76")}},ff=n=>n||"",rM=n=>n||[],Ad=n=>n.replace("#","");function nM(n){const t=new URL(window.location.href);Object.entries(n).forEach(([e,i])=>{t.searchParams.delete(e),Array.isArray(i)?i.forEach(r=>{r!==""&&t.searchParams.append(e,r)}):i!==""&&t.searchParams.set(e,i)}),window.history.replaceState({},"",t.toString())}function GK(){const{options:n,overrideSources:t}=$b(),[e,i]=Ct.useState(null),[r,o]=Ct.useState(!0),[a,s]=Ct.useState(null),l=Ct.useRef(null),u=Ct.useRef(n),f=Ct.useRef(!0);return Ct.useEffect(()=>{const c=JSON.stringify(n),h=JSON.stringify(u.current);if(!f.current&&c===h)return;f.current=!1,u.current=n,(async()=>{var _,g;try{o(!0),s(null);const v=n.peerUrl||Wf.get("PEER_URL"),E=n.nftServerUrl||Wf.get("NFT_SERVER_URL");let T=Ce.PreviewType.WEARABLE,S={color:n.background||"#4b4852",transparent:n.disableBackground===!0};const C=UI(n.profile);let O=C==null?void 0:C.value;O==="default"&&(O=fD());const A=O&&C?C.type==="address"?await zI(O,v):await GI(O,v):null,M=n.bodyShape||((_=A==null?void 0:A.avatar)==null?void 0:_.bodyShape)||Ce.BodyShape.MALE;let D=null;if(n.contractAddress&&(D=await WI({contractAddress:n.contractAddress,tokenId:n.tokenId,itemId:n.itemId,peerUrl:v,nftServerUrl:E}),D&&as(D))){S={...S,image:D.thumbnail};const Z=qb(D);yp(Z)&&(T=Ce.PreviewType.TEXTURE)}const{eyes:U,hair:V,skin:B}=zK(A,{eyes:n.eyes,hair:n.hair,skin:n.skin}),z=n.unityMode||null,J=n.camera&&Object.values(Ce.PreviewCamera).includes(n.camera)?n.camera:Ce.PreviewCamera.INTERACTIVE,X=n.projection&&Object.values(Ce.PreviewProjection).includes(n.projection)?n.projection:Ce.PreviewProjection.PERSPECTIVE,re=n.disableDefaultEmotes?null:n.emote&&Object.values(Ce.PreviewEmote).includes(n.emote)?n.emote:Ce.PreviewEmote.IDLE,ae={background:S,bodyShape:M,mode:z,projection:X,type:T,base64:((g=n.base64s)==null?void 0:g[0])||null,contract:n.contractAddress||null,disableLoader:n.disableLoader||!1,emote:(re==null?void 0:re.toString())||null,eyeColor:U.replace("#",""),hairColor:V.replace("#",""),item:n.itemId||null,profile:O||null,skinColor:B.replace("#",""),token:n.tokenId||null,urn:n.urns||null,showAnimationReference:null},se=JSON.stringify(ae),H=JSON.stringify(l.current);if(se!==H){if(l.current=ae,Object.keys(t).length===0){const Z=rM(n.urns),q=rM(n.base64s);if(z===Ce.PreviewUnityMode.CONFIG){const N={mode:ff(z||"")};nM(N)}else{const N={background:S.transparent?"":Ad(S.color),disableLoader:n.disableLoader?"true":"",profile:ff(O||""),bodyShape:ff(M||""),eyeColor:Ad(U||""),hairColor:Ad(V||""),skinColor:Ad(B||""),mode:ff(z||""),camera:J,projection:X,emote:ff((re==null?void 0:re.toString())||""),urn:Z.length>0?Z:[""],base64:q.length>0?q:[""]};nM(N)}}i(ae)}o(!1)}catch(v){console.error("[useUnityConfig] Failed to load config:",v),s(v instanceof Error?v.message:"Failed to load config"),o(!1)}})()},[n,t]),[e,r,a]}const WK="unity-renderer",HK="unity-canvas",oM=1,jK="Failed to load Unity",XK=(n,t,e,i)=>{const[r,o]=Ct.useState({isLoaded:!1,isInitialized:!1,error:null}),a=Ct.useCallback(l=>{if(l.data.type===WK){const{type:u,payload:f}=l.data.payload;u==="loaded"&&(f===!0||f==="true")?(o(c=>({...c,isLoaded:!0,isInitialized:!0})),Ce.sendMessage(cn(),Ce.PreviewMessageType.LOAD,{renderer:Ce.PreviewRenderer.UNITY})):u==="customization-done"?Ce.sendMessage(cn(),Ce.PreviewMessageType.CONTROLLER_RESPONSE,{id:"customization-done",ok:!0,result:JSON.parse(l.data.payload.payload)}):u==="error"&&(o(c=>({...c,error:f})),Ce.sendMessage(cn(),Ce.PreviewMessageType.ERROR,{message:"Error loading the wearable. Please try again."}))}},[]),s=Ct.useCallback(async()=>{if(!(!n.canvas.current||n.isInitializing.current||n.unityInstance.current)){n.isInitializing.current=!0,o(l=>({...l,isLoaded:!1,error:null}));try{const{unity:l,scene:u,emote:f}=await UK(n.canvas.current);n.unityInstance.current=l,t.current={scene:u,emote:f},o(c=>({...c,isLoaded:!0,isInitialized:!0})),Ce.sendMessage(cn(),Ce.PreviewMessageType.LOAD,{renderer:Ce.PreviewRenderer.UNITY})}catch(l){const u=l instanceof Error?l.message:jK;console.error("Unity init failed:",l),o(f=>({...f,error:u})),Ce.sendMessage(cn(),Ce.PreviewMessageType.ERROR,{message:u})}finally{n.isInitializing.current=!1}}},[n,t]);return Ct.useEffect(()=>{r.isInitialized||i||!e||s()},[e,i,r.isInitialized,s]),Ct.useEffect(()=>{if(e)return window.addEventListener("message",a,!1),()=>{window.removeEventListener("message",a,!1)}},[e,a]),r},YK=n=>{const[t,e]=Ct.useState({pixelRatio:window.devicePixelRatio||oM,is3D:!0,backgroundImage:""});return Ct.useEffect(()=>{const i=()=>{e(o=>({...o,pixelRatio:window.devicePixelRatio||oM}))},r=window.matchMedia(`(resolution: ${t.pixelRatio}dppx)`);return r.addEventListener("change",i),()=>{r.removeEventListener("change",i)}},[t.pixelRatio]),Ct.useEffect(()=>{n&&e(i=>({...i,backgroundImage:n.background.image||"",is3D:n.type!==Ce.PreviewType.TEXTURE}))},[n]),t},KK=(n,t,e,i,r)=>{const o=Ct.useMemo(()=>{const a={};for(const s of Object.keys(r))r[s]&&i[s]!==void 0&&(a[s]=i[s]);return a},[r,i]);Ct.useEffect(()=>{if(!(!e.isInitialized||!e.isLoaded||!n.current)){if(o.profile==="default"){const a=t.current.profile;o.profile=a!=null&&a.match(/^default\d+$/)?a:fD()}Object.keys(o).length>0&&(wK(n.current,o,r),t.current=o)}},[e.isInitialized,e.isLoaded,o,r,n,t])},qK=()=>{const{width:n=window.innerWidth,height:t=window.innerHeight}=WM(),e=Ct.useRef(null),i=Ct.useRef(null),r=Ct.useRef(!1),o=Ct.useRef({}),a=XI(),[s,l,u]=GK(),{options:f,overrideSources:c}=$b(),h=Ct.useMemo(()=>({canvas:e,unityInstance:i,isInitializing:r,lastSentOverrides:o}),[]),p=XK(h,a,s,l),_=YK(s);KK(h.unityInstance,h.lastSentOverrides,p,f,c),jI();const g=Ct.useMemo(()=>{const A=p.error||u,M=!p.isLoaded&&!A,D=!!_.backgroundImage&&!_.is3D&&!M,U=_.is3D&&!M;return{error:A,isLoading:M,showImage:D,showCanvas:U}},[p.error,p.isLoaded,u,_.backgroundImage,_.is3D]),v=Ct.useMemo(()=>({opacity:1,backgroundColor:!(s!=null&&s.background.transparent)&&(s==null?void 0:s.type)===Ce.PreviewType.TEXTURE?s.background.color:void 0}),[s]),E=Ct.useMemo(()=>({width:`${n}px`,height:`${t}px`}),[n,t]),T=Ct.useMemo(()=>({width:Math.round(n*_.pixelRatio),height:Math.round(t*_.pixelRatio)}),[n,t,_.pixelRatio]),S=Ct.useMemo(()=>Zl("Preview",{"is-loading":g.isLoading,"is-loaded":p.isLoaded,"is-3d":_.is3D,"has-error":!!g.error}),[g.isLoading,p.isLoaded,_.is3D,g.error]),C=Ct.useMemo(()=>Zl("thumbnail",{"is-visible":g.showImage}),[g.showImage]),O=Ct.useMemo(()=>Zl({"is-visible":g.showCanvas}),[g.showCanvas]);return On.jsxs("div",{className:S,style:v,children:[On.jsx("img",{src:_.backgroundImage,className:C,alt:"preview"}),On.jsx("canvas",{ref:h.canvas,id:HK,className:O,width:T.width,height:T.height,style:E}),g.error&&On.jsx("div",{className:"error",children:g.error})]})},QK=aM.memo(qK),cD=Ct.createContext(null),$K=({children:n,value:t})=>{const e={webGPUSupport:t,isSupported:t.isSupported,isAvailable:t.isAvailable};return On.jsx(cD.Provider,{value:e,children:n})},ZK=()=>{const n=Ct.useContext(cD);if(!n)throw new Error("useWebGPUContext must be used within a WebGPUProvider");return n},JK=()=>ZK(),eq=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown",e="Unknown",i="Unknown";if(/android/.test(n)){t="Android";const r=n.match(/android\s*([0-9.]+)/);r&&(i=r[1])}else if(/iphone|ipad|ipod/.test(n)){t="iOS";const r=n.match(/os\s*([0-9_]+)/);r&&(i=r[1].replace(/_/g,"."))}else if(/macintosh|mac os x/.test(n)){t="macOS";const r=n.match(/mac os x\s*([0-9_]+)/);r&&(i=r[1].replace(/_/g,"."))}else if(/windows/.test(n)){t="Windows";const r=n.match(/windows nt\s*([0-9.]+)/);r&&(i=r[1])}else if(/linux/.test(n)){t="Linux";const r=n.match(/\(([^)]+)\)/);r&&(i=r[1])}if(/chrome|crios/.test(n)){e="Chrome";const r=n.match(/(?:chrome|crios)\/([0-9.]+)/);r&&(i=r[1])}else if(/firefox|fxios/.test(n)){e="Firefox";const r=n.match(/(?:firefox|fxios)\/([0-9.]+)/);r&&(i=r[1])}else if(/safari/.test(n)&&!/chrome|crios|android/.test(n)){e="Safari";const r=n.match(/version\/([0-9.]+)/);r&&(i=r[1])}else if(/edg/.test(n)){e="Edge";const r=n.match(/edg\/([0-9.]+)/);r&&(i=r[1])}return{platform:t,browser:e,version:i}},tq=async()=>{const{platform:n,browser:t,version:e}=eq();if(!navigator.gpu)return console.warn("❌ navigator.gpu is not available"),{isSupported:!1,isAvailable:!1,error:"WebGPU is not supported in this browser. Please use a compatible browser.",platform:n,browser:t,platformVersion:e,browserVersion:e};try{const i=await navigator.gpu.requestAdapter();return i?await i.requestDevice()?{isSupported:!0,isAvailable:!0,platform:n,browser:t,platformVersion:e,browserVersion:e}:(console.warn("❌ Failed to create WebGPU device"),{isSupported:!0,isAvailable:!1,error:"WebGPU adapter found but failed to create device. This might be due to hardware limitations or driver issues.",platform:n,browser:t,platformVersion:e,browserVersion:e}):(console.warn("❌ No WebGPU adapter available"),{isSupported:!0,isAvailable:!1,error:"WebGPU is supported but no adapter is available. This might be due to hardware limitations or driver issues.",platform:n,browser:t,platformVersion:e,browserVersion:e})}catch(i){return console.error("❌ WebGPU detection error:",i),{isSupported:!0,isAvailable:!1,error:`WebGPU is supported but failed to initialize: ${i instanceof Error?i.message:"Unknown error"}`,platform:n,browser:t,platformVersion:e,browserVersion:e}}},iq=()=>{const t=new URLSearchParams(window.location.search).get("unity")==="true",{isAvailable:e}=JK();return t&&e?On.jsx(QK,{}):On.jsx(xK,{})},rq=async()=>{const n=await tq();tL.createRoot(document.getElementById("root")).render(On.jsx(Ct.StrictMode,{children:On.jsx($K,{value:n,children:On.jsx(iq,{})})}))};rq();export{Xd as $,ut as A,qB as B,S2 as C,tl as D,ux as E,Ob as F,fx as G,cx as H,dx as I,px as J,H4 as K,up as L,ya as M,O8 as N,u5 as O,pa as P,Eq as Q,l2 as R,Wo as S,c2 as T,zU as U,Mi as V,ga as W,yd as X,Bb as Y,wv as Z,ZB as _,zl as a,Yo as a$,Yd as a0,jn as a1,bd as a2,i8 as a3,KB as a4,yq as a5,LI as a6,ZW as a7,wO as a8,CI as a9,$B as aA,AI as aB,A4 as aC,xy as aD,Sa as aE,Pv as aF,jW as aG,VU as aH,_e as aI,PW as aJ,Je as aK,uH as aL,Md as aM,yI as aN,KG as aO,x4 as aP,nI as aQ,lq as aR,Hf as aS,Jx as aT,To as aU,f5 as aV,hH as aW,js as aX,g2 as aY,R4 as aZ,Nb as a_,Ur as aa,ss as ab,Mq as ac,Sq as ad,Cq as ae,u4 as af,hq as ag,h2 as ah,kd as ai,sk as aj,Aj as ak,hr as al,yy as am,Xo as an,Uf as ao,Hn as ap,f8 as aq,dt as ar,jq as as,Ir as at,fp as au,Hx as av,Ks as aw,gI as ax,EO as ay,PI as az,Ra as b,NG as b$,p5 as b0,dq as b1,Kx as b2,QB as b3,g5 as b4,sf as b5,n8 as b6,Xn as b7,eI as b8,zb as b9,YU as bA,Mb as bB,KU as bC,Fq as bD,Ri as bE,pu as bF,jb as bG,_4 as bH,vH as bI,U4 as bJ,xq as bK,w4 as bL,XM as bM,O4 as bN,OO as bO,no as bP,Hl as bQ,UR as bR,P2 as bS,Co as bT,jr as bU,II as bV,ce as bW,Tr as bX,dp as bY,Bz as bZ,LG as b_,Ws as ba,Bf as bb,Td as bc,L8 as bd,CW as be,jR as bf,GU as bg,FR as bh,mI as bi,rn as bj,UU as bk,DG as bl,YH as bm,Nf as bn,AB as bo,Ly as bp,LO as bq,nu as br,_H as bs,y8 as bt,MG as bu,Vb as bv,Rj as bw,WW as bx,g4 as by,nW as bz,Ht as c,Sn as c$,pq as c0,Me as c1,Zq as c2,pt as c3,Uq as c4,qR as c5,os as c6,Zt as c7,qG as c8,m5 as c9,cp as cA,bx as cB,Ex as cC,Tx as cD,Sx as cE,Ax as cF,F4 as cG,jG as cH,m4 as cI,Yf as cJ,gp as cK,ql as cL,xr as cM,xb as cN,A2 as cO,R2 as cP,XR as cQ,Sy as cR,v2 as cS,Rn as cT,Vo as cU,BH as cV,wn as cW,Gq as cX,pp as cY,Q4 as cZ,Fv as c_,KF as ca,rB as cb,JB as cc,SI as cd,bI as ce,p2 as cf,Zi as cg,x8 as ch,Gl as ci,EH as cj,Aq as ck,b2 as cl,_x as cm,mx as cn,b4 as co,T2 as cp,E2 as cq,gx as cr,vx as cs,yx as ct,v4 as cu,Lf as cv,d2 as cw,xn as cx,Cx as cy,Px as cz,Ji as d,ke as d$,RI as d0,Qs as d1,Ty as d2,Ub as d3,_5 as d4,kG as d5,wG as d6,NO as d7,Py as d8,jo as d9,a2 as dA,$s as dB,Ey as dC,xR as dD,Dv as dE,dO as dF,dI as dG,qz as dH,Hz as dI,k4 as dJ,Qz as dK,zx as dL,tG as dM,Hv as dN,E8 as dO,D4 as dP,Wr as dQ,E4 as dR,Wq as dS,h4 as dT,wj as dU,Ui as dV,Hd as dW,gy as dX,de as dY,gt as dZ,Er as d_,tI as da,kx as db,b8 as dc,Dq as dd,Iq as de,t8 as df,V8 as dg,_I as dh,d5 as di,d4 as dj,Hi as dk,WB as dl,wb as dm,eB as dn,Gt as dp,UO as dq,Bx as dr,Fx as ds,f4 as dt,s2 as du,Xi as dv,jt as dw,hB as dx,by as dy,rr as dz,di as e,YG as e$,oe as e0,te as e1,B4 as e2,Xv as e3,ne as e4,c5 as e5,Vv as e6,M8 as e7,t2 as e8,l4 as e9,en as eA,Ed as eB,An as eC,l8 as eD,Rt as eE,n4 as eF,eW as eG,M4 as eH,Bq as eI,qU as eJ,ie as eK,qF as eL,Wd as eM,kU as eN,Lx as eO,YR as eP,zG as eQ,Oq as eR,aI as eS,qs as eT,Yj as eU,Rr as eV,Xx as eW,Ci as eX,QR as eY,aW as eZ,XG as e_,V4 as ea,OG as eb,Vx as ec,sW as ed,IO as ee,Wx as ef,_p as eg,c4 as eh,OI as ei,Nx as ej,Go as ek,aq as el,Tq as em,Yx as en,My as eo,$4 as ep,kq as eq,z4 as er,oi as es,Wb as et,ct as eu,Vr as ev,k as ew,ue as ex,Ry as ey,Eo as ez,Wi as f,XH as f$,Gx as f0,AW as f1,$x as f2,_8 as f3,Qx as f4,vr as f5,Uv as f6,qx as f7,jv as f8,Rq as f9,uq as fA,$r as fB,hc as fC,iI as fD,Ta as fE,He as fF,Ja as fG,JM as fH,XB as fI,VR as fJ,g8 as fK,kv as fL,h8 as fM,Kd as fN,_W as fO,jd as fP,qf as fQ,il as fR,Ho as fS,uk as fT,Hq as fU,KR as fV,_t as fW,zd as fX,Jt as fY,dc as fZ,jH as f_,rl as fa,ix as fb,rx as fc,Or as fd,Qa as fe,BB as ff,p4 as fg,Xq as fh,Zf as fi,XW as fj,v8 as fk,It as fl,Ni as fm,kf as fn,Qd as fo,EI as fp,ec as fq,wq as fr,TI as fs,hn as ft,Zr as fu,zo as fv,Kf as fw,Rv as fx,Av as fy,tB as fz,RR as g,Oa as g$,Wv as g0,K4 as g1,G4 as g2,_q as g3,DI as g4,Lj as g5,lo as g6,QF as g7,mp as g8,JG as g9,GH as gA,s8 as gB,Zx as gC,ji as gD,FO as gE,HB as gF,jB as gG,Gd as gH,Y4 as gI,DB as gJ,yB as gK,fu as gL,VB as gM,tW as gN,lk as gO,vB as gP,rj as gQ,T8 as gR,Ue as gS,P4 as gT,fk as gU,Ke as gV,rt as gW,Jq as gX,$t as gY,$a as gZ,Fo as g_,FB as ga,ii as gb,wr as gc,mq as gd,EW as ge,gq as gf,Re as gg,vq as gh,Fk as gi,W4 as gj,o4 as gk,Bo as gl,o8 as gm,a8 as gn,bi as go,Lq as gp,wB as gq,SW as gr,p8 as gs,X4 as gt,iW as gu,fI as gv,WG as gw,S4 as gx,rW as gy,cI as gz,C4 as h,S8 as h$,I8 as h0,BO as h1,N8 as h2,VO as h3,y4 as h4,Pj as h5,xI as h6,vp as h7,Be as h8,YM as h9,m8 as hA,HW as hB,iu as hC,u2 as hD,St as hE,tn as hF,rI as hG,Gb as hH,Lb as hI,fc as hJ,_u as hK,qj as hL,n5 as hM,A8 as hN,R8 as hO,Qj as hP,cr as hQ,Mt as hR,IU as hS,cj as hT,$F as hU,RB as hV,N4 as hW,k2 as hX,z2 as hY,G2 as hZ,C8 as h_,ZF as ha,JF as hb,GR as hc,Ca as hd,u8 as he,zn as hf,IG as hg,Fb as hh,Gv as hi,cu as hj,MI as hk,lI as hl,J4 as hm,TW as hn,gW as ho,d8 as hp,qd as hq,nx as hr,_2 as hs,lu as ht,du as hu,Nq as hv,yr as hw,Hs as hx,j4 as hy,xO as hz,Kq as i,y as i$,W2 as i0,Pq as i1,iB as i2,KM as i3,vy as i4,Oi as i5,Ld as i6,Jf as i7,Wn as i8,Iy as i9,Ea as iA,P8 as iB,Ql as iC,Ee as iD,Qf as iE,hI as iF,Rx as iG,c8 as iH,F8 as iI,B8 as iJ,Oy as iK,nr as iL,oI as iM,$i as iN,pI as iO,lp as iP,lc as iQ,Dr as iR,uc as iS,q2 as iT,Ib as iU,Q2 as iV,wR as iW,FU as iX,Mx as iY,jM as iZ,Ie as i_,Gj as ia,L4 as ib,sq as ic,zR as id,Ay as ie,mi as ig,el as ih,YB as ii,h5 as ij,he as ik,Xb as il,T4 as im,zv as io,r8 as ip,CO as iq,D8 as ir,At as is,xx as it,dW as iu,mW as iv,Xs as iw,qt as ix,me as iy,Uo as iz,OB as j,zq as j$,ni as j0,wd as j1,I4 as j2,I as j3,ze as j4,Dd as j5,$q as j6,w8 as j7,Dz as j8,sI as j9,Sz as jA,Ko as jB,Jv as jC,Oo as jD,pO as jE,P5 as jF,E5 as jG,ey as jH,Zv as jI,Yv as jJ,Oz as jK,Rz as jL,LU as jM,Ix as jN,T5 as jO,Gn as jP,Id as jQ,FI as jR,qv as jS,Pz as jT,Dx as jU,Mr as jV,jl as jW,f2 as jX,Cy as jY,Ux as jZ,Z4 as j_,Dn as ja,DR as jb,H2 as jc,ok as jd,Tj as je,q4 as jf,Kl as jg,$M as jh,jf as ji,xB as jj,Hr as jk,nl as jl,Db as jm,qo as jn,cc as jo,Kv as jp,Qv as jq,Tz as jr,$f as js,$v as jt,xd as ju,Iz as jv,qq as jw,xz as jx,Mz as jy,Yq as jz,GG as k,ma as k$,Pn as k0,Wl as k1,C2 as k2,kR as k3,e8 as k4,ZG as k5,ox as k6,vz as k7,yz as k8,fq as k9,dr as kA,_O as kB,AX as kC,Jb as kD,j8 as kE,bp as kF,_a as kG,eD as kH,QI as kI,U8 as kJ,_X as kK,ao as kL,br as kM,ot as kN,JI as kO,Y8 as kP,SX as kQ,mX as kR,Vy as kS,IX as kT,e7 as kU,un as kV,K8 as kW,Za as kX,CX as kY,YO as kZ,gX as k_,r2 as ka,Ez as kb,UB as kc,$U as kd,QG as ke,QU as kf,Ae as kg,Qq as kh,Vq as ki,cq as kj,ui as kk,ye as kl,ZM as km,kB as kn,w as ko,fB as kp,Vt as kq,ap as kr,lB as ks,nf as kt,qM as ku,QM as kv,op as kw,uB as kx,at as ky,Pb as kz,F2 as l,pY as l$,W8 as l0,vX as l1,ay as l2,Jr as l3,q8 as l4,yX as l5,jO as l6,Q8 as l7,$I as l8,k8 as l9,ky as lA,So as lB,KO as lC,zf as lD,$X as lE,rc as lF,va as lG,ba as lH,ZX as lI,In as lJ,Tt as lK,JX as lL,eY as lM,tY as lN,EY as lO,Nt as lP,iY as lQ,rY as lR,aY as lS,uY as lT,nY as lU,sY as lV,lY as lW,dY as lX,hY as lY,oY as lZ,fY as l_,so as la,$8 as lb,XO as lc,EX as ld,G8 as le,Zb as lf,ZI as lg,z8 as lh,Z8 as li,Pa as lj,J8 as lk,PX as ll,Mn as lm,By as ln,$l as lo,zt as lp,oy as lq,sy as lr,TX as ls,Ep as lt,X8 as lu,H8 as lv,Li as lw,rs as lx,zy as ly,fn as lz,B2 as m,_Y as m0,mY as m1,gY as m2,vY as m3,yY as m4,bY as m5,is as m6,su as m7,tc as m8,Cn as m9,ub as mA,wX as ma,uy as mb,TY as mc,SY as md,MY as me,IY as mf,t7 as mg,UY as mh,jY as mi,$Y as mj,oD as mk,l6 as ml,p6 as mm,b6 as mn,wY as mo,DY as mp,xY as mq,A6 as mr,D6 as ms,V6 as mt,H6 as mu,Q6 as mv,iK as mw,oq as mx,HM as my,nq as mz,V2 as n,Ox as o,U2 as p,bq as q,oB as r,vd as s,tx as t,Ys as u,e2 as v,Rb as w,Vd as x,Ud as y,uI as z};
|
|
16108
|
+
`));else throw new Error("could not patch the pbrPixelShader");ce.IncludesShadersStore.customToonShading=AK;async function hy(n,t,e=Ce.BodyShape.MALE,i,r){const o=mu(t,e);if(yp(o))throw new Error(`The wearable="${t.id}" is a texture`);const a=x5(o),s=await sD(n,a);for(const l of s.meshes)l.name.toLowerCase().includes("collider")&&(l.isVisible=!1,n.removeMesh(l));for(const l of s.materials)if(l instanceof Ci){const u=l;u.specularIntensity=0,u.metallic&&(u.metallic=0,u.metallicF0Factor=0),u.name.toLowerCase().includes("hair")&&(r?(u.albedoColor=_e.FromHexString(r).toLinearSpace(),u.specularIntensity=0,u.alpha=1):(u.alpha=0,n.removeMaterial(u))),u.name.toLowerCase().includes("skin")&&(i?(u.albedoColor=_e.FromHexString(i).toLinearSpace(),u.specularIntensity=0,u.alpha=1):(u.alpha=0,n.removeMaterial(u)))}for(const l of s.animationGroups)l.stop(),l.reset(),l.dispose();return{container:s,wearable:t}}async function RK(n,t){const[e,i]=await uK(n,t);try{PK(t);let r;const o=[];if(t.type===Ce.PreviewType.AVATAR){const s=cX(t),l=Array.from(s.values());for(const p of l.filter(YI)){const _=hy(e,p,t.bodyShape,t.skin,t.hair).catch(g=>{console.warn(g.message)});o.push(_)}let u=null;t.socialEmote&&t.socialEmote.Armature_Other&&(u=new ne("parent_other",e));const f=new Map,c=(await Promise.all(o)).filter(iX);for(const p of c)if(p.container.addAllToScene(),u){const _=p.container.instantiateModelsToScene(S=>`${S}_Other`),v=_e.FromHexString("#c9c9c9").toLinearSpace(),E=_.rootNodes;for(const S of E)S.setParent(u);sX(E,v);const T=aX(p.container,E);for(const[S,C]of T)f.set(S,C)}const h=lX(c);if(h){const p=l.filter(rX),{eyes:_,eyebrows:g,mouth:v}=await TK(e,p,t.bodyShape);SK(e,h,_,g,v,t)}r=await yK(e,c,t,f)||CR()}else{const s=t.item;if(s&&!ko(s))try{(await hy(e,s,t.bodyShape,t.skin,t.hair)).container.addAllToScene()}catch{(await hy(e,s,t.bodyShape===Ce.BodyShape.MALE?Ce.BodyShape.FEMALE:Ce.BodyShape.MALE,t.skin,t.hair)).container.addAllToScene()}r=CR()}return t.centerBoundingBox&&dK(e),{scene:i,emote:r}}catch(r){throw e.clearColor=new Je(0,0,0,0),r}}function OK(n){const t=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_PLAY,payload:void 0})},e=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_PAUSE,payload:void 0})},i=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_LOOP,payload:void 0})},r=()=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_END,payload:void 0})},o=a=>{Ce.sendMessage(cn(),Ce.PreviewMessageType.EMOTE_EVENT,{type:Ce.PreviewEmoteEventType.ANIMATION_PLAYING,payload:a})};return n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_PLAY,t),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_PAUSE,e),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_LOOP,i),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_END,r),n.emote.events.on(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,o),()=>{n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_PLAY,t),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_PAUSE,e),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_LOOP,i),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_END,r),n.emote.events.off(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,o)}}const MK=()=>{const[n,t]=Ct.useState(""),{width:e,height:i}=WM(),[r,o]=Ct.useState({}),[a,s]=Ct.useState(!1),[l,u]=Ct.useState(!0),[f,c]=Ct.useState(!1),h=Ct.useRef(null),p=XI(),[_,g,v]=Z5(),[E,T]=Ct.useState(""),[S,C]=Ct.useState(!0),[O,A]=Ct.useState(!1),M=n||v,D=(l||g)&&!M,U=!!E&&!S&&!D,V=S&&!D;return Ct.useEffect(()=>{let B=()=>{};if(h.current&&_){let z={opacity:1};_.background.image&&(T(_.background.image),z.opacity=1,!_.background.transparent&&_.type===Ce.PreviewType.TEXTURE&&(z.backgroundColor=_.background.color)),o(z),_.type===Ce.PreviewType.TEXTURE?(C(!1),u(!1),c(!0)):RK(h.current,_).then(J=>{p.current=J,B=OK(p.current)}).catch(J=>t(J.message)).finally(()=>{u(!1),c(!0)})}return()=>{B()}},[h.current,_]),Ct.useEffect(()=>{var B;O||(f?(Ce.sendMessage(cn(),Ce.PreviewMessageType.LOAD,{renderer:Ce.PreviewRenderer.BABYLON}),A(!0),((_==null?void 0:_.type)===Ce.PreviewType.AVATAR||_!=null&&_.emote&&_.emote!==Ce.PreviewEmote.IDLE)&&((B=p.current)==null||B.emote.play())):M&&(Ce.sendMessage(cn(),Ce.PreviewMessageType.ERROR,{message:M}),A(!0)))},[f,M,O,p,_==null?void 0:_.type,_==null?void 0:_.emote]),Ct.useEffect(()=>{if(g){let B=!1;l||(u(!0),B=!0),O&&(A(!1),B=!0),B&&f&&c(!1)}},[g,l,O,f]),jI(),On.jsxs("div",{className:Zl("Preview",{"is-dragging":a,"is-loading":D,"is-loaded":f,"is-3d":S&&(_==null?void 0:_.camera)===Ce.PreviewCamera.INTERACTIVE,"has-error":!!M,"no-fade-effect":_&&!_.fadeEffect}),style:r,children:[On.jsx("img",{src:E,className:Zl("thumbnail",{"is-visible":U}),alt:"preview"}),On.jsx("canvas",{id:"wearable-preview",className:Zl({"is-visible":V}),width:e,height:i,ref:h,onMouseDown:()=>s(S&&!M),onMouseUp:()=>s(!1)}),M&&On.jsx("div",{className:"error",children:M})]})},xK=aM.memo(MK);var uD=(n=>(n.SET_MODE="SetMode",n.SET_PROFILE="SetProfile",n.SET_EMOTE="SetEmote",n.SET_URNS="SetUrns",n.SET_BACKGROUND="SetBackground",n.SET_SKIN_COLOR="SetSkinColor",n.SET_HAIR_COLOR="SetHairColor",n.SET_EYE_COLOR="SetEyeColor",n.SET_BODY_SHAPE="SetBodyShape",n.SET_SHOW_ANIMATION_REFERENCE="SetShowAnimationReference",n.SET_PROJECTION="SetProjection",n.ADD_BASE64="AddBase64",n.CLEAR_BASE64="ClearBase64",n.SET_CONTRACT="SetContract",n.SET_ITEM_ID="SetItemID",n.SET_TOKEN_ID="SetTokenID",n.SET_DISABLE_LOADER="SetDisableLoader",n.RELOAD="Reload",n.CLEANUP="Cleanup",n))(uD||{});const IK={unityMode:"SetMode",profile:"SetProfile",emote:"SetEmote",urns:"SetUrns",background:"SetBackground",skin:"SetSkinColor",hair:"SetHairColor",eyes:"SetEyeColor",bodyShape:"SetBodyShape",showAnimationReference:"SetShowAnimationReference",projection:"SetProjection",base64s:"AddBase64",contractAddress:"SetContract",itemId:"SetItemID",tokenId:"SetTokenID",disableLoader:"SetDisableLoader"},DK={unityMode:n=>String(n),profile:n=>String(n),emote:n=>String(n),urns:n=>Array.isArray(n)?n.join(","):String(n),background:n=>typeof n=="string"?n.replace("#",""):String(n),skin:n=>typeof n=="string"?n.replace("#",""):String(n),hair:n=>typeof n=="string"?n.replace("#",""):String(n),eyes:n=>typeof n=="string"?n.replace("#",""):String(n),bodyShape:n=>String(n),showAnimationReference:n=>String(n),projection:n=>String(n),contractAddress:n=>String(n),itemId:n=>String(n),tokenId:n=>String(n),disableLoader:n=>String(n)},Pd=(n,t,e)=>{if(n)try{const i=String(t);Object.values(uD).includes(i)||console.warn(`Unknown Unity method: ${i}. Sending anyway...`),e!==void 0?n.SendMessage("JSBridge",i,e):n.SendMessage("JSBridge",i)}catch(i){console.error(`Failed to send Unity message ${t}:`,i)}else console.warn(`Unity instance not ready, cannot send message: ${t}`)},wK=(n,t,e)=>{if(!n){console.warn("Unity instance not available, cannot send override messages");return}let i=0;t.base64s!==void 0&&e.base64s&&(Pd(n,"ClearBase64"),i++,Array.isArray(t.base64s)&&t.base64s.length>0&&t.base64s.forEach(r=>{Pd(n,"AddBase64",r),i++})),Object.entries(t).forEach(([r,o])=>{if(r!=="base64s"&&e[r]&&o!==void 0){const a=IK[r];if(a){const s=DK[r],l=s?s(o):String(o);Pd(n,a,l),i++}else console.warn(`No Unity method mapping found for property: ${r}`)}}),i>0&&Pd(n,"Reload")};var LK={VITE_BASE_URL:""};const dy=new Map,kl=(n,t)=>t;function NK(n){if(dy.has(n))return dy.get(n);const t=new Promise((e,i)=>{const r=document.querySelector(`script[src="${n}"]`);if(r){r.addEventListener("load",()=>e(r)),r.addEventListener("error",a=>i(a));return}const o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>e(o),o.onerror=a=>i(a),document.body.appendChild(o)});return dy.set(n,t),t}const FK=async(n,t,e,i,r,o,a,s,l,u,f,c)=>{try{const h=LK.VITE_BASE_URL||"";return await NK(kl(h,t)),await createUnityInstance(n,{dataUrl:kl(h,e),frameworkUrl:kl(h,i),codeUrl:kl(h,r),streamingAssetsUrl:kl(h,a),symbolUrl:kl(h,o),companyName:s,productName:l,productVersion:u,matchWebGLToCanvasSize:f,arguments:c})}catch(h){throw console.error("❌ Failed to load Unity instance:",h),h}};function BK(n){return{getScreenshot:()=>new Promise(t=>{if(!n){t("");return}n.SendMessage("JSBridge","TakeScreenshot",""),window.addEventListener("message",function e(i){if(i.data.type==="unity-renderer"){const{type:r,payload:o}=i.data.payload;r==="screenshot"&&(window.removeEventListener("message",e),t(o))}})}),getMetrics:()=>new Promise(t=>{if(!n){t({triangles:0,materials:0,textures:0,meshes:0,bodies:0,entities:0});return}n.SendMessage("JSBridge","GetMetrics",""),window.addEventListener("message",function e(i){if(i.data.type==="unity-renderer"){const{type:r,payload:o}=i.data.payload;r==="metrics"&&(window.removeEventListener("message",e),t(o))}})}),changeZoom:async t=>{n&&n.SendMessage("JSBridge","SetZoom",t.toString())},panCamera:async t=>{if(!n)return;const e=t.x??0,i=t.y??0,r=t.z??0;n.SendMessage("JSBridge","SetOffset",`${e},${i},${r}`)},changeCameraPosition:async t=>{if(!n)return;const e=t.alpha??0,i=t.beta??0,r=t.radius??0;n.SendMessage("JSBridge","SetCameraPosition",`${e},${i},${r}`)},setUsername:async t=>{n&&n.SendMessage("JSBridge","SetUsername",t)},cleanup:async()=>{n&&n.SendMessage("JSBridge","Cleanup","")}}}function VK(n){const t=Sb();return{getLength:async()=>new Promise(e=>{if(!n){e(0);return}n.SendMessage("JSBridge","GetEmoteLength",""),window.addEventListener("message",function i(r){if(r.data.type==="unity-renderer"){const{type:o,payload:a}=r.data.payload;o==="emoteLength"&&(window.removeEventListener("message",i),e(a))}})}),isPlaying:async()=>new Promise(e=>{if(!n){e(!1);return}n.SendMessage("JSBridge","IsEmotePlaying",""),window.addEventListener("message",function i(r){if(r.data.type==="unity-renderer"){const{type:o,payload:a}=r.data.payload;o==="isEmotePlaying"&&(window.removeEventListener("message",i),e(a))}})}),goTo:async e=>{n&&(n.SendMessage("JSBridge","GoToEmote",e.toString()),t.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAYING,{length:e}))},play:async()=>{n&&(n.SendMessage("JSBridge","PlayEmote",""),t.emit(Ce.PreviewEmoteEventType.ANIMATION_PLAY))},pause:async()=>{n&&(n.SendMessage("JSBridge","PauseEmote",""),t.emit(Ce.PreviewEmoteEventType.ANIMATION_PAUSE))},stop:async()=>{n&&(n.SendMessage("JSBridge","StopEmote",""),t.emit(Ce.PreviewEmoteEventType.ANIMATION_END))},enableSound:async()=>{n&&n.SendMessage("JSBridge","EnableSound","")},disableSound:async()=>{n&&n.SendMessage("JSBridge","DisableSound","")},hasSound:async()=>new Promise(e=>{if(!n){e(!1);return}n.SendMessage("JSBridge","HasSound",""),window.addEventListener("message",function i(r){if(r.data.type==="unity-renderer"){const{type:o,payload:a}=r.data.payload;o==="hasSound"&&(window.removeEventListener("message",i),e(a))}})}),events:t}}async function UK(n){let t=null;try{if(t=await FK(n,"/unity/Build/aang-renderer.loader.js","/unity/Build/aang-renderer.data.br","/unity/Build/aang-renderer.framework.js.br","/unity/Build/aang-renderer.wasm.br","/unity/Build/aang-renderer.symbols.json.br","/emotes","Decentraland","AangRenderer","2.2.1",!0,[]),!t)throw new Error("Failed to load Unity instance");const e=BK(t),i=VK(t);return{scene:e,emote:i,unity:t}}catch(e){if(console.error("Unity render failed:",e),t!=null&&t.Quit)try{t.Quit()}catch(i){console.error("Error quitting Unity instance:",i)}throw e}}const kK=()=>Math.floor(Math.random()*159)+1,fD=()=>`default${kK()}`,zK=(n,t)=>{var e,i,r,o,a,s;return{eyes:ou(t.eyes||((i=(e=n==null?void 0:n.avatar)==null?void 0:e.eyes)==null?void 0:i.color)&&au(n.avatar.eyes.color)||"#000000"),hair:ou(t.hair||((o=(r=n==null?void 0:n.avatar)==null?void 0:r.hair)==null?void 0:o.color)&&au(n.avatar.hair.color)||"#000000"),skin:ou(t.skin||((s=(a=n==null?void 0:n.avatar)==null?void 0:a.skin)==null?void 0:s.color)&&au(n.avatar.skin.color)||"#cc9b76")}},ff=n=>n||"",rM=n=>n||[],Ad=n=>n.replace("#","");function nM(n){const t=new URL(window.location.href);Object.entries(n).forEach(([e,i])=>{t.searchParams.delete(e),Array.isArray(i)?i.forEach(r=>{r!==""&&t.searchParams.append(e,r)}):i!==""&&t.searchParams.set(e,i)}),window.history.replaceState({},"",t.toString())}function GK(){const{options:n,overrideSources:t}=$b(),[e,i]=Ct.useState(null),[r,o]=Ct.useState(!0),[a,s]=Ct.useState(null),l=Ct.useRef(null),u=Ct.useRef(n),f=Ct.useRef(!0);return Ct.useEffect(()=>{const c=JSON.stringify(n),h=JSON.stringify(u.current);if(!f.current&&c===h)return;f.current=!1,u.current=n,(async()=>{var _,g;try{o(!0),s(null);const v=n.peerUrl||Wf.get("PEER_URL"),E=n.marketplaceServerUrl||n.nftServerUrl||Wf.get("MARKETPLACE_SERVER_URL");let T=Ce.PreviewType.WEARABLE,S={color:n.background||"#4b4852",transparent:n.disableBackground===!0};const C=UI(n.profile);let O=C==null?void 0:C.value;O==="default"&&(O=fD());const A=O&&C?C.type==="address"?await zI(O,v):await GI(O,v):null,M=n.bodyShape||((_=A==null?void 0:A.avatar)==null?void 0:_.bodyShape)||Ce.BodyShape.MALE;let D=null;if(n.contractAddress&&(D=await WI({contractAddress:n.contractAddress,tokenId:n.tokenId,itemId:n.itemId,peerUrl:v,marketplaceServerUrl:E}),D&&as(D))){S={...S,image:D.thumbnail};const Z=qb(D);yp(Z)&&(T=Ce.PreviewType.TEXTURE)}const{eyes:U,hair:V,skin:B}=zK(A,{eyes:n.eyes,hair:n.hair,skin:n.skin}),z=n.unityMode||null,J=n.camera&&Object.values(Ce.PreviewCamera).includes(n.camera)?n.camera:Ce.PreviewCamera.INTERACTIVE,X=n.projection&&Object.values(Ce.PreviewProjection).includes(n.projection)?n.projection:Ce.PreviewProjection.PERSPECTIVE,re=n.disableDefaultEmotes?null:n.emote&&Object.values(Ce.PreviewEmote).includes(n.emote)?n.emote:Ce.PreviewEmote.IDLE,ae={background:S,bodyShape:M,mode:z,projection:X,type:T,base64:((g=n.base64s)==null?void 0:g[0])||null,contract:n.contractAddress||null,disableLoader:n.disableLoader||!1,emote:(re==null?void 0:re.toString())||null,eyeColor:U.replace("#",""),hairColor:V.replace("#",""),item:n.itemId||null,profile:O||null,skinColor:B.replace("#",""),token:n.tokenId||null,urn:n.urns||null,showAnimationReference:null},se=JSON.stringify(ae),H=JSON.stringify(l.current);if(se!==H){if(l.current=ae,Object.keys(t).length===0){const Z=rM(n.urns),q=rM(n.base64s);if(z===Ce.PreviewUnityMode.CONFIG){const N={mode:ff(z||"")};nM(N)}else{const N={background:S.transparent?"":Ad(S.color),disableLoader:n.disableLoader?"true":"",profile:ff(O||""),bodyShape:ff(M||""),eyeColor:Ad(U||""),hairColor:Ad(V||""),skinColor:Ad(B||""),mode:ff(z||""),camera:J,projection:X,emote:ff((re==null?void 0:re.toString())||""),urn:Z.length>0?Z:[""],base64:q.length>0?q:[""]};nM(N)}}i(ae)}o(!1)}catch(v){console.error("[useUnityConfig] Failed to load config:",v),s(v instanceof Error?v.message:"Failed to load config"),o(!1)}})()},[n,t]),[e,r,a]}const WK="unity-renderer",HK="unity-canvas",oM=1,jK="Failed to load Unity",XK=(n,t,e,i)=>{const[r,o]=Ct.useState({isLoaded:!1,isInitialized:!1,error:null}),a=Ct.useCallback(l=>{if(l.data.type===WK){const{type:u,payload:f}=l.data.payload;u==="loaded"&&(f===!0||f==="true")?(o(c=>({...c,isLoaded:!0,isInitialized:!0})),Ce.sendMessage(cn(),Ce.PreviewMessageType.LOAD,{renderer:Ce.PreviewRenderer.UNITY})):u==="customization-done"?Ce.sendMessage(cn(),Ce.PreviewMessageType.CONTROLLER_RESPONSE,{id:"customization-done",ok:!0,result:JSON.parse(l.data.payload.payload)}):u==="error"&&(o(c=>({...c,error:f})),Ce.sendMessage(cn(),Ce.PreviewMessageType.ERROR,{message:"Error loading the wearable. Please try again."}))}},[]),s=Ct.useCallback(async()=>{if(!(!n.canvas.current||n.isInitializing.current||n.unityInstance.current)){n.isInitializing.current=!0,o(l=>({...l,isLoaded:!1,error:null}));try{const{unity:l,scene:u,emote:f}=await UK(n.canvas.current);n.unityInstance.current=l,t.current={scene:u,emote:f},o(c=>({...c,isLoaded:!0,isInitialized:!0})),Ce.sendMessage(cn(),Ce.PreviewMessageType.LOAD,{renderer:Ce.PreviewRenderer.UNITY})}catch(l){const u=l instanceof Error?l.message:jK;console.error("Unity init failed:",l),o(f=>({...f,error:u})),Ce.sendMessage(cn(),Ce.PreviewMessageType.ERROR,{message:u})}finally{n.isInitializing.current=!1}}},[n,t]);return Ct.useEffect(()=>{r.isInitialized||i||!e||s()},[e,i,r.isInitialized,s]),Ct.useEffect(()=>{if(e)return window.addEventListener("message",a,!1),()=>{window.removeEventListener("message",a,!1)}},[e,a]),r},YK=n=>{const[t,e]=Ct.useState({pixelRatio:window.devicePixelRatio||oM,is3D:!0,backgroundImage:""});return Ct.useEffect(()=>{const i=()=>{e(o=>({...o,pixelRatio:window.devicePixelRatio||oM}))},r=window.matchMedia(`(resolution: ${t.pixelRatio}dppx)`);return r.addEventListener("change",i),()=>{r.removeEventListener("change",i)}},[t.pixelRatio]),Ct.useEffect(()=>{n&&e(i=>({...i,backgroundImage:n.background.image||"",is3D:n.type!==Ce.PreviewType.TEXTURE}))},[n]),t},KK=(n,t,e,i,r)=>{const o=Ct.useMemo(()=>{const a={};for(const s of Object.keys(r))r[s]&&i[s]!==void 0&&(a[s]=i[s]);return a},[r,i]);Ct.useEffect(()=>{if(!(!e.isInitialized||!e.isLoaded||!n.current)){if(o.profile==="default"){const a=t.current.profile;o.profile=a!=null&&a.match(/^default\d+$/)?a:fD()}Object.keys(o).length>0&&(wK(n.current,o,r),t.current=o)}},[e.isInitialized,e.isLoaded,o,r,n,t])},qK=()=>{const{width:n=window.innerWidth,height:t=window.innerHeight}=WM(),e=Ct.useRef(null),i=Ct.useRef(null),r=Ct.useRef(!1),o=Ct.useRef({}),a=XI(),[s,l,u]=GK(),{options:f,overrideSources:c}=$b(),h=Ct.useMemo(()=>({canvas:e,unityInstance:i,isInitializing:r,lastSentOverrides:o}),[]),p=XK(h,a,s,l),_=YK(s);KK(h.unityInstance,h.lastSentOverrides,p,f,c),jI();const g=Ct.useMemo(()=>{const A=p.error||u,M=!p.isLoaded&&!A,D=!!_.backgroundImage&&!_.is3D&&!M,U=_.is3D&&!M;return{error:A,isLoading:M,showImage:D,showCanvas:U}},[p.error,p.isLoaded,u,_.backgroundImage,_.is3D]),v=Ct.useMemo(()=>({opacity:1,backgroundColor:!(s!=null&&s.background.transparent)&&(s==null?void 0:s.type)===Ce.PreviewType.TEXTURE?s.background.color:void 0}),[s]),E=Ct.useMemo(()=>({width:`${n}px`,height:`${t}px`}),[n,t]),T=Ct.useMemo(()=>({width:Math.round(n*_.pixelRatio),height:Math.round(t*_.pixelRatio)}),[n,t,_.pixelRatio]),S=Ct.useMemo(()=>Zl("Preview",{"is-loading":g.isLoading,"is-loaded":p.isLoaded,"is-3d":_.is3D,"has-error":!!g.error}),[g.isLoading,p.isLoaded,_.is3D,g.error]),C=Ct.useMemo(()=>Zl("thumbnail",{"is-visible":g.showImage}),[g.showImage]),O=Ct.useMemo(()=>Zl({"is-visible":g.showCanvas}),[g.showCanvas]);return On.jsxs("div",{className:S,style:v,children:[On.jsx("img",{src:_.backgroundImage,className:C,alt:"preview"}),On.jsx("canvas",{ref:h.canvas,id:HK,className:O,width:T.width,height:T.height,style:E}),g.error&&On.jsx("div",{className:"error",children:g.error})]})},QK=aM.memo(qK),cD=Ct.createContext(null),$K=({children:n,value:t})=>{const e={webGPUSupport:t,isSupported:t.isSupported,isAvailable:t.isAvailable};return On.jsx(cD.Provider,{value:e,children:n})},ZK=()=>{const n=Ct.useContext(cD);if(!n)throw new Error("useWebGPUContext must be used within a WebGPUProvider");return n},JK=()=>ZK(),eq=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown",e="Unknown",i="Unknown";if(/android/.test(n)){t="Android";const r=n.match(/android\s*([0-9.]+)/);r&&(i=r[1])}else if(/iphone|ipad|ipod/.test(n)){t="iOS";const r=n.match(/os\s*([0-9_]+)/);r&&(i=r[1].replace(/_/g,"."))}else if(/macintosh|mac os x/.test(n)){t="macOS";const r=n.match(/mac os x\s*([0-9_]+)/);r&&(i=r[1].replace(/_/g,"."))}else if(/windows/.test(n)){t="Windows";const r=n.match(/windows nt\s*([0-9.]+)/);r&&(i=r[1])}else if(/linux/.test(n)){t="Linux";const r=n.match(/\(([^)]+)\)/);r&&(i=r[1])}if(/chrome|crios/.test(n)){e="Chrome";const r=n.match(/(?:chrome|crios)\/([0-9.]+)/);r&&(i=r[1])}else if(/firefox|fxios/.test(n)){e="Firefox";const r=n.match(/(?:firefox|fxios)\/([0-9.]+)/);r&&(i=r[1])}else if(/safari/.test(n)&&!/chrome|crios|android/.test(n)){e="Safari";const r=n.match(/version\/([0-9.]+)/);r&&(i=r[1])}else if(/edg/.test(n)){e="Edge";const r=n.match(/edg\/([0-9.]+)/);r&&(i=r[1])}return{platform:t,browser:e,version:i}},tq=async()=>{const{platform:n,browser:t,version:e}=eq();if(!navigator.gpu)return console.warn("❌ navigator.gpu is not available"),{isSupported:!1,isAvailable:!1,error:"WebGPU is not supported in this browser. Please use a compatible browser.",platform:n,browser:t,platformVersion:e,browserVersion:e};try{const i=await navigator.gpu.requestAdapter();return i?await i.requestDevice()?{isSupported:!0,isAvailable:!0,platform:n,browser:t,platformVersion:e,browserVersion:e}:(console.warn("❌ Failed to create WebGPU device"),{isSupported:!0,isAvailable:!1,error:"WebGPU adapter found but failed to create device. This might be due to hardware limitations or driver issues.",platform:n,browser:t,platformVersion:e,browserVersion:e}):(console.warn("❌ No WebGPU adapter available"),{isSupported:!0,isAvailable:!1,error:"WebGPU is supported but no adapter is available. This might be due to hardware limitations or driver issues.",platform:n,browser:t,platformVersion:e,browserVersion:e})}catch(i){return console.error("❌ WebGPU detection error:",i),{isSupported:!0,isAvailable:!1,error:`WebGPU is supported but failed to initialize: ${i instanceof Error?i.message:"Unknown error"}`,platform:n,browser:t,platformVersion:e,browserVersion:e}}},iq=()=>{const t=new URLSearchParams(window.location.search).get("unity")==="true",{isAvailable:e}=JK();return t&&e?On.jsx(QK,{}):On.jsx(xK,{})},rq=async()=>{const n=await tq();tL.createRoot(document.getElementById("root")).render(On.jsx(Ct.StrictMode,{children:On.jsx($K,{value:n,children:On.jsx(iq,{})})}))};rq();export{Xd as $,ut as A,qB as B,S2 as C,tl as D,ux as E,Ob as F,fx as G,cx as H,dx as I,px as J,H4 as K,up as L,ya as M,O8 as N,u5 as O,pa as P,Eq as Q,l2 as R,Wo as S,c2 as T,zU as U,Mi as V,ga as W,yd as X,Bb as Y,wv as Z,ZB as _,zl as a,Yo as a$,Yd as a0,jn as a1,bd as a2,i8 as a3,KB as a4,yq as a5,LI as a6,ZW as a7,wO as a8,CI as a9,$B as aA,AI as aB,A4 as aC,xy as aD,Sa as aE,Pv as aF,jW as aG,VU as aH,_e as aI,PW as aJ,Je as aK,uH as aL,Md as aM,yI as aN,KG as aO,x4 as aP,nI as aQ,lq as aR,Hf as aS,Jx as aT,To as aU,f5 as aV,hH as aW,js as aX,g2 as aY,R4 as aZ,Nb as a_,Ur as aa,ss as ab,Mq as ac,Sq as ad,Cq as ae,u4 as af,hq as ag,h2 as ah,kd as ai,sk as aj,Aj as ak,hr as al,yy as am,Xo as an,Uf as ao,Hn as ap,f8 as aq,dt as ar,jq as as,Ir as at,fp as au,Hx as av,Ks as aw,gI as ax,EO as ay,PI as az,Ra as b,NG as b$,p5 as b0,dq as b1,Kx as b2,QB as b3,g5 as b4,sf as b5,n8 as b6,Xn as b7,eI as b8,zb as b9,YU as bA,Mb as bB,KU as bC,Fq as bD,Ri as bE,pu as bF,jb as bG,_4 as bH,vH as bI,U4 as bJ,xq as bK,w4 as bL,XM as bM,O4 as bN,OO as bO,no as bP,Hl as bQ,UR as bR,P2 as bS,Co as bT,jr as bU,II as bV,ce as bW,Tr as bX,dp as bY,Bz as bZ,LG as b_,Ws as ba,Bf as bb,Td as bc,L8 as bd,CW as be,jR as bf,GU as bg,FR as bh,mI as bi,rn as bj,UU as bk,DG as bl,YH as bm,Nf as bn,AB as bo,Ly as bp,LO as bq,nu as br,_H as bs,y8 as bt,MG as bu,Vb as bv,Rj as bw,WW as bx,g4 as by,nW as bz,Ht as c,Sn as c$,pq as c0,Me as c1,Zq as c2,pt as c3,Uq as c4,qR as c5,os as c6,Zt as c7,qG as c8,m5 as c9,cp as cA,bx as cB,Ex as cC,Tx as cD,Sx as cE,Ax as cF,F4 as cG,jG as cH,m4 as cI,Yf as cJ,gp as cK,ql as cL,xr as cM,xb as cN,A2 as cO,R2 as cP,XR as cQ,Sy as cR,v2 as cS,Rn as cT,Vo as cU,BH as cV,wn as cW,Gq as cX,pp as cY,Q4 as cZ,Fv as c_,KF as ca,rB as cb,JB as cc,SI as cd,bI as ce,p2 as cf,Zi as cg,x8 as ch,Gl as ci,EH as cj,Aq as ck,b2 as cl,_x as cm,mx as cn,b4 as co,T2 as cp,E2 as cq,gx as cr,vx as cs,yx as ct,v4 as cu,Lf as cv,d2 as cw,xn as cx,Cx as cy,Px as cz,Ji as d,ke as d$,RI as d0,Qs as d1,Ty as d2,Ub as d3,_5 as d4,kG as d5,wG as d6,NO as d7,Py as d8,jo as d9,a2 as dA,$s as dB,Ey as dC,xR as dD,Dv as dE,dO as dF,dI as dG,qz as dH,Hz as dI,k4 as dJ,Qz as dK,zx as dL,tG as dM,Hv as dN,E8 as dO,D4 as dP,Wr as dQ,E4 as dR,Wq as dS,h4 as dT,wj as dU,Ui as dV,Hd as dW,gy as dX,de as dY,gt as dZ,Er as d_,tI as da,kx as db,b8 as dc,Dq as dd,Iq as de,t8 as df,V8 as dg,_I as dh,d5 as di,d4 as dj,Hi as dk,WB as dl,wb as dm,eB as dn,Gt as dp,UO as dq,Bx as dr,Fx as ds,f4 as dt,s2 as du,Xi as dv,jt as dw,hB as dx,by as dy,rr as dz,di as e,YG as e$,oe as e0,te as e1,B4 as e2,Xv as e3,ne as e4,c5 as e5,Vv as e6,M8 as e7,t2 as e8,l4 as e9,en as eA,Ed as eB,An as eC,l8 as eD,Rt as eE,n4 as eF,eW as eG,M4 as eH,Bq as eI,qU as eJ,ie as eK,qF as eL,Wd as eM,kU as eN,Lx as eO,YR as eP,zG as eQ,Oq as eR,aI as eS,qs as eT,Yj as eU,Rr as eV,Xx as eW,Ci as eX,QR as eY,aW as eZ,XG as e_,V4 as ea,OG as eb,Vx as ec,sW as ed,IO as ee,Wx as ef,_p as eg,c4 as eh,OI as ei,Nx as ej,Go as ek,aq as el,Tq as em,Yx as en,My as eo,$4 as ep,kq as eq,z4 as er,oi as es,Wb as et,ct as eu,Vr as ev,k as ew,ue as ex,Ry as ey,Eo as ez,Wi as f,XH as f$,Gx as f0,AW as f1,$x as f2,_8 as f3,Qx as f4,vr as f5,Uv as f6,qx as f7,jv as f8,Rq as f9,uq as fA,$r as fB,hc as fC,iI as fD,Ta as fE,He as fF,Ja as fG,JM as fH,XB as fI,VR as fJ,g8 as fK,kv as fL,h8 as fM,Kd as fN,_W as fO,jd as fP,qf as fQ,il as fR,Ho as fS,uk as fT,Hq as fU,KR as fV,_t as fW,zd as fX,Jt as fY,dc as fZ,jH as f_,rl as fa,ix as fb,rx as fc,Or as fd,Qa as fe,BB as ff,p4 as fg,Xq as fh,Zf as fi,XW as fj,v8 as fk,It as fl,Ni as fm,kf as fn,Qd as fo,EI as fp,ec as fq,wq as fr,TI as fs,hn as ft,Zr as fu,zo as fv,Kf as fw,Rv as fx,Av as fy,tB as fz,RR as g,Oa as g$,Wv as g0,K4 as g1,G4 as g2,_q as g3,DI as g4,Lj as g5,lo as g6,QF as g7,mp as g8,JG as g9,GH as gA,s8 as gB,Zx as gC,ji as gD,FO as gE,HB as gF,jB as gG,Gd as gH,Y4 as gI,DB as gJ,yB as gK,fu as gL,VB as gM,tW as gN,lk as gO,vB as gP,rj as gQ,T8 as gR,Ue as gS,P4 as gT,fk as gU,Ke as gV,rt as gW,Jq as gX,$t as gY,$a as gZ,Fo as g_,FB as ga,ii as gb,wr as gc,mq as gd,EW as ge,gq as gf,Re as gg,vq as gh,Fk as gi,W4 as gj,o4 as gk,Bo as gl,o8 as gm,a8 as gn,bi as go,Lq as gp,wB as gq,SW as gr,p8 as gs,X4 as gt,iW as gu,fI as gv,WG as gw,S4 as gx,rW as gy,cI as gz,C4 as h,S8 as h$,I8 as h0,BO as h1,N8 as h2,VO as h3,y4 as h4,Pj as h5,xI as h6,vp as h7,Be as h8,YM as h9,m8 as hA,HW as hB,iu as hC,u2 as hD,St as hE,tn as hF,rI as hG,Gb as hH,Lb as hI,fc as hJ,_u as hK,qj as hL,n5 as hM,A8 as hN,R8 as hO,Qj as hP,cr as hQ,Mt as hR,IU as hS,cj as hT,$F as hU,RB as hV,N4 as hW,k2 as hX,z2 as hY,G2 as hZ,C8 as h_,ZF as ha,JF as hb,GR as hc,Ca as hd,u8 as he,zn as hf,IG as hg,Fb as hh,Gv as hi,cu as hj,MI as hk,lI as hl,J4 as hm,TW as hn,gW as ho,d8 as hp,qd as hq,nx as hr,_2 as hs,lu as ht,du as hu,Nq as hv,yr as hw,Hs as hx,j4 as hy,xO as hz,Kq as i,y as i$,W2 as i0,Pq as i1,iB as i2,KM as i3,vy as i4,Oi as i5,Ld as i6,Jf as i7,Wn as i8,Iy as i9,Ea as iA,P8 as iB,Ql as iC,Ee as iD,Qf as iE,hI as iF,Rx as iG,c8 as iH,F8 as iI,B8 as iJ,Oy as iK,nr as iL,oI as iM,$i as iN,pI as iO,lp as iP,lc as iQ,Dr as iR,uc as iS,q2 as iT,Ib as iU,Q2 as iV,wR as iW,FU as iX,Mx as iY,jM as iZ,Ie as i_,Gj as ia,L4 as ib,sq as ic,zR as id,Ay as ie,mi as ig,el as ih,YB as ii,h5 as ij,he as ik,Xb as il,T4 as im,zv as io,r8 as ip,CO as iq,D8 as ir,At as is,xx as it,dW as iu,mW as iv,Xs as iw,qt as ix,me as iy,Uo as iz,OB as j,zq as j$,ni as j0,wd as j1,I4 as j2,I as j3,ze as j4,Dd as j5,$q as j6,w8 as j7,Dz as j8,sI as j9,Sz as jA,Ko as jB,Jv as jC,Oo as jD,pO as jE,P5 as jF,E5 as jG,ey as jH,Zv as jI,Yv as jJ,Oz as jK,Rz as jL,LU as jM,Ix as jN,T5 as jO,Gn as jP,Id as jQ,FI as jR,qv as jS,Pz as jT,Dx as jU,Mr as jV,jl as jW,f2 as jX,Cy as jY,Ux as jZ,Z4 as j_,Dn as ja,DR as jb,H2 as jc,ok as jd,Tj as je,q4 as jf,Kl as jg,$M as jh,jf as ji,xB as jj,Hr as jk,nl as jl,Db as jm,qo as jn,cc as jo,Kv as jp,Qv as jq,Tz as jr,$f as js,$v as jt,xd as ju,Iz as jv,qq as jw,xz as jx,Mz as jy,Yq as jz,GG as k,ma as k$,Pn as k0,Wl as k1,C2 as k2,kR as k3,e8 as k4,ZG as k5,ox as k6,vz as k7,yz as k8,fq as k9,dr as kA,_O as kB,AX as kC,Jb as kD,j8 as kE,bp as kF,_a as kG,eD as kH,QI as kI,U8 as kJ,_X as kK,ao as kL,br as kM,ot as kN,JI as kO,Y8 as kP,SX as kQ,mX as kR,Vy as kS,IX as kT,e7 as kU,un as kV,K8 as kW,Za as kX,CX as kY,YO as kZ,gX as k_,r2 as ka,Ez as kb,UB as kc,$U as kd,QG as ke,QU as kf,Ae as kg,Qq as kh,Vq as ki,cq as kj,ui as kk,ye as kl,ZM as km,kB as kn,w as ko,fB as kp,Vt as kq,ap as kr,lB as ks,nf as kt,qM as ku,QM as kv,op as kw,uB as kx,at as ky,Pb as kz,F2 as l,pY as l$,W8 as l0,vX as l1,ay as l2,Jr as l3,q8 as l4,yX as l5,jO as l6,Q8 as l7,$I as l8,k8 as l9,ky as lA,So as lB,KO as lC,zf as lD,$X as lE,rc as lF,va as lG,ba as lH,ZX as lI,In as lJ,Tt as lK,JX as lL,eY as lM,tY as lN,EY as lO,Nt as lP,iY as lQ,rY as lR,aY as lS,uY as lT,nY as lU,sY as lV,lY as lW,dY as lX,hY as lY,oY as lZ,fY as l_,so as la,$8 as lb,XO as lc,EX as ld,G8 as le,Zb as lf,ZI as lg,z8 as lh,Z8 as li,Pa as lj,J8 as lk,PX as ll,Mn as lm,By as ln,$l as lo,zt as lp,oy as lq,sy as lr,TX as ls,Ep as lt,X8 as lu,H8 as lv,Li as lw,rs as lx,zy as ly,fn as lz,B2 as m,_Y as m0,mY as m1,gY as m2,vY as m3,yY as m4,bY as m5,is as m6,su as m7,tc as m8,Cn as m9,ub as mA,wX as ma,uy as mb,TY as mc,SY as md,MY as me,IY as mf,t7 as mg,UY as mh,jY as mi,$Y as mj,oD as mk,l6 as ml,p6 as mm,b6 as mn,wY as mo,DY as mp,xY as mq,A6 as mr,D6 as ms,V6 as mt,H6 as mu,Q6 as mv,iK as mw,oq as mx,HM as my,nq as mz,V2 as n,Ox as o,U2 as p,bq as q,oB as r,vd as s,tx as t,Ys as u,e2 as v,Rb as w,Vd as x,Ud as y,uI as z};
|