@mappedin/events 6.0.1-beta.51 → 6.0.1-beta.52

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/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{a as g,b as F,c as o,d as Ac,e as ya,f as D,g as To,h as ll,i as tt,j as H,k as Pt,l as Ct,m as ko,n as y,o as pg,p as A,q as c,r as p}from"./chunk-6DG3HUAY.js";var Pa=D(Me=>{"use strict";c();Object.defineProperty(Me,"__esModule",{value:!0});Me.regexpCode=Me.getEsmExportName=Me.getProperty=Me.safeStringify=Me.stringify=Me.strConcat=Me.addCodeArg=Me.str=Me._=Me.nil=Me._Code=Me.Name=Me.IDENTIFIER=Me._CodeOrName=void 0;var Bl=class Bl{};o(Bl,"_CodeOrName");var _a=Bl;Me._CodeOrName=_a;Me.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Gl=class Gl extends _a{constructor(t){if(super(),!Me.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};o(Gl,"Name");var xi=Gl;Me.Name=xi;var Kl=class Kl extends _a{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>"".concat(r).concat(n),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof xi&&(r[n.str]=(r[n.str]||0)+1),r),{})}};o(Kl,"_Code");var Lr=Kl;Me._Code=Lr;Me.nil=new Lr("");function Pg(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Vl(r,t[n]),r.push(e[++n]);return new Lr(r)}o(Pg,"_");Me._=Pg;var zl=new Lr("+");function Eg(e,...t){let r=[Sa(e[0])],n=0;for(;n<t.length;)r.push(zl),Vl(r,t[n]),r.push(zl,Sa(e[++n]));return RF(r),new Lr(r)}o(Eg,"str");Me.str=Eg;function Vl(e,t){t instanceof Lr?e.push(...t._items):t instanceof xi?e.push(t):e.push(LF(t))}o(Vl,"addCodeArg");Me.addCodeArg=Vl;function RF(e){let t=1;for(;t<e.length-1;){if(e[t]===zl){let r=CF(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(RF,"optimize");function CF(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof xi||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof xi))return'"'.concat(e).concat(t.slice(1))}o(CF,"mergeExprItems");var _g;function MF(e,t){return t.emptyStr()?e:e.emptyStr()?t:Eg(_g||(_g=y(["","",""])),e,t)}o(MF,"strConcat");Me.strConcat=MF;function LF(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Sa(Array.isArray(e)?e.join(","):e)}o(LF,"interpolate");function UF(e){return new Lr(Sa(e))}o(UF,"stringify");Me.stringify=UF;function Sa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Sa,"safeStringify");Me.safeStringify=Sa;var Sg;function DF(e){return typeof e=="string"&&Me.IDENTIFIER.test(e)?new Lr(".".concat(e)):Pg(Sg||(Sg=y(["[","]"])),e)}o(DF,"getProperty");Me.getProperty=DF;function qF(e){if(typeof e=="string"&&Me.IDENTIFIER.test(e))return new Lr("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}o(qF,"getEsmExportName");Me.getEsmExportName=qF;function zF(e){return new Lr(e.toString())}o(zF,"regexpCode");Me.regexpCode=zF});var Ql=D(gr=>{"use strict";c();Object.defineProperty(gr,"__esModule",{value:!0});gr.ValueScope=gr.ValueScopeName=gr.Scope=gr.varKinds=gr.UsedValueState=void 0;var hr=Pa(),Jl=class Jl extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}};o(Jl,"ValueError");var Wl=Jl,Gc;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Gc||(gr.UsedValueState=Gc={}));gr.varKinds={const:new hr.Name("const"),let:new hr.Name("let"),var:new hr.Name("var")};var Zl=class Zl{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof hr.Name?t:this.name(t)}name(t){return new hr.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}};o(Zl,"Scope");var Kc=Zl;gr.Scope=Kc;var Tg,Yl=class Yl extends hr.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,hr._)(Tg||(Tg=y([".","[","]"])),new hr.Name(r),n)}};o(Yl,"ValueScopeName");var Wc=Yl;gr.ValueScopeName=Wc;var kg,VF=(0,hr._)(kg||(kg=y(["\n"],["\\n"]))),Fg,Ag,jg,Xl=class Xl extends Kc{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=F(g({},t),{_n:t.lines?VF:hr.nil})}get(){return this._scope}name(t){return new Wc(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,u=this._values[s];if(u){let m=u.get(a);if(m)return m}else u=this._values[s]=new Map;u.set(a,i);let l=this._scope[s]||(this._scope[s]=[]),d=l.length;return l[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,hr._)(Fg||(Fg=y(["","",""])),t,n.scopePath)})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error('CodeGen: name "'.concat(i,'" has no value'));return i.value.code},r,n)}_reduceValues(t,r,n={},i){let s=hr.nil;for(let a in t){let u=t[a];if(!u)continue;let l=n[a]=n[a]||new Map;u.forEach(d=>{if(l.has(d))return;l.set(d,Gc.Started);let m=r(d);if(m){let h=this.opts.es5?gr.varKinds.var:gr.varKinds.const;s=(0,hr._)(Ag||(Ag=y(["",""," "," = ",";",""])),s,h,d,m,this.opts._n)}else if(m=i==null?void 0:i(d))s=(0,hr._)(jg||(jg=y(["","","",""])),s,m,this.opts._n);else throw new Wl(d);l.set(d,Gc.Completed)})}return s}};o(Xl,"ValueScope");var Hl=Xl;gr.ValueScope=Hl});var de=D(ye=>{"use strict";c();Object.defineProperty(ye,"__esModule",{value:!0});ye.or=ye.and=ye.not=ye.CodeGen=ye.operators=ye.varKinds=ye.ValueScopeName=ye.ValueScope=ye.Scope=ye.Name=ye.regexpCode=ye.stringify=ye.getProperty=ye.nil=ye.strConcat=ye.str=ye._=void 0;var ve=Pa(),sn=Ql(),Ro=Pa();Object.defineProperty(ye,"_",{enumerable:!0,get:o(function(){return Ro._},"get")});Object.defineProperty(ye,"str",{enumerable:!0,get:o(function(){return Ro.str},"get")});Object.defineProperty(ye,"strConcat",{enumerable:!0,get:o(function(){return Ro.strConcat},"get")});Object.defineProperty(ye,"nil",{enumerable:!0,get:o(function(){return Ro.nil},"get")});Object.defineProperty(ye,"getProperty",{enumerable:!0,get:o(function(){return Ro.getProperty},"get")});Object.defineProperty(ye,"stringify",{enumerable:!0,get:o(function(){return Ro.stringify},"get")});Object.defineProperty(ye,"regexpCode",{enumerable:!0,get:o(function(){return Ro.regexpCode},"get")});Object.defineProperty(ye,"Name",{enumerable:!0,get:o(function(){return Ro.Name},"get")});var Yc=Ql();Object.defineProperty(ye,"Scope",{enumerable:!0,get:o(function(){return Yc.Scope},"get")});Object.defineProperty(ye,"ValueScope",{enumerable:!0,get:o(function(){return Yc.ValueScope},"get")});Object.defineProperty(ye,"ValueScopeName",{enumerable:!0,get:o(function(){return Yc.ValueScopeName},"get")});Object.defineProperty(ye,"varKinds",{enumerable:!0,get:o(function(){return Yc.varKinds},"get")});ye.operators={GT:new ve._Code(">"),GTE:new ve._Code(">="),LT:new ve._Code("<"),LTE:new ve._Code("<="),EQ:new ve._Code("==="),NEQ:new ve._Code("!=="),NOT:new ve._Code("!"),OR:new ve._Code("||"),AND:new ve._Code("&&"),ADD:new ve._Code("+")};var pp=class pp{optimizeNodes(){return this}optimizeNames(t,r){return this}};o(pp,"Node");var to=pp,dp=class dp extends to{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?sn.varKinds.var:this.varKind,i=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(i,";")+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=ls(this.rhs,t,r)),this}get names(){return this.rhs instanceof ve._CodeOrName?this.rhs.names:{}}};o(dp,"Def");var ep=dp,mp=class mp extends to{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return"".concat(this.lhs," = ").concat(this.rhs,";")+t}optimizeNames(t,r){if(!(this.lhs instanceof ve.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=ls(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ve.Name?{}:g({},this.lhs.names);return Zc(t,this.rhs)}};o(mp,"Assign");var Hc=mp,yp=class yp extends Hc{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}};o(yp,"AssignOp");var tp=yp,hp=class hp extends to{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}};o(hp,"Label");var rp=hp,gp=class gp extends to{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}};o(gp,"Break");var np=gp,xp=class xp extends to{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}};o(xp,"Throw");var op=xp,Ip=class Ip extends to{constructor(t){super(),this.code=t}render({_n:t}){return"".concat(this.code,";")+t}optimizeNodes(){return"".concat(this.code)?this:void 0}optimizeNames(t,r){return this.code=ls(this.code,t,r),this}get names(){return this.code instanceof ve._CodeOrName?this.code.names:{}}};o(Ip,"AnyCode");var ip=Ip,bp=class bp extends to{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(t,r)||(BF(t,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>wi(t,r.names),{})}};o(bp,"ParentNode");var Ea=bp,wp=class wp extends Ea{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};o(wp,"BlockNode");var ro=wp,$p=class $p extends Ea{};o($p,"Root");var sp=$p,vp=class vp extends ro{};o(vp,"Else");var fs=vp;fs.kind="else";var us=class us extends ro{constructor(t,r){super(r),this.condition=t}render(t){let r="if(".concat(this.condition,")")+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new fs(n):n}if(r)return t===!1?r instanceof us?r:r.nodes:this.nodes.length?this:new us(Dg(t),r instanceof us?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=ls(this.condition,t,r),this}get names(){let t=super.names;return Zc(t,this.condition),this.else&&wi(t,this.else.names),t}};o(us,"If");var Ii=us;Ii.kind="if";var Op=class Op extends ro{};o(Op,"For");var bi=Op;bi.kind="for";var _p=class _p extends bi{constructor(t){super(),this.iteration=t}render(t){return"for(".concat(this.iteration,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=ls(this.iteration,t,r),this}get names(){return wi(super.names,this.iteration.names)}};o(_p,"ForLoop");var ap=_p,Sp=class Sp extends bi{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?sn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return"for(".concat(r," ").concat(n,"=").concat(i,"; ").concat(n,"<").concat(s,"; ").concat(n,"++)")+super.render(t)}get names(){let t=Zc(super.names,this.from);return Zc(t,this.to)}};o(Sp,"ForRange");var cp=Sp,Pp=class Pp extends bi{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=ls(this.iterable,t,r),this}get names(){return wi(super.names,this.iterable.names)}};o(Pp,"ForIter");var Jc=Pp,Ep=class Ep extends ro{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){let r=this.async?"async ":"";return"".concat(r,"function ").concat(this.name,"(").concat(this.args,")")+super.render(t)}};o(Ep,"Func");var Ta=Ep;Ta.kind="func";var Tp=class Tp extends Ea{render(t){return"return "+super.render(t)}};o(Tp,"Return");var ka=Tp;ka.kind="return";var kp=class kp extends ro{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&wi(t,this.catch.names),this.finally&&wi(t,this.finally.names),t}};o(kp,"Try");var up=kp,Fp=class Fp extends ro{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};o(Fp,"Catch");var Fa=Fp;Fa.kind="catch";var Ap=class Ap extends ro{render(t){return"finally"+super.render(t)}};o(Ap,"Finally");var Aa=Ap;Aa.kind="finally";var Ng,Rg,Cg,jp=class jp{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=F(g({},r),{_n:r.lines?"\n":""}),this._extScope=t,this._scope=new sn.Scope({parent:t}),this._nodes=[new sp]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new ep(t,s,n)),s}const(t,r,n){return this._def(sn.varKinds.const,t,r,n)}let(t,r,n){return this._def(sn.varKinds.let,t,r,n)}var(t,r,n){return this._def(sn.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Hc(t,r,n))}add(t,r){return this._leafNode(new tp(t,ye.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ve.nil&&this._leafNode(new ip(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,ve.addCodeArg)(r,i));return r.push("}"),new ve._Code(r)}if(t,r,n){if(this._blockNode(new Ii(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Ii(t))}else(){return this._elseNode(new fs)}endIf(){return this._endBlockNode(Ii,fs)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new ap(t),r)}forRange(t,r,n,i,s=this.opts.es5?sn.varKinds.var:sn.varKinds.let){let a=this._scope.toName(t);return this._for(new cp(s,a,r,n),()=>i(a))}forOf(t,r,n,i=sn.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let a=r instanceof ve.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ve._)(Ng||(Ng=y(["",".length"])),a),u=>{this.var(s,(0,ve._)(Rg||(Rg=y(["","[","]"])),a,u)),n(s)})}return this._for(new Jc("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?sn.varKinds.var:sn.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ve._)(Cg||(Cg=y(["Object.keys(",")"])),r),n);let s=this._scope.toName(t);return this._for(new Jc("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(bi)}label(t){return this._leafNode(new rp(t))}break(t){return this._leafNode(new np(t))}return(t){let r=new ka;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ka)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new up;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new Fa(s),r(s)}return n&&(this._currNode=i.finally=new Aa,this.code(n)),this._endBlockNode(Fa,Aa)}throw(t){return this._leafNode(new op(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}func(t,r=ve.nil,n,i){return this._blockNode(new Ta(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Ta)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}_elseNode(t){let r=this._currNode;if(!(r instanceof Ii))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};o(jp,"CodeGen");var fp=jp;ye.CodeGen=fp;function wi(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(wi,"addNames");function Zc(e,t){return t instanceof ve._CodeOrName?wi(e,t.names):e}o(Zc,"addExprNames");function ls(e,t,r){if(e instanceof ve.Name)return n(e);if(!i(e))return e;return new ve._Code(e._items.reduce((s,a)=>(a instanceof ve.Name&&(a=n(a)),a instanceof ve._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||t[s.str]!==1?s:(delete t[s.str],a)}function i(s){return s instanceof ve._Code&&s._items.some(a=>a instanceof ve.Name&&t[a.str]===1&&r[a.str]!==void 0)}}o(ls,"optimizeExpr");function BF(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(BF,"subtractNames");var Mg;function Dg(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ve._)(Mg||(Mg=y(["!",""])),lp(e))}o(Dg,"not");ye.not=Dg;var GF=qg(ye.operators.AND);function KF(...e){return e.reduce(GF)}o(KF,"and");ye.and=KF;var WF=qg(ye.operators.OR);function HF(...e){return e.reduce(WF)}o(HF,"or");ye.or=HF;var Lg;function qg(e){return(t,r)=>t===ve.nil?r:r===ve.nil?t:(0,ve._)(Lg||(Lg=y([""," "," ",""])),lp(t),e,lp(r))}o(qg,"mappend");var Ug;function lp(e){return e instanceof ve.Name?e:(0,ve._)(Ug||(Ug=y(["(",")"])),e)}o(lp,"par")});var Le=D(ge=>{"use strict";c();Object.defineProperty(ge,"__esModule",{value:!0});ge.checkStrictMode=ge.getErrorPath=ge.Type=ge.useFunc=ge.setEvaluated=ge.evaluatedPropsToName=ge.mergeEvaluated=ge.eachItem=ge.unescapeJsonPointer=ge.escapeJsonPointer=ge.escapeFragment=ge.unescapeFragment=ge.schemaRefOrVal=ge.schemaHasRulesButRef=ge.schemaHasRules=ge.checkUnknownRules=ge.alwaysValidSchema=ge.toHash=void 0;var rt=de(),JF=Pa();function ZF(e){let t={};for(let r of e)t[r]=!0;return t}o(ZF,"toHash");ge.toHash=ZF;function YF(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(cx(e,t),!ux(t,e.self.RULES.all))}o(YF,"alwaysValidSchema");ge.alwaysValidSchema=YF;function cx(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let s in t)i[s]||px(e,'unknown keyword: "'.concat(s,'"'))}o(cx,"checkUnknownRules");ge.checkUnknownRules=cx;function ux(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(ux,"schemaHasRules");ge.schemaHasRules=ux;function XF(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(XF,"schemaHasRulesButRef");ge.schemaHasRulesButRef=XF;var Bg,Gg;function QF({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,rt._)(Bg||(Bg=y(["",""])),r)}return(0,rt._)(Gg||(Gg=y(["","","",""])),e,t,(0,rt.getProperty)(n))}o(QF,"schemaRefOrVal");ge.schemaRefOrVal=QF;function eA(e){return fx(decodeURIComponent(e))}o(eA,"unescapeFragment");ge.unescapeFragment=eA;function tA(e){return encodeURIComponent(Rp(e))}o(tA,"escapeFragment");ge.escapeFragment=tA;function Rp(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}o(Rp,"escapeJsonPointer");ge.escapeJsonPointer=Rp;function fx(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(fx,"unescapeJsonPointer");ge.unescapeJsonPointer=fx;function rA(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(rA,"eachItem");ge.eachItem=rA;function zg({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{let l=a===void 0?s:a instanceof rt.Name?(s instanceof rt.Name?e(i,s,a):t(i,s,a),a):s instanceof rt.Name?(t(i,a,s),s):r(s,a);return u===rt.Name&&!(l instanceof rt.Name)?n(i,l):l}}o(zg,"makeMergeEvaluated");var Kg,Wg,Hg,Jg,Zg,Yg,Xg,Qg,ex,tx;ge.mergeEvaluated={props:zg({mergeNames:o((e,t,r)=>e.if((0,rt._)(Kg||(Kg=y([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,rt._)(Wg||(Wg=y([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,rt._)(Hg||(Hg=y([""," || {}"])),r)).code((0,rt._)(Jg||(Jg=y(["Object.assign(",", ",")"])),r,t)))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,rt._)(Zg||(Zg=y([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,rt._)(Yg||(Yg=y([""," || {}"])),r)),Cp(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:g(g({},e),t),"mergeValues"),resultToName:lx}),items:zg({mergeNames:o((e,t,r)=>e.if((0,rt._)(Xg||(Xg=y([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,rt._)(Qg||(Qg=y([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,rt._)(ex||(ex=y([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,rt._)(tx||(tx=y([""," > "," ? "," : ",""])),r,t,r,t))),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};var rx;function lx(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,rt._)(rx||(rx=y(["{}"]))));return t!==void 0&&Cp(e,r,t),r}o(lx,"evaluatedPropsToName");ge.evaluatedPropsToName=lx;var nx;function Cp(e,t,r){Object.keys(r).forEach(n=>e.assign((0,rt._)(nx||(nx=y(["","",""])),t,(0,rt.getProperty)(n)),!0))}o(Cp,"setEvaluated");ge.setEvaluated=Cp;var Vg={};function nA(e,t){return e.scopeValue("func",{ref:t,code:Vg[t.code]||(Vg[t.code]=new JF._Code(t.code))})}o(nA,"useFunc");ge.useFunc=nA;var Np;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Np||(ge.Type=Np={}));var ox,ix,sx,ax;function oA(e,t,r){if(e instanceof rt.Name){let n=t===Np.Num;return r?n?(0,rt._)(ox||(ox=y(['"[" + ',' + "]"'])),e):(0,rt._)(ix||(ix=y(['"[\'" + ',' + "\']"'])),e):n?(0,rt._)(sx||(sx=y(['"/" + ',""])),e):(0,rt._)(ax||(ax=y(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,rt.getProperty)(e).toString():"/"+Rp(e)}o(oA,"getErrorPath");ge.getErrorPath=oA;function px(e,t,r=e.opts.strictSchema){if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}}o(px,"checkStrictMode");ge.checkStrictMode=px});var no=D(Mp=>{"use strict";c();Object.defineProperty(Mp,"__esModule",{value:!0});var Jt=de(),iA={data:new Jt.Name("data"),valCxt:new Jt.Name("valCxt"),instancePath:new Jt.Name("instancePath"),parentData:new Jt.Name("parentData"),parentDataProperty:new Jt.Name("parentDataProperty"),rootData:new Jt.Name("rootData"),dynamicAnchors:new Jt.Name("dynamicAnchors"),vErrors:new Jt.Name("vErrors"),errors:new Jt.Name("errors"),this:new Jt.Name("this"),self:new Jt.Name("self"),scope:new Jt.Name("scope"),json:new Jt.Name("json"),jsonPos:new Jt.Name("jsonPos"),jsonLen:new Jt.Name("jsonLen"),jsonPart:new Jt.Name("jsonPart")};Mp.default=iA});var ja=D(Zt=>{"use strict";c();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.extendErrors=Zt.resetErrorsCount=Zt.reportExtraError=Zt.reportError=Zt.keyword$DataError=Zt.keywordError=void 0;var ke=de(),Xc=Le(),ar=no(),dx;Zt.keywordError={message:o(({keyword:e})=>(0,ke.str)(dx||(dx=y(['must pass "','" keyword validation'])),e),"message")};var mx,yx;Zt.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,ke.str)(mx||(mx=y(['"','" keyword must be '," ($data)"])),e,t):(0,ke.str)(yx||(yx=y(['"','" keyword is invalid ($data)'])),e),"message")};var hx;function sA(e,t=Zt.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:a,allErrors:u}=i,l=Dx(e,t,r);(n!=null?n:a||u)?Lx(s,l):Ux(i,(0,ke._)(hx||(hx=y(["[","]"])),l))}o(sA,"reportError");Zt.reportError=sA;function aA(e,t=Zt.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:a}=n,u=Dx(e,t,r);Lx(i,u),s||a||Ux(n,ar.default.vErrors)}o(aA,"reportExtraError");Zt.reportExtraError=aA;var gx,xx;function cA(e,t){e.assign(ar.default.errors,t),e.if((0,ke._)(gx||(gx=y([""," !== null"])),ar.default.vErrors),()=>e.if(t,()=>e.assign((0,ke._)(xx||(xx=y(["",".length"])),ar.default.vErrors),t),()=>e.assign(ar.default.vErrors,null)))}o(cA,"resetErrorsCount");Zt.resetErrorsCount=cA;var Ix,bx,wx,$x,vx,Ox,_x;function uA({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",i,ar.default.errors,u=>{e.const(a,(0,ke._)(Ix||(Ix=y(["","[","]"])),ar.default.vErrors,u)),e.if((0,ke._)(bx||(bx=y(["",".instancePath === undefined"])),a),()=>e.assign((0,ke._)(wx||(wx=y(["",".instancePath"])),a),(0,ke.strConcat)(ar.default.instancePath,s.errorPath))),e.assign((0,ke._)($x||($x=y(["",".schemaPath"])),a),(0,ke.str)(vx||(vx=y(["","/",""])),s.errSchemaPath,t)),s.opts.verbose&&(e.assign((0,ke._)(Ox||(Ox=y(["",".schema"])),a),r),e.assign((0,ke._)(_x||(_x=y(["",".data"])),a),n))})}o(uA,"extendErrors");Zt.extendErrors=uA;var Sx,Px,Ex,Tx;function Lx(e,t){let r=e.const("err",t);e.if((0,ke._)(Sx||(Sx=y([""," === null"])),ar.default.vErrors),()=>e.assign(ar.default.vErrors,(0,ke._)(Px||(Px=y(["[","]"])),r)),(0,ke._)(Ex||(Ex=y(["",".push(",")"])),ar.default.vErrors,r)),e.code((0,ke._)(Tx||(Tx=y(["","++"])),ar.default.errors))}o(Lx,"addError");var kx,Fx;function Ux(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,ke._)(kx||(kx=y(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,ke._)(Fx||(Fx=y(["",".errors"])),n),t),r.return(!1))}o(Ux,"returnErrors");var $i={keyword:new ke.Name("keyword"),schemaPath:new ke.Name("schemaPath"),params:new ke.Name("params"),propertyName:new ke.Name("propertyName"),message:new ke.Name("message"),schema:new ke.Name("schema"),parentSchema:new ke.Name("parentSchema")},Ax;function Dx(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ke._)(Ax||(Ax=y(["{}"]))):fA(e,t,r)}o(Dx,"errorObjectCode");function fA(e,t,r={}){let{gen:n,it:i}=e,s=[lA(i,r),pA(e,r)];return dA(e,t,s),n.object(...s)}o(fA,"errorObject");var jx;function lA({errorPath:e},{instancePath:t}){let r=t?(0,ke.str)(jx||(jx=y(["","",""])),e,(0,Xc.getErrorPath)(t,Xc.Type.Str)):e;return[ar.default.instancePath,(0,ke.strConcat)(ar.default.instancePath,r)]}o(lA,"errorInstancePath");var Nx,Rx;function pA({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,ke.str)(Nx||(Nx=y(["","/",""])),t,e);return r&&(i=(0,ke.str)(Rx||(Rx=y(["","",""])),i,(0,Xc.getErrorPath)(r,Xc.Type.Str))),[$i.schemaPath,i]}o(pA,"errorSchemaPath");var Cx,Mx;function dA(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:a,it:u}=e,{opts:l,propertyName:d,topSchemaRef:m,schemaPath:h}=u;n.push([$i.keyword,i],[$i.params,typeof t=="function"?t(e):t||(0,ke._)(Cx||(Cx=y(["{}"])))]),l.messages&&n.push([$i.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([$i.schema,a],[$i.parentSchema,(0,ke._)(Mx||(Mx=y(["","",""])),m,h)],[ar.default.data,s]),d&&n.push([$i.propertyName,d])}o(dA,"extraErrorProps")});var Vx=D(ps=>{"use strict";c();Object.defineProperty(ps,"__esModule",{value:!0});ps.boolOrEmptySchema=ps.topBoolOrEmptySchema=void 0;var mA=ja(),yA=de(),hA=no(),gA={message:"boolean schema is false"},qx;function xA(e){let{gen:t,schema:r,validateName:n}=e;r===!1?zx(e,!1):typeof r=="object"&&r.$async===!0?t.return(hA.default.data):(t.assign((0,yA._)(qx||(qx=y(["",".errors"])),n),null),t.return(!0))}o(xA,"topBoolOrEmptySchema");ps.topBoolOrEmptySchema=xA;function IA(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),zx(e)):r.var(t,!0)}o(IA,"boolOrEmptySchema");ps.boolOrEmptySchema=IA;function zx(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,mA.reportError)(i,gA,void 0,t)}o(zx,"falseSchemaError")});var Lp=D(ds=>{"use strict";c();Object.defineProperty(ds,"__esModule",{value:!0});ds.getRules=ds.isJSONType=void 0;var bA=["string","number","integer","boolean","null","object","array"],wA=new Set(bA);function $A(e){return typeof e=="string"&&wA.has(e)}o($A,"isJSONType");ds.isJSONType=$A;function vA(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:F(g({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(vA,"getRules");ds.getRules=vA});var Up=D(Co=>{"use strict";c();Object.defineProperty(Co,"__esModule",{value:!0});Co.shouldUseRule=Co.shouldUseGroup=Co.schemaHasRulesForType=void 0;function OA({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Bx(e,n)}o(OA,"schemaHasRulesForType");Co.schemaHasRulesForType=OA;function Bx(e,t){return t.rules.some(r=>Gx(e,r))}o(Bx,"shouldUseGroup");Co.shouldUseGroup=Bx;function Gx(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(Gx,"shouldUseRule");Co.shouldUseRule=Gx});var Na=D(Yt=>{"use strict";c();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.reportTypeError=Yt.checkDataTypes=Yt.checkDataType=Yt.coerceAndCheckDataType=Yt.getJSONTypes=Yt.getSchemaTypes=Yt.DataType=void 0;var _A=Lp(),SA=Up(),PA=ja(),fe=de(),_I=Le(),ms;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ms||(Yt.DataType=ms={}));function EA(e){let t=SI(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(EA,"getSchemaTypes");Yt.getSchemaTypes=EA;function SI(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(_A.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(SI,"getJSONTypes");Yt.getJSONTypes=SI;function TA(e,t){let{gen:r,data:n,opts:i}=e,s=kA(t,i.coerceTypes),a=t.length>0&&!(s.length===0&&t.length===1&&(0,SA.schemaHasRulesForType)(e,t[0]));if(a){let u=qp(t,n,i.strictNumbers,ms.Wrong);r.if(u,()=>{s.length?FA(e,t,s):zp(e)})}return a}o(TA,"coerceAndCheckDataType");Yt.coerceAndCheckDataType=TA;var PI=new Set(["string","number","integer","boolean","null"]);function kA(e,t){return t?e.filter(r=>PI.has(r)||t==="array"&&r==="array"):[]}o(kA,"coerceToTypes");var Kx,Wx,Hx,Jx,Zx,Yx,Xx,Qx,eI,tI,rI,nI,oI,iI,sI,aI,cI,uI,fI,lI;function FA(e,t,r){let{gen:n,data:i,opts:s}=e,a=n.let("dataType",(0,fe._)(Kx||(Kx=y(["typeof ",""])),i)),u=n.let("coerced",(0,fe._)(Wx||(Wx=y(["undefined"]))));s.coerceTypes==="array"&&n.if((0,fe._)(Hx||(Hx=y([""," == 'object' && Array.isArray(",") && ",".length == 1"])),a,i,i),()=>n.assign(i,(0,fe._)(Jx||(Jx=y(["","[0]"])),i)).assign(a,(0,fe._)(Zx||(Zx=y(["typeof ",""])),i)).if(qp(t,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,fe._)(Yx||(Yx=y([""," !== undefined"])),u));for(let d of r)(PI.has(d)||d==="array"&&s.coerceTypes==="array")&&l(d);n.else(),zp(e),n.endIf(),n.if((0,fe._)(Xx||(Xx=y([""," !== undefined"])),u),()=>{n.assign(i,u),AA(e,u)});function l(d){switch(d){case"string":n.elseIf((0,fe._)(Qx||(Qx=y(["",' == "number" || ',' == "boolean"'])),a,a)).assign(u,(0,fe._)(eI||(eI=y(['"" + ',""])),i)).elseIf((0,fe._)(tI||(tI=y([""," === null"])),i)).assign(u,(0,fe._)(rI||(rI=y(['""']))));return;case"number":n.elseIf((0,fe._)(nI||(nI=y(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),a,i,a,i,i,i)).assign(u,(0,fe._)(oI||(oI=y(["+",""])),i));return;case"integer":n.elseIf((0,fe._)(iI||(iI=y(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),a,i,a,i,i,i,i)).assign(u,(0,fe._)(sI||(sI=y(["+",""])),i));return;case"boolean":n.elseIf((0,fe._)(aI||(aI=y(["",' === "false" || '," === 0 || "," === null"])),i,i,i)).assign(u,!1).elseIf((0,fe._)(cI||(cI=y(["",' === "true" || '," === 1"])),i,i)).assign(u,!0);return;case"null":n.elseIf((0,fe._)(uI||(uI=y(["",' === "" || '," === 0 || "," === false"])),i,i,i)),n.assign(u,null);return;case"array":n.elseIf((0,fe._)(fI||(fI=y(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),a,a,a,i)).assign(u,(0,fe._)(lI||(lI=y(["[","]"])),i))}}o(l,"coerceSpecificType")}o(FA,"coerceData");var pI,dI;function AA({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,fe._)(pI||(pI=y([""," !== undefined"])),t),()=>e.assign((0,fe._)(dI||(dI=y(["","[","]"])),t,r),n))}o(AA,"assignParentData");var mI,yI,hI,gI,xI,II,bI;function Dp(e,t,r,n=ms.Correct){let i=n===ms.Correct?fe.operators.EQ:fe.operators.NEQ,s;switch(e){case"null":return(0,fe._)(mI||(mI=y([""," "," null"])),t,i);case"array":s=(0,fe._)(yI||(yI=y(["Array.isArray(",")"])),t);break;case"object":s=(0,fe._)(hI||(hI=y([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":s=a((0,fe._)(gI||(gI=y(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":s=a();break;default:return(0,fe._)(xI||(xI=y(["typeof "," "," ",""])),t,i,e)}return n===ms.Correct?s:(0,fe.not)(s);function a(u=fe.nil){return(0,fe.and)((0,fe._)(II||(II=y(["typeof ",' == "number"'])),t),u,r?(0,fe._)(bI||(bI=y(["isFinite(",")"])),t):fe.nil)}}o(Dp,"checkDataType");Yt.checkDataType=Dp;var wI,$I;function qp(e,t,r,n){if(e.length===1)return Dp(e[0],t,r,n);let i,s=(0,_I.toHash)(e);if(s.array&&s.object){let a=(0,fe._)(wI||(wI=y(["typeof ",' != "object"'])),t);i=s.null?a:(0,fe._)($I||($I=y(["!"," || ",""])),t,a),delete s.null,delete s.array,delete s.object}else i=fe.nil;s.number&&delete s.integer;for(let a in s)i=(0,fe.and)(i,Dp(a,t,r,n));return i}o(qp,"checkDataTypes");Yt.checkDataTypes=qp;var vI,OI,jA={message:o(({schema:e})=>"must be ".concat(e),"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,fe._)(vI||(vI=y(["{type: ","}"])),e):(0,fe._)(OI||(OI=y(["{type: ","}"])),t),"params")};function zp(e){let t=NA(e);(0,PA.reportError)(t,jA)}o(zp,"reportTypeError");Yt.reportTypeError=zp;function NA(e){let{gen:t,data:r,schema:n}=e,i=(0,_I.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(NA,"getTypeErrorContext")});var jI=D(Qc=>{"use strict";c();Object.defineProperty(Qc,"__esModule",{value:!0});Qc.assignDefaults=void 0;var ys=de(),RA=Le();function CA(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)EI(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>EI(e,s,i.default))}o(CA,"assignDefaults");Qc.assignDefaults=CA;var TI,kI,FI,AI;function EI(e,t,r){let{gen:n,compositeRule:i,data:s,opts:a}=e;if(r===void 0)return;let u=(0,ys._)(TI||(TI=y(["","",""])),s,(0,ys.getProperty)(t));if(i){(0,RA.checkStrictMode)(e,"default is ignored for: ".concat(u));return}let l=(0,ys._)(kI||(kI=y([""," === undefined"])),u);a.useDefaults==="empty"&&(l=(0,ys._)(FI||(FI=y([""," || "," === null || ",' === ""'])),l,u,u)),n.if(l,(0,ys._)(AI||(AI=y([""," = ",""])),u,(0,ys.stringify)(r)))}o(EI,"assignDefault")});var Ur=D(Ye=>{"use strict";c();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.validateUnion=Ye.validateArray=Ye.usePattern=Ye.callValidateCode=Ye.schemaProperties=Ye.allSchemaProperties=Ye.noPropertyInData=Ye.propertyInData=Ye.isOwnProperty=Ye.hasPropFunc=Ye.reportMissingProp=Ye.checkMissingProp=Ye.checkReportMissingProp=void 0;var ut=de(),Vp=Le(),Mo=no(),MA=Le(),NI;function LA(e,t){let{gen:r,data:n,it:i}=e;r.if(Gp(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ut._)(NI||(NI=y(["",""])),t)},!0),e.error()})}o(LA,"checkReportMissingProp");Ye.checkReportMissingProp=LA;var RI;function UA({gen:e,data:t,it:{opts:r}},n,i){return(0,ut.or)(...n.map(s=>(0,ut.and)(Gp(e,t,s,r.ownProperties),(0,ut._)(RI||(RI=y([""," = ",""])),i,s))))}o(UA,"checkMissingProp");Ye.checkMissingProp=UA;function DA(e,t){e.setParams({missingProperty:t},!0),e.error()}o(DA,"reportMissingProp");Ye.reportMissingProp=DA;var CI;function JI(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ut._)(CI||(CI=y(["Object.prototype.hasOwnProperty"])))})}o(JI,"hasPropFunc");Ye.hasPropFunc=JI;var MI;function Bp(e,t,r){return(0,ut._)(MI||(MI=y(["",".call(",", ",")"])),JI(e),t,r)}o(Bp,"isOwnProperty");Ye.isOwnProperty=Bp;var LI,UI;function qA(e,t,r,n){let i=(0,ut._)(LI||(LI=y(["",""," !== undefined"])),t,(0,ut.getProperty)(r));return n?(0,ut._)(UI||(UI=y([""," && ",""])),i,Bp(e,t,r)):i}o(qA,"propertyInData");Ye.propertyInData=qA;var DI;function Gp(e,t,r,n){let i=(0,ut._)(DI||(DI=y(["",""," === undefined"])),t,(0,ut.getProperty)(r));return n?(0,ut.or)(i,(0,ut.not)(Bp(e,t,r))):i}o(Gp,"noPropertyInData");Ye.noPropertyInData=Gp;function ZI(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(ZI,"allSchemaProperties");Ye.allSchemaProperties=ZI;function zA(e,t){return ZI(t).filter(r=>!(0,Vp.alwaysValidSchema)(e,t[r]))}o(zA,"schemaProperties");Ye.schemaProperties=zA;var qI,zI,VI,BI;function VA({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,l,d){let m=d?(0,ut._)(qI||(qI=y(["",", ",", ","",""])),e,t,n,i):t,h=[[Mo.default.instancePath,(0,ut.strConcat)(Mo.default.instancePath,s)],[Mo.default.parentData,a.parentData],[Mo.default.parentDataProperty,a.parentDataProperty],[Mo.default.rootData,Mo.default.rootData]];a.opts.dynamicRef&&h.push([Mo.default.dynamicAnchors,Mo.default.dynamicAnchors]);let b=(0,ut._)(zI||(zI=y(["",", ",""])),m,r.object(...h));return l!==ut.nil?(0,ut._)(VI||(VI=y(["",".call(",", ",")"])),u,l,b):(0,ut._)(BI||(BI=y(["","(",")"])),u,b)}o(VA,"callValidateCode");Ye.callValidateCode=VA;var GI,BA=(0,ut._)(GI||(GI=y(["new RegExp"]))),KI;function GA({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,ut._)(KI||(KI=y(["","(",", ",")"])),i.code==="new RegExp"?BA:(0,MA.useFunc)(e,i),r,n)})}o(GA,"usePattern");Ye.usePattern=GA;var WI;function KA(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let u=t.let("valid",!0);return a(()=>t.assign(u,!1)),u}return t.var(s,!0),a(()=>t.break()),s;function a(u){let l=t.const("len",(0,ut._)(WI||(WI=y(["",".length"])),r));t.forRange("i",0,l,d=>{e.subschema({keyword:n,dataProp:d,dataPropType:Vp.Type.Num},s),t.if((0,ut.not)(s),u)})}o(a,"validateItems")}o(KA,"validateArray");Ye.validateArray=KA;var HI;function WA(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,Vp.alwaysValidSchema)(i,l))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),u=t.name("_valid");t.block(()=>r.forEach((l,d)=>{let m=e.subschema({keyword:n,schemaProp:d,compositeRule:!0},u);t.assign(a,(0,ut._)(HI||(HI=y([""," || ",""])),a,u)),e.mergeValidEvaluated(m,u)||t.if((0,ut.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}o(WA,"validateUnion");Ye.validateUnion=WA});var ub=D(Sn=>{"use strict";c();Object.defineProperty(Sn,"__esModule",{value:!0});Sn.validateKeywordUsage=Sn.validSchemaType=Sn.funcKeywordCode=Sn.macroKeywordCode=void 0;var cr=de(),vi=no(),HA=Ur(),JA=ja();function ZA(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=e,u=t.macro.call(a.self,i,s,a),l=cb(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let d=r.name("valid");e.subschema({schema:u,schemaPath:cr.nil,errSchemaPath:"".concat(a.errSchemaPath,"/").concat(n),topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}o(ZA,"macroKeywordCode");Sn.macroKeywordCode=ZA;var XI,QI,eb,tb,rb,nb;function YA(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:l}=e;QA(l,t);let d=!u&&t.compile?t.compile.call(l.self,s,a,l):t.validate,m=cb(n,i,d),h=n.let("valid");e.block$data(h,b),e.ok((r=t.valid)!==null&&r!==void 0?r:h);function b(){if(t.errors===!1)_(),t.modifying&&YI(e),E(()=>e.error());else{let k=t.async?$():O();t.modifying&&YI(e),E(()=>XA(e,k))}}o(b,"validateKeyword");function $(){let k=n.let("ruleErrs",null);return n.try(()=>_((0,cr._)(XI||(XI=y(["await "])))),G=>n.assign(h,!1).if((0,cr._)(QI||(QI=y([""," instanceof ",""])),G,l.ValidationError),()=>n.assign(k,(0,cr._)(eb||(eb=y(["",".errors"])),G)),()=>n.throw(G))),k}o($,"validateAsync");function O(){let k=(0,cr._)(tb||(tb=y(["",".errors"])),m);return n.assign(k,null),_(cr.nil),k}o(O,"validateSync");function _(k=t.async?(0,cr._)(rb||(rb=y(["await "]))):cr.nil){let G=l.opts.passContext?vi.default.this:vi.default.self,R=!("compile"in t&&!u||t.schema===!1);n.assign(h,(0,cr._)(nb||(nb=y(["","",""])),k,(0,HA.callValidateCode)(e,m,G,R)),t.modifying)}o(_,"assignValid");function E(k){var G;n.if((0,cr.not)((G=t.valid)!==null&&G!==void 0?G:h),k)}o(E,"reportErrs")}o(YA,"funcKeywordCode");Sn.funcKeywordCode=YA;var ob;function YI(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,cr._)(ob||(ob=y(["","[","]"])),n.parentData,n.parentDataProperty)))}o(YI,"modifyData");var ib,sb,ab;function XA(e,t){let{gen:r}=e;r.if((0,cr._)(ib||(ib=y(["Array.isArray(",")"])),t),()=>{r.assign(vi.default.vErrors,(0,cr._)(sb||(sb=y([""," === null ? "," : ",".concat(",")"])),vi.default.vErrors,t,vi.default.vErrors,t)).assign(vi.default.errors,(0,cr._)(ab||(ab=y(["",".length"])),vi.default.vErrors)),(0,JA.extendErrors)(e)},()=>e.error())}o(XA,"addErrs");function QA({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(QA,"checkAsyncKeyword");function cb(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,cr.stringify)(r)})}o(cb,"useKeyword");function ej(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(ej,"validSchemaType");Sn.validSchemaType=ej;function tj({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a!=null&&a.some(u=>!Object.prototype.hasOwnProperty.call(e,u)))throw new Error("parent schema must have dependencies of ".concat(s,": ").concat(a.join(",")));if(i.validateSchema&&!i.validateSchema(e[s])){let l='keyword "'.concat(s,'" value is invalid at path "').concat(n,'": ')+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}o(tj,"validateKeywordUsage");Sn.validateKeywordUsage=tj});var hb=D(Lo=>{"use strict";c();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.extendSubschemaMode=Lo.extendSubschemaData=Lo.getSubschema=void 0;var Pn=de(),yb=Le(),fb,lb;function rj(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let u=e.schema[t];return r===void 0?{schema:u,schemaPath:(0,Pn._)(fb||(fb=y(["","",""])),e.schemaPath,(0,Pn.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:u[r],schemaPath:(0,Pn._)(lb||(lb=y(["","","",""])),e.schemaPath,(0,Pn.getProperty)(t),(0,Pn.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,yb.escapeFragment)(r))}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(rj,"getSubschema");Lo.getSubschema=rj;var pb,db,mb;function nj(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=t;if(r!==void 0){let{errorPath:d,dataPathArr:m,opts:h}=t,b=u.let("data",(0,Pn._)(pb||(pb=y(["","",""])),t.data,(0,Pn.getProperty)(r)),!0);l(b),e.errorPath=(0,Pn.str)(db||(db=y(["","",""])),d,(0,yb.getErrorPath)(r,n,h.jsPropertySyntax)),e.parentDataProperty=(0,Pn._)(mb||(mb=y(["",""])),r),e.dataPathArr=[...m,e.parentDataProperty]}if(i!==void 0){let d=i instanceof Pn.Name?i:u.let("data",i,!0);l(d),a!==void 0&&(e.propertyName=a)}s&&(e.dataTypes=s);function l(d){e.data=d,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,d]}o(l,"dataContextProps")}o(nj,"extendSubschemaData");Lo.extendSubschemaData=nj;function oj(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(oj,"extendSubschemaMode");Lo.extendSubschemaMode=oj});var Kp=D((qK,gb)=>{"use strict";c();gb.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},"equal")});var Ib=D((BK,xb)=>{"use strict";c();var Uo=xb.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};eu(t,n,i,e,"",e)};Uo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Uo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Uo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Uo.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 eu(e,t,r,n,i,s,a,u,l,d){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,a,u,l,d);for(var m in n){var h=n[m];if(Array.isArray(h)){if(m in Uo.arrayKeywords)for(var b=0;b<h.length;b++)eu(e,t,r,h[b],i+"/"+m+"/"+b,s,i,m,n,b)}else if(m in Uo.propsKeywords){if(h&&typeof h=="object")for(var $ in h)eu(e,t,r,h[$],i+"/"+m+"/"+ij($),s,i,m,n,$)}else(m in Uo.keywords||e.allKeys&&!(m in Uo.skipKeywords))&&eu(e,t,r,h,i+"/"+m,s,i,m,n)}r(n,i,s,a,u,l,d)}}o(eu,"_traverse");function ij(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(ij,"escapeJsonPtr")});var Ra=D(xr=>{"use strict";c();Object.defineProperty(xr,"__esModule",{value:!0});xr.getSchemaRefs=xr.resolveUrl=xr.normalizeId=xr._getFullPath=xr.getFullPath=xr.inlineRef=void 0;var sj=Le(),aj=Kp(),cj=Ib(),uj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fj(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Wp(e):t?bb(e)<=t:!1}o(fj,"inlineRef");xr.inlineRef=fj;var lj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Wp(e){for(let t in e){if(lj.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Wp)||typeof r=="object"&&Wp(r))return!0}return!1}o(Wp,"hasRef");function bb(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!uj.has(r)&&(typeof e[r]=="object"&&(0,sj.eachItem)(e[r],n=>t+=bb(n)),t===1/0))return 1/0}return t}o(bb,"countKeys");function wb(e,t="",r){r!==!1&&(t=hs(t));let n=e.parse(t);return $b(e,n)}o(wb,"getFullPath");xr.getFullPath=wb;function $b(e,t){return e.serialize(t).split("#")[0]+"#"}o($b,"_getFullPath");xr._getFullPath=$b;var pj=/#\/?$/;function hs(e){return e?e.replace(pj,""):""}o(hs,"normalizeId");xr.normalizeId=hs;function dj(e,t,r){return r=hs(r),e.resolve(t,r)}o(dj,"resolveUrl");xr.resolveUrl=dj;var mj=/^[a-z_][-a-z0-9._]*$/i;function yj(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=hs(e[r]||t),s={"":i},a=wb(n,i,!1),u={},l=new Set;return cj(e,{allKeys:!0},(h,b,$,O)=>{if(O===void 0)return;let _=a+b,E=s[O];typeof h[r]=="string"&&(E=k.call(this,h[r])),G.call(this,h.$anchor),G.call(this,h.$dynamicAnchor),s[b]=E;function k(R){let N=this.opts.uriResolver.resolve;if(R=hs(E?N(E,R):R),l.has(R))throw m(R);l.add(R);let C=this.refs[R];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?d(h,C.schema,R):R!==hs(_)&&(R[0]==="#"?(d(h,u[R],R),u[R]=h):this.refs[R]=_),R}o(k,"addRef");function G(R){if(typeof R=="string"){if(!mj.test(R))throw new Error('invalid anchor "'.concat(R,'"'));k.call(this,"#".concat(R))}}o(G,"addAnchor")}),u;function d(h,b,$){if(b!==void 0&&!aj(h,b))throw m($)}o(d,"checkAmbiguosRef");function m(h){return new Error('reference "'.concat(h,'" resolves to more than one schema'))}o(m,"ambiguos")}o(yj,"getSchemaRefs");xr.getSchemaRefs=yj});var La=D(Do=>{"use strict";c();Object.defineProperty(Do,"__esModule",{value:!0});Do.getData=Do.KeywordCxt=Do.validateFunctionCode=void 0;var p0=Vx(),vb=Na(),Jp=Up(),tu=Na(),hj=jI(),Ma=ub(),Hp=hb(),Y=de(),ie=no(),gj=Ra(),oo=Le(),Ca=ja();function xj(e){if(y0(e)&&(h0(e),m0(e))){wj(e);return}d0(e,()=>(0,p0.topBoolOrEmptySchema)(e))}o(xj,"validateFunctionCode");Do.validateFunctionCode=xj;var Pb,Eb,Tb;function d0({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,Y._)(Pb||(Pb=y(["",", ",""])),ie.default.data,ie.default.valCxt),n.$async,()=>{e.code((0,Y._)(Eb||(Eb=y(['"use strict"; ',""])),Ob(r,i))),bj(e,i),e.code(s)}):e.func(t,(0,Y._)(Tb||(Tb=y(["",", ",""])),ie.default.data,Ij(i)),n.$async,()=>e.code(Ob(r,i)).code(s))}o(d0,"validateFunction");var kb,Fb;function Ij(e){return(0,Y._)(Fb||(Fb=y(["{",'="", ',", ",", ","=","","}={}"])),ie.default.instancePath,ie.default.parentData,ie.default.parentDataProperty,ie.default.rootData,ie.default.data,e.dynamicRef?(0,Y._)(kb||(kb=y([", ","={}"])),ie.default.dynamicAnchors):Y.nil)}o(Ij,"destructureValCxt");var Ab,jb,Nb,Rb,Cb,Mb,Lb,Ub,Db;function bj(e,t){e.if(ie.default.valCxt,()=>{e.var(ie.default.instancePath,(0,Y._)(Ab||(Ab=y(["",".",""])),ie.default.valCxt,ie.default.instancePath)),e.var(ie.default.parentData,(0,Y._)(jb||(jb=y(["",".",""])),ie.default.valCxt,ie.default.parentData)),e.var(ie.default.parentDataProperty,(0,Y._)(Nb||(Nb=y(["",".",""])),ie.default.valCxt,ie.default.parentDataProperty)),e.var(ie.default.rootData,(0,Y._)(Rb||(Rb=y(["",".",""])),ie.default.valCxt,ie.default.rootData)),t.dynamicRef&&e.var(ie.default.dynamicAnchors,(0,Y._)(Cb||(Cb=y(["",".",""])),ie.default.valCxt,ie.default.dynamicAnchors))},()=>{e.var(ie.default.instancePath,(0,Y._)(Mb||(Mb=y(['""'])))),e.var(ie.default.parentData,(0,Y._)(Lb||(Lb=y(["undefined"])))),e.var(ie.default.parentDataProperty,(0,Y._)(Ub||(Ub=y(["undefined"])))),e.var(ie.default.rootData,ie.default.data),t.dynamicRef&&e.var(ie.default.dynamicAnchors,(0,Y._)(Db||(Db=y(["{}"]))))})}o(bj,"destructureValCxtES5");function wj(e){let{schema:t,opts:r,gen:n}=e;d0(e,()=>{r.$comment&&t.$comment&&x0(e),Sj(e),n.let(ie.default.vErrors,null),n.let(ie.default.errors,0),r.unevaluated&&$j(e),g0(e),Tj(e)})}o(wj,"topSchemaObjCode");var qb,zb,Vb,Bb,Gb,Kb,Wb;function $j(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Y._)(qb||(qb=y(["",".evaluated"])),r)),t.if((0,Y._)(zb||(zb=y(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,Y._)(Vb||(Vb=y(["",".props"])),e.evaluated),(0,Y._)(Bb||(Bb=y(["undefined"]))))),t.if((0,Y._)(Gb||(Gb=y(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,Y._)(Kb||(Kb=y(["",".items"])),e.evaluated),(0,Y._)(Wb||(Wb=y(["undefined"])))))}o($j,"resetEvaluated");var Hb;function Ob(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Y._)(Hb||(Hb=y(["/*# sourceURL="," */"])),r):Y.nil}o(Ob,"funcSourceUrl");function vj(e,t){if(y0(e)&&(h0(e),m0(e))){Oj(e,t);return}(0,p0.boolOrEmptySchema)(e,t)}o(vj,"subschemaCode");function m0({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(m0,"schemaCxtHasRules");function y0(e){return typeof e.schema!="boolean"}o(y0,"isSchemaObj");var Jb;function Oj(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&x0(e),Pj(e),Ej(e);let s=n.const("_errs",ie.default.errors);g0(e,s),n.var(t,(0,Y._)(Jb||(Jb=y([""," === ",""])),s,ie.default.errors))}o(Oj,"subSchemaObjCode");function h0(e){(0,oo.checkUnknownRules)(e),_j(e)}o(h0,"checkKeywords");function g0(e,t){if(e.opts.jtd)return _b(e,[],!1,t);let r=(0,vb.getSchemaTypes)(e.schema),n=(0,vb.coerceAndCheckDataType)(e,r);_b(e,r,!n,t)}o(g0,"typeAndKeywords");function _j(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,oo.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}o(_j,"checkRefsAndKeywords");function Sj(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,oo.checkStrictMode)(e,"default is ignored in the schema root")}o(Sj,"checkNoDefault");function Pj(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,gj.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(Pj,"updateContext");function Ej(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(Ej,"checkAsyncSchema");var Zb,Yb,Xb;function x0({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,Y._)(Zb||(Zb=y(["",".logger.log(",")"])),ie.default.self,s));else if(typeof i.$comment=="function"){let a=(0,Y.str)(Yb||(Yb=y(["","/$comment"])),n),u=e.scopeValue("root",{ref:t.root});e.code((0,Y._)(Xb||(Xb=y(["",".opts.$comment(",", ",", ",".schema)"])),ie.default.self,s,a,u))}}o(x0,"commentKeyword");var Qb,e0,t0,r0;function Tj(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,Y._)(Qb||(Qb=y([""," === 0"])),ie.default.errors),()=>t.return(ie.default.data),()=>t.throw((0,Y._)(e0||(e0=y(["new ","(",")"])),i,ie.default.vErrors))):(t.assign((0,Y._)(t0||(t0=y(["",".errors"])),n),ie.default.vErrors),s.unevaluated&&kj(e),t.return((0,Y._)(r0||(r0=y([""," === 0"])),ie.default.errors)))}o(Tj,"returnResults");var n0,o0;function kj({gen:e,evaluated:t,props:r,items:n}){r instanceof Y.Name&&e.assign((0,Y._)(n0||(n0=y(["",".props"])),t),r),n instanceof Y.Name&&e.assign((0,Y._)(o0||(o0=y(["",".items"])),t),n)}o(kj,"assignEvaluated");var i0;function _b(e,t,r,n){let{gen:i,schema:s,data:a,allErrors:u,opts:l,self:d}=e,{RULES:m}=d;if(s.$ref&&(l.ignoreKeywordsWithRef||!(0,oo.schemaHasRulesButRef)(s,m))){i.block(()=>b0(e,"$ref",m.all.$ref.definition));return}l.jtd||Fj(e,t),i.block(()=>{for(let b of m.rules)h(b);h(m.post)});function h(b){(0,Jp.shouldUseGroup)(s,b)&&(b.type?(i.if((0,tu.checkDataType)(b.type,a,l.strictNumbers)),Sb(e,b),t.length===1&&t[0]===b.type&&r&&(i.else(),(0,tu.reportTypeError)(e)),i.endIf()):Sb(e,b),u||i.if((0,Y._)(i0||(i0=y([""," === ",""])),ie.default.errors,n||0)))}o(h,"groupKeywords")}o(_b,"schemaKeywords");function Sb(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,hj.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,Jp.shouldUseRule)(n,s)&&b0(e,s.keyword,s.definition,t.type)})}o(Sb,"iterateKeywords");function Fj(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Aj(e,t),e.opts.allowUnionTypes||jj(e,t),Nj(e,e.dataTypes))}o(Fj,"checkStrictTypes");function Aj(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{I0(e.dataTypes,r)||Zp(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),Cj(e,t)}}o(Aj,"checkContextTypes");function jj(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Zp(e,"use allowUnionTypes to allow union type keyword")}o(jj,"checkMultipleTypes");function Nj(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Jp.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>Rj(t,a))&&Zp(e,'missing type "'.concat(s.join(","),'" for keyword "').concat(n,'"'))}}}o(Nj,"checkKeywordTypes");function Rj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(Rj,"hasApplicableType");function I0(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(I0,"includesType");function Cj(e,t){let r=[];for(let n of e.dataTypes)I0(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(Cj,"narrowSchemaTypes");function Zp(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,oo.checkStrictMode)(e,t,e.opts.strictTypes)}o(Zp,"strictTypesError");var s0,a0,c0,u0,Yp=class Yp{constructor(t,r,n){if((0,Ma.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,oo.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",w0(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ma.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",ie.default.errors))}result(t,r,n){this.failResult((0,Y.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,Y.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,Y._)(s0||(s0=y([""," !== undefined && (",")"])),r,(0,Y.or)(this.invalid$data(),t)))}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ca.reportExtraError:Ca.reportError)(this,this.def.error,r)}$dataError(){(0,Ca.reportError)(this,this.def.$dataError||Ca.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ca.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=Y.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=Y.nil,r=Y.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,Y.or)((0,Y._)(a0||(a0=y([""," === undefined"])),i),r)),t!==Y.nil&&n.assign(t,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Y.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,Y.or)(a(),u());function a(){if(n.length){if(!(r instanceof Y.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,Y._)(c0||(c0=y(["",""])),(0,tu.checkDataTypes)(l,r,s.opts.strictNumbers,tu.DataType.Wrong))}return Y.nil}function u(){if(i.validateSchema){let l=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,Y._)(u0||(u0=y(["!","(",")"])),l,r)}return Y.nil}}subschema(t,r){let n=(0,Hp.getSubschema)(this.it,t);(0,Hp.extendSubschemaData)(n,this.it,t),(0,Hp.extendSubschemaMode)(n,t);let i=F(g(g({},this.it),n),{items:void 0,props:void 0});return vj(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=oo.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=oo.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,Y.Name)),!0}};o(Yp,"KeywordCxt");var ru=Yp;Do.KeywordCxt=ru;function b0(e,t,r,n){let i=new ru(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Ma.funcKeywordCode)(i,r):"macro"in r?(0,Ma.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Ma.funcKeywordCode)(i,r)}o(b0,"keywordCode");var Mj=/^\/(?:[^~]|~0|~1)*$/,Lj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,f0,l0;function w0(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return ie.default.rootData;if(e[0]==="/"){if(!Mj.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));i=e,s=ie.default.rootData}else{let d=Lj.exec(e);if(!d)throw new Error("Invalid JSON-pointer: ".concat(e));let m=+d[1];if(i=d[2],i==="#"){if(m>=t)throw new Error(l("property/index",m));return n[t-m]}if(m>t)throw new Error(l("data",m));if(s=r[t-m],!i)return s}let a=s,u=i.split("/");for(let d of u)d&&(s=(0,Y._)(f0||(f0=y(["","",""])),s,(0,Y.getProperty)((0,oo.unescapeJsonPointer)(d))),a=(0,Y._)(l0||(l0=y([""," && ",""])),a,s));return a;function l(d,m){return"Cannot access ".concat(d," ").concat(m," levels up, current level is ").concat(t)}}o(w0,"getData");Do.getData=w0});var nu=D(Qp=>{"use strict";c();Object.defineProperty(Qp,"__esModule",{value:!0});var ed=class ed extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(ed,"ValidationError");var Xp=ed;Qp.default=Xp});var Ua=D(nd=>{"use strict";c();Object.defineProperty(nd,"__esModule",{value:!0});var td=Ra(),od=class od extends Error{constructor(t,r,n,i){super(i||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,td.resolveUrl)(t,r,n),this.missingSchema=(0,td.normalizeId)((0,td.getFullPath)(t,this.missingRef))}};o(od,"MissingRefError");var rd=od;nd.default=rd});var iu=D(Dr=>{"use strict";c();Object.defineProperty(Dr,"__esModule",{value:!0});Dr.resolveSchema=Dr.getCompilingSchema=Dr.resolveRef=Dr.compileSchema=Dr.SchemaEnv=void 0;var an=de(),Uj=nu(),Oi=no(),cn=Ra(),$0=Le(),Dj=La(),ad=class ad{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,cn.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(ad,"SchemaEnv");var gs=ad;Dr.SchemaEnv=gs;var v0,O0;function sd(e){let t=_0.call(this,e);if(t)return t;let r=(0,cn.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new an.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;e.$async&&(u=a.scopeValue("Error",{ref:Uj.default,code:(0,an._)(v0||(v0=y(['require("ajv/dist/runtime/validation_error").default'])))}));let l=a.scopeName("validate");e.validateName=l;let d={gen:a,allErrors:this.opts.allErrors,data:Oi.default.data,parentData:Oi.default.parentData,parentDataProperty:Oi.default.parentDataProperty,dataNames:[Oi.default.data],dataPathArr:[an.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,an.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:an.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,an._)(O0||(O0=y(['""']))),opts:this.opts,self:this},m;try{this._compilations.add(e),(0,Dj.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let h=a.toString();m="".concat(a.scopeRefs(Oi.default.scope),"return ").concat(h),this.opts.code.process&&(m=this.opts.code.process(m,e));let $=new Function("".concat(Oi.default.self),"".concat(Oi.default.scope),m)(this,this.scope.get());if(this.scope.value(l,{ref:$}),$.errors=null,$.schema=e.schema,$.schemaEnv=e,e.$async&&($.$async=!0),this.opts.code.source===!0&&($.source={validateName:l,validateCode:h,scopeValues:a._values}),this.opts.unevaluated){let{props:O,items:_}=d;$.evaluated={props:O instanceof an.Name?void 0:O,items:_ instanceof an.Name?void 0:_,dynamicProps:O instanceof an.Name,dynamicItems:_ instanceof an.Name},$.source&&($.source.evaluated=(0,an.stringify)($.evaluated))}return e.validate=$,e}catch(h){throw delete e.validate,delete e.validateName,m&&this.logger.error("Error compiling schema, function code:",m),h}finally{this._compilations.delete(e)}}o(sd,"compileSchema");Dr.compileSchema=sd;function qj(e,t,r){var n;r=(0,cn.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=Bj.call(this,e,r);if(s===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;a&&(s=new gs({schema:a,schemaId:u,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=zj.call(this,s)}o(qj,"resolveRef");Dr.resolveRef=qj;function zj(e){return(0,cn.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:sd.call(this,e)}o(zj,"inlineOrCompile");function _0(e){for(let t of this._compilations)if(Vj(t,e))return t}o(_0,"getCompilingSchema");Dr.getCompilingSchema=_0;function Vj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(Vj,"sameSchemaEnv");function Bj(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||ou.call(this,e,t)}o(Bj,"resolve");function ou(e,t){let r=this.opts.uriResolver.parse(t),n=(0,cn._getFullPath)(this.opts.uriResolver,r),i=(0,cn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return id.call(this,r,e);let s=(0,cn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=ou.call(this,e,a);return typeof(u==null?void 0:u.schema)!="object"?void 0:id.call(this,r,u)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||sd.call(this,a),s===(0,cn.normalizeId)(t)){let{schema:u}=a,{schemaId:l}=this.opts,d=u[l];return d&&(i=(0,cn.resolveUrl)(this.opts.uriResolver,i,d)),new gs({schema:u,schemaId:l,root:e,baseId:i})}return id.call(this,r,a)}}o(ou,"resolveSchema");Dr.resolveSchema=ou;var Gj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function id(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,$0.unescapeFragment)(u)];if(l===void 0)return;r=l;let d=typeof r=="object"&&r[this.opts.schemaId];!Gj.has(u)&&d&&(t=(0,cn.resolveUrl)(this.opts.uriResolver,t,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,$0.schemaHasRulesButRef)(r,this.RULES)){let u=(0,cn.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=ou.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new gs({schema:r,schemaId:a,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(id,"getJsonPointer")});var S0=D((c8,Kj)=>{Kj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var E0=D((u8,P0)=>{"use strict";c();var Wj={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};P0.exports={HEX:Wj}});var C0=D((l8,R0)=>{"use strict";c();var{HEX:Hj}=E0(),Jj=new RegExp("^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$","u");function A0(e){if(N0(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(Jj)||[],[r]=t;return r?{host:Yj(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(A0,"normalizeIPv4");function cd(e,t=!1){let r="",n=!0;for(let i of e){if(Hj[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(cd,"stringArrayToHexStripped");function Zj(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=!1;function l(){if(i.length){if(s===!1){let d=cd(i);if(d!==void 0)n.push(d);else return r.error=!0,!1}i.length=0}return!0}o(l,"consume");for(let d=0;d<e.length;d++){let m=e[d];if(!(m==="["||m==="]"))if(m===":"){if(a===!0&&(u=!0),!l())break;if(t++,n.push(":"),t>7){r.error=!0;break}d-1>=0&&e[d-1]===":"&&(a=!0);continue}else if(m==="%"){if(!l())break;s=!0}else{i.push(m);continue}}return i.length&&(s?r.zone=i.join(""):u?n.push(i.join("")):n.push(cd(i))),r.address=n.join(""),r}o(Zj,"getIPV6");function j0(e){if(N0(e,":")<2)return{host:e,isIPV6:!1};let t=Zj(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}o(j0,"normalizeIPv6");function Yj(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let a=e[s];a==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=a,n=!1):(a===t?n=!0:n=!1,r+=a)}return r}o(Yj,"stripLeadingZeros");function N0(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o(N0,"findToken");var T0=new RegExp("^\\.\\.?\\/","u"),k0=new RegExp("^\\/\\.(?:\\/|$)","u"),F0=new RegExp("^\\/\\.\\.(?:\\/|$)","u"),Xj=new RegExp("^\\/?(?:.|\\n)*?(?=\\/|$)","u");function Qj(e){let t=[];for(;e.length;)if(e.match(T0))e=e.replace(T0,"");else if(e.match(k0))e=e.replace(k0,"/");else if(e.match(F0))e=e.replace(F0,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(Xj);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(Qj,"removeDotSegments");function e1(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(e1,"normalizeComponentEncoding");function t1(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=A0(r);if(n.isIPV4)r=n.host;else{let i=j0(n.host);i.isIPV6===!0?r="[".concat(i.escapedHost,"]"):r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}o(t1,"recomposeAuthority");R0.exports={recomposeAuthority:t1,normalizeComponentEncoding:e1,removeDotSegments:Qj,normalizeIPv4:A0,normalizeIPv6:j0,stringArrayToHexStripped:cd}});var z0=D((m8,q0)=>{"use strict";c();var r1=new RegExp("^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$","iu"),n1=new RegExp("([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)","iu");function M0(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o(M0,"isSecure");function L0(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(L0,"httpParse");function U0(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(U0,"httpSerialize");function o1(e){return e.secure=M0(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(o1,"wsParse");function i1(e){if((e.port===(M0(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(i1,"wsSerialize");function s1(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(n1);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i="".concat(n,":").concat(t.nid||e.nid),s=ud[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(s1,"urnParse");function a1(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i="".concat(r,":").concat(t.nid||n),s=ud[i];s&&(e=s.serialize(e,t));let a=e,u=e.nss;return a.path="".concat(n||t.nid,":").concat(u),t.skipEscape=!0,a}o(a1,"urnSerialize");function c1(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!r1.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(c1,"urnuuidParse");function u1(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(u1,"urnuuidSerialize");var D0={scheme:"http",domainHost:!0,parse:L0,serialize:U0},f1={scheme:"https",domainHost:D0.domainHost,parse:L0,serialize:U0},su={scheme:"ws",domainHost:!0,parse:o1,serialize:i1},l1={scheme:"wss",domainHost:su.domainHost,parse:su.parse,serialize:su.serialize},p1={scheme:"urn",parse:s1,serialize:a1,skipNormalize:!0},d1={scheme:"urn:uuid",parse:c1,serialize:u1,skipNormalize:!0},ud={http:D0,https:f1,ws:su,wss:l1,urn:p1,"urn:uuid":d1};q0.exports=ud});var B0=D((g8,cu)=>{"use strict";c();var{normalizeIPv6:m1,normalizeIPv4:y1,removeDotSegments:Da,recomposeAuthority:h1,normalizeComponentEncoding:au}=C0(),fd=z0();function g1(e,t){return typeof e=="string"?e=En(io(e,t),t):typeof e=="object"&&(e=io(En(e,t),t)),e}o(g1,"normalize");function x1(e,t,r){let n=Object.assign({scheme:"null"},r),i=V0(io(e,n),io(t,n),n,!0);return En(i,F(g({},n),{skipEscape:!0}))}o(x1,"resolve");function V0(e,t,r,n){let i={};return n||(e=io(En(e,r),r),t=io(En(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Da(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Da(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=Da(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Da(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(V0,"resolveComponents");function I1(e,t,r){return typeof e=="string"?(e=unescape(e),e=En(au(io(e,r),!0),F(g({},r),{skipEscape:!0}))):typeof e=="object"&&(e=En(au(e,!0),F(g({},r),{skipEscape:!0}))),typeof t=="string"?(t=unescape(t),t=En(au(io(t,r),!0),F(g({},r),{skipEscape:!0}))):typeof t=="object"&&(t=En(au(t,!0),F(g({},r),{skipEscape:!0}))),e.toLowerCase()===t.toLowerCase()}o(I1,"equal");function En(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=fd[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=h1(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let u=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=Da(u)),a===void 0&&(u=u.replace(new RegExp("^\\/\\/","u"),"/%2F")),i.push(u)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}o(En,"serialize");var b1=Array.from({length:127},(e,t)=>new RegExp("[^!\"$&'()*+,\\-.;=_`a-z{}~]","u").test(String.fromCharCode(t)));function w1(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||b1[t])return!0;return!1}o(w1,"nonSimpleDomain");var $1=new RegExp("^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?","u");function io(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let a=e.match($1);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host){let l=y1(n.host);if(l.isIPV4===!1){let d=m1(l.host);n.host=d.host.toLowerCase(),s=d.isIPV6}else n.host=l.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let u=fd[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&w1(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}(!u||u&&!u.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(io,"parse");var ld={SCHEMES:fd,normalize:g1,resolve:x1,resolveComponents:V0,equal:I1,serialize:En,parse:io};cu.exports=ld;cu.exports.default=ld;cu.exports.fastUri=ld});var K0=D(pd=>{"use strict";c();Object.defineProperty(pd,"__esModule",{value:!0});var G0=B0();G0.code='require("ajv/dist/runtime/uri").default';pd.default=G0});var ew=D(Lt=>{"use strict";c();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.CodeGen=Lt.Name=Lt.nil=Lt.stringify=Lt.str=Lt._=Lt.KeywordCxt=void 0;var v1=La();Object.defineProperty(Lt,"KeywordCxt",{enumerable:!0,get:o(function(){return v1.KeywordCxt},"get")});var xs=de();Object.defineProperty(Lt,"_",{enumerable:!0,get:o(function(){return xs._},"get")});Object.defineProperty(Lt,"str",{enumerable:!0,get:o(function(){return xs.str},"get")});Object.defineProperty(Lt,"stringify",{enumerable:!0,get:o(function(){return xs.stringify},"get")});Object.defineProperty(Lt,"nil",{enumerable:!0,get:o(function(){return xs.nil},"get")});Object.defineProperty(Lt,"Name",{enumerable:!0,get:o(function(){return xs.Name},"get")});Object.defineProperty(Lt,"CodeGen",{enumerable:!0,get:o(function(){return xs.CodeGen},"get")});var O1=nu(),Y0=Ua(),_1=Lp(),qa=iu(),S1=de(),za=Ra(),uu=Na(),md=Le(),W0=S0(),P1=K0(),X0=o((e,t)=>new RegExp(e,t),"defaultRegExp");X0.code="new RegExp";var E1=["removeAdditional","useDefaults","coerceTypes"],T1=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),k1={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."},F1={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},H0=200;function A1(e){var t,r,n,i,s,a,u,l,d,m,h,b,$,O,_,E,k,G,R,N,C,me,le,ee,Z;let we=e.strict,$e=(t=e.code)===null||t===void 0?void 0:t.optimize,V=$e===!0||$e===void 0?1:$e||0,De=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:X0,ue=(i=e.uriResolver)!==null&&i!==void 0?i:P1.default;return{strictSchema:(a=(s=e.strictSchema)!==null&&s!==void 0?s:we)!==null&&a!==void 0?a:!0,strictNumbers:(l=(u=e.strictNumbers)!==null&&u!==void 0?u:we)!==null&&l!==void 0?l:!0,strictTypes:(m=(d=e.strictTypes)!==null&&d!==void 0?d:we)!==null&&m!==void 0?m:"log",strictTuples:(b=(h=e.strictTuples)!==null&&h!==void 0?h:we)!==null&&b!==void 0?b:"log",strictRequired:(O=($=e.strictRequired)!==null&&$!==void 0?$:we)!==null&&O!==void 0?O:!1,code:e.code?F(g({},e.code),{optimize:V,regExp:De}):{optimize:V,regExp:De},loopRequired:(_=e.loopRequired)!==null&&_!==void 0?_:H0,loopEnum:(E=e.loopEnum)!==null&&E!==void 0?E:H0,meta:(k=e.meta)!==null&&k!==void 0?k:!0,messages:(G=e.messages)!==null&&G!==void 0?G:!0,inlineRefs:(R=e.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(N=e.schemaId)!==null&&N!==void 0?N:"$id",addUsedSchema:(C=e.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(me=e.validateSchema)!==null&&me!==void 0?me:!0,validateFormats:(le=e.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(ee=e.unicodeRegExp)!==null&&ee!==void 0?ee:!0,int32range:(Z=e.int32range)!==null&&Z!==void 0?Z:!0,uriResolver:ue}}o(A1,"requiredOptions");var yd=class yd{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=g(g({},t),A1(t));let{es5:r,lines:n}=this.opts.code;this.scope=new S1.ValueScope({scope:{},prefixes:T1,es5:r,lines:n}),this.logger=L1(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,_1.getRules)(),J0.call(this,k1,t,"NOT SUPPORTED"),J0.call(this,F1,t,"DEPRECATED","warn"),this._metaOpts=C1.call(this),t.formats&&N1.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&R1.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),j1.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=W0;n==="id"&&(i=g({},W0),i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(m,h){await s.call(this,m.$schema);let b=this._addSchema(m,h);return b.validate||a.call(this,b)}async function s(m){m&&!this.getSchema(m)&&await i.call(this,{$ref:m},!0)}async function a(m){try{return this._compileSchemaEnv(m)}catch(h){if(!(h instanceof Y0.default))throw h;return u.call(this,h),await l.call(this,h.missingSchema),a.call(this,m)}}function u({missingSchema:m,missingRef:h}){if(this.refs[m])throw new Error("AnySchema ".concat(m," is loaded but ").concat(h," cannot be resolved"))}async function l(m){let h=await d.call(this,m);this.refs[m]||await s.call(this,h.$schema),this.refs[m]||this.addSchema(h,m,r)}async function d(m){let h=this._loading[m];if(h)return h;try{return await(this._loading[m]=n(m))}finally{delete this._loading[m]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:a}=this.opts;if(s=t[a],s!==void 0&&typeof s!="string")throw new Error("schema ".concat(a," must be string"))}return r=(0,za.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=Z0.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new qa.SchemaEnv({schema:{},schemaId:n});if(r=qa.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Z0.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,za.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(D1.call(this,n,r),!r)return(0,md.eachItem)(n,s=>dd.call(this,s)),this;z1.call(this,r);let i=F(g({},r),{type:(0,uu.getJSONTypes)(r.type),schemaType:(0,uu.getJSONTypes)(r.schemaType)});return(0,md.eachItem)(n,i.type.length===0?s=>dd.call(this,s,i):s=>i.type.forEach(a=>dd.call(this,s,i,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>"".concat(n).concat(i.instancePath," ").concat(i.message)).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),a=t;for(let u of s)a=a[u];for(let u in n){let l=n[u];if(typeof l!="object")continue;let{$data:d}=l.definition,m=a[u];d&&m&&(a[u]=Q0(m))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:u}=this.opts;if(typeof t=="object")a=t[u];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(t);if(l!==void 0)return l;n=(0,za.normalizeId)(a||n);let d=za.getSchemaRefs.call(this,t,n);return l=new qa.SchemaEnv({schema:t,schemaId:u,meta:r,baseId:n,localRefs:d}),this._cache.set(l.schema,l),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),i&&this.validateSchema(t,!0),l}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):qa.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{qa.compileSchema.call(this,t)}finally{this.opts=r}}};o(yd,"Ajv");var Va=yd;Va.ValidationError=O1.default;Va.MissingRefError=Y0.default;Lt.default=Va;function J0(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n]("".concat(r,": option ").concat(i,". ").concat(e[s]))}}o(J0,"checkOptions");function Z0(e){return e=(0,za.normalizeId)(e),this.schemas[e]||this.refs[e]}o(Z0,"getSchEnv");function j1(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(j1,"addInitialSchemas");function N1(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(N1,"addInitialFormats");function R1(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(R1,"addInitialKeywords");function C1(){let e=g({},this.opts);for(let t of E1)delete e[t];return e}o(C1,"getMetaSchemaOptions");var M1={log(){},warn(){},error(){}};function L1(e){if(e===!1)return M1;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(L1,"getLogger");var U1=/^[a-z_$][a-z0-9_$:-]*$/i;function D1(e,t){let{RULES:r}=this;if((0,md.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!U1.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(D1,"checkKeyword");function dd(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:l})=>l===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[e]=!0,!t)return;let u={keyword:e,definition:F(g({},t),{type:(0,uu.getJSONTypes)(t.type),schemaType:(0,uu.getJSONTypes)(t.schemaType)})};t.before?q1.call(this,a,u,t.before):a.rules.push(u),s.all[e]=u,(n=t.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}o(dd,"addRule");function q1(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))}o(q1,"addBeforeRule");function z1(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Q0(t)),e.validateSchema=this.compile(t,!0))}o(z1,"keywordMetaschema");var V1={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Q0(e){return{anyOf:[e,V1]}}o(Q0,"schemaOrData")});var tw=D(hd=>{"use strict";c();Object.defineProperty(hd,"__esModule",{value:!0});var B1={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};hd.default=B1});var mw=D(_i=>{"use strict";c();Object.defineProperty(_i,"__esModule",{value:!0});_i.callRef=_i.getValidate=void 0;var G1=Ua(),rw=Ur(),Ir=de(),Is=no(),nw=iu(),fu=Le(),ow,K1={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:l}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return h();let m=nw.resolveRef.call(l,d,i,r);if(m===void 0)throw new G1.default(n.opts.uriResolver,i,r);if(m instanceof nw.SchemaEnv)return b(m);return $(m);function h(){if(s===d)return lu(e,a,s,s.$async);let O=t.scopeValue("root",{ref:d});return lu(e,(0,Ir._)(ow||(ow=y(["",".validate"])),O),d,d.$async)}function b(O){let _=dw(e,O);lu(e,_,O,O.$async)}function $(O){let _=t.scopeValue("schema",u.code.source===!0?{ref:O,code:(0,Ir.stringify)(O)}:{ref:O}),E=t.name("valid"),k=e.subschema({schema:O,dataTypes:[],schemaPath:Ir.nil,topSchemaRef:_,errSchemaPath:r},E);e.mergeEvaluated(k),e.ok(E)}}},iw;function dw(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Ir._)(iw||(iw=y(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}o(dw,"getValidate");_i.getValidate=dw;var sw,aw,cw,uw,fw,lw,pw;function lu(e,t,r,n){let{gen:i,it:s}=e,{allErrors:a,schemaEnv:u,opts:l}=s,d=l.passContext?Is.default.this:Ir.nil;n?m():h();function m(){if(!u.$async)throw new Error("async schema referenced by sync schema");let O=i.let("valid");i.try(()=>{i.code((0,Ir._)(sw||(sw=y(["await ",""])),(0,rw.callValidateCode)(e,t,d))),$(t),a||i.assign(O,!0)},_=>{i.if((0,Ir._)(aw||(aw=y(["!("," instanceof ",")"])),_,s.ValidationError),()=>i.throw(_)),b(_),a||i.assign(O,!1)}),e.ok(O)}o(m,"callAsyncRef");function h(){e.result((0,rw.callValidateCode)(e,t,d),()=>$(t),()=>b(t))}o(h,"callSyncRef");function b(O){let _=(0,Ir._)(cw||(cw=y(["",".errors"])),O);i.assign(Is.default.vErrors,(0,Ir._)(uw||(uw=y([""," === null ? "," : ",".concat(",")"])),Is.default.vErrors,_,Is.default.vErrors,_)),i.assign(Is.default.errors,(0,Ir._)(fw||(fw=y(["",".length"])),Is.default.vErrors))}o(b,"addErrorsFrom");function $(O){var _;if(!s.opts.unevaluated)return;let E=(_=r==null?void 0:r.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=fu.mergeEvaluated.props(i,E.props,s.props));else{let k=i.var("props",(0,Ir._)(lw||(lw=y(["",".evaluated.props"])),O));s.props=fu.mergeEvaluated.props(i,k,s.props,Ir.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=fu.mergeEvaluated.items(i,E.items,s.items));else{let k=i.var("items",(0,Ir._)(pw||(pw=y(["",".evaluated.items"])),O));s.items=fu.mergeEvaluated.items(i,k,s.items,Ir.Name)}}o($,"addEvaluatedFrom")}o(lu,"callRef");_i.callRef=lu;_i.default=K1});var yw=D(gd=>{"use strict";c();Object.defineProperty(gd,"__esModule",{value:!0});var W1=tw(),H1=mw(),J1=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",W1.default,H1.default];gd.default=J1});var Iw=D(xd=>{"use strict";c();Object.defineProperty(xd,"__esModule",{value:!0});var pu=de(),qo=pu.operators,du={maximum:{okStr:"<=",ok:qo.LTE,fail:qo.GT},minimum:{okStr:">=",ok:qo.GTE,fail:qo.LT},exclusiveMaximum:{okStr:"<",ok:qo.LT,fail:qo.GTE},exclusiveMinimum:{okStr:">",ok:qo.GT,fail:qo.LTE}},hw,gw,Z1={message:o(({keyword:e,schemaCode:t})=>(0,pu.str)(hw||(hw=y(["must be "," ",""])),du[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>(0,pu._)(gw||(gw=y(["{comparison: ",", limit: ","}"])),du[e].okStr,t),"params")},xw,Y1={keyword:Object.keys(du),type:"number",schemaType:"number",$data:!0,error:Z1,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,pu._)(xw||(xw=y([""," "," "," || isNaN(",")"])),r,du[t].fail,n,r))}};xd.default=Y1});var _w=D(Id=>{"use strict";c();Object.defineProperty(Id,"__esModule",{value:!0});var Ba=de(),bw,ww,X1={message:o(({schemaCode:e})=>(0,Ba.str)(bw||(bw=y(["must be multiple of ",""])),e),"message"),params:o(({schemaCode:e})=>(0,Ba._)(ww||(ww=y(["{multipleOf: ","}"])),e),"params")},$w,vw,Ow,Q1={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:X1,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),u=s?(0,Ba._)($w||($w=y(["Math.abs(Math.round(",") - ",") > 1e-",""])),a,a,s):(0,Ba._)(vw||(vw=y([""," !== parseInt(",")"])),a,a);e.fail$data((0,Ba._)(Ow||(Ow=y(["("," === 0 || ("," = ","/",", ","))"])),n,a,r,n,u))}};Id.default=Q1});var Pw=D(bd=>{"use strict";c();Object.defineProperty(bd,"__esModule",{value:!0});function Sw(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(Sw,"ucs2length");bd.default=Sw;Sw.code='require("ajv/dist/runtime/ucs2length").default'});var jw=D(wd=>{"use strict";c();Object.defineProperty(wd,"__esModule",{value:!0});var Si=de(),eN=Le(),tN=Pw(),Ew,Tw,rN={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Si.str)(Ew||(Ew=y(["must NOT have "," than "," characters"])),r,t)},params:o(({schemaCode:e})=>(0,Si._)(Tw||(Tw=y(["{limit: ","}"])),e),"params")},kw,Fw,Aw,nN={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:rN,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?Si.operators.GT:Si.operators.LT,a=i.opts.unicode===!1?(0,Si._)(kw||(kw=y(["",".length"])),r):(0,Si._)(Fw||(Fw=y(["","(",")"])),(0,eN.useFunc)(e.gen,tN.default),r);e.fail$data((0,Si._)(Aw||(Aw=y([""," "," ",""])),a,s,n))}};wd.default=nN});var Lw=D($d=>{"use strict";c();Object.defineProperty($d,"__esModule",{value:!0});var oN=Ur(),mu=de(),Nw,Rw,iN={message:o(({schemaCode:e})=>(0,mu.str)(Nw||(Nw=y(['must match pattern "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,mu._)(Rw||(Rw=y(["{pattern: ","}"])),e),"params")},Cw,Mw,sN={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:iN,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"",u=r?(0,mu._)(Cw||(Cw=y(["(new RegExp(",", ","))"])),i,a):(0,oN.usePattern)(e,n);e.fail$data((0,mu._)(Mw||(Mw=y(["!",".test(",")"])),u,t))}};$d.default=sN});var zw=D(vd=>{"use strict";c();Object.defineProperty(vd,"__esModule",{value:!0});var Ga=de(),Uw,Dw,aN={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Ga.str)(Uw||(Uw=y(["must NOT have "," than "," properties"])),r,t)},params:o(({schemaCode:e})=>(0,Ga._)(Dw||(Dw=y(["{limit: ","}"])),e),"params")},qw,cN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:aN,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Ga.operators.GT:Ga.operators.LT;e.fail$data((0,Ga._)(qw||(qw=y(["Object.keys(",").length "," ",""])),r,i,n))}};vd.default=cN});var Gw=D(Od=>{"use strict";c();Object.defineProperty(Od,"__esModule",{value:!0});var Ka=Ur(),Wa=de(),uN=Le(),Vw,Bw,fN={message:o(({params:{missingProperty:e}})=>(0,Wa.str)(Vw||(Vw=y(["must have required property '","'"])),e),"message"),params:o(({params:{missingProperty:e}})=>(0,Wa._)(Bw||(Bw=y(["{missingProperty: ","}"])),e),"params")},lN={keyword:"required",type:"object",schemaType:"array",$data:!0,error:fN,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:a}=e,{opts:u}=a;if(!s&&r.length===0)return;let l=r.length>=u.loopRequired;if(a.allErrors?d():m(),u.strictRequired){let $=e.parentSchema.properties,{definedProperties:O}=e.it;for(let _ of r)if(($==null?void 0:$[_])===void 0&&!O.has(_)){let E=a.schemaEnv.baseId+a.errSchemaPath,k='required property "'.concat(_,'" is not defined at "').concat(E,'" (strictRequired)');(0,uN.checkStrictMode)(a,k,a.opts.strictRequired)}}function d(){if(l||s)e.block$data(Wa.nil,h);else for(let $ of r)(0,Ka.checkReportMissingProp)(e,$)}o(d,"allErrorsMode");function m(){let $=t.let("missing");if(l||s){let O=t.let("valid",!0);e.block$data(O,()=>b($,O)),e.ok(O)}else t.if((0,Ka.checkMissingProp)(e,r,$)),(0,Ka.reportMissingProp)(e,$),t.else()}o(m,"exitOnErrorMode");function h(){t.forOf("prop",n,$=>{e.setParams({missingProperty:$}),t.if((0,Ka.noPropertyInData)(t,i,$,u.ownProperties),()=>e.error())})}o(h,"loopAllRequired");function b($,O){e.setParams({missingProperty:$}),t.forOf($,n,()=>{t.assign(O,(0,Ka.propertyInData)(t,i,$,u.ownProperties)),t.if((0,Wa.not)(O),()=>{e.error(),t.break()})},Wa.nil)}o(b,"loopUntilMissing")}};Od.default=lN});var Jw=D(_d=>{"use strict";c();Object.defineProperty(_d,"__esModule",{value:!0});var Ha=de(),Kw,Ww,pN={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Ha.str)(Kw||(Kw=y(["must NOT have "," than "," items"])),r,t)},params:o(({schemaCode:e})=>(0,Ha._)(Ww||(Ww=y(["{limit: ","}"])),e),"params")},Hw,dN={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:pN,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Ha.operators.GT:Ha.operators.LT;e.fail$data((0,Ha._)(Hw||(Hw=y(["",".length "," ",""])),r,i,n))}};_d.default=dN});var yu=D(Sd=>{"use strict";c();Object.defineProperty(Sd,"__esModule",{value:!0});var Zw=Kp();Zw.code='require("ajv/dist/runtime/equal").default';Sd.default=Zw});var m$=D(Ed=>{"use strict";c();Object.defineProperty(Ed,"__esModule",{value:!0});var Pd=Na(),Ut=de(),mN=Le(),yN=yu(),Yw,Xw,hN={message:o(({params:{i:e,j:t}})=>(0,Ut.str)(Yw||(Yw=y(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),"message"),params:o(({params:{i:e,j:t}})=>(0,Ut._)(Xw||(Xw=y(["{i: ",", j: ","}"])),e,t),"params")},Qw,e$,t$,r$,n$,o$,i$,s$,a$,c$,u$,f$,l$,p$,d$,gN={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:hN,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=e;if(!n&&!i)return;let l=t.let("valid"),d=s.items?(0,Pd.getSchemaTypes)(s.items):[];e.block$data(l,m,(0,Ut._)(Qw||(Qw=y([""," === false"])),a)),e.ok(l);function m(){let O=t.let("i",(0,Ut._)(e$||(e$=y(["",".length"])),r)),_=t.let("j");e.setParams({i:O,j:_}),t.assign(l,!0),t.if((0,Ut._)(t$||(t$=y([""," > 1"])),O),()=>(h()?b:$)(O,_))}o(m,"validateUniqueItems");function h(){return d.length>0&&!d.some(O=>O==="object"||O==="array")}o(h,"canOptimize");function b(O,_){let E=t.name("item"),k=(0,Pd.checkDataTypes)(d,E,u.opts.strictNumbers,Pd.DataType.Wrong),G=t.const("indices",(0,Ut._)(r$||(r$=y(["{}"]))));t.for((0,Ut._)(n$||(n$=y([";","--;"])),O),()=>{t.let(E,(0,Ut._)(o$||(o$=y(["","[","]"])),r,O)),t.if(k,(0,Ut._)(i$||(i$=y(["continue"])))),d.length>1&&t.if((0,Ut._)(s$||(s$=y(["typeof ",' == "string"'])),E),(0,Ut._)(a$||(a$=y(["",' += "_"'])),E)),t.if((0,Ut._)(c$||(c$=y(["typeof ","[",'] == "number"'])),G,E),()=>{t.assign(_,(0,Ut._)(u$||(u$=y(["","[","]"])),G,E)),e.error(),t.assign(l,!1).break()}).code((0,Ut._)(f$||(f$=y(["","[","] = ",""])),G,E,O))})}o(b,"loopN");function $(O,_){let E=(0,mN.useFunc)(t,yN.default),k=t.name("outer");t.label(k).for((0,Ut._)(l$||(l$=y([";","--;"])),O),()=>t.for((0,Ut._)(p$||(p$=y([""," = ","; ","--;"])),_,O,_),()=>t.if((0,Ut._)(d$||(d$=y(["","(","[","], ","[","])"])),E,r,O,r,_),()=>{e.error(),t.assign(l,!1).break(k)})))}o($,"loopN2")}};Ed.default=gN});var x$=D(kd=>{"use strict";c();Object.defineProperty(kd,"__esModule",{value:!0});var Td=de(),xN=Le(),IN=yu(),y$,bN={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,Td._)(y$||(y$=y(["{allowedValue: ","}"])),e),"params")},h$,g$,wN={keyword:"const",$data:!0,error:bN,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,Td._)(h$||(h$=y(["!","(",", ",")"])),(0,xN.useFunc)(t,IN.default),r,i)):e.fail((0,Td._)(g$||(g$=y([""," !== ",""])),s,r))}};kd.default=wN});var v$=D(Fd=>{"use strict";c();Object.defineProperty(Fd,"__esModule",{value:!0});var Ja=de(),$N=Le(),vN=yu(),I$,ON={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,Ja._)(I$||(I$=y(["{allowedValues: ","}"])),e),"params")},b$,w$,$$,_N={keyword:"enum",schemaType:"array",$data:!0,error:ON,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:a}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let u=i.length>=a.opts.loopEnum,l,d=o(()=>l!=null?l:l=(0,$N.useFunc)(t,vN.default),"getEql"),m;if(u||n)m=t.let("valid"),e.block$data(m,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let $=t.const("vSchema",s);m=(0,Ja.or)(...i.map((O,_)=>b($,_)))}e.pass(m);function h(){t.assign(m,!1),t.forOf("v",s,$=>t.if((0,Ja._)(b$||(b$=y(["","(",", ",")"])),d(),r,$),()=>t.assign(m,!0).break()))}o(h,"loopEnum");function b($,O){let _=i[O];return typeof _=="object"&&_!==null?(0,Ja._)(w$||(w$=y(["","(",", ","[","])"])),d(),r,$,O):(0,Ja._)($$||($$=y([""," === ",""])),r,_)}o(b,"equalCode")}};Fd.default=_N});var O$=D(Ad=>{"use strict";c();Object.defineProperty(Ad,"__esModule",{value:!0});var SN=Iw(),PN=_w(),EN=jw(),TN=Lw(),kN=zw(),FN=Gw(),AN=Jw(),jN=m$(),NN=x$(),RN=v$(),CN=[SN.default,PN.default,EN.default,TN.default,kN.default,FN.default,AN.default,jN.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},NN.default,RN.default];Ad.default=CN});var Nd=D(Za=>{"use strict";c();Object.defineProperty(Za,"__esModule",{value:!0});Za.validateAdditionalItems=void 0;var Pi=de(),jd=Le(),_$,S$,MN={message:o(({params:{len:e}})=>(0,Pi.str)(_$||(_$=y(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,Pi._)(S$||(S$=y(["{limit: ","}"])),e),"params")},LN={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:MN,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,jd.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}k$(e,n)}},P$,E$,T$;function k$(e,t){let{gen:r,schema:n,data:i,keyword:s,it:a}=e;a.items=!0;let u=r.const("len",(0,Pi._)(P$||(P$=y(["",".length"])),i));if(n===!1)e.setParams({len:t.length}),e.pass((0,Pi._)(E$||(E$=y([""," <= ",""])),u,t.length));else if(typeof n=="object"&&!(0,jd.alwaysValidSchema)(a,n)){let d=r.var("valid",(0,Pi._)(T$||(T$=y([""," <= ",""])),u,t.length));r.if((0,Pi.not)(d),()=>l(d)),e.ok(d)}function l(d){r.forRange("i",t.length,u,m=>{e.subschema({keyword:s,dataProp:m,dataPropType:jd.Type.Num},d),a.allErrors||r.if((0,Pi.not)(d),()=>r.break())})}o(l,"validateItems")}o(k$,"validateAdditionalItems");Za.validateAdditionalItems=k$;Za.default=LN});var Rd=D(Ya=>{"use strict";c();Object.defineProperty(Ya,"__esModule",{value:!0});Ya.validateTuple=void 0;var F$=de(),hu=Le(),UN=Ur(),DN={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return N$(e,"additionalItems",t);r.items=!0,!(0,hu.alwaysValidSchema)(r,t)&&e.ok((0,UN.validateArray)(e))}},A$,j$;function N$(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=e;m(i),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=hu.mergeEvaluated.items(n,r.length,u.items));let l=n.name("valid"),d=n.const("len",(0,F$._)(A$||(A$=y(["",".length"])),s));r.forEach((h,b)=>{(0,hu.alwaysValidSchema)(u,h)||(n.if((0,F$._)(j$||(j$=y([""," > ",""])),d,b),()=>e.subschema({keyword:a,schemaProp:b,dataProp:b},l)),e.ok(l))});function m(h){let{opts:b,errSchemaPath:$}=u,O=r.length,_=O===h.minItems&&(O===h.maxItems||h[t]===!1);if(b.strictTuples&&!_){let E='"'.concat(a,'" is ').concat(O,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat($,'"');(0,hu.checkStrictMode)(u,E,b.strictTuples)}}o(m,"checkStrictTuple")}o(N$,"validateTuple");Ya.validateTuple=N$;Ya.default=DN});var R$=D(Cd=>{"use strict";c();Object.defineProperty(Cd,"__esModule",{value:!0});var qN=Rd(),zN={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,qN.validateTuple)(e,"items"),"code")};Cd.default=zN});var U$=D(Md=>{"use strict";c();Object.defineProperty(Md,"__esModule",{value:!0});var C$=de(),VN=Le(),BN=Ur(),GN=Nd(),M$,L$,KN={message:o(({params:{len:e}})=>(0,C$.str)(M$||(M$=y(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,C$._)(L$||(L$=y(["{limit: ","}"])),e),"params")},WN={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:KN,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,VN.alwaysValidSchema)(n,t)&&(i?(0,GN.validateAdditionalItems)(e,i):e.ok((0,BN.validateArray)(e)))}};Md.default=WN});var X$=D(Ld=>{"use strict";c();Object.defineProperty(Ld,"__esModule",{value:!0});var qr=de(),gu=Le(),D$,q$,z$,V$,HN={message:o(({params:{min:e,max:t}})=>t===void 0?(0,qr.str)(D$||(D$=y(["must contain at least "," valid item(s)"])),e):(0,qr.str)(q$||(q$=y(["must contain at least "," and no more than "," valid item(s)"])),e,t),"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,qr._)(z$||(z$=y(["{minContains: ","}"])),e):(0,qr._)(V$||(V$=y(["{minContains: ",", maxContains: ","}"])),e,t),"params")},B$,G$,K$,W$,H$,J$,Z$,Y$,JN={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:HN,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,a,u,{minContains:l,maxContains:d}=n;s.opts.next?(a=l===void 0?1:l,u=d):a=1;let m=t.const("len",(0,qr._)(B$||(B$=y(["",".length"])),i));if(e.setParams({min:a,max:u}),u===void 0&&a===0){(0,gu.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,gu.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,gu.alwaysValidSchema)(s,r)){let _=(0,qr._)(G$||(G$=y([""," >= ",""])),m,a);u!==void 0&&(_=(0,qr._)(K$||(K$=y([""," && "," <= ",""])),_,m,u)),e.pass(_);return}s.items=!0;let h=t.name("valid");u===void 0&&a===1?$(h,()=>t.if(h,()=>t.break())):a===0?(t.let(h,!0),u!==void 0&&t.if((0,qr._)(W$||(W$=y(["",".length > 0"])),i),b)):(t.let(h,!1),b()),e.result(h,()=>e.reset());function b(){let _=t.name("_valid"),E=t.let("count",0);$(_,()=>t.if(_,()=>O(E)))}o(b,"validateItemsWithCount");function $(_,E){t.forRange("i",0,m,k=>{e.subschema({keyword:"contains",dataProp:k,dataPropType:gu.Type.Num,compositeRule:!0},_),E()})}o($,"validateItems");function O(_){t.code((0,qr._)(H$||(H$=y(["","++"])),_)),u===void 0?t.if((0,qr._)(J$||(J$=y([""," >= ",""])),_,a),()=>t.assign(h,!0).break()):(t.if((0,qr._)(Z$||(Z$=y([""," > ",""])),_,u),()=>t.assign(h,!1).break()),a===1?t.assign(h,!0):t.if((0,qr._)(Y$||(Y$=y([""," >= ",""])),_,a),()=>t.assign(h,!0)))}o(O,"checkLimits")}};Ld.default=JN});var ov=D(Tn=>{"use strict";c();Object.defineProperty(Tn,"__esModule",{value:!0});Tn.validateSchemaDeps=Tn.validatePropertyDeps=Tn.error=void 0;var Ud=de(),ZN=Le(),Xa=Ur(),Q$,ev;Tn.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Ud.str)(Q$||(Q$=y(["must have "," "," when property "," is present"])),n,r,e)},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Ud._)(ev||(ev=y(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r),"params")};var YN={keyword:"dependencies",type:"object",schemaType:"object",error:Tn.error,code(e){let[t,r]=XN(e);rv(e,t),nv(e,r)}};function XN({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}o(XN,"splitDependencies");var tv;function rv(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let a in t){let u=t[a];if(u.length===0)continue;let l=(0,Xa.propertyInData)(r,n,a,i.opts.ownProperties);e.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),i.allErrors?r.if(l,()=>{for(let d of u)(0,Xa.checkReportMissingProp)(e,d)}):(r.if((0,Ud._)(tv||(tv=y([""," && (",")"])),l,(0,Xa.checkMissingProp)(e,u,s))),(0,Xa.reportMissingProp)(e,s),r.else())}}o(rv,"validatePropertyDeps");Tn.validatePropertyDeps=rv;function nv(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,a=r.name("valid");for(let u in t)(0,ZN.alwaysValidSchema)(s,t[u])||(r.if((0,Xa.propertyInData)(r,n,u,s.opts.ownProperties),()=>{let l=e.subschema({keyword:i,schemaProp:u},a);e.mergeValidEvaluated(l,a)},()=>r.var(a,!0)),e.ok(a))}o(nv,"validateSchemaDeps");Tn.validateSchemaDeps=nv;Tn.default=YN});var av=D(Dd=>{"use strict";c();Object.defineProperty(Dd,"__esModule",{value:!0});var sv=de(),QN=Le(),iv,eR={message:"property name must be valid",params:o(({params:e})=>(0,sv._)(iv||(iv=y(["{propertyName: ","}"])),e.propertyName),"params")},tR={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:eR,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,QN.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),t.if((0,sv.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};Dd.default=tR});var zd=D(qd=>{"use strict";c();Object.defineProperty(qd,"__esModule",{value:!0});var xu=Ur(),un=de(),rR=no(),Iu=Le(),cv,nR={message:"must NOT have additional properties",params:o(({params:e})=>(0,un._)(cv||(cv=y(["{additionalProperty: ","}"])),e.additionalProperty),"params")},uv,fv,lv,pv,oR={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nR,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:u,opts:l}=a;if(a.props=!0,l.removeAdditional!=="all"&&(0,Iu.alwaysValidSchema)(a,r))return;let d=(0,xu.allSchemaProperties)(n.properties),m=(0,xu.allSchemaProperties)(n.patternProperties);h(),e.ok((0,un._)(uv||(uv=y([""," === ",""])),s,rR.default.errors));function h(){t.forIn("key",i,E=>{!d.length&&!m.length?O(E):t.if(b(E),()=>O(E))})}o(h,"checkAdditionalProperties");function b(E){let k;if(d.length>8){let G=(0,Iu.schemaRefOrVal)(a,n.properties,"properties");k=(0,xu.isOwnProperty)(t,G,E)}else d.length?k=(0,un.or)(...d.map(G=>(0,un._)(fv||(fv=y([""," === ",""])),E,G))):k=un.nil;return m.length&&(k=(0,un.or)(k,...m.map(G=>(0,un._)(lv||(lv=y(["",".test(",")"])),(0,xu.usePattern)(e,G),E)))),(0,un.not)(k)}o(b,"isAdditional");function $(E){t.code((0,un._)(pv||(pv=y(["delete ","[","]"])),i,E))}o($,"deleteAdditional");function O(E){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){$(E);return}if(r===!1){e.setParams({additionalProperty:E}),e.error(),u||t.break();return}if(typeof r=="object"&&!(0,Iu.alwaysValidSchema)(a,r)){let k=t.name("valid");l.removeAdditional==="failing"?(_(E,k,!1),t.if((0,un.not)(k),()=>{e.reset(),$(E)})):(_(E,k),u||t.if((0,un.not)(k),()=>t.break()))}}o(O,"additionalPropertyCode");function _(E,k,G){let R={keyword:"additionalProperties",dataProp:E,dataPropType:Iu.Type.Str};G===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(R,k)}o(_,"applyAdditionalSchema")}};qd.default=oR});var yv=D(Bd=>{"use strict";c();Object.defineProperty(Bd,"__esModule",{value:!0});var iR=La(),dv=Ur(),Vd=Le(),mv=zd(),sR={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&mv.default.code(new iR.KeywordCxt(s,mv.default,"additionalProperties"));let a=(0,dv.allSchemaProperties)(r);for(let h of a)s.definedProperties.add(h);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=Vd.mergeEvaluated.props(t,(0,Vd.toHash)(a),s.props));let u=a.filter(h=>!(0,Vd.alwaysValidSchema)(s,r[h]));if(u.length===0)return;let l=t.name("valid");for(let h of u)d(h)?m(h):(t.if((0,dv.propertyInData)(t,i,h,s.opts.ownProperties)),m(h),s.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(h),e.ok(l);function d(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}o(d,"hasDefault");function m(h){e.subschema({keyword:"properties",schemaProp:h,dataProp:h},l)}o(m,"applyPropertySchema")}};Bd.default=sR});var wv=D(Gd=>{"use strict";c();Object.defineProperty(Gd,"__esModule",{value:!0});var hv=Ur(),bu=de(),gv=Le(),xv=Le(),Iv,bv,aR={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:a}=s,u=(0,hv.allSchemaProperties)(r),l=u.filter(_=>(0,gv.alwaysValidSchema)(s,r[_]));if(u.length===0||l.length===u.length&&(!s.opts.unevaluated||s.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&i.properties,m=t.name("valid");s.props!==!0&&!(s.props instanceof bu.Name)&&(s.props=(0,xv.evaluatedPropsToName)(t,s.props));let{props:h}=s;b();function b(){for(let _ of u)d&&$(_),s.allErrors?O(_):(t.var(m,!0),O(_),t.if(m))}o(b,"validatePatternProperties");function $(_){for(let E in d)new RegExp(_).test(E)&&(0,gv.checkStrictMode)(s,"property ".concat(E," matches pattern ").concat(_," (use allowMatchingProperties)"))}o($,"checkMatchingProperties");function O(_){t.forIn("key",n,E=>{t.if((0,bu._)(Iv||(Iv=y(["",".test(",")"])),(0,hv.usePattern)(e,_),E),()=>{let k=l.includes(_);k||e.subschema({keyword:"patternProperties",schemaProp:_,dataProp:E,dataPropType:xv.Type.Str},m),s.opts.unevaluated&&h!==!0?t.assign((0,bu._)(bv||(bv=y(["","[","]"])),h,E),!0):!k&&!s.allErrors&&t.if((0,bu.not)(m),()=>t.break())})})}o(O,"validateProperties")}};Gd.default=aR});var $v=D(Kd=>{"use strict";c();Object.defineProperty(Kd,"__esModule",{value:!0});var cR=Le(),uR={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,cR.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Kd.default=uR});var vv=D(Wd=>{"use strict";c();Object.defineProperty(Wd,"__esModule",{value:!0});var fR=Ur(),lR={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fR.validateUnion,error:{message:"must match a schema in anyOf"}};Wd.default=lR});var Pv=D(Hd=>{"use strict";c();Object.defineProperty(Hd,"__esModule",{value:!0});var wu=de(),pR=Le(),Ov,dR={message:"must match exactly one schema in oneOf",params:o(({params:e})=>(0,wu._)(Ov||(Ov=y(["{passingSchemas: ","}"])),e.passing),"params")},_v,Sv,mR={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dR,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");e.setParams({passing:u}),t.block(d),e.result(a,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((m,h)=>{let b;(0,pR.alwaysValidSchema)(i,m)?t.var(l,!0):b=e.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},l),h>0&&t.if((0,wu._)(_v||(_v=y([""," && ",""])),l,a)).assign(a,!1).assign(u,(0,wu._)(Sv||(Sv=y(["[",", ","]"])),u,h)).else(),t.if(l,()=>{t.assign(a,!0),t.assign(u,h),b&&e.mergeEvaluated(b,wu.Name)})})}o(d,"validateOneOf")}};Hd.default=mR});var Ev=D(Jd=>{"use strict";c();Object.defineProperty(Jd,"__esModule",{value:!0});var yR=Le(),hR={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,a)=>{if((0,yR.alwaysValidSchema)(n,s))return;let u=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(u)})}};Jd.default=hR});var Nv=D(Zd=>{"use strict";c();Object.defineProperty(Zd,"__esModule",{value:!0});var $u=de(),jv=Le(),kv,Fv,gR={message:o(({params:e})=>(0,$u.str)(kv||(kv=y(['must match "','" schema'])),e.ifClause),"message"),params:o(({params:e})=>(0,$u._)(Fv||(Fv=y(["{failingKeyword: ","}"])),e.ifClause),"params")},Av,xR={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:gR,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,jv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Tv(n,"then"),s=Tv(n,"else");if(!i&&!s)return;let a=t.let("valid",!0),u=t.name("_valid");if(l(),e.reset(),i&&s){let m=t.let("ifClause");e.setParams({ifClause:m}),t.if(u,d("then",m),d("else",m))}else i?t.if(u,d("then")):t.if((0,$u.not)(u),d("else"));e.pass(a,()=>e.error(!0));function l(){let m=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(m)}o(l,"validateIf");function d(m,h){return()=>{let b=e.subschema({keyword:m},u);t.assign(a,u),e.mergeValidEvaluated(b,a),h?t.assign(h,(0,$u._)(Av||(Av=y(["",""])),m)):e.setParams({ifClause:m})}}o(d,"validateClause")}};function Tv(e,t){let r=e.schema[t];return r!==void 0&&!(0,jv.alwaysValidSchema)(e,r)}o(Tv,"hasSchema");Zd.default=xR});var Rv=D(Yd=>{"use strict";c();Object.defineProperty(Yd,"__esModule",{value:!0});var IR=Le(),bR={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,IR.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};Yd.default=bR});var Cv=D(Xd=>{"use strict";c();Object.defineProperty(Xd,"__esModule",{value:!0});var wR=Nd(),$R=R$(),vR=Rd(),OR=U$(),_R=X$(),SR=ov(),PR=av(),ER=zd(),TR=yv(),kR=wv(),FR=$v(),AR=vv(),jR=Pv(),NR=Ev(),RR=Nv(),CR=Rv();function MR(e=!1){let t=[FR.default,AR.default,jR.default,NR.default,RR.default,CR.default,PR.default,ER.default,SR.default,TR.default,kR.default];return e?t.push($R.default,OR.default):t.push(wR.default,vR.default),t.push(_R.default),t}o(MR,"getApplicator");Xd.default=MR});var eO=D(Qd=>{"use strict";c();Object.defineProperty(Qd,"__esModule",{value:!0});var wt=de(),Mv,Lv,LR={message:o(({schemaCode:e})=>(0,wt.str)(Mv||(Mv=y(['must match format "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,wt._)(Lv||(Lv=y(["{format: ","}"])),e),"params")},Uv,Dv,qv,zv,Vv,Bv,Gv,Kv,Wv,Hv,Jv,Zv,Yv,Xv,Qv,UR={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:LR,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:u}=e,{opts:l,errSchemaPath:d,schemaEnv:m,self:h}=u;if(!l.validateFormats)return;i?b():$();function b(){let O=r.scopeValue("formats",{ref:h.formats,code:l.code.formats}),_=r.const("fDef",(0,wt._)(Uv||(Uv=y(["","[","]"])),O,a)),E=r.let("fType"),k=r.let("format");r.if((0,wt._)(Dv||(Dv=y(["typeof ",' == "object" && !('," instanceof RegExp)"])),_,_),()=>r.assign(E,(0,wt._)(qv||(qv=y(["",'.type || "string"'])),_)).assign(k,(0,wt._)(zv||(zv=y(["",".validate"])),_)),()=>r.assign(E,(0,wt._)(Vv||(Vv=y(['"string"'])))).assign(k,_)),e.fail$data((0,wt.or)(G(),R()));function G(){return l.strictSchema===!1?wt.nil:(0,wt._)(Bv||(Bv=y([""," && !",""])),a,k)}o(G,"unknownFmt");function R(){let N=m.$async?(0,wt._)(Gv||(Gv=y(["(",".async ? await ","(",") : ","(","))"])),_,k,n,k,n):(0,wt._)(Kv||(Kv=y(["","(",")"])),k,n),C=(0,wt._)(Wv||(Wv=y(["(typeof ",' == "function" ? '," : ",".test(","))"])),k,N,k,n);return(0,wt._)(Hv||(Hv=y([""," && "," !== true && "," === "," && !",""])),k,k,E,t,C)}o(R,"invalidFmt")}o(b,"validate$DataFormat");function $(){let O=h.formats[s];if(!O){G();return}if(O===!0)return;let[_,E,k]=R(O);_===t&&e.pass(N());function G(){if(l.strictSchema===!1){h.logger.warn(C());return}throw new Error(C());function C(){return'unknown format "'.concat(s,'" ignored in schema at path "').concat(d,'"')}}o(G,"unknownFormat");function R(C){let me=C instanceof RegExp?(0,wt.regexpCode)(C):l.code.formats?(0,wt._)(Jv||(Jv=y(["","",""])),l.code.formats,(0,wt.getProperty)(s)):void 0,le=r.scopeValue("formats",{key:s,ref:C,code:me});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,wt._)(Zv||(Zv=y(["",".validate"])),le)]:["string",C,le]}o(R,"getFormat");function N(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!m.$async)throw new Error("async format in sync schema");return(0,wt._)(Yv||(Yv=y(["await ","(",")"])),k,n)}return typeof E=="function"?(0,wt._)(Xv||(Xv=y(["","(",")"])),k,n):(0,wt._)(Qv||(Qv=y(["",".test(",")"])),k,n)}o(N,"validCondition")}o($,"validateFormat")}};Qd.default=UR});var tO=D(em=>{"use strict";c();Object.defineProperty(em,"__esModule",{value:!0});var DR=eO(),qR=[DR.default];em.default=qR});var rO=D(bs=>{"use strict";c();Object.defineProperty(bs,"__esModule",{value:!0});bs.contentVocabulary=bs.metadataVocabulary=void 0;bs.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];bs.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var oO=D(tm=>{"use strict";c();Object.defineProperty(tm,"__esModule",{value:!0});var zR=yw(),VR=O$(),BR=Cv(),GR=tO(),nO=rO(),KR=[zR.default,VR.default,(0,BR.default)(),GR.default,nO.metadataVocabulary,nO.contentVocabulary];tm.default=KR});var sO=D(vu=>{"use strict";c();Object.defineProperty(vu,"__esModule",{value:!0});vu.DiscrError=void 0;var iO;(function(e){e.Tag="tag",e.Mapping="mapping"})(iO||(vu.DiscrError=iO={}))});var pO=D(nm=>{"use strict";c();Object.defineProperty(nm,"__esModule",{value:!0});var ws=de(),rm=sO(),aO=iu(),WR=Ua(),HR=Le(),cO,JR={message:o(({params:{discrError:e,tagName:t}})=>e===rm.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),"message"),params:o(({params:{discrError:e,tag:t,tagName:r}})=>(0,ws._)(cO||(cO=y(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t),"params")},uO,fO,lO,ZR={keyword:"discriminator",type:"object",schemaType:"object",error:JR,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let l=t.let("valid",!1),d=t.const("tag",(0,ws._)(uO||(uO=y(["","",""])),r,(0,ws.getProperty)(u)));t.if((0,ws._)(fO||(fO=y(["typeof ",' == "string"'])),d),()=>m(),()=>e.error(!1,{discrError:rm.DiscrError.Tag,tag:d,tagName:u})),e.ok(l);function m(){let $=b();t.if(!1);for(let O in $)t.elseIf((0,ws._)(lO||(lO=y([""," === ",""])),d,O)),t.assign(l,h($[O]));t.else(),e.error(!1,{discrError:rm.DiscrError.Mapping,tag:d,tagName:u}),t.endIf()}o(m,"validateMapping");function h($){let O=t.name("valid"),_=e.subschema({keyword:"oneOf",schemaProp:$},O);return e.mergeEvaluated(_,ws.Name),O}o(h,"applyTagSchema");function b(){var $;let O={},_=k(i),E=!0;for(let N=0;N<a.length;N++){let C=a[N];if(C!=null&&C.$ref&&!(0,HR.schemaHasRulesButRef)(C,s.self.RULES)){let le=C.$ref;if(C=aO.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,le),C instanceof aO.SchemaEnv&&(C=C.schema),C===void 0)throw new WR.default(s.opts.uriResolver,s.baseId,le)}let me=($=C==null?void 0:C.properties)===null||$===void 0?void 0:$[u];if(typeof me!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(u,'"'));E=E&&(_||k(C)),G(me,N)}if(!E)throw new Error('discriminator: "'.concat(u,'" must be required'));return O;function k({required:N}){return Array.isArray(N)&&N.includes(u)}function G(N,C){if(N.const)R(N.const,C);else if(N.enum)for(let me of N.enum)R(me,C);else throw new Error('discriminator: "properties/'.concat(u,'" must have "const" or "enum"'))}function R(N,C){if(typeof N!="string"||N in O)throw new Error('discriminator: "'.concat(u,'" values must be unique strings'));O[N]=C}}o(b,"getMapping")}};nm.default=ZR});var dO=D(($6,YR)=>{YR.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0}});var sm=D((ft,om)=>{"use strict";c();Object.defineProperty(ft,"__esModule",{value:!0});ft.MissingRefError=ft.ValidationError=ft.CodeGen=ft.Name=ft.nil=ft.stringify=ft.str=ft._=ft.KeywordCxt=ft.Ajv=void 0;var XR=ew(),QR=oO(),eC=pO(),mO=dO(),tC=["/properties"],Ou="http://json-schema.org/draft-07/schema",im=class im extends XR.default{_addVocabularies(){super._addVocabularies(),QR.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(eC.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(mO,tC):mO;this.addMetaSchema(t,Ou,!1),this.refs["http://json-schema.org/schema"]=Ou}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ou)?Ou:void 0)}};o(im,"Ajv");var $s=im;ft.Ajv=$s;om.exports=ft=$s;om.exports.Ajv=$s;Object.defineProperty(ft,"__esModule",{value:!0});ft.default=$s;var rC=La();Object.defineProperty(ft,"KeywordCxt",{enumerable:!0,get:o(function(){return rC.KeywordCxt},"get")});var vs=de();Object.defineProperty(ft,"_",{enumerable:!0,get:o(function(){return vs._},"get")});Object.defineProperty(ft,"str",{enumerable:!0,get:o(function(){return vs.str},"get")});Object.defineProperty(ft,"stringify",{enumerable:!0,get:o(function(){return vs.stringify},"get")});Object.defineProperty(ft,"nil",{enumerable:!0,get:o(function(){return vs.nil},"get")});Object.defineProperty(ft,"Name",{enumerable:!0,get:o(function(){return vs.Name},"get")});Object.defineProperty(ft,"CodeGen",{enumerable:!0,get:o(function(){return vs.CodeGen},"get")});var nC=nu();Object.defineProperty(ft,"ValidationError",{enumerable:!0,get:o(function(){return nC.default},"get")});var oC=Ua();Object.defineProperty(ft,"MissingRefError",{enumerable:!0,get:o(function(){return oC.default},"get")})});var bO=D(kn=>{"use strict";c();Object.defineProperty(kn,"__esModule",{value:!0});kn.formatNames=kn.fastFormats=kn.fullFormats=void 0;function Os(e,t){return{validate:e,compare:t}}o(Os,"fmtDef");kn.fullFormats={date:Os(gO,um),time:Os(xO,fm),"date-time":Os(cC,IO),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:lC,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:new RegExp("^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$","iu"),email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:xC,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:pC,int32:{type:"number",validate:yC},int64:{type:"number",validate:hC},float:{type:"number",validate:hO},double:{type:"number",validate:hO},password:!0,binary:!0};kn.fastFormats=F(g({},kn.fullFormats),{date:Os(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,um),time:Os(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,fm),"date-time":Os(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,IO),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});kn.formatNames=Object.keys(kn.fullFormats);function iC(e){return e%4===0&&(e%100!==0||e%400===0)}o(iC,"isLeapYear");var sC=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,aC=[0,31,28,31,30,31,30,31,31,30,31,30,31];function gO(e){let t=sC.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&iC(r)?29:aC[n])}o(gO,"date");function um(e,t){if(e&&t)return e>t?1:e<t?-1:0}o(um,"compareDate");var am=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function xO(e,t){let r=am.exec(e);if(!r)return!1;let n=+r[1],i=+r[2],s=+r[3],a=r[5];return(n<=23&&i<=59&&s<=59||n===23&&i===59&&s===60)&&(!t||a!=="")}o(xO,"time");function fm(e,t){if(!(e&&t))return;let r=am.exec(e),n=am.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}o(fm,"compareTime");var cm=/t|\s/i;function cC(e){let t=e.split(cm);return t.length===2&&gO(t[0])&&xO(t[1],!0)}o(cC,"date_time");function IO(e,t){if(!(e&&t))return;let[r,n]=e.split(cm),[i,s]=t.split(cm),a=um(r,i);if(a!==void 0)return a||fm(n,s)}o(IO,"compareDateTime");var uC=/\/|:/,fC=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function lC(e){return uC.test(e)&&fC.test(e)}o(lC,"uri");var yO=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function pC(e){return yO.lastIndex=0,yO.test(e)}o(pC,"byte");var dC=-(2**31),mC=2**31-1;function yC(e){return Number.isInteger(e)&&e<=mC&&e>=dC}o(yC,"validateInt32");function hC(e){return Number.isInteger(e)}o(hC,"validateInt64");function hO(){return!0}o(hO,"validateNumber");var gC=/[^\\]\\Z/;function xC(e){if(gC.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}o(xC,"regex")});var TO=D(_s=>{"use strict";c();Object.defineProperty(_s,"__esModule",{value:!0});_s.formatLimitDefinition=void 0;var IC=sm(),fn=de(),zo=fn.operators,_u={formatMaximum:{okStr:"<=",ok:zo.LTE,fail:zo.GT},formatMinimum:{okStr:">=",ok:zo.GTE,fail:zo.LT},formatExclusiveMaximum:{okStr:"<",ok:zo.LT,fail:zo.GTE},formatExclusiveMinimum:{okStr:">",ok:zo.GT,fail:zo.LTE}},wO,$O,bC={message:o(({keyword:e,schemaCode:t})=>fn.str(wO||(wO=y(["should be "," ",""])),_u[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>fn._($O||($O=y(["{comparison: ",", limit: ","}"])),_u[e].okStr,t),"params")},vO,OO,_O,SO,PO,EO;_s.formatLimitDefinition={keyword:Object.keys(_u),type:"string",schemaType:"string",$data:!0,error:bC,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:a,self:u}=s;if(!a.validateFormats)return;let l=new IC.KeywordCxt(s,u.RULES.all.format.definition,"format");l.$data?d():m();function d(){let b=t.scopeValue("formats",{ref:u.formats,code:a.code.formats}),$=t.const("fmt",fn._(vO||(vO=y(["","[","]"])),b,l.schemaCode));e.fail$data(fn.or(fn._(OO||(OO=y(["typeof ",' != "object"'])),$),fn._(_O||(_O=y([""," instanceof RegExp"])),$),fn._(SO||(SO=y(["typeof ",'.compare != "function"'])),$),h($)))}o(d,"validate$DataFormat");function m(){let b=l.schema,$=u.formats[b];if(!$||$===!0)return;if(typeof $!="object"||$ instanceof RegExp||typeof $.compare!="function")throw new Error('"'.concat(i,'": format "').concat(b,'" does not define "compare" function'));let O=t.scopeValue("formats",{key:b,ref:$,code:a.code.formats?fn._(PO||(PO=y(["","",""])),a.code.formats,fn.getProperty(b)):void 0});e.fail$data(h(O))}o(m,"validateFormat");function h(b){return fn._(EO||(EO=y(["",".compare(",", ",") "," 0"])),b,r,n,_u[i].fail)}o(h,"compareCode")},dependencies:["format"]};var wC=o(e=>(e.addKeyword(_s.formatLimitDefinition),e),"formatLimitPlugin");_s.default=wC});var NO=D((Qa,jO)=>{"use strict";c();Object.defineProperty(Qa,"__esModule",{value:!0});var Ss=bO(),$C=TO(),lm=de(),kO=new lm.Name("fullFormats"),vC=new lm.Name("fastFormats"),pm=o((e,t={keywords:!0})=>{if(Array.isArray(t))return FO(e,t,Ss.fullFormats,kO),e;let[r,n]=t.mode==="fast"?[Ss.fastFormats,vC]:[Ss.fullFormats,kO],i=t.formats||Ss.formatNames;return FO(e,i,r,n),t.keywords&&$C.default(e),e},"formatsPlugin");pm.get=(e,t="full")=>{let n=(t==="fast"?Ss.fastFormats:Ss.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var AO;function FO(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=lm._(AO||(AO=y(['require("ajv-formats/dist/formats").',""])),n));for(let a of t)e.addFormat(a,r[a])}o(FO,"addFormats");jO.exports=Qa=pm;Object.defineProperty(Qa,"__esModule",{value:!0});Qa.default=pm});var ak=D((ag,cg)=>{c();(function(e,t){typeof ag=="object"&&typeof cg<"u"?cg.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.TinyQueue=t())})(ag,function(){"use strict";var e=o(function(n,i){if(n===void 0&&(n=[]),i===void 0&&(i=t),this.data=n,this.length=this.data.length,this.compare=i,this.length>0)for(var s=(this.length>>1)-1;s>=0;s--)this._down(s)},"TinyQueue");e.prototype.push=o(function(n){this.data.push(n),this.length++,this._up(this.length-1)},"push"),e.prototype.pop=o(function(){if(this.length!==0){var n=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),n}},"pop"),e.prototype.peek=o(function(){return this.data[0]},"peek"),e.prototype._up=o(function(n){for(var i=this,s=i.data,a=i.compare,u=s[n];n>0;){var l=n-1>>1,d=s[l];if(a(u,d)>=0)break;s[n]=d,n=l}s[n]=u},"_up"),e.prototype._down=o(function(n){for(var i=this,s=i.data,a=i.compare,u=this.length>>1,l=s[n];n<u;){var d=(n<<1)+1,m=s[d],h=d+1;if(h<this.length&&a(s[h],m)<0&&(d=h,m=s[h]),a(m,l)>=0)break;s[n]=m,n=d}s[n]=l},"_down");function t(r,n){return r<n?-1:r>n?1:0}return o(t,"defaultCompare"),e})});var uk=D((L0e,ug)=>{"use strict";c();var ul=ak();ul.default&&(ul=ul.default);ug.exports=ck;ug.exports.default=ck;function ck(e,t,r){t=t||1;for(var n,i,s,a,u=0;u<e[0].length;u++){var l=e[0][u];(!u||l[0]<n)&&(n=l[0]),(!u||l[1]<i)&&(i=l[1]),(!u||l[0]>s)&&(s=l[0]),(!u||l[1]>a)&&(a=l[1])}var d=s-n,m=a-i,h=Math.min(d,m),b=h/2;if(h===0){var $=[n,i];return $.distance=0,$}for(var O=new ul(void 0,uB),_=n;_<s;_+=h)for(var E=i;E<a;E+=h)O.push(new Qo(_+b,E+b,b,e));var k=lB(e),G=new Qo(n+d/2,i+m/2,0,e);G.d>k.d&&(k=G);for(var R=O.length;O.length;){var N=O.pop();N.d>k.d&&(k=N,r&&console.log("found best %d after %d probes",Math.round(1e4*N.d)/1e4,R)),!(N.max-k.d<=t)&&(b=N.h/2,O.push(new Qo(N.x-b,N.y-b,b,e)),O.push(new Qo(N.x+b,N.y-b,b,e)),O.push(new Qo(N.x-b,N.y+b,b,e)),O.push(new Qo(N.x+b,N.y+b,b,e)),R+=4)}r&&(console.log("num probes: "+R),console.log("best distance: "+k.d));var C=[k.x,k.y];return C.distance=k.d,C}o(ck,"polylabel");function uB(e,t){return t.max-e.max}o(uB,"compareMax");function Qo(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=fB(e,t,n),this.max=this.d+this.h*Math.SQRT2}o(Qo,"Cell");function fB(e,t,r){for(var n=!1,i=1/0,s=0;s<r.length;s++)for(var a=r[s],u=0,l=a.length,d=l-1;u<l;d=u++){var m=a[u],h=a[d];m[1]>t!=h[1]>t&&e<(h[0]-m[0])*(t-m[1])/(h[1]-m[1])+m[0]&&(n=!n),i=Math.min(i,pB(e,t,m,h))}return i===0?0:(n?1:-1)*Math.sqrt(i)}o(fB,"pointToPolygonDist");function lB(e){for(var t=0,r=0,n=0,i=e[0],s=0,a=i.length,u=a-1;s<a;u=s++){var l=i[s],d=i[u],m=l[0]*d[1]-d[0]*l[1];r+=(l[0]+d[0])*m,n+=(l[1]+d[1])*m,t+=m*3}return t===0?new Qo(i[0][0],i[0][1],0,e):new Qo(r/t,n/t,0,e)}o(lB,"getCentroidCell");function pB(e,t,r,n){var i=r[0],s=r[1],a=n[0]-i,u=n[1]-s;if(a!==0||u!==0){var l=((e-i)*a+(t-s)*u)/(a*a+u*u);l>1?(i=n[0],s=n[1]):l>0&&(i+=a*l,s+=u*l)}return a=e-i,u=t-s,a*a+u*u}o(pB,"getSegDistSq")});c();c();c();c();var $k="[MappedinJS]";function vk(e=""){let t="".concat($k).concat(e?"-".concat(e):""),r=o((n,i)=>{if(typeof window<"u"&&window.rnDebug){let s=i.map(a=>a instanceof Error&&a.stack?"".concat(a.message,"\n").concat(a.stack):a);window.rnDebug("".concat(t," ").concat(n,": ").concat(s.join(" ")))}},"rnDebug");return{logState:p.env.NODE_ENV==="test"?3:0,log(...n){this.logState<=0&&(console.log(t,...n),r("log",n))},warn(...n){this.logState<=1&&(console.warn(t,...n),r("warn",n))},error(...n){this.logState<=2&&(console.error(t,...n),r("error",n))},assert(...n){console.assert(...n)},time(n){console.time(n)},timeEnd(n){console.timeEnd(n)},setLevel(n){0<=n&&n<=3&&(this.logState=n)}}}o(vk,"createLogger");var Ok=vk();var Zi=Ok;c();c();var dl=class dl extends Error{};o(dl,"InvalidTokenError");var pl=dl;pl.prototype.name="InvalidTokenError";c();c();c();c();c();c();c();var $n,Xi,ei,ha,Yi=class Yi{constructor(t,r){Pt(this,ei);tt(this,"__type",Yi.__type);Pt(this,$n);Pt(this,Xi);tt(this,"id");tt(this,"type");Ct(this,$n,t),Ct(this,Xi,r),this.id="ev_".concat(t.id),this.type=t.type}static is(t){return t!=null&&typeof t=="object"&&"__type"in t&&t.__type===Yi.__type}get name(){var t;return(t=ko(this,ei,ha).call(this,"name"))!=null?t:""}get startDate(){return new Date(H(this,$n).startDate)}get endDate(){return new Date(H(this,$n).endDate)}get externalId(){return H(this,$n).externalId}get description(){return ko(this,ei,ha).call(this,"description")}get location(){let t=H(this,$n).location,r=t!=null&&t.startsWith("el_")?t:"el_".concat(t);return H(this,Xi).getById("enterprise-location",r)}get image(){let t=ko(this,ei,ha).call(this,"image");if(t!=null)return g({url:t.original},t)}get video(){let t=ko(this,ei,ha).call(this,"video");if(t!=null)return{url:t.original,thumbnail:t.thumbnail,width:t.width,height:t.height}}};$n=new WeakMap,Xi=new WeakMap,ei=new WeakSet,ha=o(function(t){var r,n,i,s,a;return(a=(s=(i=H(this,$n)._locale)==null?void 0:i[(n=(r=H(this,Xi).currentLanguage)==null?void 0:r.code)!=null?n:"en"])==null?void 0:s[t])!=null?a:H(this,$n)[t]},"#getLocalizedResource"),o(Yi,"EventMetaData"),tt(Yi,"__type","event");var jc=Yi;c();c();c();var qe={};To(qe,{BRAND:()=>Zk,DIRTY:()=>ti,EMPTY_PATH:()=>Ek,INVALID:()=>te,NEVER:()=>NF,OK:()=>Ht,ParseStatus:()=>Mt,Schema:()=>pe,ZodAny:()=>jo,ZodArray:()=>eo,ZodBigInt:()=>oi,ZodBoolean:()=>ii,ZodBranded:()=>va,ZodCatch:()=>hi,ZodDate:()=>si,ZodDefault:()=>yi,ZodDiscriminatedUnion:()=>Lc,ZodEffects:()=>Mr,ZodEnum:()=>di,ZodError:()=>mr,ZodFirstPartyTypeKind:()=>oe,ZodFunction:()=>Dc,ZodIntersection:()=>fi,ZodIssueCode:()=>j,ZodLazy:()=>li,ZodLiteral:()=>pi,ZodMap:()=>ss,ZodNaN:()=>cs,ZodNativeEnum:()=>mi,ZodNever:()=>on,ZodNull:()=>ci,ZodNullable:()=>_n,ZodNumber:()=>ni,ZodObject:()=>yr,ZodOptional:()=>Rr,ZodParsedType:()=>z,ZodPipeline:()=>Oa,ZodPromise:()=>No,ZodReadonly:()=>gi,ZodRecord:()=>Uc,ZodSchema:()=>pe,ZodSet:()=>as,ZodString:()=>Ao,ZodSymbol:()=>os,ZodTransformer:()=>Mr,ZodTuple:()=>On,ZodType:()=>pe,ZodUndefined:()=>ai,ZodUnion:()=>ui,ZodUnknown:()=>Qn,ZodVoid:()=>is,addIssueToContext:()=>M,any:()=>iF,array:()=>uF,bigint:()=>eF,boolean:()=>Og,coerce:()=>jF,custom:()=>wg,date:()=>tF,datetimeRegex:()=>Ig,defaultErrorMap:()=>Yn,discriminatedUnion:()=>dF,effect:()=>_F,enum:()=>$F,function:()=>IF,getErrorMap:()=>Qi,getParsedType:()=>vn,instanceof:()=>Xk,intersection:()=>mF,isAborted:()=>Cc,isAsync:()=>es,isDirty:()=>Mc,isValid:()=>Fo,late:()=>Yk,lazy:()=>bF,literal:()=>wF,makeIssue:()=>ga,map:()=>gF,nan:()=>Qk,nativeEnum:()=>vF,never:()=>aF,null:()=>oF,nullable:()=>PF,number:()=>vg,object:()=>fF,objectUtil:()=>ml,oboolean:()=>AF,onumber:()=>FF,optional:()=>SF,ostring:()=>kF,pipeline:()=>TF,preprocess:()=>EF,promise:()=>OF,quotelessJson:()=>_k,record:()=>hF,set:()=>xF,setErrorMap:()=>Pk,strictObject:()=>lF,string:()=>$g,symbol:()=>rF,transformer:()=>_F,tuple:()=>yF,undefined:()=>nF,union:()=>pF,unknown:()=>sF,util:()=>xe,void:()=>cF});c();c();c();c();c();var xe;(function(e){e.assertEqual=i=>{};function t(i){}o(t,"assertIs"),e.assertIs=t;function r(i){throw new Error}o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=i=>{let s={};for(let a of i)s[a]=a;return s},e.getValidEnumValues=i=>{let s=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(let u of s)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},e.find=(i,s)=>{for(let a of i)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(s)}o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(xe||(xe={}));var ml;(function(e){e.mergeShapes=(t,r)=>g(g({},t),r)})(ml||(ml={}));var z=xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vn=o(e=>{switch(typeof e){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(e)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(e)?z.array:e===null?z.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?z.promise:typeof Map<"u"&&e instanceof Map?z.map:typeof Set<"u"&&e instanceof Set?z.set:typeof Date<"u"&&e instanceof Date?z.date:z.object;default:return z.unknown}},"getParsedType");var j=xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_k=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Nc=class Nc extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let u=n,l=0;for(;l<a.path.length;){let d=a.path[l];l===a.path.length-1?(u[d]=u[d]||{_errors:[]},u[d]._errors.push(r(a))):u[d]=u[d]||{_errors:[]},u=u[d],l++}}},"processError");return i(this),n}static assert(t){if(!(t instanceof Nc))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,xe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(Nc,"ZodError");var mr=Nc;mr.create=e=>new mr(e);var Sk=o((e,t)=>{let r;switch(e.code){case j.invalid_type:e.received===z.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case j.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,xe.jsonStringifyReplacer));break;case j.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(xe.joinValues(e.keys,", "));break;case j.invalid_union:r="Invalid input";break;case j.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(xe.joinValues(e.options));break;case j.invalid_enum_value:r="Invalid enum value. Expected ".concat(xe.joinValues(e.options),", received '").concat(e.received,"'");break;case j.invalid_arguments:r="Invalid function arguments";break;case j.invalid_return_type:r="Invalid function return type";break;case j.invalid_date:r="Invalid date";break;case j.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):xe.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case j.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case j.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case j.custom:r="Invalid input";break;case j.invalid_intersection_types:r="Intersection results could not be merged";break;case j.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case j.not_finite:r="Number must be finite";break;default:r=t.defaultError,xe.assertNever(e)}return{message:r}},"errorMap"),Yn=Sk;var mg=Yn;function Pk(e){mg=e}o(Pk,"setErrorMap");function Qi(){return mg}o(Qi,"getErrorMap");c();var ga=o(e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],a=F(g({},i),{path:s});if(i.message!==void 0)return F(g({},i),{path:s,message:i.message});let u="",l=n.filter(d=>!!d).slice().reverse();for(let d of l)u=d(a,{data:t,defaultError:u}).message;return F(g({},i),{path:s,message:u})},"makeIssue"),Ek=[];function M(e,t){let r=Qi(),n=ga({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Yn?void 0:Yn].filter(i=>!!i)});e.common.issues.push(n)}o(M,"addIssueToContext");var Rc=class Rc{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return te;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let s=await i.key,a=await i.value;n.push({key:s,value:a})}return Rc.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return te;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[s.value]=a.value)}return{status:t.value,value:n}}};o(Rc,"ParseStatus");var Mt=Rc,te=Object.freeze({status:"aborted"}),ti=o(e=>({status:"dirty",value:e}),"DIRTY"),Ht=o(e=>({status:"valid",value:e}),"OK"),Cc=o(e=>e.status==="aborted","isAborted"),Mc=o(e=>e.status==="dirty","isDirty"),Fo=o(e=>e.status==="valid","isValid"),es=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");c();c();c();var J;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(J||(J={}));var gl=class gl{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(gl,"ParseInputLazyPath");var Cr=gl,yg=o((e,t)=>{if(Fo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new mr(e.common.issues);return this._error=r,this._error}}},"handleResult");function ce(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:o((a,u)=>{var d,m;let{message:l}=e;return a.code==="invalid_enum_value"?{message:l!=null?l:u.defaultError}:typeof u.data>"u"?{message:(d=l!=null?l:n)!=null?d:u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:(m=l!=null?l:r)!=null?m:u.defaultError}},"customMap"),description:i}}o(ce,"processCreateParams");var xl=class xl{get description(){return this._def.description}_getType(t){return vn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:vn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Mt,ctx:{common:t.parent.common,data:t.data,parsedType:vn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(es(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var s;let n={common:{issues:[],async:(s=r==null?void 0:r.async)!=null?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vn(t)},i=this._parseSync({data:t,path:n.path,parent:n});return yg(n,i)}"~validate"(t){var n,i;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vn(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:r});return Fo(s)?{value:s.value}:{issues:r.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(s=>Fo(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vn(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(es(i)?i:Promise.resolve(i));return yg(n,s)}refine(t,r){let n=o(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,s)=>{let a=t(i),u=o(()=>s.addIssue(g({code:j.custom},n(i))),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Mr({schema:this,typeName:oe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:o(r=>this["~validate"](r),"validate")}}optional(){return Rr.create(this,this._def)}nullable(){return _n.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return eo.create(this)}promise(){return No.create(this,this._def)}or(t){return ui.create([this,t],this._def)}and(t){return fi.create(this,t,this._def)}transform(t){return new Mr(F(g({},ce(this._def)),{schema:this,typeName:oe.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let r=typeof t=="function"?t:()=>t;return new yi(F(g({},ce(this._def)),{innerType:this,defaultValue:r,typeName:oe.ZodDefault}))}brand(){return new va(g({typeName:oe.ZodBranded,type:this},ce(this._def)))}catch(t){let r=typeof t=="function"?t:()=>t;return new hi(F(g({},ce(this._def)),{innerType:this,catchValue:r,typeName:oe.ZodCatch}))}describe(t){let r=this.constructor;return new r(F(g({},this._def),{description:t}))}pipe(t){return Oa.create(this,t)}readonly(){return gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(xl,"ZodType");var pe=xl,Tk=/^c[^\s-]{8,}$/i,kk=/^[0-9a-z]+$/,Fk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ak=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jk=/^[a-z0-9_-]{21}$/i,Nk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Rk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ck=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yl,Lk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Uk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Dk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gg="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Bk=new RegExp("^".concat(gg,"$"));function xg(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?"));let r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)}o(xg,"timeRegexSource");function Gk(e){return new RegExp("^".concat(xg(e),"$"))}o(Gk,"timeRegex");function Ig(e){let t="".concat(gg,"T").concat(xg(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}o(Ig,"datetimeRegex");function Kk(e,t){return!!((t==="v4"||!t)&&Lk.test(e)||(t==="v6"||!t)&&Dk.test(e))}o(Kk,"isValidIP");function Wk(e,t){if(!Nk.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch(r){return!1}}o(Wk,"isValidJWT");function Hk(e,t){return!!((t==="v4"||!t)&&Uk.test(e)||(t==="v6"||!t)&&qk.test(e))}o(Hk,"isValidCidr");var ri=class ri extends pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==z.string){let s=this._getOrReturnCtx(t);return M(s,{code:j.invalid_type,expected:z.string,received:s.parsedType}),te}let n=new Mt,i;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:j.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:j.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let a=t.data.length>s.value,u=t.data.length<s.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?M(i,{code:j.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&M(i,{code:j.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Ck.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"email",code:j.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")yl||(yl=new RegExp(Mk,"u")),yl.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"emoji",code:j.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Ak.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"uuid",code:j.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")jk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"nanoid",code:j.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Tk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cuid",code:j.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")kk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cuid2",code:j.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Fk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"ulid",code:j.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch(a){i=this._getOrReturnCtx(t,i),M(i,{validation:"url",code:j.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"regex",code:j.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),M(i,{code:j.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),M(i,{code:j.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),M(i,{code:j.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ig(s).test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:j.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Bk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:j.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Gk(s).test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:j.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Rk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"duration",code:j.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Kk(t.data,s.version)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"ip",code:j.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Wk(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"jwt",code:j.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Hk(t.data,s.version)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cidr",code:j.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?zk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"base64",code:j.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Vk.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"base64url",code:j.invalid_string,message:s.message}),n.dirty()):xe.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),g({validation:r,code:j.invalid_string},J.errToObj(n)))}_addCheck(t){return new ri(F(g({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(g({kind:"email"},J.errToObj(t)))}url(t){return this._addCheck(g({kind:"url"},J.errToObj(t)))}emoji(t){return this._addCheck(g({kind:"emoji"},J.errToObj(t)))}uuid(t){return this._addCheck(g({kind:"uuid"},J.errToObj(t)))}nanoid(t){return this._addCheck(g({kind:"nanoid"},J.errToObj(t)))}cuid(t){return this._addCheck(g({kind:"cuid"},J.errToObj(t)))}cuid2(t){return this._addCheck(g({kind:"cuid2"},J.errToObj(t)))}ulid(t){return this._addCheck(g({kind:"ulid"},J.errToObj(t)))}base64(t){return this._addCheck(g({kind:"base64"},J.errToObj(t)))}base64url(t){return this._addCheck(g({kind:"base64url"},J.errToObj(t)))}jwt(t){return this._addCheck(g({kind:"jwt"},J.errToObj(t)))}ip(t){return this._addCheck(g({kind:"ip"},J.errToObj(t)))}cidr(t){return this._addCheck(g({kind:"cidr"},J.errToObj(t)))}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(g({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!=null?r:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},J.errToObj(t==null?void 0:t.message)))}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(g({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},J.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(g({kind:"duration"},J.errToObj(t)))}regex(t,r){return this._addCheck(g({kind:"regex",regex:t},J.errToObj(r)))}includes(t,r){return this._addCheck(g({kind:"includes",value:t,position:r==null?void 0:r.position},J.errToObj(r==null?void 0:r.message)))}startsWith(t,r){return this._addCheck(g({kind:"startsWith",value:t},J.errToObj(r)))}endsWith(t,r){return this._addCheck(g({kind:"endsWith",value:t},J.errToObj(r)))}min(t,r){return this._addCheck(g({kind:"min",value:t},J.errToObj(r)))}max(t,r){return this._addCheck(g({kind:"max",value:t},J.errToObj(r)))}length(t,r){return this._addCheck(g({kind:"length",value:t},J.errToObj(r)))}nonempty(t){return this.min(1,J.errToObj(t))}trim(){return new ri(F(g({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new ri(F(g({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new ri(F(g({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(ri,"ZodString");var Ao=ri;Ao.create=e=>{var t;return new Ao(g({checks:[],typeName:oe.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},ce(e)))};function Jk(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}o(Jk,"floatSafeRemainder");var xa=class xa extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==z.number){let s=this._getOrReturnCtx(t);return M(s,{code:j.invalid_type,expected:z.number,received:s.parsedType}),te}let n,i=new Mt;for(let s of this._def.checks)s.kind==="int"?xe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:j.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:j.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:j.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Jk(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),M(n,{code:j.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:j.not_finite,message:s.message}),i.dirty()):xe.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,J.toString(r))}gt(t,r){return this.setLimit("min",t,!1,J.toString(r))}lte(t,r){return this.setLimit("max",t,!0,J.toString(r))}lt(t,r){return this.setLimit("max",t,!1,J.toString(r))}setLimit(t,r,n,i){return new xa(F(g({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:J.toString(i)}]}))}_addCheck(t){return new xa(F(g({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:J.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:J.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:J.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&xe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};o(xa,"ZodNumber");var ni=xa;ni.create=e=>new ni(g({checks:[],typeName:oe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},ce(e)));var Ia=class Ia extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(s){return this._getInvalidInput(t)}if(this._getType(t)!==z.bigint)return this._getInvalidInput(t);let n,i=new Mt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:j.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:j.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),M(n,{code:j.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):xe.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return M(r,{code:j.invalid_type,expected:z.bigint,received:r.parsedType}),te}gte(t,r){return this.setLimit("min",t,!0,J.toString(r))}gt(t,r){return this.setLimit("min",t,!1,J.toString(r))}lte(t,r){return this.setLimit("max",t,!0,J.toString(r))}lt(t,r){return this.setLimit("max",t,!1,J.toString(r))}setLimit(t,r,n,i){return new Ia(F(g({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:J.toString(i)}]}))}_addCheck(t){return new Ia(F(g({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:J.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:J.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(Ia,"ZodBigInt");var oi=Ia;oi.create=e=>{var t;return new oi(g({checks:[],typeName:oe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},ce(e)))};var Il=class Il extends pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==z.boolean){let n=this._getOrReturnCtx(t);return M(n,{code:j.invalid_type,expected:z.boolean,received:n.parsedType}),te}return Ht(t.data)}};o(Il,"ZodBoolean");var ii=Il;ii.create=e=>new ii(g({typeName:oe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},ce(e)));var qc=class qc extends pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==z.date){let s=this._getOrReturnCtx(t);return M(s,{code:j.invalid_type,expected:z.date,received:s.parsedType}),te}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return M(s,{code:j.invalid_date}),te}let n=new Mt,i;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:j.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:j.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):xe.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new qc(F(g({},this._def),{checks:[...this._def.checks,t]}))}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:J.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:J.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};o(qc,"ZodDate");var si=qc;si.create=e=>new si(g({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:oe.ZodDate},ce(e)));var bl=class bl extends pe{_parse(t){if(this._getType(t)!==z.symbol){let n=this._getOrReturnCtx(t);return M(n,{code:j.invalid_type,expected:z.symbol,received:n.parsedType}),te}return Ht(t.data)}};o(bl,"ZodSymbol");var os=bl;os.create=e=>new os(g({typeName:oe.ZodSymbol},ce(e)));var wl=class wl extends pe{_parse(t){if(this._getType(t)!==z.undefined){let n=this._getOrReturnCtx(t);return M(n,{code:j.invalid_type,expected:z.undefined,received:n.parsedType}),te}return Ht(t.data)}};o(wl,"ZodUndefined");var ai=wl;ai.create=e=>new ai(g({typeName:oe.ZodUndefined},ce(e)));var $l=class $l extends pe{_parse(t){if(this._getType(t)!==z.null){let n=this._getOrReturnCtx(t);return M(n,{code:j.invalid_type,expected:z.null,received:n.parsedType}),te}return Ht(t.data)}};o($l,"ZodNull");var ci=$l;ci.create=e=>new ci(g({typeName:oe.ZodNull},ce(e)));var vl=class vl extends pe{constructor(){super(...arguments),this._any=!0}_parse(t){return Ht(t.data)}};o(vl,"ZodAny");var jo=vl;jo.create=e=>new jo(g({typeName:oe.ZodAny},ce(e)));var Ol=class Ol extends pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ht(t.data)}};o(Ol,"ZodUnknown");var Qn=Ol;Qn.create=e=>new Qn(g({typeName:oe.ZodUnknown},ce(e)));var _l=class _l extends pe{_parse(t){let r=this._getOrReturnCtx(t);return M(r,{code:j.invalid_type,expected:z.never,received:r.parsedType}),te}};o(_l,"ZodNever");var on=_l;on.create=e=>new on(g({typeName:oe.ZodNever},ce(e)));var Sl=class Sl extends pe{_parse(t){if(this._getType(t)!==z.undefined){let n=this._getOrReturnCtx(t);return M(n,{code:j.invalid_type,expected:z.void,received:n.parsedType}),te}return Ht(t.data)}};o(Sl,"ZodVoid");var is=Sl;is.create=e=>new is(g({typeName:oe.ZodVoid},ce(e)));var rs=class rs extends pe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==z.array)return M(r,{code:j.invalid_type,expected:z.array,received:r.parsedType}),te;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,u=r.data.length<i.exactLength.value;(a||u)&&(M(r,{code:a?j.too_big:j.too_small,minimum:u?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(M(r,{code:j.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(M(r,{code:j.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,u)=>i.type._parseAsync(new Cr(r,a,r.path,u)))).then(a=>Mt.mergeArray(n,a));let s=[...r.data].map((a,u)=>i.type._parseSync(new Cr(r,a,r.path,u)));return Mt.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new rs(F(g({},this._def),{minLength:{value:t,message:J.toString(r)}}))}max(t,r){return new rs(F(g({},this._def),{maxLength:{value:t,message:J.toString(r)}}))}length(t,r){return new rs(F(g({},this._def),{exactLength:{value:t,message:J.toString(r)}}))}nonempty(t){return this.min(1,t)}};o(rs,"ZodArray");var eo=rs;eo.create=(e,t)=>new eo(g({type:e,minLength:null,maxLength:null,exactLength:null,typeName:oe.ZodArray},ce(t)));function ts(e){if(e instanceof yr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Rr.create(ts(n))}return new yr(F(g({},e._def),{shape:o(()=>t,"shape")}))}else return e instanceof eo?new eo(F(g({},e._def),{type:ts(e.element)})):e instanceof Rr?Rr.create(ts(e.unwrap())):e instanceof _n?_n.create(ts(e.unwrap())):e instanceof On?On.create(e.items.map(t=>ts(t))):e}o(ts,"deepPartialify");var _r=class _r extends pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=xe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==z.object){let d=this._getOrReturnCtx(t);return M(d,{code:j.invalid_type,expected:z.object,received:d.parsedType}),te}let{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof on&&this._def.unknownKeys==="strip"))for(let d in i.data)a.includes(d)||u.push(d);let l=[];for(let d of a){let m=s[d],h=i.data[d];l.push({key:{status:"valid",value:d},value:m._parse(new Cr(i,h,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof on){let d=this._def.unknownKeys;if(d==="passthrough")for(let m of u)l.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(d==="strict")u.length>0&&(M(i,{code:j.unrecognized_keys,keys:u}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let m of u){let h=i.data[m];l.push({key:{status:"valid",value:m},value:d._parse(new Cr(i,h,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let d=[];for(let m of l){let h=await m.key,b=await m.value;d.push({key:h,value:b,alwaysSet:m.alwaysSet})}return d}).then(d=>Mt.mergeObjectSync(n,d)):Mt.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return J.errToObj,new _r(g(F(g({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:o((r,n)=>{var s,a,u,l;let i=(u=(a=(s=this._def).errorMap)==null?void 0:a.call(s,r,n).message)!=null?u:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=J.errToObj(t).message)!=null?l:i}:{message:i}},"errorMap")}:{}))}strip(){return new _r(F(g({},this._def),{unknownKeys:"strip"}))}passthrough(){return new _r(F(g({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new _r(F(g({},this._def),{shape:o(()=>g(g({},this._def.shape()),t),"shape")}))}merge(t){return new _r({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>g(g({},this._def.shape()),t._def.shape()),"shape"),typeName:oe.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new _r(F(g({},this._def),{catchall:t}))}pick(t){let r={};for(let n of xe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new _r(F(g({},this._def),{shape:o(()=>r,"shape")}))}omit(t){let r={};for(let n of xe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new _r(F(g({},this._def),{shape:o(()=>r,"shape")}))}deepPartial(){return ts(this)}partial(t){let r={};for(let n of xe.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new _r(F(g({},this._def),{shape:o(()=>r,"shape")}))}required(t){let r={};for(let n of xe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Rr;)s=s._def.innerType;r[n]=s}return new _r(F(g({},this._def),{shape:o(()=>r,"shape")}))}keyof(){return bg(xe.objectKeys(this.shape))}};o(_r,"ZodObject");var yr=_r;yr.create=(e,t)=>new yr(g({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:on.create(),typeName:oe.ZodObject},ce(t)));yr.strictCreate=(e,t)=>new yr(g({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:on.create(),typeName:oe.ZodObject},ce(t)));yr.lazycreate=(e,t)=>new yr(g({shape:e,unknownKeys:"strip",catchall:on.create(),typeName:oe.ZodObject},ce(t)));var Pl=class Pl extends pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(let u of s)if(u.result.status==="valid")return u.result;for(let u of s)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let a=s.map(u=>new mr(u.ctx.common.issues));return M(r,{code:j.invalid_union,unionErrors:a}),te}if(o(i,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let a=F(g({},r),{common:F(g({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let s,a=[];for(let l of n){let d=F(g({},r),{common:F(g({},r.common),{issues:[]}),parent:null}),m=l._parseSync({data:r.data,path:r.path,parent:d});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let u=a.map(l=>new mr(l));return M(r,{code:j.invalid_union,unionErrors:u}),te}}get options(){return this._def.options}};o(Pl,"ZodUnion");var ui=Pl;ui.create=(e,t)=>new ui(g({options:e,typeName:oe.ZodUnion},ce(t)));var Xn=o(e=>e instanceof li?Xn(e.schema):e instanceof Mr?Xn(e.innerType()):e instanceof pi?[e.value]:e instanceof di?e.options:e instanceof mi?xe.objectValues(e.enum):e instanceof yi?Xn(e._def.innerType):e instanceof ai?[void 0]:e instanceof ci?[null]:e instanceof Rr?[void 0,...Xn(e.unwrap())]:e instanceof _n?[null,...Xn(e.unwrap())]:e instanceof va||e instanceof gi?Xn(e.unwrap()):e instanceof hi?Xn(e._def.innerType):[],"getDiscriminator"),zc=class zc extends pe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.object)return M(r,{code:j.invalid_type,expected:z.object,received:r.parsedType}),te;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let s of r){let a=Xn(s.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let u of a){if(i.has(u))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(u)));i.set(u,s)}}return new zc(g({typeName:oe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i},ce(n)))}};o(zc,"ZodDiscriminatedUnion");var Lc=zc;function hl(e,t){let r=vn(e),n=vn(t);if(e===t)return{valid:!0,data:e};if(r===z.object&&n===z.object){let i=xe.objectKeys(t),s=xe.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a=g(g({},e),t);for(let u of s){let l=hl(e[u],t[u]);if(!l.valid)return{valid:!1};a[u]=l.data}return{valid:!0,data:a}}else if(r===z.array&&n===z.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<e.length;s++){let a=e[s],u=t[s],l=hl(a,u);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return r===z.date&&n===z.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(hl,"mergeValues");var El=class El extends pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=o((s,a)=>{if(Cc(s)||Cc(a))return te;let u=hl(s.value,a.value);return u.valid?((Mc(s)||Mc(a))&&r.dirty(),{status:r.value,value:u.data}):(M(n,{code:j.invalid_intersection_types}),te)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(El,"ZodIntersection");var fi=El;fi.create=(e,t,r)=>new fi(g({left:e,right:t,typeName:oe.ZodIntersection},ce(r)));var Vc=class Vc extends pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.array)return M(n,{code:j.invalid_type,expected:z.array,received:n.parsedType}),te;if(n.data.length<this._def.items.length)return M(n,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),te;!this._def.rest&&n.data.length>this._def.items.length&&(M(n,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((a,u)=>{let l=this._def.items[u]||this._def.rest;return l?l._parse(new Cr(n,a,n.path,u)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>Mt.mergeArray(r,a)):Mt.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new Vc(F(g({},this._def),{rest:t}))}};o(Vc,"ZodTuple");var On=Vc;On.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new On(g({items:e,typeName:oe.ZodTuple,rest:null},ce(t)))};var ba=class ba extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.object)return M(n,{code:j.invalid_type,expected:z.object,received:n.parsedType}),te;let i=[],s=this._def.keyType,a=this._def.valueType;for(let u in n.data)i.push({key:s._parse(new Cr(n,u,n.path,u)),value:a._parse(new Cr(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?Mt.mergeObjectAsync(r,i):Mt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof pe?new ba(g({keyType:t,valueType:r,typeName:oe.ZodRecord},ce(n))):new ba(g({keyType:Ao.create(),valueType:t,typeName:oe.ZodRecord},ce(r)))}};o(ba,"ZodRecord");var Uc=ba,Tl=class Tl extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.map)return M(n,{code:j.invalid_type,expected:z.map,received:n.parsedType}),te;let i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([u,l],d)=>({key:i._parse(new Cr(n,u,n.path,[d,"key"])),value:s._parse(new Cr(n,l,n.path,[d,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let l of a){let d=await l.key,m=await l.value;if(d.status==="aborted"||m.status==="aborted")return te;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),u.set(d.value,m.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let l of a){let d=l.key,m=l.value;if(d.status==="aborted"||m.status==="aborted")return te;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),u.set(d.value,m.value)}return{status:r.value,value:u}}}};o(Tl,"ZodMap");var ss=Tl;ss.create=(e,t,r)=>new ss(g({valueType:t,keyType:e,typeName:oe.ZodMap},ce(r)));var wa=class wa extends pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.set)return M(n,{code:j.invalid_type,expected:z.set,received:n.parsedType}),te;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(M(n,{code:j.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(M(n,{code:j.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function a(l){let d=new Set;for(let m of l){if(m.status==="aborted")return te;m.status==="dirty"&&r.dirty(),d.add(m.value)}return{status:r.value,value:d}}o(a,"finalizeSet");let u=[...n.data.values()].map((l,d)=>s._parse(new Cr(n,l,n.path,d)));return n.common.async?Promise.all(u).then(l=>a(l)):a(u)}min(t,r){return new wa(F(g({},this._def),{minSize:{value:t,message:J.toString(r)}}))}max(t,r){return new wa(F(g({},this._def),{maxSize:{value:t,message:J.toString(r)}}))}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};o(wa,"ZodSet");var as=wa;as.create=(e,t)=>new as(g({valueType:e,minSize:null,maxSize:null,typeName:oe.ZodSet},ce(t)));var ns=class ns extends pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.function)return M(r,{code:j.invalid_type,expected:z.function,received:r.parsedType}),te;function n(u,l){return ga({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Qi(),Yn].filter(d=>!!d),issueData:{code:j.invalid_arguments,argumentsError:l}})}o(n,"makeArgsIssue");function i(u,l){return ga({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Qi(),Yn].filter(d=>!!d),issueData:{code:j.invalid_return_type,returnTypeError:l}})}o(i,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof No){let u=this;return Ht(async function(...l){let d=new mr([]),m=await u._def.args.parseAsync(l,s).catch($=>{throw d.addIssue(n(l,$)),d}),h=await Reflect.apply(a,this,m);return await u._def.returns._def.type.parseAsync(h,s).catch($=>{throw d.addIssue(i(h,$)),d})})}else{let u=this;return Ht(function(...l){let d=u._def.args.safeParse(l,s);if(!d.success)throw new mr([n(l,d.error)]);let m=Reflect.apply(a,this,d.data),h=u._def.returns.safeParse(m,s);if(!h.success)throw new mr([i(m,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ns(F(g({},this._def),{args:On.create(t).rest(Qn.create())}))}returns(t){return new ns(F(g({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ns(g({args:t||On.create([]).rest(Qn.create()),returns:r||Qn.create(),typeName:oe.ZodFunction},ce(n)))}};o(ns,"ZodFunction");var Dc=ns,kl=class kl extends pe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o(kl,"ZodLazy");var li=kl;li.create=(e,t)=>new li(g({getter:e,typeName:oe.ZodLazy},ce(t)));var Fl=class Fl extends pe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return M(r,{received:r.data,code:j.invalid_literal,expected:this._def.value}),te}return{status:"valid",value:t.data}}get value(){return this._def.value}};o(Fl,"ZodLiteral");var pi=Fl;pi.create=(e,t)=>new pi(g({value:e,typeName:oe.ZodLiteral},ce(t)));function bg(e,t){return new di(g({values:e,typeName:oe.ZodEnum},ce(t)))}o(bg,"createZodEnum");var $a=class $a extends pe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return M(r,{expected:xe.joinValues(n),received:r.parsedType,code:j.invalid_type}),te}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return M(r,{received:r.data,code:j.invalid_enum_value,options:n}),te}return Ht(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return $a.create(t,g(g({},this._def),r))}exclude(t,r=this._def){return $a.create(this.options.filter(n=>!t.includes(n)),g(g({},this._def),r))}};o($a,"ZodEnum");var di=$a;di.create=bg;var Al=class Al extends pe{_parse(t){let r=xe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==z.string&&n.parsedType!==z.number){let i=xe.objectValues(r);return M(n,{expected:xe.joinValues(i),received:n.parsedType,code:j.invalid_type}),te}if(this._cache||(this._cache=new Set(xe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=xe.objectValues(r);return M(n,{received:n.data,code:j.invalid_enum_value,options:i}),te}return Ht(t.data)}get enum(){return this._def.values}};o(Al,"ZodNativeEnum");var mi=Al;mi.create=(e,t)=>new mi(g({values:e,typeName:oe.ZodNativeEnum},ce(t)));var jl=class jl extends pe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.promise&&r.common.async===!1)return M(r,{code:j.invalid_type,expected:z.promise,received:r.parsedType}),te;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Ht(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(jl,"ZodPromise");var No=jl;No.create=(e,t)=>new No(g({type:e,typeName:oe.ZodPromise},ce(t)));var Nl=class Nl extends pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o(a=>{M(n,a),a.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let a=i.transform(n.data,s);if(n.common.async)return Promise.resolve(a).then(async u=>{if(r.value==="aborted")return te;let l=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return l.status==="aborted"?te:l.status==="dirty"?ti(l.value):r.value==="dirty"?ti(l.value):l});{if(r.value==="aborted")return te;let u=this._def.schema._parseSync({data:a,path:n.path,parent:n});return u.status==="aborted"?te:u.status==="dirty"?ti(u.value):r.value==="dirty"?ti(u.value):u}}if(i.type==="refinement"){let a=o(u=>{let l=i.refinement(u,s);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u},"executeRefinement");if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?te:(u.status==="dirty"&&r.dirty(),a(u.value),{status:r.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?te:(u.status==="dirty"&&r.dirty(),a(u.value).then(()=>({status:r.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fo(a))return te;let u=i.transform(a.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Fo(a)?Promise.resolve(i.transform(a.value,s)).then(u=>({status:r.value,value:u})):te);xe.assertNever(i)}};o(Nl,"ZodEffects");var Mr=Nl;Mr.create=(e,t,r)=>new Mr(g({schema:e,typeName:oe.ZodEffects,effect:t},ce(r)));Mr.createWithPreprocess=(e,t,r)=>new Mr(g({schema:t,effect:{type:"preprocess",transform:e},typeName:oe.ZodEffects},ce(r)));var Rl=class Rl extends pe{_parse(t){return this._getType(t)===z.undefined?Ht(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(Rl,"ZodOptional");var Rr=Rl;Rr.create=(e,t)=>new Rr(g({innerType:e,typeName:oe.ZodOptional},ce(t)));var Cl=class Cl extends pe{_parse(t){return this._getType(t)===z.null?Ht(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(Cl,"ZodNullable");var _n=Cl;_n.create=(e,t)=>new _n(g({innerType:e,typeName:oe.ZodNullable},ce(t)));var Ml=class Ml extends pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(Ml,"ZodDefault");var yi=Ml;yi.create=(e,t)=>new yi(g({innerType:e,typeName:oe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},ce(t)));var Ll=class Ll extends pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=F(g({},r),{common:F(g({},r.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:g({},n)});return es(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new mr(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new mr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(Ll,"ZodCatch");var hi=Ll;hi.create=(e,t)=>new hi(g({innerType:e,typeName:oe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},ce(t)));var Ul=class Ul extends pe{_parse(t){if(this._getType(t)!==z.nan){let n=this._getOrReturnCtx(t);return M(n,{code:j.invalid_type,expected:z.nan,received:n.parsedType}),te}return{status:"valid",value:t.data}}};o(Ul,"ZodNaN");var cs=Ul;cs.create=e=>new cs(g({typeName:oe.ZodNaN},ce(e)));var Zk=Symbol("zod_brand"),Dl=class Dl extends pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(Dl,"ZodBranded");var va=Dl,Bc=class Bc extends pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?te:s.status==="dirty"?(r.dirty(),ti(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?te:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new Bc({in:t,out:r,typeName:oe.ZodPipeline})}};o(Bc,"ZodPipeline");var Oa=Bc,ql=class ql extends pe{_parse(t){let r=this._def.innerType._parse(t),n=o(i=>(Fo(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return es(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};o(ql,"ZodReadonly");var gi=ql;gi.create=(e,t)=>new gi(g({innerType:e,typeName:oe.ZodReadonly},ce(t)));function hg(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}o(hg,"cleanParams");function wg(e,t={},r){return e?jo.create().superRefine((n,i)=>{var a,u;let s=e(n);if(s instanceof Promise)return s.then(l=>{var d,m;if(!l){let h=hg(t,n),b=(m=(d=h.fatal)!=null?d:r)!=null?m:!0;i.addIssue(F(g({code:"custom"},h),{fatal:b}))}});if(!s){let l=hg(t,n),d=(u=(a=l.fatal)!=null?a:r)!=null?u:!0;i.addIssue(F(g({code:"custom"},l),{fatal:d}))}}):jo.create()}o(wg,"custom");var Yk={object:yr.lazycreate},oe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(oe||(oe={}));var Xk=o((e,t={message:"Input not instance of ".concat(e.name)})=>wg(r=>r instanceof e,t),"instanceOfType"),$g=Ao.create,vg=ni.create,Qk=cs.create,eF=oi.create,Og=ii.create,tF=si.create,rF=os.create,nF=ai.create,oF=ci.create,iF=jo.create,sF=Qn.create,aF=on.create,cF=is.create,uF=eo.create,fF=yr.create,lF=yr.strictCreate,pF=ui.create,dF=Lc.create,mF=fi.create,yF=On.create,hF=Uc.create,gF=ss.create,xF=as.create,IF=Dc.create,bF=li.create,wF=pi.create,$F=di.create,vF=mi.create,OF=No.create,_F=Mr.create,SF=Rr.create,PF=_n.create,EF=Mr.createWithPreprocess,TF=Oa.create,kF=o(()=>$g().optional(),"ostring"),FF=o(()=>vg().optional(),"onumber"),AF=o(()=>Og().optional(),"oboolean"),jF={string:o(e=>Ao.create(F(g({},e),{coerce:!0})),"string"),number:o(e=>ni.create(F(g({},e),{coerce:!0})),"number"),boolean:o(e=>ii.create(F(g({},e),{coerce:!0})),"boolean"),bigint:o(e=>oi.create(F(g({},e),{coerce:!0})),"bigint"),date:o(e=>si.create(F(g({},e),{coerce:!0})),"date")};var NF=te;c();c();c();c();c();c();var CO=ll(sm(),1),MO=ll(NO(),1);c();var OC=o(e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2},"isPotentiallyBadSchema");function Su(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(Su);let t=g({},e);for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let i=Su(n);if(OC(i)){let s=i.allOf.findIndex(u=>u.type==="array"),a=i.allOf.findIndex(u=>u.type==="object");if(s!==-1&&a!==-1){t[r]=F(g({},i),{allOf:[i.allOf[s]]});continue}}t[r]=i}return t}o(Su,"cleanupInvalidArrayAllOf");var RO={$ref:"#/definitions/ParsedMVF",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AnchoredFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},geometryId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text belongs. It will be displayed on top of it."},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","geometryId","rotation","text","visible"],type:"object"},AnchoredImageProperties:{additionalProperties:!1,properties:{anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this image belongs. It will be displayed on top of it."},height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["anchorId","height","path","rotation","width"],type:"object"},AnchoredTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text area belongs. It will be displayed on top of it."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"}},required:["align","anchorId","maxHeight","maxWidth","rotation"],type:"object"},AnnotationCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/AnnotationProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AnnotationId:{pattern:"^a_[A-Za-z0-9_-]{8,}$",type:"string"},AnnotationProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},id:{$ref:"#/definitions/AnnotationId"},symbolId:{type:"string"}},required:["id","symbolId"],type:"object"},Area:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/AreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},AreaCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Area"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AreaId:{pattern:"^ar_[A-Za-z0-9_-]{8,}$",type:"string"},AreaProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this area."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this area.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/AreaId"}},required:["id"],type:"object"},Category:{additionalProperties:!1,properties:{icon:{description:"The category's icon",format:"uri",type:"string"},id:{$ref:"#/definitions/CategoryId"},name:{type:"string"},parent:{$ref:"#/definitions/CategoryId"}},required:["id","name","icon"],type:"object"},CategoryId:{description:"A category ID",pattern:"^cat_[A-Za-z0-9_-]{8,}$",type:"string"},Connection:{additionalProperties:!1,properties:{accessible:{type:"boolean"},details:{additionalProperties:!1,properties:{name:{type:"string"}},type:"object"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},id:{$ref:"#/definitions/ConnectionId"},metadata:{$ref:"#/definitions/Metadata"},nodes:{description:"A list of node IDs corresponding to nodes that are a part of this connection.",items:{$ref:"#/definitions/NodeId"},type:"array"},type:{type:"string"}},required:["id","type","nodes","externalId"],type:"object"},ConnectionId:{pattern:"^c_[A-Za-z0-9_-]{8,}$",type:"string"},Connections:{items:{$ref:"#/definitions/Connection"},type:"array"},Day:{enum:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],type:"string"},DayOrPublicHoliday:{anyOf:[{$ref:"#/definitions/Day"},{const:"PublicHolidays",type:"string"}]},Details:{additionalProperties:!1,description:"Additional information about a given entity.",properties:{description:{type:"string"},images:{items:{$ref:"#/definitions/Image"},type:"array"},links:{items:{$ref:"#/definitions/Hyperlink"},type:"array"},name:{type:"string"}},type:"object"},EnterpriseCategory:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},color:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The category's icon",format:"uri",type:"string"},iconFromDefaultList:{type:["string","null"]},id:{$ref:"#/definitions/EnterpriseCategoryId"},locations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},name:{type:"string"},picture:{description:"The category's picture",format:"uri",type:"string"},sortOrder:{type:"number"}},required:["children","externalId","id","locations","name","sortOrder"],type:"object"},EnterpriseCategoryId:{description:"An ID for an enterprise category",pattern:"^ec_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseCategoryPriority:{additionalProperties:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},description:"The ordered list of category ids that this location belongs to The order here determines the priority of the categories, with the first category being the highest priority for determining application logic like icon and color preference.",propertyNames:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$"},type:"object"},EnterpriseCollection:{additionalProperties:!1,properties:{categories:{items:{$ref:"#/definitions/EnterpriseCategory"},type:"array"},categoryPriorities:{$ref:"#/definitions/EnterpriseCategoryPriority"},enterpriseStyles:{$ref:"#/definitions/EnterpriseStyles"},floorText:{$ref:"#/definitions/EnterpriseFloorText"},layers:{items:{$ref:"#/definitions/EnterpriseLayer"},type:"array"},locationInstances:{items:{$ref:"#/definitions/EnterpriseLocationInstance"},type:"array"},locations:{items:{$ref:"#/definitions/EnterpriseLocation"},type:"array"},textures:{items:{$ref:"#/definitions/EnterpriseTexture"},type:"array"},venue:{$ref:"#/definitions/EnterpriseVenue"}},required:["locations","categories","venue","locationInstances","layers"],type:"object"},EnterpriseFloorText:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorTextFeatureCollection"},{not:{}}]},description:"The text to display on a map, split into feature collection per floor.",type:"object"},EnterpriseLayer:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/EnterpriseLayerId"},name:{type:"string"},spaces:{items:{$ref:"#/definitions/EnterpriseLayerSpace"},minItems:1,type:"array"}},required:["id","name","spaces"],type:"object"},EnterpriseLayerId:{pattern:"^ely_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLayerSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},EnterpriseLocation:{additionalProperties:!1,properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["externalId","id","name","nodes","polygons","sortOrder","spaces","type"],type:"object"},EnterpriseLocationId:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLocationInstance:{additionalProperties:!1,description:"A locationInstance is a particular instace of an Enterprise Location that has some properties different from the parent. Eg, it may have different hours, or a slightly different name.\n\nA LocationInstance:\n- MUST have a parent, referring to an Enterprise Location.\n- MUST have a unique ID, for localization to work.\n- SHOULD have AT LEAST ONE polygon or node to anchor it in space.\n- SHOULD have AT LEAST ONE other Enterprise Location property set.\n\nIt is otherwise a Partial<EnterpriseLocation>\n\nUsage examples:\n- A locationInstance for a location with a different externalId so a customer can identify them individually.\n- A locationInstance with different operationHours, that might indicate different hours for that particular entrace.",properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationInstanceId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},parent:{$ref:"#/definitions/EnterpriseLocationId"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["id","parent"],type:"object"},EnterpriseLocationInstanceId:{description:"An ID for an enterprise location instance",pattern:"^eli_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseStyles:{additionalProperties:{additionalProperties:!1,properties:{edgeOffset:{type:"number"},geometryAnchors:{items:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},type:"array"}},required:["geometryAnchors"],type:"object"},type:"object"},EnterpriseTexture:{additionalProperties:!1,properties:{bounds:{description:"Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat].",items:{type:"number"},maxItems:4,minItems:4,type:"array"},face:{$ref:"#/definitions/EnterpriseTextureFace",description:"Face of the polygon that the texture will be applied to.\n\n'top' means that the texture will be applied to the upward-pointing face of the polygon.\n\n'side' means that the texture will be applied to every side face of the polygon."},geometryAnchors:{description:"Anchors for the texture on the geometry of the polygon.",items:{$ref:"#/definitions/EnterpriseTextureGeometryAnchor"},minItems:1,type:"array"},offset:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls the starting position of the texture on the surface. The u value shifts the texture horizontally and v shifts vertically."},path:{description:"Path to the texture image. Must be either a PNG or JPG format.",type:"string"},repeat:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls how many times the texture repeats across the surface. The u value controls horizontal repetition and v controls vertical repetition."},rotation:{description:"Rotation of the texture in degrees clockwise.\n\nFor top textures this is relative to north. North is 0, east is 90.\n\nFor side textures this is relative to the upward direction, with 0 degrees being upright.",maximum:360,minimum:0,type:"number"},surface:{$ref:"#/definitions/EnterpriseTextureSurface",description:"Surface of the polygon that the texture will be applied to.\n\n'inside' means that the texture will only be applied to the interior surface of the polygon.\n\n'outside' means that the texture will only be applied to the exterior surface of the polygon.\n\n'both' means that the texture will be applied to both interior and exterior surfaces of the polygon."}},required:["repeat","offset","rotation","path","face","surface","bounds","geometryAnchors"],type:"object"},EnterpriseTextureFace:{enum:["top","side"],type:"string"},EnterpriseTextureGeometryAnchor:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},EnterpriseTextureSurface:{enum:["inside","outside","both"],type:"string"},EnterpriseTextureUV:{additionalProperties:!1,properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},EnterpriseVenue:{additionalProperties:!1,properties:{countrycode:{description:"The ISO 3166-1 alpha-2 country code of the venue, if known\n\nEg. `US` or `GB`",type:"string"},coverImage:{description:"The venue's cover image",format:"uri",type:"string"},defaultFloor:{$ref:"#/definitions/FloorId",description:"The venue's default floor"},defaultLanguage:{$ref:"#/definitions/Language"},defaultMap:{$ref:"#/definitions/FloorId",deprecated:"Use `defaultFloor` instead"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The venue's icon",format:"uri",type:"string"},languages:{items:{$ref:"#/definitions/Language"},type:"array"},logo:{description:"The venue's logo",format:"uri",type:"string"},mappedinWebUrl:{description:"The base URL for Mappedin Web for this venue\n\nBetter name?",type:"string"},name:{type:"string"},operationHours:{description:"When this venue is open.",items:{$ref:"#/definitions/OperationHours"},type:"array"},slug:{type:"string"},topLocations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},tzid:{description:"The venue's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",pattern:"^[A-Za-z0-9\\/_-]+$",type:"string"}},required:["defaultLanguage","externalId","languages","name","slug"],type:"object"},EntranceCollection:{$ref:"#/definitions/FeatureCollection%3CLineString%2CEntranceProperties%3E"},EntranceId:{pattern:"^e_[A-Za-z0-9_-]{8,}$",type:"string"},EntranceProperties:{additionalProperties:!1,properties:{details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/EntranceId"},isExterior:{type:"boolean"},metadata:{$ref:"#/definitions/Metadata"},node:{$ref:"#/definitions/NodeId"}},required:["id","externalId"],type:"object"},Facade:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/FacadeId"},spaces:{items:{$ref:"#/definitions/FacadeSpace"},minItems:1,type:"array"}},required:["id","spaces"],type:"object"},FacadeId:{pattern:"^fc_[A-Za-z0-9_-]{8,}$",type:"string"},FacadeSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},"Feature<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"}]},properties:{$ref:"#/definitions/ObstructionProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"},{$ref:"#/definitions/Point"}]},properties:{$ref:"#/definitions/SpaceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/MultiPolygon"},{type:"null"}]},properties:{$ref:"#/definitions/FloorProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<LineString,EntranceProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/EntranceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorImageProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorImageProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorTextProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorTextProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,NodeProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/NodeProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,TextAreaProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/TextAreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/FloorStackFootprintProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"FeatureCollection<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<LineString,EntranceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CLineString%2CEntranceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorImageProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorImageProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorTextProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorTextProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,NodeProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CNodeProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,TextAreaProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CTextAreaProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPolygon%2CFloorStackFootprintProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},FeatureCollectionType:{const:"FeatureCollection",description:"The type field used for a collection of GeoJSON features.",type:"string"},FeatureType:{const:"Feature",description:"The type field used for individual GeoJSON features.",type:"string"},FloatingFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},verticalOffset:{description:"The vertical offset of the text, in meters.",type:"number"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","rotation","text","verticalOffset","visible"],type:"object"},FloatingImageProperties:{additionalProperties:!1,properties:{height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the image, in meters, relative to the ground plane.",minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["height","path","rotation","verticalOffset","width"],type:"object"},FloatingTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the text area, in meters, relative to the ground plane.",minimum:0,type:"number"}},required:["align","maxHeight","maxWidth","rotation","verticalOffset"],type:"object"},FloorCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},FloorId:{description:"The m_ prefix is deprecated, from when floors were previously called maps. Use f_ as the prefix instead.",pattern:"^[mf]_[A-Za-z0-9_-]{8,}$",type:"string"},FloorImageFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorImageProperties%3E",description:"A collection of images to be displayed on a map. They are either attached to a polygon or are floating in space."},FloorImageProperties:{anyOf:[{$ref:"#/definitions/AnchoredImageProperties"},{$ref:"#/definitions/FloatingImageProperties"}]},FloorProperties:{additionalProperties:!1,properties:{elevation:{description:"The elevation of this map relative to other maps in the stack. Must be an integer.",type:"integer"},externalId:{description:"Use of this property as the name of the map is deprecated. Use the name property instead.",type:"string"},id:{$ref:"#/definitions/FloorId"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map, if it exists. Usually one or two characters (eg, 3, F1, L, etc.) For display in very small spaces, like a floor selector dropdown. Might line up with what is shown on elevator buttons in the physical world.",type:"string"},subtitle:{description:'A subtitle for the map, for display in larger spaces, usually beneath the full name. Provides additional context for what is actually on the map, if the name is not clear. For example, if the full name is "Level 1", the subtitle might be "Arrivals and Baggage Claim".\n\nShould be no more than a few words.',type:"string"}},required:["id","externalId","elevation"],type:"object"},FloorStack:{additionalProperties:!1,properties:{defaultFloor:{$ref:"#/definitions/FloorId",description:"The default floor to use when a floor is not specified."},externalId:{type:"string"},floors:{description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},footprint:{$ref:"#/definitions/FeatureCollection%3CPolygon%2CFloorStackFootprintProperties%3E",description:"Provides a footprint for the map stack based on the geometry of the maps it contains. This is useful for rendering a map stack without loading all of its maps."},id:{$ref:"#/definitions/FloorStackId"},maps:{deprecated:"Use `floors` instead.",description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map stack, if it exists. For display in small spaces, like a floor selector dropdown.",type:"string"},type:{description:"The type of MapStack, e.g. Building, Outdoor. Defaults to Building.",enum:["Building","Outdoor"],type:"string"}},required:["id","externalId","name","maps"],type:"object"},FloorStackFootprintProperties:{additionalProperties:{not:{}},type:"object"},FloorStackId:{description:"The mg_ prefix is deprecated, from when floor stacks were previously called map groups. Use fs_ as the prefix instead.",pattern:"^fs_[A-Za-z0-9_-]{8,}$",type:"string"},FloorStacks:{items:{$ref:"#/definitions/FloorStack"},type:"array"},FloorTextFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorTextProperties%3E",description:"A collection of text to be displayed on a map. They are either attached to a space or are floating."},FloorTextProperties:{anyOf:[{$ref:"#/definitions/AnchoredFloorTextProperties"},{$ref:"#/definitions/FloatingFloorTextProperties"}]},Hyperlink:{additionalProperties:!1,properties:{displayName:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Image:{additionalProperties:!1,properties:{altText:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Language:{additionalProperties:!1,properties:{code:{type:"string"},name:{type:"string"}},required:["name","code"],type:"object"},Latitude:{description:"A WGS 84-compatible latitude coordinate value.",maximum:90,minimum:-90,type:"number"},LineString:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON LineString geometry.",properties:{coordinates:{items:{$ref:"#/definitions/Position"},minItems:2,type:"array"},type:{const:"LineString",type:"string"}},required:["coordinates","type"],type:"object"},LineStringStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},lineStrings:{description:"The line strings which this style applies to.",items:{anyOf:[{$ref:"#/definitions/EntranceId"},{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},opacity:{maximum:1,minimum:0,type:"number"},width:{description:"The thickness of the line when rendered, in meters, measured from the center to the edge.",exclusiveMinimum:0,type:"number"}},required:["altitude","color","height","lineStrings","opacity","width"],type:"object"},LocalPosition:{description:"A position for a local coordinate system, measured in metres.",items:{type:"number"},maxItems:2,minItems:2,type:"array"},Location:{additionalProperties:!1,properties:{annotations:{items:{$ref:"#/definitions/LocationAnnotationMapping"},type:"array"},areas:{items:{$ref:"#/definitions/LocationAreaMapping"},type:"array"},categories:{items:{$ref:"#/definitions/CategoryId"},type:"array"},connections:{items:{$ref:"#/definitions/ConnectionId"},type:"array"},description:{type:"string"},entrances:{items:{$ref:"#/definitions/LocationEntranceMapping"},type:"array"},externalId:{type:"string"},icon:{description:"The location's icon, one of picture/category/logo",format:"uri",type:"string"},id:{$ref:"#/definitions/LocationId"},links:{description:"Web links for the location",items:{$ref:"#/definitions/LocationLink"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},obstructions:{items:{$ref:"#/definitions/LocationObstructionMapping"},type:"array"},openingHoursSpecification:{description:"The location's opening hours",items:{$ref:"#/definitions/OpeningHoursSpecification"},type:"array"},phone:{type:"string"},pictures:{description:"The location's pictures",items:{$ref:"#/definitions/LocationPicture"},type:"array"},social:{description:"The location's social media links.",items:{$ref:"#/definitions/LocationSocial"},type:"array"},spaces:{items:{$ref:"#/definitions/LocationSpaceMapping"},type:"array"},website:{$ref:"#/definitions/LocationLink",description:"The location's website"}},required:["id","name","categories","spaces","obstructions","entrances","connections","annotations","areas","social","pictures","links","openingHoursSpecification"],type:"object"},LocationAnnotationMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AnnotationId"}},required:["floor","id"],type:"object"},LocationAreaMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AreaId"}},required:["floor","id"],type:"object"},LocationEntranceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/EntranceId"}},required:["floor","id"],type:"object"},LocationId:{description:"An ID for a location",pattern:"^loc_[A-Za-z0-9_-]{8,}$",type:"string"},LocationLink:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},LocationObstructionMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/ObstructionId"}},required:["floor","id"],type:"object"},LocationPicture:{additionalProperties:!1,description:"The location's pictures Single-field object, because it's plausible we might add captions or comments in the future",properties:{url:{format:"uri",type:"string"}},type:"object"},LocationSocial:{additionalProperties:!1,properties:{name:{description:"The name of the social media platform.",type:"string"},url:{description:"The URL of the social media profile",format:"uri",type:"string"}},required:["name","url"],type:"object"},LocationSpaceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},LocationState:{additionalProperties:!1,description:"The state of a location. Start and end dates are optional.",properties:{end:{description:"The start date of the state",format:"date",type:"string"},start:{description:"The start date of the state",format:"date",type:"string"},type:{description:"The type of the location state. Technically not limited, but should be one of the following:\n- closed-temporarily\n- new\n- pop-up\n- coming-soon\n- relocated",type:"string"}},required:["type"],type:"object"},Longitude:{description:"A WGS 84-compatible longitude coordinate value.",maximum:180,minimum:-180,type:"number"},ManifestCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/ManifestFeature"},maxItems:1,minItems:1,type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},ManifestFeature:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/ManifestProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},ManifestFile:{additionalProperties:!1,properties:{name:{type:"string"},type:{const:"file",type:"string"}},required:["type","name"],type:"object"},ManifestFolder:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/ManifestFile"},minItems:1,type:"array"},name:{type:"string"},type:{const:"folder",type:"string"}},required:["type","name","children"],type:"object"},ManifestProperties:{additionalProperties:!1,properties:{folder_struct:{items:{anyOf:[{$ref:"#/definitions/ManifestFolder"},{$ref:"#/definitions/ManifestFile"}]},type:"array"},language:{description:"The RFC 5646 language tag of the MVF. https://datatracker.ietf.org/doc/html/rfc5646",examples:["en-US"],type:"string"},map:{description:"The identifier of the map that this MVF is for.",type:"string"},name:{type:"string"},naturalBearing:{description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"',maximum:360,minimum:0,type:"number"},org_id:{type:"string"},time:{description:"An ISO 8601 date-time string, including timezone offset.",format:"date-time",type:"string"},tzid:{description:"The map's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",examples:["America/New_York"],pattern:"^[A-Za-z0-9_-]+\\/[A-Za-z0-9_-]+$",type:"string"},version:{const:"2.0.0",type:"string"}},required:["name","folder_struct","version","time"],type:"object"},Maps:{deprecated:"This is only present on `map.geojson` which is deprecated. Use\nthe collection on `floor.geojson` instead.",items:{$ref:"#/definitions/FloorProperties"},type:"array"},Material:{additionalProperties:!1,description:"The color and/or texture that should be applied to an instance of a Shape.\n\nIf both a color and a texture are provided, the color will be applied to the texture via a multiply operation. If neither are provided, the shape will be white.",properties:{color:{description:"The color of this mateial as a hex code.",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},texture:{$ref:"#/definitions/Texture"}},type:"object"},Metadata:{additionalProperties:{},description:"Can be any extra metadata that is not part of the main MVF spec. Presence of any key or value is not guaranteed. Values are expected to be JSON-serializable.",type:"object"},ModelInstance:{additionalProperties:!1,description:"An instance of a 3D model.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},path:{description:"The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ.",minLength:1,type:"string"},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","path","position","rotation","scale"],type:"object"},ModelInstanceCollection:{additionalProperties:{$ref:"#/definitions/ModelInstance"},description:"A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},MultiPolygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry.",properties:{coordinates:{items:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:"array"},type:{const:"MultiPolygon",type:"string"}},required:["coordinates","type"],type:"object"},NodeCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CNodeProperties%3E"},NodeId:{pattern:"^n_[A-Za-z0-9_-]{8,}$",type:"string"},NodeProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},floor:{$ref:"#/definitions/FloorId",description:"The ID of the floor this node is found on."},id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId",deprecated:"use `floor` instead.",description:"The ID of the floor this node is found on."},neighbors:{description:"A list of nodes that can be navigated to from this node.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},weight:{description:"The cost of navigating to this node.",minimum:0,type:"number"}},required:["id","weight"],type:"object"},type:"array"},preventSmoothing:{description:"Flag that may optionally indicate that a node is part of a custom path network rather than auto generated and should not be removed during smoothing/simplifcation.",type:"boolean"},space:{description:"The IDs of any spaces this node may be contained within.",items:{$ref:"#/definitions/SpaceId"},type:"array"}},required:["id","externalId","map","space","neighbors"],type:"object"},ObstructionCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},ObstructionId:{pattern:"^o_[A-Za-z0-9_-]{8,}$",type:"string"},ObstructionProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this obstruction, if it is a polygon. This is undefined for line strings as this can be trivially derived."},details:{$ref:"#/definitions/Details"},entrances:{description:"A list of entrance IDs corresponding to entrances that can be used to navigate through this obstruction.",items:{$ref:"#/definitions/EntranceId"},type:"array"},externalId:{type:"string"},footprintComponent:{description:"Indicates whether this obstruction is considered part of the footprint of the building it is a part of. For example, an exterior wall would be considered part of the building footprint.",type:"boolean"},id:{$ref:"#/definitions/ObstructionId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"}},required:["id","externalId","entrances"],type:"object"},OpeningHoursSpecification:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.\n\nBehavioral notes:\n- if the \"opens\" property is not present, the location is closed, and the closes property is ignored (Schema.org style)\n- if opens/closes are both set to 00:00, the location is closed (Google style)\n- If special hours do not specifiy certain weekdays being open, those weekdays are closed.\n- Not specifying dayOfWeek is equivalent to specifying every day of the week.\n- we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs that include it.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of opening hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the opening hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the opening hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the opening hours start"},validFrom:{description:"The date the opening hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the opening hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},OperationHours:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of operation hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the operation hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the operation hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the operation hours start"},validFrom:{description:"The date the operation hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the operation hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},ParsedMVF:{additionalProperties:!1,properties:{annotation:{additionalProperties:{anyOf:[{$ref:"#/definitions/AnnotationCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},area:{additionalProperties:{anyOf:[{$ref:"#/definitions/AreaCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"category.json":{items:{$ref:"#/definitions/Category"},type:"array"},"connection.json":{$ref:"#/definitions/Connections"},enterprise:{$ref:"#/definitions/EnterpriseCollection"},entrance:{additionalProperties:{anyOf:[{$ref:"#/definitions/EntranceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},facade:{additionalProperties:{anyOf:[{$ref:"#/definitions/Facade"},{not:{}}]},propertyNames:{pattern:"^fs_[A-Za-z0-9_-]{8,}$"},type:"object"},"floor.geojson":{$ref:"#/definitions/FloorCollection"},floorImages:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorImageFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"floorstack.json":{$ref:"#/definitions/FloorStacks"},"location.json":{items:{$ref:"#/definitions/Location"},type:"array"},"manifest.geojson":{$ref:"#/definitions/ManifestCollection"},"map.geojson":{$ref:"#/definitions/Maps",deprecated:"Use `floor.geojson` instead."},"mapstack.geojson":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},"mapstack.json":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},modelInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ModelInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"node.geojson":{$ref:"#/definitions/NodeCollection"},obstruction:{additionalProperties:{anyOf:[{$ref:"#/definitions/ObstructionCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},shapeInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ShapeInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"shapes.json":{$ref:"#/definitions/ShapeCollection"},space:{additionalProperties:{anyOf:[{$ref:"#/definitions/SpaceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"styles.json":{$ref:"#/definitions/StyleCollection"},textAreas:{additionalProperties:{anyOf:[{$ref:"#/definitions/TextAreaFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"tileset.json":{$ref:"#/definitions/TilesetCollection"},window:{additionalProperties:{anyOf:[{$ref:"#/definitions/WindowCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"}},required:["manifest.geojson","mapstack.geojson","map.geojson","space","obstruction","connection.json","node.geojson","entrance"],type:"object"},Point:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Point geometry.",properties:{coordinates:{$ref:"#/definitions/Position"},type:{const:"Point",type:"string"}},required:["coordinates","type"],type:"object"},PointStyle:{additionalProperties:!1,properties:{points:{description:"The points which this style applies to.",items:{$ref:"#/definitions/SpaceId"},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the point.",type:"boolean"}},required:["points"],type:"object"},Polygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Polygon geometry.",properties:{coordinates:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:{const:"Polygon",type:"string"}},required:["coordinates","type"],type:"object"},PolygonStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},opacity:{maximum:1,minimum:0,type:"number"},polygons:{description:"The polygons which this style applies to.",items:{anyOf:[{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the polygon.",type:"boolean"}},required:["altitude","color","height","opacity","polygons"],type:"object"},Position:{description:"A valid WGS 84 position consisting of a longitude coodinate, followed by a latitude coordinate.",items:[{$ref:"#/definitions/Longitude"},{$ref:"#/definitions/Latitude"}],maxItems:2,minItems:2,type:"array"},Ring:{description:"A simple shape for part of a complex polygon",items:{$ref:"#/definitions/LocalPosition"},minItems:3,type:"array"},Shape:{description:"A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance.",items:{$ref:"#/definitions/ShapeComponent"},minItems:1,type:"array"},ShapeCollection:{additionalProperties:{$ref:"#/definitions/Shape"},description:"A group of Shapes, without any information as to how they will be placed in a scene.",propertyNames:{pattern:"^sh_[A-Za-z0-9_-]{8,}$"},type:"object"},ShapeComponent:{additionalProperties:!1,description:"A single extruded 2D polygon.",properties:{altitude:{description:"In metres.",type:"number"},geometry:{description:"Can contain holes, like GeoJSON.",items:{$ref:"#/definitions/Ring"},minItems:1,type:"array"},height:{description:"In metres.",exclusiveMinimum:0,type:"number"}},required:["geometry","altitude","height"],type:"object"},ShapeId:{pattern:"^sh_[A-Za-z0-9_-]{8,}$",type:"string"},ShapeInstance:{additionalProperties:!1,description:"An instance of a Shape.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},id:{$ref:"#/definitions/ShapeId",description:"The identifier of the Shape to be placed."},material:{$ref:"#/definitions/Material",description:"The color and/or texture to apply to this shape instance."},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","id","material","position","rotation","scale"],type:"object"},ShapeInstanceCollection:{additionalProperties:{$ref:"#/definitions/ShapeInstance"},description:"A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},SiblingGroup:{additionalProperties:!1,properties:{label:{type:"string"},siblings:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"}},required:["label","siblings"],type:"object"},SpaceCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},SpaceId:{pattern:"^s_[A-Za-z0-9_-]{8,}$",type:"string"},SpaceProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this space, if it is a polygon. This is undefined for line string and point spaces as these can be trivially derived."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this space.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/SpaceId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"},tags:{description:"A list of tags that may apply to categorize the space, e.g. Void",items:{type:"string"},type:"array"}},required:["id","externalId","destinationNodes"],type:"object"},StyleCollection:{additionalProperties:{anyOf:[{$ref:"#/definitions/PolygonStyle"},{$ref:"#/definitions/LineStringStyle"},{$ref:"#/definitions/PointStyle"},{not:{}}]},description:"A map of layer styles, where keys represent the group IDs of each style.",type:"object"},TextAreaAlignment:{enum:["near","center"],type:"string"},TextAreaFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CTextAreaProperties%3E",description:"A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space."},TextAreaProperties:{anyOf:[{$ref:"#/definitions/AnchoredTextAreaProperties"},{$ref:"#/definitions/FloatingTextAreaProperties"}]},Texture:{additionalProperties:!1,description:"A reference to an image texture and how it should be applied to a Component.",properties:{path:{description:"The path to this asset, relative to the MVF's images folder.",minLength:1,type:"string"},repeat:{$ref:"#/definitions/TextureRepeat"}},required:["path"],type:"object"},TextureRepeat:{additionalProperties:!1,description:"How a texture should be placed on a Component.",properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},TilesetCollection:{additionalProperties:!1,description:"Collection of tileset styles",properties:{default:{$ref:"#/definitions/TilesetStyle",description:"Default tileset style that should be used"},others:{description:"Additional tileset styles that can be used",items:{$ref:"#/definitions/TilesetStyle"},type:"array"}},required:["default"],type:"object"},TilesetStyle:{additionalProperties:!1,description:"A tileset style definition",properties:{key:{description:"Unique identifier for this tileset style",minLength:1,type:"string"},name:{description:"Display name for this tileset style",minLength:1,type:"string"},url:{description:"URL to the tileset style definition. This should be a JSON file matching the MapLibre style specification.",format:"uri",type:"string"}},required:["key","name","url"],type:"object"},Time:{description:"A time in the format of HH:MM:SS",pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",type:"string"},Vector3:{description:"A three-number tuple.",items:{type:"number"},maxItems:3,minItems:3,type:"array"},WindowCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/WindowProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},WindowId:{pattern:"^w_[A-Za-z0-9_-]{8,}$",type:"string"},WindowProperties:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/WindowId"}},required:["id"],type:"object"}}};var U6=MO.default.default(new CO.default.default).compile(Su(RO));c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();c();var Oe={};To(Oe,{HasPropertyKey:()=>SC,IsArray:()=>Xt,IsAsyncIterator:()=>dm,IsBigInt:()=>ec,IsBoolean:()=>Vo,IsDate:()=>Ei,IsFunction:()=>mm,IsIterator:()=>ym,IsNull:()=>hm,IsNumber:()=>ln,IsObject:()=>Xe,IsRegExp:()=>tc,IsString:()=>ot,IsSymbol:()=>gm,IsUint8Array:()=>so,IsUndefined:()=>yt});c();function SC(e,t){return t in e}o(SC,"HasPropertyKey");function dm(e){return Xe(e)&&!Xt(e)&&!so(e)&&Symbol.asyncIterator in e}o(dm,"IsAsyncIterator");function Xt(e){return Array.isArray(e)}o(Xt,"IsArray");function ec(e){return typeof e=="bigint"}o(ec,"IsBigInt");function Vo(e){return typeof e=="boolean"}o(Vo,"IsBoolean");function Ei(e){return e instanceof globalThis.Date}o(Ei,"IsDate");function mm(e){return typeof e=="function"}o(mm,"IsFunction");function ym(e){return Xe(e)&&!Xt(e)&&!so(e)&&Symbol.iterator in e}o(ym,"IsIterator");function hm(e){return e===null}o(hm,"IsNull");function ln(e){return typeof e=="number"}o(ln,"IsNumber");function Xe(e){return typeof e=="object"&&e!==null}o(Xe,"IsObject");function tc(e){return e instanceof globalThis.RegExp}o(tc,"IsRegExp");function ot(e){return typeof e=="string"}o(ot,"IsString");function gm(e){return typeof e=="symbol"}o(gm,"IsSymbol");function so(e){return e instanceof globalThis.Uint8Array}o(so,"IsUint8Array");function yt(e){return e===void 0}o(yt,"IsUndefined");function PC(e){return e.map(t=>Pu(t))}o(PC,"ArrayType");function EC(e){return new Date(e.getTime())}o(EC,"DateType");function TC(e){return new Uint8Array(e)}o(TC,"Uint8ArrayType");function kC(e){return new RegExp(e.source,e.flags)}o(kC,"RegExpType");function FC(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Pu(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Pu(e[r]);return t}o(FC,"ObjectType");function Pu(e){return Xt(e)?PC(e):Ei(e)?EC(e):so(e)?TC(e):tc(e)?kC(e):Xe(e)?FC(e):e}o(Pu,"Visit");function lt(e){return Pu(e)}o(lt,"Clone");function LO(e){return e.map(t=>rc(t))}o(LO,"CloneRest");function rc(e,t){return t===void 0?lt(e):lt(g(g({},t),e))}o(rc,"CloneType");c();c();c();function Eu(e){return ae(e)&&Symbol.asyncIterator in e}o(Eu,"IsAsyncIterator");function Tu(e){return ae(e)&&Symbol.iterator in e}o(Tu,"IsIterator");function xm(e){return ae(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}o(xm,"IsStandardObject");function ku(e){return e instanceof Promise}o(ku,"IsPromise");function ur(e){return e instanceof Date&&Number.isFinite(e.getTime())}o(ur,"IsDate");function UO(e){return e instanceof globalThis.Map}o(UO,"IsMap");function DO(e){return e instanceof globalThis.Set}o(DO,"IsSet");function zr(e){return ArrayBuffer.isView(e)}o(zr,"IsTypedArray");function Ps(e){return e instanceof globalThis.Uint8Array}o(Ps,"IsUint8Array");function ne(e,t){return t in e}o(ne,"HasPropertyKey");function ae(e){return e!==null&&typeof e=="object"}o(ae,"IsObject");function se(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}o(se,"IsArray");function ht(e){return e===void 0}o(ht,"IsUndefined");function ao(e){return e===null}o(ao,"IsNull");function Fn(e){return typeof e=="boolean"}o(Fn,"IsBoolean");function X(e){return typeof e=="number"}o(X,"IsNumber");function Fu(e){return Number.isInteger(e)}o(Fu,"IsInteger");function Dt(e){return typeof e=="bigint"}o(Dt,"IsBigInt");function _e(e){return typeof e=="string"}o(_e,"IsString");function Bo(e){return typeof e=="function"}o(Bo,"IsFunction");function co(e){return typeof e=="symbol"}o(co,"IsSymbol");function qt(e){return Dt(e)||Fn(e)||ao(e)||X(e)||_e(e)||co(e)||ht(e)}o(qt,"IsValueType");var Ge;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(a,u){return e.ExactOptionalPropertyTypes?u in a:a[u]!==void 0}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(a){let u=ae(a);return e.AllowArrayObject?u:u&&!se(a)}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(a){return r(a)&&!(a instanceof Date)&&!(a instanceof Uint8Array)}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(a){return e.AllowNaN?X(a):Number.isFinite(a)}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(a){let u=ht(a);return e.AllowNullVoid?u||a===null:u}o(s,"IsVoidLike"),e.IsVoidLike=s})(Ge||(Ge={}));c();function AC(e){return globalThis.Object.freeze(e).map(t=>nc(t))}o(AC,"ImmutableArray");function jC(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=nc(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=nc(e[r]);return globalThis.Object.freeze(t)}o(jC,"ImmutableObject");function nc(e){return Xt(e)?AC(e):Ei(e)?e:so(e)?e:tc(e)?e:Xe(e)?jC(e):e}o(nc,"Immutable");function T(e,t){let r=t!==void 0?g(g({},t),e):e;switch(Ge.InstanceMode){case"freeze":return nc(r);case"clone":return lt(r);default:return r}}o(T,"CreateType");c();var Im=class Im extends Error{constructor(t){super(t)}};o(Im,"TypeBoxError");var re=Im;c();c();c();var pt=Symbol.for("TypeBox.Transform"),uo=Symbol.for("TypeBox.Readonly"),fr=Symbol.for("TypeBox.Optional"),Vr=Symbol.for("TypeBox.Hint"),v=Symbol.for("TypeBox.Kind");function qO(e){return Xe(e)&&e[uo]==="Readonly"}o(qO,"IsReadonly");function An(e){return Xe(e)&&e[fr]==="Optional"}o(An,"IsOptional");function bm(e){return Fe(e,"Any")}o(bm,"IsAny");function fo(e){return Fe(e,"Array")}o(fo,"IsArray");function oc(e){return Fe(e,"AsyncIterator")}o(oc,"IsAsyncIterator");function wm(e){return Fe(e,"BigInt")}o(wm,"IsBigInt");function $m(e){return Fe(e,"Boolean")}o($m,"IsBoolean");function ic(e){return Fe(e,"Constructor")}o(ic,"IsConstructor");function NC(e){return Fe(e,"Date")}o(NC,"IsDate");function sc(e){return Fe(e,"Function")}o(sc,"IsFunction");function Ti(e){return Fe(e,"Integer")}o(Ti,"IsInteger");function $t(e){return Fe(e,"Intersect")}o($t,"IsIntersect");function ac(e){return Fe(e,"Iterator")}o(ac,"IsIterator");function Fe(e,t){return Xe(e)&&v in e&&e[v]===t}o(Fe,"IsKindOf");function lo(e){return Fe(e,"Literal")}o(lo,"IsLiteral");function Sr(e){return Fe(e,"MappedKey")}o(Sr,"IsMappedKey");function dt(e){return Fe(e,"MappedResult")}o(dt,"IsMappedResult");function Go(e){return Fe(e,"Never")}o(Go,"IsNever");function RC(e){return Fe(e,"Not")}o(RC,"IsNot");function CC(e){return Fe(e,"Null")}o(CC,"IsNull");function ki(e){return Fe(e,"Number")}o(ki,"IsNumber");function Et(e){return Fe(e,"Object")}o(Et,"IsObject");function Fi(e){return Fe(e,"Promise")}o(Fi,"IsPromise");function vm(e){return Fe(e,"Record")}o(vm,"IsRecord");function Om(e){return Fe(e,"Ref")}o(Om,"IsRef");function _m(e){return Fe(e,"RegExp")}o(_m,"IsRegExp");function cc(e){return Fe(e,"String")}o(cc,"IsString");function MC(e){return Fe(e,"Symbol")}o(MC,"IsSymbol");function Pr(e){return Fe(e,"TemplateLiteral")}o(Pr,"IsTemplateLiteral");function LC(e){return Fe(e,"This")}o(LC,"IsThis");function Es(e){return Xe(e)&&pt in e}o(Es,"IsTransform");function pn(e){return Fe(e,"Tuple")}o(pn,"IsTuple");function UC(e){return Fe(e,"Undefined")}o(UC,"IsUndefined");function Ue(e){return Fe(e,"Union")}o(Ue,"IsUnion");function DC(e){return Fe(e,"Uint8Array")}o(DC,"IsUint8Array");function qC(e){return Fe(e,"Unknown")}o(qC,"IsUnknown");function zC(e){return Fe(e,"Unsafe")}o(zC,"IsUnsafe");function VC(e){return Fe(e,"Void")}o(VC,"IsVoid");function Ko(e){return Xe(e)&&v in e&&ot(e[v])}o(Ko,"IsKind");function dn(e){return bm(e)||fo(e)||$m(e)||wm(e)||oc(e)||ic(e)||NC(e)||sc(e)||Ti(e)||$t(e)||ac(e)||lo(e)||Sr(e)||dt(e)||Go(e)||RC(e)||CC(e)||ki(e)||Et(e)||Fi(e)||vm(e)||Om(e)||_m(e)||cc(e)||MC(e)||Pr(e)||LC(e)||pn(e)||UC(e)||Ue(e)||DC(e)||qC(e)||zC(e)||VC(e)||Ko(e)}o(dn,"IsSchema");var x={};To(x,{IsAny:()=>GO,IsArray:()=>KO,IsAsyncIterator:()=>WO,IsBigInt:()=>HO,IsBoolean:()=>JO,IsConstructor:()=>ZO,IsDate:()=>YO,IsFunction:()=>XO,IsInteger:()=>QO,IsIntersect:()=>e_,IsIterator:()=>t_,IsKind:()=>__,IsKindOf:()=>Pe,IsLiteral:()=>fc,IsLiteralBoolean:()=>JC,IsLiteralNumber:()=>n_,IsLiteralString:()=>r_,IsLiteralValue:()=>o_,IsMappedKey:()=>i_,IsMappedResult:()=>s_,IsNever:()=>a_,IsNot:()=>c_,IsNull:()=>u_,IsNumber:()=>f_,IsObject:()=>l_,IsOptional:()=>HC,IsPromise:()=>p_,IsProperties:()=>Tm,IsReadonly:()=>WC,IsRecord:()=>d_,IsRecursive:()=>ZC,IsRef:()=>m_,IsRegExp:()=>y_,IsSchema:()=>Se,IsString:()=>h_,IsSymbol:()=>g_,IsTemplateLiteral:()=>x_,IsThis:()=>I_,IsTransform:()=>it,IsTuple:()=>b_,IsUint8Array:()=>w_,IsUndefined:()=>Ts,IsUnion:()=>km,IsUnionLiteral:()=>YC,IsUnknown:()=>$_,IsUnsafe:()=>v_,IsVoid:()=>O_,TypeGuardUnknownTypeError:()=>Sm});c();var Fm=class Fm extends re{};o(Fm,"TypeGuardUnknownTypeError");var Sm=Fm,BC=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function zO(e){try{return new RegExp(e),!0}catch(t){return!1}}o(zO,"IsPattern");function Pm(e){if(!ot(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}o(Pm,"IsControlCharacterFree");function VO(e){return Em(e)||Se(e)}o(VO,"IsAdditionalProperties");function uc(e){return yt(e)||ec(e)}o(uc,"IsOptionalBigInt");function nt(e){return yt(e)||ln(e)}o(nt,"IsOptionalNumber");function Em(e){return yt(e)||Vo(e)}o(Em,"IsOptionalBoolean");function We(e){return yt(e)||ot(e)}o(We,"IsOptionalString");function GC(e){return yt(e)||ot(e)&&Pm(e)&&zO(e)}o(GC,"IsOptionalPattern");function KC(e){return yt(e)||ot(e)&&Pm(e)}o(KC,"IsOptionalFormat");function BO(e){return yt(e)||Se(e)}o(BO,"IsOptionalSchema");function WC(e){return Xe(e)&&e[uo]==="Readonly"}o(WC,"IsReadonly");function HC(e){return Xe(e)&&e[fr]==="Optional"}o(HC,"IsOptional");function GO(e){return Pe(e,"Any")&&We(e.$id)}o(GO,"IsAny");function KO(e){return Pe(e,"Array")&&e.type==="array"&&We(e.$id)&&Se(e.items)&&nt(e.minItems)&&nt(e.maxItems)&&Em(e.uniqueItems)&&BO(e.contains)&&nt(e.minContains)&&nt(e.maxContains)}o(KO,"IsArray");function WO(e){return Pe(e,"AsyncIterator")&&e.type==="AsyncIterator"&&We(e.$id)&&Se(e.items)}o(WO,"IsAsyncIterator");function HO(e){return Pe(e,"BigInt")&&e.type==="bigint"&&We(e.$id)&&uc(e.exclusiveMaximum)&&uc(e.exclusiveMinimum)&&uc(e.maximum)&&uc(e.minimum)&&uc(e.multipleOf)}o(HO,"IsBigInt");function JO(e){return Pe(e,"Boolean")&&e.type==="boolean"&&We(e.$id)}o(JO,"IsBoolean");function ZO(e){return Pe(e,"Constructor")&&e.type==="Constructor"&&We(e.$id)&&Xt(e.parameters)&&e.parameters.every(t=>Se(t))&&Se(e.returns)}o(ZO,"IsConstructor");function YO(e){return Pe(e,"Date")&&e.type==="Date"&&We(e.$id)&&nt(e.exclusiveMaximumTimestamp)&&nt(e.exclusiveMinimumTimestamp)&&nt(e.maximumTimestamp)&&nt(e.minimumTimestamp)&&nt(e.multipleOfTimestamp)}o(YO,"IsDate");function XO(e){return Pe(e,"Function")&&e.type==="Function"&&We(e.$id)&&Xt(e.parameters)&&e.parameters.every(t=>Se(t))&&Se(e.returns)}o(XO,"IsFunction");function QO(e){return Pe(e,"Integer")&&e.type==="integer"&&We(e.$id)&&nt(e.exclusiveMaximum)&&nt(e.exclusiveMinimum)&&nt(e.maximum)&&nt(e.minimum)&&nt(e.multipleOf)}o(QO,"IsInteger");function Tm(e){return Xe(e)&&Object.entries(e).every(([t,r])=>Pm(t)&&Se(r))}o(Tm,"IsProperties");function e_(e){return Pe(e,"Intersect")&&!(ot(e.type)&&e.type!=="object")&&Xt(e.allOf)&&e.allOf.every(t=>Se(t)&&!it(t))&&We(e.type)&&(Em(e.unevaluatedProperties)||BO(e.unevaluatedProperties))&&We(e.$id)}o(e_,"IsIntersect");function t_(e){return Pe(e,"Iterator")&&e.type==="Iterator"&&We(e.$id)&&Se(e.items)}o(t_,"IsIterator");function Pe(e,t){return Xe(e)&&v in e&&e[v]===t}o(Pe,"IsKindOf");function r_(e){return fc(e)&&ot(e.const)}o(r_,"IsLiteralString");function n_(e){return fc(e)&&ln(e.const)}o(n_,"IsLiteralNumber");function JC(e){return fc(e)&&Vo(e.const)}o(JC,"IsLiteralBoolean");function fc(e){return Pe(e,"Literal")&&We(e.$id)&&o_(e.const)}o(fc,"IsLiteral");function o_(e){return Vo(e)||ln(e)||ot(e)}o(o_,"IsLiteralValue");function i_(e){return Pe(e,"MappedKey")&&Xt(e.keys)&&e.keys.every(t=>ln(t)||ot(t))}o(i_,"IsMappedKey");function s_(e){return Pe(e,"MappedResult")&&Tm(e.properties)}o(s_,"IsMappedResult");function a_(e){return Pe(e,"Never")&&Xe(e.not)&&Object.getOwnPropertyNames(e.not).length===0}o(a_,"IsNever");function c_(e){return Pe(e,"Not")&&Se(e.not)}o(c_,"IsNot");function u_(e){return Pe(e,"Null")&&e.type==="null"&&We(e.$id)}o(u_,"IsNull");function f_(e){return Pe(e,"Number")&&e.type==="number"&&We(e.$id)&&nt(e.exclusiveMaximum)&&nt(e.exclusiveMinimum)&&nt(e.maximum)&&nt(e.minimum)&&nt(e.multipleOf)}o(f_,"IsNumber");function l_(e){return Pe(e,"Object")&&e.type==="object"&&We(e.$id)&&Tm(e.properties)&&VO(e.additionalProperties)&&nt(e.minProperties)&&nt(e.maxProperties)}o(l_,"IsObject");function p_(e){return Pe(e,"Promise")&&e.type==="Promise"&&We(e.$id)&&Se(e.item)}o(p_,"IsPromise");function d_(e){return Pe(e,"Record")&&e.type==="object"&&We(e.$id)&&VO(e.additionalProperties)&&Xe(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&zO(r[0])&&Xe(t.patternProperties)&&Se(t.patternProperties[r[0]])})(e)}o(d_,"IsRecord");function ZC(e){return Xe(e)&&Vr in e&&e[Vr]==="Recursive"}o(ZC,"IsRecursive");function m_(e){return Pe(e,"Ref")&&We(e.$id)&&ot(e.$ref)}o(m_,"IsRef");function y_(e){return Pe(e,"RegExp")&&We(e.$id)&&ot(e.source)&&ot(e.flags)&&nt(e.maxLength)&&nt(e.minLength)}o(y_,"IsRegExp");function h_(e){return Pe(e,"String")&&e.type==="string"&&We(e.$id)&&nt(e.minLength)&&nt(e.maxLength)&&GC(e.pattern)&&KC(e.format)}o(h_,"IsString");function g_(e){return Pe(e,"Symbol")&&e.type==="symbol"&&We(e.$id)}o(g_,"IsSymbol");function x_(e){return Pe(e,"TemplateLiteral")&&e.type==="string"&&ot(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}o(x_,"IsTemplateLiteral");function I_(e){return Pe(e,"This")&&We(e.$id)&&ot(e.$ref)}o(I_,"IsThis");function it(e){return Xe(e)&&pt in e}o(it,"IsTransform");function b_(e){return Pe(e,"Tuple")&&e.type==="array"&&We(e.$id)&&ln(e.minItems)&&ln(e.maxItems)&&e.minItems===e.maxItems&&(yt(e.items)&&yt(e.additionalItems)&&e.minItems===0||Xt(e.items)&&e.items.every(t=>Se(t)))}o(b_,"IsTuple");function Ts(e){return Pe(e,"Undefined")&&e.type==="undefined"&&We(e.$id)}o(Ts,"IsUndefined");function YC(e){return km(e)&&e.anyOf.every(t=>r_(t)||n_(t))}o(YC,"IsUnionLiteral");function km(e){return Pe(e,"Union")&&We(e.$id)&&Xe(e)&&Xt(e.anyOf)&&e.anyOf.every(t=>Se(t))}o(km,"IsUnion");function w_(e){return Pe(e,"Uint8Array")&&e.type==="Uint8Array"&&We(e.$id)&&nt(e.minByteLength)&&nt(e.maxByteLength)}o(w_,"IsUint8Array");function $_(e){return Pe(e,"Unknown")&&We(e.$id)}o($_,"IsUnknown");function v_(e){return Pe(e,"Unsafe")}o(v_,"IsUnsafe");function O_(e){return Pe(e,"Void")&&e.type==="void"&&We(e.$id)}o(O_,"IsVoid");function __(e){return Xe(e)&&v in e&&ot(e[v])&&!BC.includes(e[v])}o(__,"IsKind");function Se(e){return Xe(e)&&(GO(e)||KO(e)||JO(e)||HO(e)||WO(e)||ZO(e)||YO(e)||XO(e)||QO(e)||e_(e)||t_(e)||fc(e)||i_(e)||s_(e)||a_(e)||c_(e)||u_(e)||f_(e)||l_(e)||p_(e)||d_(e)||m_(e)||y_(e)||h_(e)||g_(e)||x_(e)||I_(e)||b_(e)||Ts(e)||km(e)||w_(e)||$_(e)||v_(e)||O_(e)||__(e))}o(Se,"IsSchema");c();var Am="(true|false)",lc="(0|[1-9][0-9]*)",jm="(.*)",XC="(?!.*)",cH="^".concat(Am,"$"),po="^".concat(lc,"$"),mo="^".concat(jm,"$"),S_="^".concat(XC,"$");c();var lr={};To(lr,{Clear:()=>eM,Delete:()=>tM,Entries:()=>QC,Get:()=>oM,Has:()=>rM,Set:()=>nM});c();var ks=new Map;function QC(){return new Map(ks)}o(QC,"Entries");function eM(){return ks.clear()}o(eM,"Clear");function tM(e){return ks.delete(e)}o(tM,"Delete");function rM(e){return ks.has(e)}o(rM,"Has");function nM(e,t){ks.set(e,t)}o(nM,"Set");function oM(e){return ks.get(e)}o(oM,"Get");var Tt={};To(Tt,{Clear:()=>sM,Delete:()=>aM,Entries:()=>iM,Get:()=>fM,Has:()=>cM,Set:()=>uM});c();var Fs=new Map;function iM(){return new Map(Fs)}o(iM,"Entries");function sM(){return Fs.clear()}o(sM,"Clear");function aM(e){return Fs.delete(e)}o(aM,"Delete");function cM(e){return Fs.has(e)}o(cM,"Has");function uM(e,t){Fs.set(e,t)}o(uM,"Set");function fM(e){return Fs.get(e)}o(fM,"Get");c();function P_(e,t){return e.includes(t)}o(P_,"SetIncludes");function E_(e){return[...new Set(e)]}o(E_,"SetDistinct");function lM(e,t){return e.filter(r=>t.includes(r))}o(lM,"SetIntersect");function pM(e,t){return e.reduce((r,n)=>lM(r,n),t)}o(pM,"SetIntersectManyResolve");function T_(e){return e.length===1?e[0]:e.length>1?pM(e.slice(1),e[0]):[]}o(T_,"SetIntersectMany");function k_(e){let t=[];for(let r of e)t.push(...r);return t}o(k_,"SetUnionMany");c();function Wo(e){return T({[v]:"Any"},e)}o(Wo,"Any");c();function Au(e,t){return T({[v]:"Array",type:"array",items:e},t)}o(Au,"Array");c();function ju(e,t){return T({[v]:"AsyncIterator",type:"AsyncIterator",items:e},t)}o(ju,"AsyncIterator");c();c();c();function dM(e,t){let i=e,{[t]:r}=i;return ya(i,[Ac(t)])}o(dM,"DiscardKey");function It(e,t){return t.reduce((r,n)=>dM(r,n),e)}o(It,"Discard");c();function He(e){return T({[v]:"Never",not:{}},e)}o(He,"Never");c();c();function Ae(e){return T({[v]:"MappedResult",properties:e})}o(Ae,"MappedResult");c();c();function Nu(e,t,r){return T({[v]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}o(Nu,"Constructor");c();function Ho(e,t,r){return T({[v]:"Function",type:"Function",parameters:e,returns:t},r)}o(Ho,"Function");c();c();c();c();function pc(e,t){return T({[v]:"Union",anyOf:e},t)}o(pc,"UnionCreate");function mM(e){return e.some(t=>An(t))}o(mM,"IsUnionOptional");function F_(e){return e.map(t=>An(t)?yM(t):t)}o(F_,"RemoveOptionalFromRest");function yM(e){return It(e,[fr])}o(yM,"RemoveOptionalFromType");function hM(e,t){return mM(e)?br(pc(F_(e),t)):pc(F_(e),t)}o(hM,"ResolveUnion");function jn(e,t){return e.length===0?He(t):e.length===1?T(e[0],t):hM(e,t)}o(jn,"UnionEvaluated");c();function Je(e,t){return e.length===0?He(t):e.length===1?T(e[0],t):pc(e,t)}o(Je,"Union");c();c();c();var Rm=class Rm extends re{};o(Rm,"TemplateLiteralParserError");var Ru=Rm;function gM(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}o(gM,"Unescape");function Nm(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}o(Nm,"IsNonEscaped");function yo(e,t){return Nm(e,t,"(")}o(yo,"IsOpenParen");function dc(e,t){return Nm(e,t,")")}o(dc,"IsCloseParen");function A_(e,t){return Nm(e,t,"|")}o(A_,"IsSeparator");function xM(e){if(!(yo(e,0)&&dc(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(yo(e,r)&&(t+=1),dc(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}o(xM,"IsGroup");function IM(e){return e.slice(1,e.length-1)}o(IM,"InGroup");function bM(e){let t=0;for(let r=0;r<e.length;r++)if(yo(e,r)&&(t+=1),dc(e,r)&&(t-=1),A_(e,r)&&t===0)return!0;return!1}o(bM,"IsPrecedenceOr");function wM(e){for(let t=0;t<e.length;t++)if(yo(e,t))return!0;return!1}o(wM,"IsPrecedenceAnd");function $M(e){let[t,r]=[0,0],n=[];for(let s=0;s<e.length;s++)if(yo(e,s)&&(t+=1),dc(e,s)&&(t-=1),A_(e,s)&&t===0){let a=e.slice(r,s);a.length>0&&n.push(As(a)),r=s+1}let i=e.slice(r);return i.length>0&&n.push(As(i)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}o($M,"Or");function vM(e){function t(i,s){if(!yo(i,s))throw new Ru("TemplateLiteralParser: Index must point to open parens");let a=0;for(let u=s;u<i.length;u++)if(yo(i,u)&&(a+=1),dc(i,u)&&(a-=1),a===0)return[s,u];throw new Ru("TemplateLiteralParser: Unclosed group parens in expression")}o(t,"Group");function r(i,s){for(let a=s;a<i.length;a++)if(yo(i,a))return[s,a];return[s,i.length]}o(r,"Range");let n=[];for(let i=0;i<e.length;i++)if(yo(e,i)){let[s,a]=t(e,i),u=e.slice(s,a+1);n.push(As(u)),i=a}else{let[s,a]=r(e,i),u=e.slice(s,a);u.length>0&&n.push(As(u)),i=a-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}o(vM,"And");function As(e){return xM(e)?As(IM(e)):bM(e)?$M(e):wM(e)?vM(e):{type:"const",const:gM(e)}}o(As,"TemplateLiteralParse");function js(e){return As(e.slice(1,e.length-1))}o(js,"TemplateLiteralParseExact");var Mm=class Mm extends re{};o(Mm,"TemplateLiteralFiniteError");var Cm=Mm;function OM(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}o(OM,"IsNumberExpression");function _M(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}o(_M,"IsBooleanExpression");function SM(e){return e.type==="const"&&e.const===".*"}o(SM,"IsStringExpression");function Ai(e){return OM(e)||SM(e)?!1:_M(e)?!0:e.type==="and"?e.expr.every(t=>Ai(t)):e.type==="or"?e.expr.every(t=>Ai(t)):e.type==="const"?!0:(()=>{throw new Cm("Unknown expression type")})()}o(Ai,"IsTemplateLiteralExpressionFinite");function Cu(e){let t=js(e.pattern);return Ai(t)}o(Cu,"IsTemplateLiteralFinite");c();var Um=class Um extends re{};o(Um,"TemplateLiteralGenerateError");var Lm=Um;function*j_(e){if(e.length===1)return yield*A(e[0]);for(let t of e[0])for(let r of j_(e.slice(1)))yield"".concat(t).concat(r)}o(j_,"GenerateReduce");function*PM(e){return yield*A(j_(e.expr.map(t=>[...mc(t)])))}o(PM,"GenerateAnd");function*EM(e){for(let t of e.expr)yield*A(mc(t))}o(EM,"GenerateOr");function*TM(e){return yield e.const}o(TM,"GenerateConst");function*mc(e){return e.type==="and"?yield*A(PM(e)):e.type==="or"?yield*A(EM(e)):e.type==="const"?yield*A(TM(e)):(()=>{throw new Lm("Unknown expression")})()}o(mc,"TemplateLiteralExpressionGenerate");function Ns(e){let t=js(e.pattern);return Ai(t)?[...mc(t)]:[]}o(Ns,"TemplateLiteralGenerate");c();c();function ze(e,t){return T({[v]:"Literal",const:e,type:typeof e},t)}o(ze,"Literal");c();function Mu(e){return T({[v]:"Boolean",type:"boolean"},e)}o(Mu,"Boolean");c();function Rs(e){return T({[v]:"BigInt",type:"bigint"},e)}o(Rs,"BigInt");c();function Nn(e){return T({[v]:"Number",type:"number"},e)}o(Nn,"Number");c();function Br(e){return T({[v]:"String",type:"string"},e)}o(Br,"String");function*kM(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield Mu():t==="number"?yield Nn():t==="bigint"?yield Rs():t==="string"?yield Br():yield(()=>{let r=t.split("|").map(n=>ze(n.trim()));return r.length===0?He():r.length===1?r[0]:jn(r)})()}o(kM,"FromUnion");function*FM(e){if(e[1]!=="{"){let t=ze("$"),r=Dm(e.slice(1));return yield*A([t,...r])}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=kM(e.slice(2,t)),n=Dm(e.slice(t+1));return yield*A([...r,...n])}yield ze(e)}o(FM,"FromTerminal");function*Dm(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=ze(e.slice(0,t)),n=FM(e.slice(t));return yield*A([r,...n])}yield ze(e)}o(Dm,"FromSyntax");function N_(e){return[...Dm(e)]}o(N_,"TemplateLiteralSyntax");c();var Vm=class Vm extends re{};o(Vm,"TemplateLiteralPatternError");var qm=Vm;function AM(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(AM,"Escape");function R_(e,t){return Pr(e)?e.pattern.slice(1,e.pattern.length-1):Ue(e)?"(".concat(e.anyOf.map(r=>R_(r,t)).join("|"),")"):ki(e)?"".concat(t).concat(lc):Ti(e)?"".concat(t).concat(lc):wm(e)?"".concat(t).concat(lc):cc(e)?"".concat(t).concat(jm):lo(e)?"".concat(t).concat(AM(e.const.toString())):$m(e)?"".concat(t).concat(Am):(()=>{throw new qm("Unexpected Kind '".concat(e[v],"'"))})()}o(R_,"Visit");function zm(e){return"^".concat(e.map(t=>R_(t,"")).join(""),"$")}o(zm,"TemplateLiteralPattern");c();function ji(e){let r=Ns(e).map(n=>ze(n));return jn(r)}o(ji,"TemplateLiteralToUnion");c();function Lu(e,t){let r=ot(e)?zm(N_(e)):zm(e);return T({[v]:"TemplateLiteral",type:"string",pattern:r},t)}o(Lu,"TemplateLiteral");function jM(e){return Ns(e).map(r=>r.toString())}o(jM,"FromTemplateLiteral");function NM(e){let t=[];for(let r of e)t.push(...wr(r));return t}o(NM,"FromUnion");function RM(e){return[e.toString()]}o(RM,"FromLiteral");function wr(e){return[...new Set(Pr(e)?jM(e):Ue(e)?NM(e.anyOf):lo(e)?RM(e.const):ki(e)?["[number]"]:Ti(e)?["[number]"]:[])]}o(wr,"IndexPropertyKeys");c();function CM(e,t,r){let n={};for(let i of Object.getOwnPropertyNames(t))n[i]=Cs(e,wr(t[i]),r);return n}o(CM,"FromProperties");function MM(e,t,r){return CM(e,t.properties,r)}o(MM,"FromMappedResult");function C_(e,t,r){let n=MM(e,t,r);return Ae(n)}o(C_,"IndexFromMappedResult");function L_(e,t){return e.map(r=>U_(r,t))}o(L_,"FromRest");function LM(e){return e.filter(t=>!Go(t))}o(LM,"FromIntersectRest");function UM(e,t){return Uu(LM(L_(e,t)))}o(UM,"FromIntersect");function DM(e){return e.some(t=>Go(t))?[]:e}o(DM,"FromUnionRest");function qM(e,t){return jn(DM(L_(e,t)))}o(qM,"FromUnion");function zM(e,t){return t in e?e[t]:t==="[number]"?jn(e):He()}o(zM,"FromTuple");function VM(e,t){return t==="[number]"?e:He()}o(VM,"FromArray");function BM(e,t){return t in e?e[t]:He()}o(BM,"FromProperty");function U_(e,t){var r;return $t(e)?UM(e.allOf,t):Ue(e)?qM(e.anyOf,t):pn(e)?zM((r=e.items)!=null?r:[],t):fo(e)?VM(e.items,t):Et(e)?BM(e.properties,t):He()}o(U_,"IndexFromPropertyKey");function yc(e,t){return t.map(r=>U_(e,r))}o(yc,"IndexFromPropertyKeys");function M_(e,t){return jn(yc(e,t))}o(M_,"FromSchema");function Cs(e,t,r){return dt(t)?C_(e,t,r):Sr(t)?D_(e,t,r):T(dn(t)?M_(e,wr(t)):M_(e,t),r)}o(Cs,"Index");function GM(e,t,r){return{[t]:Cs(e,[t],lt(r))}}o(GM,"MappedIndexPropertyKey");function KM(e,t,r){return t.reduce((n,i)=>g(g({},n),GM(e,i,r)),{})}o(KM,"MappedIndexPropertyKeys");function WM(e,t,r){return KM(e,t.keys,r)}o(WM,"MappedIndexProperties");function D_(e,t,r){let n=WM(e,t,r);return Ae(n)}o(D_,"IndexFromMappedKey");c();function Du(e,t){return T({[v]:"Iterator",type:"Iterator",items:e},t)}o(Du,"Iterator");c();function HM(e){let t=[];for(let r in e)An(e[r])||t.push(r);return t}o(HM,"RequiredKeys");function JM(e,t){let r=HM(e),n=r.length>0?{[v]:"Object",type:"object",properties:e,required:r}:{[v]:"Object",type:"object",properties:e};return T(n,t)}o(JM,"_Object");var Qe=JM;c();function qu(e,t){return T({[v]:"Promise",type:"Promise",item:e},t)}o(qu,"Promise");c();c();function ZM(e){return T(It(e,[uo]))}o(ZM,"RemoveReadonly");function YM(e){return T(F(g({},e),{[uo]:"Readonly"}))}o(YM,"AddReadonly");function XM(e,t){return t===!1?ZM(e):YM(e)}o(XM,"ReadonlyWithFlag");function Gr(e,t){let r=t!=null?t:!0;return dt(e)?q_(e,r):XM(e,r)}o(Gr,"Readonly");function QM(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Gr(e[n],t);return r}o(QM,"FromProperties");function eL(e,t){return QM(e.properties,t)}o(eL,"FromMappedResult");function q_(e,t){let r=eL(e,t);return Ae(r)}o(q_,"ReadonlyFromMappedResult");c();function Rn(e,t){return T(e.length>0?{[v]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[v]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}o(Rn,"Tuple");function z_(e,t){return e in t?Kr(e,t[e]):Ae(t)}o(z_,"FromMappedResult");function tL(e){return{[e]:ze(e)}}o(tL,"MappedKeyToKnownMappedResultProperties");function rL(e){let t={};for(let r of e)t[r]=ze(r);return t}o(rL,"MappedKeyToUnknownMappedResultProperties");function nL(e,t){return P_(t,e)?tL(e):rL(t)}o(nL,"MappedKeyToMappedResultProperties");function oL(e,t){let r=nL(e,t);return z_(e,r)}o(oL,"FromMappedKey");function hc(e,t){return t.map(r=>Kr(e,r))}o(hc,"FromRest");function iL(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Kr(e,t[n]);return r}o(iL,"FromProperties");function Kr(e,t){var n;let r=g({},t);return An(t)?br(Kr(e,It(t,[fr]))):qO(t)?Gr(Kr(e,It(t,[uo]))):dt(t)?z_(e,t.properties):Sr(t)?oL(e,t.keys):ic(t)?Nu(hc(e,t.parameters),Kr(e,t.returns),r):sc(t)?Ho(hc(e,t.parameters),Kr(e,t.returns),r):oc(t)?ju(Kr(e,t.items),r):ac(t)?Du(Kr(e,t.items),r):$t(t)?$r(hc(e,t.allOf),r):Ue(t)?Je(hc(e,t.anyOf),r):pn(t)?Rn(hc(e,(n=t.items)!=null?n:[]),r):Et(t)?Qe(iL(e,t.properties),r):fo(t)?Au(Kr(e,t.items),r):Fi(t)?qu(Kr(e,t.item),r):t}o(Kr,"FromSchemaType");function sL(e,t){let r={};for(let n of e)r[n]=Kr(n,t);return r}o(sL,"MappedFunctionReturnType");function V_(e,t,r){let n=dn(e)?wr(e):e,i=t({[v]:"MappedKey",keys:n}),s=sL(n,i);return Qe(s,r)}o(V_,"Mapped");c();function aL(e){return T(It(e,[fr]))}o(aL,"RemoveOptional");function cL(e){return T(F(g({},e),{[fr]:"Optional"}))}o(cL,"AddOptional");function uL(e,t){return t===!1?aL(e):cL(e)}o(uL,"OptionalWithFlag");function br(e,t){let r=t!=null?t:!0;return dt(e)?B_(e,r):uL(e,r)}o(br,"Optional");function fL(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=br(e[n],t);return r}o(fL,"FromProperties");function lL(e,t){return fL(e.properties,t)}o(lL,"FromMappedResult");function B_(e,t){let r=lL(e,t);return Ae(r)}o(B_,"OptionalFromMappedResult");c();function gc(e,t={}){let r=e.every(i=>Et(i)),n=dn(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return T(t.unevaluatedProperties===!1||dn(t.unevaluatedProperties)||r?F(g({},n),{[v]:"Intersect",type:"object",allOf:e}):F(g({},n),{[v]:"Intersect",allOf:e}),t)}o(gc,"IntersectCreate");function pL(e){return e.every(t=>An(t))}o(pL,"IsIntersectOptional");function dL(e){return It(e,[fr])}o(dL,"RemoveOptionalFromType");function G_(e){return e.map(t=>An(t)?dL(t):t)}o(G_,"RemoveOptionalFromRest");function mL(e,t){return pL(e)?br(gc(G_(e),t)):gc(G_(e),t)}o(mL,"ResolveIntersect");function Uu(e,t={}){if(e.length===0)return He(t);if(e.length===1)return T(e[0],t);if(e.some(r=>Es(r)))throw new Error("Cannot intersect transform types");return mL(e,t)}o(Uu,"IntersectEvaluated");c();function $r(e,t){if(e.length===0)return He(t);if(e.length===1)return T(e[0],t);if(e.some(r=>Es(r)))throw new Error("Cannot intersect transform types");return gc(e,t)}o($r,"Intersect");function K_(e){return e.map(t=>Bm(t))}o(K_,"FromRest");function yL(e){return $r(K_(e))}o(yL,"FromIntersect");function hL(e){return Je(K_(e))}o(hL,"FromUnion");function gL(e){return Bm(e)}o(gL,"FromPromise");function Bm(e){return $t(e)?yL(e.allOf):Ue(e)?hL(e.anyOf):Fi(e)?gL(e.item):e}o(Bm,"AwaitedResolve");function W_(e,t){return T(Bm(e),t)}o(W_,"Awaited");c();c();c();c();function H_(e){let t=[];for(let r of e)t.push(At(r));return t}o(H_,"FromRest");function xL(e){let t=H_(e);return k_(t)}o(xL,"FromIntersect");function IL(e){let t=H_(e);return T_(t)}o(IL,"FromUnion");function bL(e){return e.map((t,r)=>r.toString())}o(bL,"FromTuple");function wL(e){return["[number]"]}o(wL,"FromArray");function $L(e){return globalThis.Object.getOwnPropertyNames(e)}o($L,"FromProperties");function vL(e){return Gm?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}o(vL,"FromPatternProperties");function At(e){var t;return $t(e)?xL(e.allOf):Ue(e)?IL(e.anyOf):pn(e)?bL((t=e.items)!=null?t:[]):fo(e)?wL(e.items):Et(e)?$L(e.properties):vm(e)?vL(e.patternProperties):[]}o(At,"KeyOfPropertyKeys");var Gm=!1;function ho(e){Gm=!0;let t=At(e);Gm=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}o(ho,"KeyOfPattern");function OL(e){return e.map(t=>t==="[number]"?Nn():ze(t))}o(OL,"KeyOfPropertyKeysToRest");function zu(e,t){if(dt(e))return J_(e,t);{let r=At(e),n=OL(r),i=jn(n);return T(i,t)}}o(zu,"KeyOf");function _L(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=zu(e[n],lt(t));return r}o(_L,"FromProperties");function SL(e,t){return _L(e.properties,t)}o(SL,"FromMappedResult");function J_(e,t){let r=SL(e,t);return Ae(r)}o(J_,"KeyOfFromMappedResult");c();function Jo(e){let t=At(e),r=yc(e,t);return t.map((n,i)=>[t[i],r[i]])}o(Jo,"KeyOfPropertyEntries");function PL(e){let t=[];for(let r of e)t.push(...At(r));return E_(t)}o(PL,"CompositeKeys");function EL(e){return e.filter(t=>!Go(t))}o(EL,"FilterNever");function TL(e,t){let r=[];for(let n of e)r.push(...yc(n,[t]));return EL(r)}o(TL,"CompositeProperty");function kL(e,t){let r={};for(let n of t)r[n]=Uu(TL(e,n));return r}o(kL,"CompositeProperties");function Z_(e,t){let r=PL(e),n=kL(e,r);return Qe(n,t)}o(Z_,"Composite");c();c();function Vu(e){return T({[v]:"Date",type:"Date"},e)}o(Vu,"Date");c();function Bu(e){return T({[v]:"Null",type:"null"},e)}o(Bu,"Null");c();function Gu(e){return T({[v]:"Symbol",type:"symbol"},e)}o(Gu,"Symbol");c();function Ku(e){return T({[v]:"Undefined",type:"undefined"},e)}o(Ku,"Undefined");c();function Wu(e){return T({[v]:"Uint8Array",type:"Uint8Array"},e)}o(Wu,"Uint8Array");c();function go(e){return T({[v]:"Unknown"},e)}o(go,"Unknown");function FL(e){return e.map(t=>Km(t,!1))}o(FL,"FromArray");function AL(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Gr(Km(e[r],!1));return t}o(AL,"FromProperties");function Hu(e,t){return t===!0?e:Gr(e)}o(Hu,"ConditionalReadonly");function Km(e,t){return dm(e)?Hu(Wo(),t):ym(e)?Hu(Wo(),t):Xt(e)?Gr(Rn(FL(e))):so(e)?Wu():Ei(e)?Vu():Xe(e)?Hu(Qe(AL(e)),t):mm(e)?Hu(Ho([],go()),t):yt(e)?Ku():hm(e)?Bu():gm(e)?Gu():ec(e)?Rs():ln(e)?ze(e):Vo(e)?ze(e):ot(e)?ze(e):Qe({})}o(Km,"FromValue");function Y_(e,t){return T(Km(e,!0),t)}o(Y_,"Const");c();function X_(e,t){return Rn(e.parameters,t)}o(X_,"ConstructorParameters");c();function xc(e,t){return e.map(r=>mn(r,t))}o(xc,"FromRest");function jL(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=mn(e[n],t);return r}o(jL,"FromProperties");function NL(e,t){return e.parameters=xc(e.parameters,t),e.returns=mn(e.returns,t),e}o(NL,"FromConstructor");function RL(e,t){return e.parameters=xc(e.parameters,t),e.returns=mn(e.returns,t),e}o(RL,"FromFunction");function CL(e,t){return e.allOf=xc(e.allOf,t),e}o(CL,"FromIntersect");function ML(e,t){return e.anyOf=xc(e.anyOf,t),e}o(ML,"FromUnion");function LL(e,t){return yt(e.items)||(e.items=xc(e.items,t)),e}o(LL,"FromTuple");function UL(e,t){return e.items=mn(e.items,t),e}o(UL,"FromArray");function DL(e,t){return e.properties=jL(e.properties,t),e}o(DL,"FromObject");function qL(e,t){return e.item=mn(e.item,t),e}o(qL,"FromPromise");function zL(e,t){return e.items=mn(e.items,t),e}o(zL,"FromAsyncIterator");function VL(e,t){return e.items=mn(e.items,t),e}o(VL,"FromIterator");function BL(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw Error("Unable to dereference schema with $id ".concat(e.$ref));let n=It(r,["$id"]);return mn(n,t)}o(BL,"FromRef");function GL(e,t){return ic(e)?NL(e,t):sc(e)?RL(e,t):$t(e)?CL(e,t):Ue(e)?ML(e,t):pn(e)?LL(e,t):fo(e)?UL(e,t):Et(e)?DL(e,t):Fi(e)?qL(e,t):oc(e)?zL(e,t):ac(e)?VL(e,t):Om(e)?BL(e,t):e}o(GL,"DerefResolve");function mn(e,t){return GL(rc(e),LO(t))}o(mn,"Deref");c();function Q_(e,t){if(yt(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(s=>isNaN(s)).map(s=>e[s]),i=[...new Set(r)].map(s=>ze(s));return Je(i,F(g({},t),{[Vr]:"Enum"}))}o(Q_,"Enum");c();c();c();var Qm=class Qm extends re{};o(Qm,"ExtendsResolverError");var Hm=Qm,P;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(P||(P={}));function Wr(e){return e===P.False?e:P.True}o(Wr,"IntoBooleanResult");function Ms(e){throw new Hm(e)}o(Ms,"Throw");function Ot(e){return x.IsNever(e)||x.IsIntersect(e)||x.IsUnion(e)||x.IsUnknown(e)||x.IsAny(e)}o(Ot,"IsStructuralRight");function _t(e,t){return x.IsNever(t)?sS(e,t):x.IsIntersect(t)?Ju(e,t):x.IsUnion(t)?Xm(e,t):x.IsUnknown(t)?fS(e,t):x.IsAny(t)?Ym(e,t):Ms("StructuralRight")}o(_t,"StructuralRight");function Ym(e,t){return P.True}o(Ym,"FromAnyRight");function KL(e,t){return x.IsIntersect(t)?Ju(e,t):x.IsUnion(t)&&t.anyOf.some(r=>x.IsAny(r)||x.IsUnknown(r))?P.True:x.IsUnion(t)?P.Union:x.IsUnknown(t)||x.IsAny(t)?P.True:P.Union}o(KL,"FromAny");function WL(e,t){return x.IsUnknown(e)?P.False:x.IsAny(e)?P.Union:x.IsNever(e)?P.True:P.False}o(WL,"FromArrayRight");function HL(e,t){return x.IsObject(t)&&Zu(t)?P.True:Ot(t)?_t(e,t):x.IsArray(t)?Wr(Ze(e.items,t.items)):P.False}o(HL,"FromArray");function JL(e,t){return Ot(t)?_t(e,t):x.IsAsyncIterator(t)?Wr(Ze(e.items,t.items)):P.False}o(JL,"FromAsyncIterator");function ZL(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsBigInt(t)?P.True:P.False}o(ZL,"FromBigInt");function oS(e,t){return x.IsLiteralBoolean(e)||x.IsBoolean(e)?P.True:P.False}o(oS,"FromBooleanRight");function YL(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsBoolean(t)?P.True:P.False}o(YL,"FromBoolean");function XL(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsConstructor(t)?e.parameters.length>t.parameters.length?P.False:e.parameters.every((r,n)=>Wr(Ze(t.parameters[n],r))===P.True)?Wr(Ze(e.returns,t.returns)):P.False:P.False}o(XL,"FromConstructor");function QL(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsDate(t)?P.True:P.False}o(QL,"FromDate");function eU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsFunction(t)?e.parameters.length>t.parameters.length?P.False:e.parameters.every((r,n)=>Wr(Ze(t.parameters[n],r))===P.True)?Wr(Ze(e.returns,t.returns)):P.False:P.False}o(eU,"FromFunction");function iS(e,t){return x.IsLiteral(e)&&Oe.IsNumber(e.const)||x.IsNumber(e)||x.IsInteger(e)?P.True:P.False}o(iS,"FromIntegerRight");function tU(e,t){return x.IsInteger(t)||x.IsNumber(t)?P.True:Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):P.False}o(tU,"FromInteger");function Ju(e,t){return t.allOf.every(r=>Ze(e,r)===P.True)?P.True:P.False}o(Ju,"FromIntersectRight");function rU(e,t){return e.allOf.some(r=>Ze(r,t)===P.True)?P.True:P.False}o(rU,"FromIntersect");function nU(e,t){return Ot(t)?_t(e,t):x.IsIterator(t)?Wr(Ze(e.items,t.items)):P.False}o(nU,"FromIterator");function oU(e,t){return x.IsLiteral(t)&&t.const===e.const?P.True:Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsString(t)?uS(e,t):x.IsNumber(t)?aS(e,t):x.IsInteger(t)?iS(e,t):x.IsBoolean(t)?oS(e,t):P.False}o(oU,"FromLiteral");function sS(e,t){return P.False}o(sS,"FromNeverRight");function iU(e,t){return P.True}o(iU,"FromNever");function eS(e){let[t,r]=[e,0];for(;x.IsNot(t);)t=t.not,r+=1;return r%2===0?t:go()}o(eS,"UnwrapTNot");function sU(e,t){return x.IsNot(e)?Ze(eS(e),t):x.IsNot(t)?Ze(e,eS(t)):Ms("Invalid fallthrough for Not")}o(sU,"FromNot");function aU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsNull(t)?P.True:P.False}o(aU,"FromNull");function aS(e,t){return x.IsLiteralNumber(e)||x.IsNumber(e)||x.IsInteger(e)?P.True:P.False}o(aS,"FromNumberRight");function cU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsInteger(t)||x.IsNumber(t)?P.True:P.False}o(cU,"FromNumber");function vr(e,t){return Object.getOwnPropertyNames(e.properties).length===t}o(vr,"IsObjectPropertyCount");function tS(e){return Zu(e)}o(tS,"IsObjectStringLike");function rS(e){return vr(e,0)||vr(e,1)&&"description"in e.properties&&x.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(x.IsString(e.properties.description.anyOf[0])&&x.IsUndefined(e.properties.description.anyOf[1])||x.IsString(e.properties.description.anyOf[1])&&x.IsUndefined(e.properties.description.anyOf[0]))}o(rS,"IsObjectSymbolLike");function Wm(e){return vr(e,0)}o(Wm,"IsObjectNumberLike");function nS(e){return vr(e,0)}o(nS,"IsObjectBooleanLike");function uU(e){return vr(e,0)}o(uU,"IsObjectBigIntLike");function fU(e){return vr(e,0)}o(fU,"IsObjectDateLike");function lU(e){return Zu(e)}o(lU,"IsObjectUint8ArrayLike");function pU(e){let t=Nn();return vr(e,0)||vr(e,1)&&"length"in e.properties&&Wr(Ze(e.properties.length,t))===P.True}o(pU,"IsObjectFunctionLike");function dU(e){return vr(e,0)}o(dU,"IsObjectConstructorLike");function Zu(e){let t=Nn();return vr(e,0)||vr(e,1)&&"length"in e.properties&&Wr(Ze(e.properties.length,t))===P.True}o(Zu,"IsObjectArrayLike");function mU(e){let t=Ho([Wo()],Wo());return vr(e,0)||vr(e,1)&&"then"in e.properties&&Wr(Ze(e.properties.then,t))===P.True}o(mU,"IsObjectPromiseLike");function cS(e,t){return Ze(e,t)===P.False||x.IsOptional(e)&&!x.IsOptional(t)?P.False:P.True}o(cS,"Property");function Qt(e,t){return x.IsUnknown(e)?P.False:x.IsAny(e)?P.Union:x.IsNever(e)||x.IsLiteralString(e)&&tS(t)||x.IsLiteralNumber(e)&&Wm(t)||x.IsLiteralBoolean(e)&&nS(t)||x.IsSymbol(e)&&rS(t)||x.IsBigInt(e)&&uU(t)||x.IsString(e)&&tS(t)||x.IsSymbol(e)&&rS(t)||x.IsNumber(e)&&Wm(t)||x.IsInteger(e)&&Wm(t)||x.IsBoolean(e)&&nS(t)||x.IsUint8Array(e)&&lU(t)||x.IsDate(e)&&fU(t)||x.IsConstructor(e)&&dU(t)||x.IsFunction(e)&&pU(t)?P.True:x.IsRecord(e)&&x.IsString(Jm(e))?t[Vr]==="Record"?P.True:P.False:x.IsRecord(e)&&x.IsNumber(Jm(e))?vr(t,0)?P.True:P.False:P.False}o(Qt,"FromObjectRight");function yU(e,t){return Ot(t)?_t(e,t):x.IsRecord(t)?Hr(e,t):x.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!x.IsOptional(t.properties[r]))return P.False;if(x.IsOptional(t.properties[r]))return P.True;if(cS(e.properties[r],t.properties[r])===P.False)return P.False}return P.True})():P.False}o(yU,"FromObject");function hU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)&&mU(t)?P.True:x.IsPromise(t)?Wr(Ze(e.item,t.item)):P.False}o(hU,"FromPromise");function Jm(e){return po in e.patternProperties?Nn():mo in e.patternProperties?Br():Ms("Unknown record key pattern")}o(Jm,"RecordKey");function Zm(e){return po in e.patternProperties?e.patternProperties[po]:mo in e.patternProperties?e.patternProperties[mo]:Ms("Unable to get record value schema")}o(Zm,"RecordValue");function Hr(e,t){let[r,n]=[Jm(t),Zm(t)];return x.IsLiteralString(e)&&x.IsNumber(r)&&Wr(Ze(e,n))===P.True?P.True:x.IsUint8Array(e)&&x.IsNumber(r)||x.IsString(e)&&x.IsNumber(r)||x.IsArray(e)&&x.IsNumber(r)?Ze(e,n):x.IsObject(e)?(()=>{for(let i of Object.getOwnPropertyNames(e.properties))if(cS(n,e.properties[i])===P.False)return P.False;return P.True})():P.False}o(Hr,"FromRecordRight");function gU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Ze(Zm(e),Zm(t)):P.False}o(gU,"FromRecord");function xU(e,t){let r=x.IsRegExp(e)?Br():e,n=x.IsRegExp(t)?Br():t;return Ze(r,n)}o(xU,"FromRegExp");function uS(e,t){return x.IsLiteral(e)&&Oe.IsString(e.const)||x.IsString(e)?P.True:P.False}o(uS,"FromStringRight");function IU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsString(t)?P.True:P.False}o(IU,"FromString");function bU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsSymbol(t)?P.True:P.False}o(bU,"FromSymbol");function wU(e,t){return x.IsTemplateLiteral(e)?Ze(ji(e),t):x.IsTemplateLiteral(t)?Ze(e,ji(t)):Ms("Invalid fallthrough for TemplateLiteral")}o(wU,"FromTemplateLiteral");function $U(e,t){return x.IsArray(t)&&e.items!==void 0&&e.items.every(r=>Ze(r,t.items)===P.True)}o($U,"IsArrayOfTuple");function vU(e,t){return x.IsNever(e)?P.True:x.IsUnknown(e)?P.False:x.IsAny(e)?P.Union:P.False}o(vU,"FromTupleRight");function OU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)&&Zu(t)||x.IsArray(t)&&$U(e,t)?P.True:x.IsTuple(t)?Oe.IsUndefined(e.items)&&!Oe.IsUndefined(t.items)||!Oe.IsUndefined(e.items)&&Oe.IsUndefined(t.items)?P.False:Oe.IsUndefined(e.items)&&!Oe.IsUndefined(t.items)||e.items.every((r,n)=>Ze(r,t.items[n])===P.True)?P.True:P.False:P.False}o(OU,"FromTuple");function _U(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsUint8Array(t)?P.True:P.False}o(_U,"FromUint8Array");function SU(e,t){return Ot(t)?_t(e,t):x.IsObject(t)?Qt(e,t):x.IsRecord(t)?Hr(e,t):x.IsVoid(t)?TU(e,t):x.IsUndefined(t)?P.True:P.False}o(SU,"FromUndefined");function Xm(e,t){return t.anyOf.some(r=>Ze(e,r)===P.True)?P.True:P.False}o(Xm,"FromUnionRight");function PU(e,t){return e.anyOf.every(r=>Ze(r,t)===P.True)?P.True:P.False}o(PU,"FromUnion");function fS(e,t){return P.True}o(fS,"FromUnknownRight");function EU(e,t){return x.IsNever(t)?sS(e,t):x.IsIntersect(t)?Ju(e,t):x.IsUnion(t)?Xm(e,t):x.IsAny(t)?Ym(e,t):x.IsString(t)?uS(e,t):x.IsNumber(t)?aS(e,t):x.IsInteger(t)?iS(e,t):x.IsBoolean(t)?oS(e,t):x.IsArray(t)?WL(e,t):x.IsTuple(t)?vU(e,t):x.IsObject(t)?Qt(e,t):x.IsUnknown(t)?P.True:P.False}o(EU,"FromUnknown");function TU(e,t){return x.IsUndefined(e)||x.IsUndefined(e)?P.True:P.False}o(TU,"FromVoidRight");function kU(e,t){return x.IsIntersect(t)?Ju(e,t):x.IsUnion(t)?Xm(e,t):x.IsUnknown(t)?fS(e,t):x.IsAny(t)?Ym(e,t):x.IsObject(t)?Qt(e,t):x.IsVoid(t)?P.True:P.False}o(kU,"FromVoid");function Ze(e,t){return x.IsTemplateLiteral(e)||x.IsTemplateLiteral(t)?wU(e,t):x.IsRegExp(e)||x.IsRegExp(t)?xU(e,t):x.IsNot(e)||x.IsNot(t)?sU(e,t):x.IsAny(e)?KL(e,t):x.IsArray(e)?HL(e,t):x.IsBigInt(e)?ZL(e,t):x.IsBoolean(e)?YL(e,t):x.IsAsyncIterator(e)?JL(e,t):x.IsConstructor(e)?XL(e,t):x.IsDate(e)?QL(e,t):x.IsFunction(e)?eU(e,t):x.IsInteger(e)?tU(e,t):x.IsIntersect(e)?rU(e,t):x.IsIterator(e)?nU(e,t):x.IsLiteral(e)?oU(e,t):x.IsNever(e)?iU(e,t):x.IsNull(e)?aU(e,t):x.IsNumber(e)?cU(e,t):x.IsObject(e)?yU(e,t):x.IsRecord(e)?gU(e,t):x.IsString(e)?IU(e,t):x.IsSymbol(e)?bU(e,t):x.IsTuple(e)?OU(e,t):x.IsPromise(e)?hU(e,t):x.IsUint8Array(e)?_U(e,t):x.IsUndefined(e)?SU(e,t):x.IsUnion(e)?PU(e,t):x.IsUnknown(e)?EU(e,t):x.IsVoid(e)?kU(e,t):Ms("Unknown left type operand '".concat(e[v],"'"))}o(Ze,"Visit");function Zo(e,t){return Ze(e,t)}o(Zo,"ExtendsCheck");c();c();c();function FU(e,t,r,n,i){let s={};for(let a of globalThis.Object.getOwnPropertyNames(e))s[a]=Ls(e[a],t,r,n,lt(i));return s}o(FU,"FromProperties");function AU(e,t,r,n,i){return FU(e.properties,t,r,n,i)}o(AU,"FromMappedResult");function lS(e,t,r,n,i){let s=AU(e,t,r,n,i);return Ae(s)}o(lS,"ExtendsFromMappedResult");function jU(e,t,r,n){let i=Zo(e,t);return i===P.Union?Je([r,n]):i===P.True?r:n}o(jU,"ExtendsResolve");function Ls(e,t,r,n,i){return dt(e)?lS(e,t,r,n,i):Sr(e)?T(pS(e,t,r,n,i)):T(jU(e,t,r,n),i)}o(Ls,"Extends");function NU(e,t,r,n,i){return{[e]:Ls(ze(e),t,r,n,lt(i))}}o(NU,"FromPropertyKey");function RU(e,t,r,n,i){return e.reduce((s,a)=>g(g({},s),NU(a,t,r,n,i)),{})}o(RU,"FromPropertyKeys");function CU(e,t,r,n,i){return RU(e.keys,t,r,n,i)}o(CU,"FromMappedKey");function pS(e,t,r,n,i){let s=CU(e,t,r,n,i);return Ae(s)}o(pS,"ExtendsFromMappedKey");c();function MU(e){return e.allOf.every(t=>xo(t))}o(MU,"Intersect");function LU(e){return e.anyOf.some(t=>xo(t))}o(LU,"Union");function UU(e){return!xo(e.not)}o(UU,"Not");function xo(e){return e[v]==="Intersect"?MU(e):e[v]==="Union"?LU(e):e[v]==="Not"?UU(e):e[v]==="Undefined"}o(xo,"ExtendsUndefinedCheck");c();function dS(e,t){return Us(ji(e),t)}o(dS,"ExcludeFromTemplateLiteral");function DU(e,t){let r=e.filter(n=>Zo(n,t)===P.False);return r.length===1?r[0]:Je(r)}o(DU,"ExcludeRest");function Us(e,t,r={}){return Pr(e)?T(dS(e,t),r):dt(e)?T(mS(e,t),r):T(Ue(e)?DU(e.anyOf,t):Zo(e,t)!==P.False?He():e,r)}o(Us,"Exclude");function qU(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Us(e[n],t);return r}o(qU,"FromProperties");function zU(e,t){return qU(e.properties,t)}o(zU,"FromMappedResult");function mS(e,t){let r=zU(e,t);return Ae(r)}o(mS,"ExcludeFromMappedResult");c();c();c();function yS(e,t){return Ds(ji(e),t)}o(yS,"ExtractFromTemplateLiteral");function VU(e,t){let r=e.filter(n=>Zo(n,t)!==P.False);return r.length===1?r[0]:Je(r)}o(VU,"ExtractRest");function Ds(e,t,r){return Pr(e)?T(yS(e,t),r):dt(e)?T(hS(e,t),r):T(Ue(e)?VU(e.anyOf,t):Zo(e,t)!==P.False?e:He(),r)}o(Ds,"Extract");function BU(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Ds(e[n],t);return r}o(BU,"FromProperties");function GU(e,t){return BU(e.properties,t)}o(GU,"FromMappedResult");function hS(e,t){let r=GU(e,t);return Ae(r)}o(hS,"ExtractFromMappedResult");c();function gS(e,t){return T(e.returns,t)}o(gS,"InstanceType");c();function xS(e){return T({[v]:"Integer",type:"integer"},e)}o(xS,"Integer");c();c();c();function KU(e,t,r){return{[e]:yn(ze(e),t,lt(r))}}o(KU,"MappedIntrinsicPropertyKey");function WU(e,t,r){return e.reduce((i,s)=>g(g({},i),KU(s,t,r)),{})}o(WU,"MappedIntrinsicPropertyKeys");function HU(e,t,r){return WU(e.keys,t,r)}o(HU,"MappedIntrinsicProperties");function IS(e,t,r){let n=HU(e,t,r);return Ae(n)}o(IS,"IntrinsicFromMappedKey");function JU(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}o(JU,"ApplyUncapitalize");function ZU(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}o(ZU,"ApplyCapitalize");function YU(e){return e.toUpperCase()}o(YU,"ApplyUppercase");function XU(e){return e.toLowerCase()}o(XU,"ApplyLowercase");function QU(e,t,r){let n=js(e.pattern);if(!Ai(n))return F(g({},e),{pattern:bS(e.pattern,t)});let a=[...mc(n)].map(d=>ze(d)),u=wS(a,t),l=Je(u);return Lu([l],r)}o(QU,"FromTemplateLiteral");function bS(e,t){return typeof e=="string"?t==="Uncapitalize"?JU(e):t==="Capitalize"?ZU(e):t==="Uppercase"?YU(e):t==="Lowercase"?XU(e):e:e.toString()}o(bS,"FromLiteralValue");function wS(e,t){return e.map(r=>yn(r,t))}o(wS,"FromRest");function yn(e,t,r={}){return Sr(e)?IS(e,t,r):Pr(e)?QU(e,t,r):Ue(e)?Je(wS(e.anyOf,t),r):lo(e)?ze(bS(e.const,t),r):T(e,r)}o(yn,"Intrinsic");function $S(e,t={}){return yn(e,"Capitalize",t)}o($S,"Capitalize");c();function vS(e,t={}){return yn(e,"Lowercase",t)}o(vS,"Lowercase");c();function OS(e,t={}){return yn(e,"Uncapitalize",t)}o(OS,"Uncapitalize");c();function _S(e,t={}){return yn(e,"Uppercase",t)}o(_S,"Uppercase");c();function SS(e,t){return T({[v]:"Not",not:e},t)}o(SS,"Not");c();c();c();function e2(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=qs(e[i],t,lt(r));return n}o(e2,"FromProperties");function t2(e,t,r){return e2(e.properties,t,r)}o(t2,"FromMappedResult");function PS(e,t,r){let n=t2(e,t,r);return Ae(n)}o(PS,"OmitFromMappedResult");function r2(e,t){return e.map(r=>ey(r,t))}o(r2,"FromIntersect");function n2(e,t){return e.map(r=>ey(r,t))}o(n2,"FromUnion");function o2(e,t){let i=e,{[t]:r}=i;return ya(i,[Ac(t)])}o(o2,"FromProperty");function i2(e,t){return t.reduce((r,n)=>o2(r,n),e)}o(i2,"FromProperties");function s2(e,t){let r=It(e,[pt,"$id","required","properties"]),n=i2(e.properties,t);return Qe(n,r)}o(s2,"FromObject");function ey(e,t){return $t(e)?$r(r2(e.allOf,t)):Ue(e)?Je(n2(e.anyOf,t)):Et(e)?s2(e,t):Qe({})}o(ey,"OmitResolve");function qs(e,t,r){if(Sr(t))return ES(e,t,r);if(dt(e))return PS(e,t,r);let n=dn(t)?wr(t):t;return T(g(g({},ey(e,n)),r))}o(qs,"Omit");function a2(e,t,r){return{[t]:qs(e,[t],lt(r))}}o(a2,"FromPropertyKey");function c2(e,t,r){return t.reduce((n,i)=>g(g({},n),a2(e,i,r)),{})}o(c2,"FromPropertyKeys");function u2(e,t,r){return c2(e,t.keys,r)}o(u2,"FromMappedKey");function ES(e,t,r){let n=u2(e,t,r);return Ae(n)}o(ES,"OmitFromMappedKey");c();function TS(e,t){return Rn(e.parameters,t)}o(TS,"Parameters");c();c();function kS(e){return e.map(t=>FS(t))}o(kS,"FromRest");function f2(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=br(e[r]);return t}o(f2,"FromProperties");function l2(e){let t=It(e,[pt,"$id","required","properties"]),r=f2(e.properties);return Qe(r,t)}o(l2,"FromObject");function FS(e){return $t(e)?$r(kS(e.allOf)):Ue(e)?Je(kS(e.anyOf)):Et(e)?l2(e):Qe({})}o(FS,"PartialResolve");function Yu(e,t){return dt(e)?AS(e,t):T(g(g({},FS(e)),t))}o(Yu,"Partial");function p2(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Yu(e[n],lt(t));return r}o(p2,"FromProperties");function d2(e,t){return p2(e.properties,t)}o(d2,"FromMappedResult");function AS(e,t){let r=d2(e,t);return Ae(r)}o(AS,"PartialFromMappedResult");c();c();c();function m2(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=zs(e[i],t,lt(r));return n}o(m2,"FromProperties");function y2(e,t,r){return m2(e.properties,t,r)}o(y2,"FromMappedResult");function jS(e,t,r){let n=y2(e,t,r);return Ae(n)}o(jS,"PickFromMappedResult");function h2(e,t){return e.map(r=>ty(r,t))}o(h2,"FromIntersect");function g2(e,t){return e.map(r=>ty(r,t))}o(g2,"FromUnion");function x2(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}o(x2,"FromProperties");function I2(e,t){let r=It(e,[pt,"$id","required","properties"]),n=x2(e.properties,t);return Qe(n,r)}o(I2,"FromObject");function ty(e,t){return $t(e)?$r(h2(e.allOf,t)):Ue(e)?Je(g2(e.anyOf,t)):Et(e)?I2(e,t):Qe({})}o(ty,"PickResolve");function zs(e,t,r){if(Sr(t))return NS(e,t,r);if(dt(e))return jS(e,t,r);let n=dn(t)?wr(t):t;return T(g(g({},ty(e,n)),r))}o(zs,"Pick");function b2(e,t,r){return{[t]:zs(e,[t],lt(r))}}o(b2,"FromPropertyKey");function w2(e,t,r){return t.reduce((n,i)=>g(g({},n),b2(e,i,r)),{})}o(w2,"FromPropertyKeys");function $2(e,t,r){return w2(e,t.keys,r)}o($2,"FromMappedKey");function NS(e,t,r){let n=$2(e,t,r);return Ae(n)}o(NS,"PickFromMappedKey");c();function RS(e){return Gr(br(e))}o(RS,"ReadonlyOptional");c();function Ni(e,t,r){return T({[v]:"Record",type:"object",patternProperties:{[e]:t}},r)}o(Ni,"RecordCreateFromPattern");function ry(e,t,r){let n={};for(let i of e)n[i]=t;return Qe(n,F(g({},r),{[Vr]:"Record"}))}o(ry,"RecordCreateFromKeys");function v2(e,t,r){return Cu(e)?ry(wr(e),t,r):Ni(e.pattern,t,r)}o(v2,"FromTemplateLiteralKey");function O2(e,t,r){return ry(wr(Je(e)),t,r)}o(O2,"FromUnionKey");function _2(e,t,r){return ry([e.toString()],t,r)}o(_2,"FromLiteralKey");function S2(e,t,r){return Ni(e.source,t,r)}o(S2,"FromRegExpKey");function P2(e,t,r){let n=yt(e.pattern)?mo:e.pattern;return Ni(n,t,r)}o(P2,"FromStringKey");function E2(e,t,r){return Ni(mo,t,r)}o(E2,"FromAnyKey");function T2(e,t,r){return Ni(S_,t,r)}o(T2,"FromNeverKey");function k2(e,t,r){return Ni(po,t,r)}o(k2,"FromIntegerKey");function F2(e,t,r){return Ni(po,t,r)}o(F2,"FromNumberKey");function CS(e,t,r={}){return Ue(e)?O2(e.anyOf,t,r):Pr(e)?v2(e,t,r):lo(e)?_2(e.const,t,r):Ti(e)?k2(e,t,r):ki(e)?F2(e,t,r):_m(e)?S2(e,t,r):cc(e)?P2(e,t,r):bm(e)?E2(e,t,r):Go(e)?T2(e,t,r):He(r)}o(CS,"Record");c();var A2=0;function MS(e,t={}){yt(t.$id)&&(t.$id="T".concat(A2++));let r=rc(e({[v]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,T(g({[Vr]:"Recursive"},r),t)}o(MS,"Recursive");c();function LS(e,t){if(ot(e))return T({[v]:"Ref",$ref:e},t);if(yt(e.$id))throw new Error("Reference target type must specify an $id");return T({[v]:"Ref",$ref:e.$id},t)}o(LS,"Ref");c();function US(e,t){let r=ot(e)?new globalThis.RegExp(e):e;return T({[v]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}o(US,"RegExp");c();c();function DS(e){return e.map(t=>qS(t))}o(DS,"FromRest");function j2(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=It(e[r],[fr]);return t}o(j2,"FromProperties");function N2(e){let t=It(e,[pt,"$id","required","properties"]),r=j2(e.properties);return Qe(r,t)}o(N2,"FromObject");function qS(e){return $t(e)?$r(DS(e.allOf)):Ue(e)?Je(DS(e.anyOf)):Et(e)?N2(e):Qe({})}o(qS,"RequiredResolve");function Xu(e,t){return dt(e)?zS(e,t):T(g(g({},qS(e)),t))}o(Xu,"Required");function R2(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Xu(e[n],t);return r}o(R2,"FromProperties");function C2(e,t){return R2(e.properties,t)}o(C2,"FromMappedResult");function zS(e,t){let r=C2(e,t);return Ae(r)}o(zS,"RequiredFromMappedResult");c();function M2(e){var t;return $t(e)?e.allOf:Ue(e)?e.anyOf:pn(e)?(t=e.items)!=null?t:[]:[]}o(M2,"RestResolve");function VS(e){return M2(e)}o(VS,"Rest");c();function BS(e,t){return T(e.returns,t)}o(BS,"ReturnType");c();function GS(e){return JSON.parse(JSON.stringify(e))}o(GS,"Strict");c();var iy=class iy{constructor(t){this.schema=t}Decode(t){return new oy(this.schema,t)}};o(iy,"TransformDecodeBuilder");var ny=iy,sy=class sy{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let s={Encode:o(a=>r[pt].Encode(t(a)),"Encode"),Decode:o(a=>this.decode(r[pt].Decode(a)),"Decode")};return F(g({},r),{[pt]:s})}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return F(g({},r),{[pt]:n})}Encode(t){return Es(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};o(sy,"TransformEncodeBuilder");var oy=sy;function KS(e){return new ny(e)}o(KS,"Transform");c();function Qu(e={}){var t;return T({[v]:(t=e[v])!=null?t:"Unsafe"},e)}o(Qu,"Unsafe");c();function WS(e){return T({[v]:"Void",type:"void"},e)}o(WS,"Void");c();var ay={};To(ay,{Any:()=>Wo,Array:()=>Au,AsyncIterator:()=>ju,Awaited:()=>W_,BigInt:()=>Rs,Boolean:()=>Mu,Capitalize:()=>$S,Composite:()=>Z_,Const:()=>Y_,Constructor:()=>Nu,ConstructorParameters:()=>X_,Date:()=>Vu,Deref:()=>mn,Enum:()=>Q_,Exclude:()=>Us,Extends:()=>Ls,Extract:()=>Ds,Function:()=>Ho,Index:()=>Cs,InstanceType:()=>gS,Integer:()=>xS,Intersect:()=>$r,Iterator:()=>Du,KeyOf:()=>zu,Literal:()=>ze,Lowercase:()=>vS,Mapped:()=>V_,Never:()=>He,Not:()=>SS,Null:()=>Bu,Number:()=>Nn,Object:()=>Qe,Omit:()=>qs,Optional:()=>br,Parameters:()=>TS,Partial:()=>Yu,Pick:()=>zs,Promise:()=>qu,Readonly:()=>Gr,ReadonlyOptional:()=>RS,Record:()=>CS,Recursive:()=>MS,Ref:()=>LS,RegExp:()=>US,Required:()=>Xu,Rest:()=>VS,ReturnType:()=>BS,Strict:()=>GS,String:()=>Br,Symbol:()=>Gu,TemplateLiteral:()=>Lu,Transform:()=>KS,Tuple:()=>Rn,Uint8Array:()=>Wu,Uncapitalize:()=>OS,Undefined:()=>Ku,Union:()=>Je,Unknown:()=>go,Unsafe:()=>Qu,Uppercase:()=>_S,Void:()=>WS});c();var f=ay;var mt=o((e,t)=>f.Unsafe(f.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),"Ident"),er=mt("g","GeometryId"),je=mt("f","FloorId"),cy=[er,je];c();c();var Ic=f.Object({externalId:f.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:f.String({description:"The name of the entity."}),shortName:f.String({description:"A short name for the entity."}),description:f.String({description:"A description of the entity."}),icon:f.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),uy=f.Partial(Ic,{$id:"Details",description:"Additional information about a given entity."}),hn=f.Object({details:f.Optional(f.Ref(uy))},{$id:"WithDetails"}),Ri=o(e=>{let t=[...e].sort(),r=f.Pick(Ic,e),n=f.Omit(Ic,e);return f.Object({details:f.Intersect([r,f.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),fy=[Ic,uy];c();c();var ly=f.Record(f.String(),f.Unknown(),{$id:"Extra"}),gn=f.Object({extra:f.Optional(f.Ref(ly))}),py=[ly];c();c();var Vs=f.Object({geometryId:f.Ref(er),floorId:f.Ref(je)},{$id:"GeometryAnchor"}),L2=f.Object({geometryAnchor:f.Ref(Vs)}),Ci=o((e,t)=>f.Object({geometryAnchors:f.Array(f.Ref(Vs),e)},t),"WithGeometryAnchors"),dy=[Vs];c();c();c();c();c();var Bs=f.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),Gs=f.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),Mi=f.Tuple([f.Ref(Bs),f.Ref(Gs)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),tr=f.Object({type:f.Literal("Point"),coordinates:f.Ref(Mi)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),ef=f.Object({type:f.Literal("MultiPoint"),coordinates:f.Array(f.Ref(Mi))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),tf=f.Object({type:f.Literal("LineString"),coordinates:f.Array(f.Ref(Mi),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),rf=f.Object({type:f.Literal("MultiLineString"),coordinates:f.Array(f.Array(f.Ref(Mi),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),HS=f.Array(f.Ref(Mi),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),my=f.Array(f.Ref(HS),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),Ks=f.Object({type:f.Literal("Polygon"),coordinates:f.Ref(my)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),Ws=f.Object({type:f.Literal("MultiPolygon"),coordinates:f.Array(f.Ref(my))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),zt=o((e,t,r)=>f.Object({type:f.Literal("Feature"),geometry:e,properties:t},r),"Feature"),pr=o((e,t,r)=>f.Object({type:f.Literal("FeatureCollection"),features:f.Array(e,r)},t),"FeatureCollection"),yy=[Bs,Gs,Mi,tr,ef,tf,rf,HS,my,Ks,Ws];var JS=f.Intersect([f.Object({id:f.Ref(je),elevation:f.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:f.Optional(f.String({description:"The subtitle of the floor."}))}),hn],{$id:"FloorProperties"}),ZS=zt(f.Union([f.Ref(Ks),f.Ref(Ws),f.Null()]),f.Ref(JS),{$id:"FloorFeature"}),YS=pr(f.Ref(ZS),{$id:"FloorCollection"}),U2=f.Object({floors:f.Ref(YS)}),XS={name:"core:floors",intoBundle:o(function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},"fromBundle"),schema:U2,references:[JS,ZS,YS]};c();c();c();var hy=class hy{constructor(t){tt(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(hy,"OptionIterator");var nf=hy,gy=class gy{constructor(t){tt(this,"_tag","Some");tt(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return QS(t(this.value))}mapAsync(t){return t(this.value).then(r=>QS(r))}mapOr(t,r){return this.map(t).unwrapOr(r)}mapOrAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOr(r))}mapOrElse(t,r){return this.map(t).unwrapOrElse(r)}mapOrElseAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOrElse(r))}and(t){return t}andThen(t){return t(this.value)}andThenAsync(t){return t(this.value)}filter(t){return t(this.value)?this:Yo()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?Yo():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return B(this.value)}okOrElse(t){return B(this.value)}iter(){return new nf(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?Hs([this.value,t.value]):Yo()}zipWith(t,r){return t.isSome()?Hs(r(this.value,t.value)):Yo()}get[Symbol.toStringTag](){return"Some"}};o(gy,"Some");var of=gy,xy=class xy{constructor(){tt(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return W(t)}okOrElse(t){return W(t())}iter(){return new nf(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}};o(xy,"None");var sf=xy,Hs=o(e=>new of(e),"some"),Yo=o(()=>new sf,"none"),QS=o(e=>e instanceof of||e instanceof sf?e:e==null?Yo():Hs(e),"option");var wy=class wy{constructor(t){tt(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(wy,"ResultIterator");var af=wy,$y=class $y{constructor(t){tt(this,"_tag","Ok");tt(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return Hs(this.value)}err(){return Yo()}expect(t){return this.value}expectErr(t){throw new Error(t)}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectErr(){return this}map(t){return B(t(this.value))}async mapAsync(t){return t(this.value).then(B)}mapOr(t,r){return t(this.value)}async mapOrAsync(t,r){return t(this.value)}mapOrElse(t,r){return t(this.value)}async mapOrElseAsync(t,r){return t(this.value)}mapErr(t){return this}iter(){return new af(this.value)}[Symbol.iterator](){return this.iter()}and(t){return t}andThen(t){return t(this.value)}or(t){return this}orElse(t){return this}async andThenAsync(t){return t(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}};o($y,"Ok");var Iy=$y,cf=class cf{constructor(t){tt(this,"_tag","Err");tt(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return Yo()}err(){return Hs(this.error)}expect(t){throw new Error(t)}expectErr(t){return this.error}unwrap(){throw this.error}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(){return this}inspectErr(t){return t(this.error),this}map(t){return this}iter(){return new af(null)}[Symbol.iterator](){return this.iter()}async mapAsync(t){return this}mapOr(t,r){return r}async mapOrAsync(t,r){return r}mapOrElse(t,r){return r()}async mapOrElseAsync(t,r){return r()}mapErr(t){return new cf(t(this.error))}and(t){return this}andThen(t){return this}async andThenAsync(t){return this}or(t){return t}orElse(t){return t(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}};o(cf,"Err");var by=cf,B=o(e=>new Iy(e),"ok"),W=o(e=>new by(e),"err");c();var Cn;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(Cn||(Cn={}));var D2=o(e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},"createFloorMap"),Io=o(e=>{let t=D2(e);return o(n=>{let i=t.get(n);return i==null?W({kind:Cn.UnknownFloorError,properties:{floorId:n}}):B(i)},"floorLookup")},"createFloorLookup");c();c();c();c();var bt=o(e=>f.Unsafe(e),"PartialRecord");c();var Ke=o(e=>Object.keys(e),"typedKeys");c();var eP=o(e=>{if(e.floors==null)return W({kind:Cn.FloorMissingError,properties:null});if(e.geometry==null)return W({kind:Cn.GeometryMissingError,properties:null});let t=Io(e);for(let r of Ke(e.geometry)){let n=t(r);if(n.isErr())return n}return B(!0)},"validateGeometry");var tP=f.Intersect([f.Object({id:f.Ref(er)}),hn],{$id:"GeometryProperties"}),rP=zt(f.Union([f.Ref(tr),f.Ref(ef),f.Ref(tf),f.Ref(rf),f.Ref(Ks),f.Ref(Ws)]),f.Ref(tP),{$id:"GeometryFeature"}),nP=pr(f.Ref(rP),{$id:"GeometryCollection"}),q2=f.Object({geometry:bt(f.Record(je,f.Ref(nP),{additionalProperties:!1}))},{$id:"GeometrySchema"}),z2=/^geometry\/(.*)\.geojson$/,oP={name:"core:geometry",schema:q2,intoBundle:o(function*(e){if(e.geometry!=null)for(let t of Ke(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(z2))==null?void 0:i[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[tP,rP,nP],integrityCheck:eP};c();c();var rr=o(e=>Object.entries(e),"typedEntries");var V2=o(e=>{var r;let t=new Map;for(let[n,i]of rr((r=e.geometry)!=null?r:{}))t.set(n,new Map(i==null?void 0:i.features.map(s=>[s.properties.id,s])));return t},"createLookupMap"),kt=o(e=>{let t=V2(e);return o((n,i)=>{let s=t.get(n);if(s==null)return W({kind:Cn.UnknownFloorError,properties:{floorId:n}});let a=s.get(i);return a==null?W({kind:Cn.UnknownGeometryError,properties:{floorId:n,geometryId:i}}):B(a)},"geometryLookup")},"createGeometryLookup");c();var vy=f.Object({type:f.Literal("file"),name:f.String({description:"The name of the file."})},{$id:"ManifestFile"}),iP=f.Recursive(e=>f.Object({type:f.Literal("folder"),name:f.String({description:"The name of the folder."}),children:f.Array(f.Union([e,f.Ref(vy)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),sP=f.Object({name:f.String({description:"The name of the map."}),version:f.Literal("3.0.0",{description:"The version of the manifest."}),orgId:f.Optional(f.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:f.Optional(f.String({description:"The identifier of the map that this MVF is for."})),contents:f.Array(f.Union([f.Ref(iP),f.Ref(vy)]),{minItems:1,description:"The contents of the MVF bundle."}),time:f.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:f.Optional(f.Unsafe(f.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:f.Optional(f.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:f.Optional(f.Ref(je,{description:"The default floor ID of the map."})),language:f.Optional(f.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),aP=pr(zt(tr,f.Ref(sP)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),B2=f.Object({manifest:f.Ref(aP)}),cP={name:"core:manifest",intoBundle:o(function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},"fromBundle"),schema:B2,references:[vy,iP,sP,aP]};var Jr=f.Object({geometryId:f.Ref(er)},{$id:"WithGeometryId"}),uf=f.Object({geometryIds:f.Array(f.Ref(er))},{$id:"WithGeometryIds"}),Oy=[Jr,uf];c();c();var uP=o((e,t)=>f.Unsafe(f.Transform(f.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),Or=o((e,t)=>{let r=uP(e,t),n=[...e,"unknown"],i=Object.freeze(Object.fromEntries([...e,"unknown"].map(s=>[s,s])));return{schema:r,values:n,record:i}},"SafeStringEnum");c();c();c();var bc;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(bc||(bc={}));var fP=o(e=>{var n;if(e.annotations==null)return B(!0);let t=kt(e),r=new Set(Ke((n=e.annotationSymbols)!=null?n:{}));for(let i of Ke(e.annotations)){let s=e.annotations[i];if(s!=null)for(let a of s){if(!r.has(a.symbolKey))return W({kind:bc.AnnotationUnknownSymbolError,properties:{annotationId:a.id,symbolKey:a.symbolKey}});let u=t(i,a.geometryId);if(u.isErr())return u;if(u.value.geometry.type!=="Point")return W({kind:bc.AnnotationNonPointGeometryError,properties:{annotationId:a.id,floorId:i,geometryId:a.geometryId}})}}return B(!0)},"validateAnnotations");var lP=mt("a","AnnotationId"),_y=f.Intersect([Jr,f.Object({id:f.Ref(lP,{description:"The unique identifier for the annotation."}),externalId:f.Optional(f.String({description:"The external identifier for the annotation."})),symbolKey:f.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),pP=f.Object({url:f.String({format:"uri",description:"The URL for the symbol."}),name:f.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),G2=f.Object({annotations:bt(f.Record(je,f.Array(f.Ref(_y)),{additionalProperties:!1})),annotationSymbols:bt(f.Record(f.Index(_y,["symbolKey"]),f.Ref(pP)))},{$id:"AnnotationsSchema"}),K2=/^annotations\/(.*)\.json$/,dP={name:"ext:mvf-annotations",schema:G2,intoBundle:o(function*(e){if(e.annotations!=null)for(let t of Ke(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},"intoBundle"),fromBundle:o((e,t,r)=>{var i;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(i=e.match(K2))==null?void 0:i[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[lP,_y,pP],integrityCheck:fP};c();c();c();c();c();c();c();c();var Py=class Py extends re{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};o(Py,"TypeSystemDuplicateTypeKind");var Sy=Py,Ey=class Ey extends re{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};o(Ey,"TypeSystemDuplicateFormat");var wc=Ey,ff;(function(e){function t(n,i){if(Tt.Has(n))throw new Sy(n);return Tt.Set(n,i),(s={})=>Qu(F(g({},s),{[v]:n}))}o(t,"Type"),e.Type=t;function r(n,i){if(lr.Has(n))throw new wc(n);return lr.Set(n,i),n}o(r,"Format"),e.Format=r})(ff||(ff={}));c();c();c();function W2(e){switch(e.errorType){case S.ArrayContains:return"Expected array to contain at least one matching value";case S.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case S.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case S.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case S.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case S.ArrayUniqueItems:return"Expected array elements to be unique";case S.Array:return"Expected array";case S.AsyncIterator:return"Expected AsyncIterator";case S.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case S.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case S.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case S.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case S.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case S.BigInt:return"Expected bigint";case S.Boolean:return"Expected boolean";case S.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case S.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case S.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case S.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case S.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case S.Date:return"Expected Date";case S.Function:return"Expected function";case S.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case S.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case S.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case S.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case S.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case S.Integer:return"Expected integer";case S.IntersectUnevaluatedProperties:return"Unexpected property";case S.Intersect:return"Expected all values to match";case S.Iterator:return"Expected Iterator";case S.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case S.Never:return"Never";case S.Not:return"Value should not match";case S.Null:return"Expected null";case S.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case S.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case S.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case S.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case S.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case S.Number:return"Expected number";case S.Object:return"Expected object";case S.ObjectAdditionalProperties:return"Unexpected property";case S.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case S.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case S.ObjectRequiredProperty:return"Expected required property";case S.Promise:return"Expected Promise";case S.RegExp:return"Expected string to match regular expression";case S.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case S.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case S.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case S.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case S.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case S.String:return"Expected string";case S.Symbol:return"Expected symbol";case S.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case S.Tuple:return"Expected tuple";case S.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case S.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case S.Uint8Array:return"Expected Uint8Array";case S.Undefined:return"Expected undefined";case S.Union:return"Expected union value";case S.Void:return"Expected void";case S.Kind:return"Expected kind '".concat(e.schema[v],"'");default:return"Unknown error type"}}o(W2,"DefaultErrorFunction");var H2=W2;function mP(){return H2}o(mP,"GetErrorFunction");c();var ky=class ky extends re{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};o(ky,"TypeDereferenceError");var Ty=ky;function J2(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new Ty(e);return Ne(r,t)}o(J2,"Resolve");function Zr(e,t){return!_e(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(Zr,"Pushref");function Ne(e,t){return e[v]==="This"||e[v]==="Ref"?J2(e,t):e}o(Ne,"Deref");c();var Ay=class Ay extends re{constructor(t){super("Unable to hash value"),this.value=t}};o(Ay,"ValueHashError");var Fy=Ay,Er;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(Er||(Er={}));var Js=BigInt("14695981039346656037"),[Z2,Y2]=[BigInt("1099511628211"),BigInt("18446744073709551616")],X2=Array.from({length:256}).map((e,t)=>BigInt(t)),yP=new Float64Array(1),hP=new DataView(yP.buffer),gP=new Uint8Array(yP.buffer);function*Q2(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}o(Q2,"NumberToBytes");function eD(e){nr(Er.Array);for(let t of e)Zs(t)}o(eD,"ArrayType");function tD(e){nr(Er.Boolean),nr(e?1:0)}o(tD,"BooleanType");function rD(e){nr(Er.BigInt),hP.setBigInt64(0,e);for(let t of gP)nr(t)}o(rD,"BigIntType");function nD(e){nr(Er.Date),Zs(e.getTime())}o(nD,"DateType");function oD(e){nr(Er.Null)}o(oD,"NullType");function iD(e){nr(Er.Number),hP.setFloat64(0,e);for(let t of gP)nr(t)}o(iD,"NumberType");function sD(e){nr(Er.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Zs(t),Zs(e[t])}o(sD,"ObjectType");function aD(e){nr(Er.String);for(let t=0;t<e.length;t++)for(let r of Q2(e.charCodeAt(t)))nr(r)}o(aD,"StringType");function cD(e){nr(Er.Symbol),Zs(e.description)}o(cD,"SymbolType");function uD(e){nr(Er.Uint8Array);for(let t=0;t<e.length;t++)nr(e[t])}o(uD,"Uint8ArrayType");function fD(e){return nr(Er.Undefined)}o(fD,"UndefinedType");function Zs(e){if(se(e))return eD(e);if(Fn(e))return tD(e);if(Dt(e))return rD(e);if(ur(e))return nD(e);if(ao(e))return oD(e);if(X(e))return iD(e);if(ae(e))return sD(e);if(_e(e))return aD(e);if(co(e))return cD(e);if(Ps(e))return uD(e);if(ht(e))return fD(e);throw new Fy(e)}o(Zs,"Visit");function nr(e){Js=Js^X2[e],Js=Js*Z2%Y2}o(nr,"FNV1A64");function Xo(e){return Js=BigInt("14695981039346656037"),Zs(e),Js}o(Xo,"Hash");c();var Ny=class Ny extends re{constructor(t){super("Unknown type"),this.schema=t}};o(Ny,"ValueCheckUnknownTypeError");var jy=Ny;function lD(e){return e[v]==="Any"||e[v]==="Unknown"}o(lD,"IsAnyOrUnknown");function Ie(e){return e!==void 0}o(Ie,"IsDefined");function pD(e,t,r){return!0}o(pD,"FromAny");function dD(e,t,r){if(!se(r)||Ie(e.minItems)&&!(r.length>=e.minItems)||Ie(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(s=>Vt(e.items,t,s))||e.uniqueItems===!0&&!function(){let s=new Set;for(let a of r){let u=Xo(a);if(s.has(u))return!1;s.add(u)}return!0}())return!1;if(!(Ie(e.contains)||X(e.minContains)||X(e.maxContains)))return!0;let n=Ie(e.contains)?e.contains:He(),i=r.reduce((s,a)=>Vt(n,t,a)?s+1:s,0);return!(i===0||X(e.minContains)&&i<e.minContains||X(e.maxContains)&&i>e.maxContains)}o(dD,"FromArray");function mD(e,t,r){return Eu(r)}o(mD,"FromAsyncIterator");function yD(e,t,r){return!(!Dt(r)||Ie(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ie(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ie(e.maximum)&&!(r<=e.maximum)||Ie(e.minimum)&&!(r>=e.minimum)||Ie(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}o(yD,"FromBigInt");function hD(e,t,r){return Fn(r)}o(hD,"FromBoolean");function gD(e,t,r){return Vt(e.returns,t,r.prototype)}o(gD,"FromConstructor");function xD(e,t,r){return!(!ur(r)||Ie(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||Ie(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||Ie(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||Ie(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||Ie(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}o(xD,"FromDate");function ID(e,t,r){return Bo(r)}o(ID,"FromFunction");function bD(e,t,r){return!(!Fu(r)||Ie(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ie(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ie(e.maximum)&&!(r<=e.maximum)||Ie(e.minimum)&&!(r>=e.minimum)||Ie(e.multipleOf)&&r%e.multipleOf!==0)}o(bD,"FromInteger");function wD(e,t,r){let n=e.allOf.every(i=>Vt(i,t,r));if(e.unevaluatedProperties===!1){let i=new RegExp(ho(e)),s=Object.getOwnPropertyNames(r).every(a=>i.test(a));return n&&s}else if(Se(e.unevaluatedProperties)){let i=new RegExp(ho(e)),s=Object.getOwnPropertyNames(r).every(a=>i.test(a)||Vt(e.unevaluatedProperties,t,r[a]));return n&&s}else return n}o(wD,"FromIntersect");function $D(e,t,r){return Tu(r)}o($D,"FromIterator");function vD(e,t,r){return r===e.const}o(vD,"FromLiteral");function OD(e,t,r){return!1}o(OD,"FromNever");function _D(e,t,r){return!Vt(e.not,t,r)}o(_D,"FromNot");function SD(e,t,r){return ao(r)}o(SD,"FromNull");function PD(e,t,r){return!(!Ge.IsNumberLike(r)||Ie(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ie(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ie(e.minimum)&&!(r>=e.minimum)||Ie(e.maximum)&&!(r<=e.maximum)||Ie(e.multipleOf)&&r%e.multipleOf!==0)}o(PD,"FromNumber");function ED(e,t,r){if(!Ge.IsObjectLike(r)||Ie(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ie(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let i of n){let s=e.properties[i];if(e.required&&e.required.includes(i)){if(!Vt(s,t,r[i])||(xo(s)||lD(s))&&!(i in r))return!1}else if(Ge.IsExactOptionalProperty(r,i)&&!Vt(s,t,r[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&i.length===n.length?!0:i.every(s=>n.includes(s))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||Vt(e.additionalProperties,t,r[s])):!0}o(ED,"FromObject");function TD(e,t,r){return ku(r)}o(TD,"FromPromise");function kD(e,t,r){if(!Ge.IsRecordLike(r)||Ie(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ie(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,i]=Object.entries(e.patternProperties)[0],s=new RegExp(n),a=Object.entries(r).every(([d,m])=>s.test(d)?Vt(i,t,m):!0),u=typeof e.additionalProperties=="object"?Object.entries(r).every(([d,m])=>s.test(d)?!0:Vt(e.additionalProperties,t,m)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return a&&u&&l}o(kD,"FromRecord");function FD(e,t,r){return Vt(Ne(e,t),t,r)}o(FD,"FromRef");function AD(e,t,r){let n=new RegExp(e.source,e.flags);return Ie(e.minLength)&&!(r.length>=e.minLength)||Ie(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}o(AD,"FromRegExp");function jD(e,t,r){return!_e(r)||Ie(e.minLength)&&!(r.length>=e.minLength)||Ie(e.maxLength)&&!(r.length<=e.maxLength)||Ie(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:Ie(e.format)?lr.Has(e.format)?lr.Get(e.format)(r):!1:!0}o(jD,"FromString");function ND(e,t,r){return co(r)}o(ND,"FromSymbol");function RD(e,t,r){return _e(r)&&new RegExp(e.pattern).test(r)}o(RD,"FromTemplateLiteral");function CD(e,t,r){return Vt(Ne(e,t),t,r)}o(CD,"FromThis");function MD(e,t,r){if(!se(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!Vt(e.items[n],t,r[n]))return!1;return!0}o(MD,"FromTuple");function LD(e,t,r){return ht(r)}o(LD,"FromUndefined");function UD(e,t,r){return e.anyOf.some(n=>Vt(n,t,r))}o(UD,"FromUnion");function DD(e,t,r){return!(!Ps(r)||Ie(e.maxByteLength)&&!(r.length<=e.maxByteLength)||Ie(e.minByteLength)&&!(r.length>=e.minByteLength))}o(DD,"FromUint8Array");function qD(e,t,r){return!0}o(qD,"FromUnknown");function zD(e,t,r){return Ge.IsVoidLike(r)}o(zD,"FromVoid");function VD(e,t,r){return Tt.Has(e[v])?Tt.Get(e[v])(e,r):!1}o(VD,"FromKind");function Vt(e,t,r){let n=Ie(e.$id)?[...t,e]:t,i=e;switch(i[v]){case"Any":return pD(i,n,r);case"Array":return dD(i,n,r);case"AsyncIterator":return mD(i,n,r);case"BigInt":return yD(i,n,r);case"Boolean":return hD(i,n,r);case"Constructor":return gD(i,n,r);case"Date":return xD(i,n,r);case"Function":return ID(i,n,r);case"Integer":return bD(i,n,r);case"Intersect":return wD(i,n,r);case"Iterator":return $D(i,n,r);case"Literal":return vD(i,n,r);case"Never":return OD(i,n,r);case"Not":return _D(i,n,r);case"Null":return SD(i,n,r);case"Number":return PD(i,n,r);case"Object":return ED(i,n,r);case"Promise":return TD(i,n,r);case"Record":return kD(i,n,r);case"Ref":return FD(i,n,r);case"RegExp":return AD(i,n,r);case"String":return jD(i,n,r);case"Symbol":return ND(i,n,r);case"TemplateLiteral":return RD(i,n,r);case"This":return CD(i,n,r);case"Tuple":return MD(i,n,r);case"Undefined":return LD(i,n,r);case"Union":return UD(i,n,r);case"Uint8Array":return DD(i,n,r);case"Unknown":return qD(i,n,r);case"Void":return zD(i,n,r);default:if(!Tt.Has(i[v]))throw new jy(i);return VD(i,n,r)}}o(Vt,"Visit");function he(...e){return e.length===3?Vt(e[0],e[1],e[2]):Vt(e[0],[],e[1])}o(he,"Check");var S;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(S||(S={}));var Cy=class Cy extends re{constructor(t){super("Unknown type"),this.schema=t}};o(Cy,"ValueErrorsUnknownTypeError");var Ry=Cy;function bo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(bo,"EscapeKey");function be(e){return e!==void 0}o(be,"IsDefined");var My=class My{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};o(My,"ValueErrorIterator");var Yr=My;function L(e,t,r,n,i=[]){return{type:e,schema:t,path:r,value:n,message:mP()({errorType:e,path:r,schema:t,value:n,errors:i}),errors:i}}o(L,"Create");function*BD(e,t,r,n){}o(BD,"FromAny");function*GD(e,t,r,n){if(!se(n))return yield L(S.Array,e,r,n);be(e.minItems)&&!(n.length>=e.minItems)&&(yield L(S.ArrayMinItems,e,r,n)),be(e.maxItems)&&!(n.length<=e.maxItems)&&(yield L(S.ArrayMaxItems,e,r,n));for(let a=0;a<n.length;a++)yield*A(Bt(e.items,t,"".concat(r,"/").concat(a),n[a]));if(e.uniqueItems===!0&&!function(){let a=new Set;for(let u of n){let l=Xo(u);if(a.has(l))return!1;a.add(l)}return!0}()&&(yield L(S.ArrayUniqueItems,e,r,n)),!(be(e.contains)||be(e.minContains)||be(e.maxContains)))return;let i=be(e.contains)?e.contains:He(),s=n.reduce((a,u,l)=>Bt(i,t,"".concat(r).concat(l),u).next().done===!0?a+1:a,0);s===0&&(yield L(S.ArrayContains,e,r,n)),X(e.minContains)&&s<e.minContains&&(yield L(S.ArrayMinContains,e,r,n)),X(e.maxContains)&&s>e.maxContains&&(yield L(S.ArrayMaxContains,e,r,n))}o(GD,"FromArray");function*KD(e,t,r,n){Eu(n)||(yield L(S.AsyncIterator,e,r,n))}o(KD,"FromAsyncIterator");function*WD(e,t,r,n){if(!Dt(n))return yield L(S.BigInt,e,r,n);be(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield L(S.BigIntExclusiveMaximum,e,r,n)),be(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield L(S.BigIntExclusiveMinimum,e,r,n)),be(e.maximum)&&!(n<=e.maximum)&&(yield L(S.BigIntMaximum,e,r,n)),be(e.minimum)&&!(n>=e.minimum)&&(yield L(S.BigIntMinimum,e,r,n)),be(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield L(S.BigIntMultipleOf,e,r,n))}o(WD,"FromBigInt");function*HD(e,t,r,n){Fn(n)||(yield L(S.Boolean,e,r,n))}o(HD,"FromBoolean");function*JD(e,t,r,n){yield*A(Bt(e.returns,t,r,n.prototype))}o(JD,"FromConstructor");function*ZD(e,t,r,n){if(!ur(n))return yield L(S.Date,e,r,n);be(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield L(S.DateExclusiveMaximumTimestamp,e,r,n)),be(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield L(S.DateExclusiveMinimumTimestamp,e,r,n)),be(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield L(S.DateMaximumTimestamp,e,r,n)),be(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield L(S.DateMinimumTimestamp,e,r,n)),be(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield L(S.DateMultipleOfTimestamp,e,r,n))}o(ZD,"FromDate");function*YD(e,t,r,n){Bo(n)||(yield L(S.Function,e,r,n))}o(YD,"FromFunction");function*XD(e,t,r,n){if(!Fu(n))return yield L(S.Integer,e,r,n);be(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield L(S.IntegerExclusiveMaximum,e,r,n)),be(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield L(S.IntegerExclusiveMinimum,e,r,n)),be(e.maximum)&&!(n<=e.maximum)&&(yield L(S.IntegerMaximum,e,r,n)),be(e.minimum)&&!(n>=e.minimum)&&(yield L(S.IntegerMinimum,e,r,n)),be(e.multipleOf)&&n%e.multipleOf!==0&&(yield L(S.IntegerMultipleOf,e,r,n))}o(XD,"FromInteger");function*QD(e,t,r,n){let i=!1;for(let s of e.allOf)for(let a of Bt(s,t,r,n))i=!0,yield a;if(i)return yield L(S.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let s=new RegExp(ho(e));for(let a of Object.getOwnPropertyNames(n))s.test(a)||(yield L(S.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(a),n))}if(typeof e.unevaluatedProperties=="object"){let s=new RegExp(ho(e));for(let a of Object.getOwnPropertyNames(n))if(!s.test(a)){let u=Bt(e.unevaluatedProperties,t,"".concat(r,"/").concat(a),n[a]).next();u.done||(yield u.value)}}}o(QD,"FromIntersect");function*eq(e,t,r,n){Tu(n)||(yield L(S.Iterator,e,r,n))}o(eq,"FromIterator");function*tq(e,t,r,n){n!==e.const&&(yield L(S.Literal,e,r,n))}o(tq,"FromLiteral");function*rq(e,t,r,n){yield L(S.Never,e,r,n)}o(rq,"FromNever");function*nq(e,t,r,n){Bt(e.not,t,r,n).next().done===!0&&(yield L(S.Not,e,r,n))}o(nq,"FromNot");function*oq(e,t,r,n){ao(n)||(yield L(S.Null,e,r,n))}o(oq,"FromNull");function*iq(e,t,r,n){if(!Ge.IsNumberLike(n))return yield L(S.Number,e,r,n);be(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield L(S.NumberExclusiveMaximum,e,r,n)),be(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield L(S.NumberExclusiveMinimum,e,r,n)),be(e.maximum)&&!(n<=e.maximum)&&(yield L(S.NumberMaximum,e,r,n)),be(e.minimum)&&!(n>=e.minimum)&&(yield L(S.NumberMinimum,e,r,n)),be(e.multipleOf)&&n%e.multipleOf!==0&&(yield L(S.NumberMultipleOf,e,r,n))}o(iq,"FromNumber");function*sq(e,t,r,n){if(!Ge.IsObjectLike(n))return yield L(S.Object,e,r,n);be(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield L(S.ObjectMinProperties,e,r,n)),be(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield L(S.ObjectMaxProperties,e,r,n));let i=Array.isArray(e.required)?e.required:[],s=Object.getOwnPropertyNames(e.properties),a=Object.getOwnPropertyNames(n);for(let u of i)a.includes(u)||(yield L(S.ObjectRequiredProperty,e.properties[u],"".concat(r,"/").concat(bo(u)),void 0));if(e.additionalProperties===!1)for(let u of a)s.includes(u)||(yield L(S.ObjectAdditionalProperties,e,"".concat(r,"/").concat(bo(u)),n[u]));if(typeof e.additionalProperties=="object")for(let u of a)s.includes(u)||(yield*A(Bt(e.additionalProperties,t,"".concat(r,"/").concat(bo(u)),n[u])));for(let u of s){let l=e.properties[u];e.required&&e.required.includes(u)?(yield*A(Bt(l,t,"".concat(r,"/").concat(bo(u)),n[u])),xo(e)&&!(u in n)&&(yield L(S.ObjectRequiredProperty,l,"".concat(r,"/").concat(bo(u)),void 0))):Ge.IsExactOptionalProperty(n,u)&&(yield*A(Bt(l,t,"".concat(r,"/").concat(bo(u)),n[u])))}}o(sq,"FromObject");function*aq(e,t,r,n){ku(n)||(yield L(S.Promise,e,r,n))}o(aq,"FromPromise");function*cq(e,t,r,n){if(!Ge.IsRecordLike(n))return yield L(S.Object,e,r,n);be(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield L(S.ObjectMinProperties,e,r,n)),be(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield L(S.ObjectMaxProperties,e,r,n));let[i,s]=Object.entries(e.patternProperties)[0],a=new RegExp(i);for(let[u,l]of Object.entries(n))a.test(u)&&(yield*A(Bt(s,t,"".concat(r,"/").concat(bo(u)),l)));if(typeof e.additionalProperties=="object")for(let[u,l]of Object.entries(n))a.test(u)||(yield*A(Bt(e.additionalProperties,t,"".concat(r,"/").concat(bo(u)),l)));if(e.additionalProperties===!1){for(let[u,l]of Object.entries(n))if(!a.test(u))return yield L(S.ObjectAdditionalProperties,e,"".concat(r,"/").concat(bo(u)),l)}}o(cq,"FromRecord");function*uq(e,t,r,n){yield*A(Bt(Ne(e,t),t,r,n))}o(uq,"FromRef");function*fq(e,t,r,n){if(!_e(n))return yield L(S.String,e,r,n);if(be(e.minLength)&&!(n.length>=e.minLength)&&(yield L(S.StringMinLength,e,r,n)),be(e.maxLength)&&!(n.length<=e.maxLength)&&(yield L(S.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield L(S.RegExp,e,r,n)}o(fq,"FromRegExp");function*lq(e,t,r,n){if(!_e(n))return yield L(S.String,e,r,n);be(e.minLength)&&!(n.length>=e.minLength)&&(yield L(S.StringMinLength,e,r,n)),be(e.maxLength)&&!(n.length<=e.maxLength)&&(yield L(S.StringMaxLength,e,r,n)),_e(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield L(S.StringPattern,e,r,n))),_e(e.format)&&(lr.Has(e.format)?lr.Get(e.format)(n)||(yield L(S.StringFormat,e,r,n)):yield L(S.StringFormatUnknown,e,r,n))}o(lq,"FromString");function*pq(e,t,r,n){co(n)||(yield L(S.Symbol,e,r,n))}o(pq,"FromSymbol");function*dq(e,t,r,n){if(!_e(n))return yield L(S.String,e,r,n);new RegExp(e.pattern).test(n)||(yield L(S.StringPattern,e,r,n))}o(dq,"FromTemplateLiteral");function*mq(e,t,r,n){yield*A(Bt(Ne(e,t),t,r,n))}o(mq,"FromThis");function*yq(e,t,r,n){if(!se(n))return yield L(S.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield L(S.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield L(S.TupleLength,e,r,n);if(e.items)for(let i=0;i<e.items.length;i++)yield*A(Bt(e.items[i],t,"".concat(r,"/").concat(i),n[i]))}o(yq,"FromTuple");function*hq(e,t,r,n){ht(n)||(yield L(S.Undefined,e,r,n))}o(hq,"FromUndefined");function*gq(e,t,r,n){if(he(e,t,n))return;let i=e.anyOf.map(s=>new Yr(Bt(s,t,r,n)));yield L(S.Union,e,r,n,i)}o(gq,"FromUnion");function*xq(e,t,r,n){if(!Ps(n))return yield L(S.Uint8Array,e,r,n);be(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield L(S.Uint8ArrayMaxByteLength,e,r,n)),be(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield L(S.Uint8ArrayMinByteLength,e,r,n))}o(xq,"FromUint8Array");function*Iq(e,t,r,n){}o(Iq,"FromUnknown");function*bq(e,t,r,n){Ge.IsVoidLike(n)||(yield L(S.Void,e,r,n))}o(bq,"FromVoid");function*wq(e,t,r,n){Tt.Get(e[v])(e,n)||(yield L(S.Kind,e,r,n))}o(wq,"FromKind");function*Bt(e,t,r,n){let i=be(e.$id)?[...t,e]:t,s=e;switch(s[v]){case"Any":return yield*A(BD(s,i,r,n));case"Array":return yield*A(GD(s,i,r,n));case"AsyncIterator":return yield*A(KD(s,i,r,n));case"BigInt":return yield*A(WD(s,i,r,n));case"Boolean":return yield*A(HD(s,i,r,n));case"Constructor":return yield*A(JD(s,i,r,n));case"Date":return yield*A(ZD(s,i,r,n));case"Function":return yield*A(YD(s,i,r,n));case"Integer":return yield*A(XD(s,i,r,n));case"Intersect":return yield*A(QD(s,i,r,n));case"Iterator":return yield*A(eq(s,i,r,n));case"Literal":return yield*A(tq(s,i,r,n));case"Never":return yield*A(rq(s,i,r,n));case"Not":return yield*A(nq(s,i,r,n));case"Null":return yield*A(oq(s,i,r,n));case"Number":return yield*A(iq(s,i,r,n));case"Object":return yield*A(sq(s,i,r,n));case"Promise":return yield*A(aq(s,i,r,n));case"Record":return yield*A(cq(s,i,r,n));case"Ref":return yield*A(uq(s,i,r,n));case"RegExp":return yield*A(fq(s,i,r,n));case"String":return yield*A(lq(s,i,r,n));case"Symbol":return yield*A(pq(s,i,r,n));case"TemplateLiteral":return yield*A(dq(s,i,r,n));case"This":return yield*A(mq(s,i,r,n));case"Tuple":return yield*A(yq(s,i,r,n));case"Undefined":return yield*A(hq(s,i,r,n));case"Union":return yield*A(gq(s,i,r,n));case"Uint8Array":return yield*A(xq(s,i,r,n));case"Unknown":return yield*A(Iq(s,i,r,n));case"Void":return yield*A(bq(s,i,r,n));default:if(!Tt.Has(s[v]))throw new Ry(e);return yield*A(wq(s,i,r,n))}}o(Bt,"Visit");function Mn(...e){let t=e.length===3?Bt(e[0],e[1],"",e[2]):Bt(e[0],[],"",e[1]);return new Yr(t)}o(Mn,"Errors");c();var $q=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},IP=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ly,lf,bP,Dy=class Dy extends re{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),Ly.add(this),lf.set(this,void 0),$q(this,lf,t,"f"),this.error=r}Errors(){return new Yr(IP(this,Ly,"m",bP).call(this))}};o(Dy,"AssertError");var Uy=Dy;lf=new WeakMap,Ly=new WeakSet,bP=o(function*(){this.error&&(yield this.error),yield*A(IP(this,lf,"f"))},"_AssertError_Iterator");function xP(e,t,r){if(!he(e,t,r))throw new Uy(Mn(e,t,r))}o(xP,"AssertValue");function pf(...e){return e.length===3?xP(e[0],e[1],e[2]):xP(e[0],[],e[1])}o(pf,"Assert");c();c();c();function vq(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Re(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Re(e[r]);return t}o(vq,"FromObject");function Oq(e){return e.map(t=>Re(t))}o(Oq,"FromArray");function _q(e){return e.slice()}o(_q,"FromTypedArray");function Sq(e){return new Map(Re([...e.entries()]))}o(Sq,"FromMap");function Pq(e){return new Set(Re([...e.entries()]))}o(Pq,"FromSet");function Eq(e){return new Date(e.toISOString())}o(Eq,"FromDate");function Re(e){if(se(e))return Oq(e);if(ur(e))return Eq(e);if(zr(e))return _q(e);if(UO(e))return Sq(e);if(DO(e))return Pq(e);if(ae(e))return vq(e);if(qt(e))return e;throw new Error("ValueClone: Unable to clone value")}o(Re,"Clone");var qy=class qy extends re{constructor(t,r){super(r),this.schema=t}};o(qy,"ValueCreateError");var Tr=qy;function Ce(e){return Bo(e)?e():Re(e)}o(Ce,"FromDefault");function Tq(e,t){return ne(e,"default")?Ce(e.default):{}}o(Tq,"FromAny");function kq(e,t){if(e.uniqueItems===!0&&!ne(e,"default"))throw new Tr(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!ne(e,"default"))throw new Tr(e,"Array with the contains constraint requires a default value");return"default"in e?Ce(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>kr(e.items,t)):[]}o(kq,"FromArray");function Fq(e,t){return ne(e,"default")?Ce(e.default):function(){return pg(this,null,function*(){})}()}o(Fq,"FromAsyncIterator");function Aq(e,t){return ne(e,"default")?Ce(e.default):BigInt(0)}o(Aq,"FromBigInt");function jq(e,t){return ne(e,"default")?Ce(e.default):!1}o(jq,"FromBoolean");function Nq(e,t){if(ne(e,"default"))return Ce(e.default);{let r=kr(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,i]of Object.entries(r)){let s=this;s[n]=i}}}:class{}}}o(Nq,"FromConstructor");function Rq(e,t){return ne(e,"default")?Ce(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}o(Rq,"FromDate");function Cq(e,t){return ne(e,"default")?Ce(e.default):()=>kr(e.returns,t)}o(Cq,"FromFunction");function Mq(e,t){return ne(e,"default")?Ce(e.default):e.minimum!==void 0?e.minimum:0}o(Mq,"FromInteger");function Lq(e,t){if(ne(e,"default"))return Ce(e.default);{let r=e.allOf.reduce((n,i)=>{let s=kr(i,t);return typeof s=="object"?g(g({},n),s):s},{});if(!he(e,t,r))throw new Tr(e,"Intersect produced invalid value. Consider using a default value.");return r}}o(Lq,"FromIntersect");function Uq(e,t){return ne(e,"default")?Ce(e.default):function*(){}()}o(Uq,"FromIterator");function Dq(e,t){return ne(e,"default")?Ce(e.default):e.const}o(Dq,"FromLiteral");function qq(e,t){if(ne(e,"default"))return Ce(e.default);throw new Tr(e,"Never types cannot be created. Consider using a default value.")}o(qq,"FromNever");function zq(e,t){if(ne(e,"default"))return Ce(e.default);throw new Tr(e,"Not types must have a default value")}o(zq,"FromNot");function Vq(e,t){return ne(e,"default")?Ce(e.default):null}o(Vq,"FromNull");function Bq(e,t){return ne(e,"default")?Ce(e.default):e.minimum!==void 0?e.minimum:0}o(Bq,"FromNumber");function Gq(e,t){if(ne(e,"default"))return Ce(e.default);{let r=new Set(e.required),n={};for(let[i,s]of Object.entries(e.properties))r.has(i)&&(n[i]=kr(s,t));return n}}o(Gq,"FromObject");function Kq(e,t){return ne(e,"default")?Ce(e.default):Promise.resolve(kr(e.item,t))}o(Kq,"FromPromise");function Wq(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(ne(e,"default"))return Ce(e.default);if(r===mo||r===po)return{};{let i=r.slice(1,r.length-1).split("|"),s={};for(let a of i)s[a]=kr(n,t);return s}}o(Wq,"FromRecord");function Hq(e,t){return ne(e,"default")?Ce(e.default):kr(Ne(e,t),t)}o(Hq,"FromRef");function Jq(e,t){if(ne(e,"default"))return Ce(e.default);throw new Tr(e,"RegExp types cannot be created. Consider using a default value.")}o(Jq,"FromRegExp");function Zq(e,t){if(e.pattern!==void 0){if(ne(e,"default"))return Ce(e.default);throw new Tr(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(ne(e,"default"))return Ce(e.default);throw new Tr(e,"String types with formats must specify a default value")}else return ne(e,"default")?Ce(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}o(Zq,"FromString");function Yq(e,t){return ne(e,"default")?Ce(e.default):"value"in e?Symbol.for(e.value):Symbol()}o(Yq,"FromSymbol");function Xq(e,t){if(ne(e,"default"))return Ce(e.default);if(!Cu(e))throw new Tr(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Ns(e)[0]}o(Xq,"FromTemplateLiteral");function Qq(e,t){if(wP++>a9)throw new Tr(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return ne(e,"default")?Ce(e.default):kr(Ne(e,t),t)}o(Qq,"FromThis");function e9(e,t){return ne(e,"default")?Ce(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>kr(e.items[n],t))}o(e9,"FromTuple");function t9(e,t){if(ne(e,"default"))return Ce(e.default)}o(t9,"FromUndefined");function r9(e,t){if(ne(e,"default"))return Ce(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return kr(e.anyOf[0],t)}o(r9,"FromUnion");function n9(e,t){return ne(e,"default")?Ce(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}o(n9,"FromUint8Array");function o9(e,t){return ne(e,"default")?Ce(e.default):{}}o(o9,"FromUnknown");function i9(e,t){if(ne(e,"default"))return Ce(e.default)}o(i9,"FromVoid");function s9(e,t){if(ne(e,"default"))return Ce(e.default);throw new Error("User defined types must specify a default value")}o(s9,"FromKind");function kr(e,t){let r=Zr(e,t),n=e;switch(n[v]){case"Any":return Tq(n,r);case"Array":return kq(n,r);case"AsyncIterator":return Fq(n,r);case"BigInt":return Aq(n,r);case"Boolean":return jq(n,r);case"Constructor":return Nq(n,r);case"Date":return Rq(n,r);case"Function":return Cq(n,r);case"Integer":return Mq(n,r);case"Intersect":return Lq(n,r);case"Iterator":return Uq(n,r);case"Literal":return Dq(n,r);case"Never":return qq(n,r);case"Not":return zq(n,r);case"Null":return Vq(n,r);case"Number":return Bq(n,r);case"Object":return Gq(n,r);case"Promise":return Kq(n,r);case"Record":return Wq(n,r);case"Ref":return Hq(n,r);case"RegExp":return Jq(n,r);case"String":return Zq(n,r);case"Symbol":return Yq(n,r);case"TemplateLiteral":return Xq(n,r);case"This":return Qq(n,r);case"Tuple":return e9(n,r);case"Undefined":return t9(n,r);case"Union":return r9(n,r);case"Uint8Array":return n9(n,r);case"Unknown":return o9(n,r);case"Void":return i9(n,r);default:if(!Tt.Has(n[v]))throw new Tr(n,"Unknown type");return s9(n,r)}}o(kr,"Visit");var a9=512,wP=0;function Xr(...e){return wP=0,e.length===2?kr(e[0],e[1]):kr(e[0],[])}o(Xr,"Create");var Vy=class Vy extends re{constructor(t,r){super(r),this.schema=t}};o(Vy,"ValueCastError");var df=Vy;function c9(e,t,r){if(e[v]==="Object"&&typeof r=="object"&&!ao(r)){let n=e,i=Object.getOwnPropertyNames(r),s=Object.entries(n.properties),[a,u]=[1/s.length,s.length];return s.reduce((l,[d,m])=>{let h=m[v]==="Literal"&&m.const===r[d]?u:0,b=he(m,t,r[d])?a:0,$=i.includes(d)?a:0;return l+(h+b+$)},0)}else return he(e,t,r)?1:0}o(c9,"ScoreUnion");function u9(e,t,r){let n=e.anyOf.map(a=>Ne(a,t)),[i,s]=[n[0],0];for(let a of n){let u=c9(a,t,r);u>s&&(i=a,s=u)}return i}o(u9,"SelectUnion");function f9(e,t,r){if("default"in e)return typeof r=="function"?e.default:Re(e.default);{let n=u9(e,t,r);return zy(n,t,r)}}o(f9,"CastUnion");function l9(e,t,r){return he(e,t,r)?Re(r):Xr(e,t)}o(l9,"DefaultClone");function p9(e,t,r){return he(e,t,r)?r:Xr(e,t)}o(p9,"Default");function d9(e,t,r){if(he(e,t,r))return Re(r);let n=se(r)?Re(r):Xr(e,t),i=X(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,a=(X(e.maxItems)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(l=>Ln(e.items,t,l));if(e.uniqueItems!==!0)return a;let u=[...new Set(a)];if(!he(e,t,u))throw new df(e,"Array cast produced invalid data due to uniqueItems constraint");return u}o(d9,"FromArray");function m9(e,t,r){if(he(e,t,r))return Xr(e,t);let n=new Set(e.returns.required||[]),i=o(function(){},"result");for(let[s,a]of Object.entries(e.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(i.prototype[s]=Ln(a,t,r.prototype[s]));return i}o(m9,"FromConstructor");function y9(e,t,r){let n=Xr(e,t),i=ae(n)&&ae(r)?g(g({},n),r):r;return he(e,t,i)?i:Xr(e,t)}o(y9,"FromIntersect");function h9(e,t,r){throw new df(e,"Never types cannot be cast")}o(h9,"FromNever");function g9(e,t,r){if(he(e,t,r))return r;if(r===null||typeof r!="object")return Xr(e,t);let n=new Set(e.required||[]),i={};for(let[s,a]of Object.entries(e.properties))!n.has(s)&&r[s]===void 0||(i[s]=Ln(a,t,r[s]));if(typeof e.additionalProperties=="object"){let s=Object.getOwnPropertyNames(e.properties);for(let a of Object.getOwnPropertyNames(r))s.includes(a)||(i[a]=Ln(e.additionalProperties,t,r[a]))}return i}o(g9,"FromObject");function x9(e,t,r){if(he(e,t,r))return Re(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Xr(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n],s={};for(let[a,u]of Object.entries(r))s[a]=Ln(i,t,u);return s}o(x9,"FromRecord");function I9(e,t,r){return Ln(Ne(e,t),t,r)}o(I9,"FromRef");function b9(e,t,r){return Ln(Ne(e,t),t,r)}o(b9,"FromThis");function w9(e,t,r){return he(e,t,r)?Re(r):se(r)?e.items===void 0?[]:e.items.map((n,i)=>Ln(n,t,r[i])):Xr(e,t)}o(w9,"FromTuple");function $9(e,t,r){return he(e,t,r)?Re(r):f9(e,t,r)}o($9,"FromUnion");function Ln(e,t,r){let n=_e(e.$id)?[...t,e]:t,i=e;switch(e[v]){case"Array":return d9(i,n,r);case"Constructor":return m9(i,n,r);case"Intersect":return y9(i,n,r);case"Never":return h9(i,n,r);case"Object":return g9(i,n,r);case"Record":return x9(i,n,r);case"Ref":return I9(i,n,r);case"This":return b9(i,n,r);case"Tuple":return w9(i,n,r);case"Union":return $9(i,n,r);case"Date":case"Symbol":case"Uint8Array":return l9(e,t,r);default:return p9(i,n,r)}}o(Ln,"Visit");function zy(...e){return e.length===3?Ln(e[0],e[1],e[2]):Ln(e[0],[],e[1])}o(zy,"Cast");c();function v9(e){return Ko(e)&&e[v]!=="Unsafe"}o(v9,"IsCheckable");function O9(e,t,r){return se(r)?r.map(n=>Fr(e.items,t,n)):r}o(O9,"FromArray");function _9(e,t,r){let n=e.unevaluatedProperties,s=e.allOf.map(u=>Fr(u,t,Re(r))).reduce((u,l)=>ae(l)?g(g({},u),l):l,{});if(!ae(r)||!ae(s)||!Ko(n))return s;let a=At(e);for(let u of Object.getOwnPropertyNames(r))a.includes(u)||he(n,t,r[u])&&(s[u]=Fr(n,t,r[u]));return s}o(_9,"FromIntersect");function S9(e,t,r){if(!ae(r)||se(r))return r;let n=e.additionalProperties;for(let i of Object.getOwnPropertyNames(r)){if(ne(e.properties,i)){r[i]=Fr(e.properties[i],t,r[i]);continue}if(Ko(n)&&he(n,t,r[i])){r[i]=Fr(n,t,r[i]);continue}delete r[i]}return r}o(S9,"FromObject");function P9(e,t,r){if(!ae(r))return r;let n=e.additionalProperties,i=Object.getOwnPropertyNames(r),[s,a]=Object.entries(e.patternProperties)[0],u=new RegExp(s);for(let l of i){if(u.test(l)){r[l]=Fr(a,t,r[l]);continue}if(Ko(n)&&he(n,t,r[l])){r[l]=Fr(n,t,r[l]);continue}delete r[l]}return r}o(P9,"FromRecord");function E9(e,t,r){return Fr(Ne(e,t),t,r)}o(E9,"FromRef");function T9(e,t,r){return Fr(Ne(e,t),t,r)}o(T9,"FromThis");function k9(e,t,r){if(!se(r))return r;if(ht(e.items))return[];let n=Math.min(r.length,e.items.length);for(let i=0;i<n;i++)r[i]=Fr(e.items[i],t,r[i]);return r.length>n?r.slice(0,n):r}o(k9,"FromTuple");function F9(e,t,r){for(let n of e.anyOf)if(v9(n)&&he(n,t,r))return Fr(n,t,r);return r}o(F9,"FromUnion");function Fr(e,t,r){let n=_e(e.$id)?[...t,e]:t,i=e;switch(i[v]){case"Array":return O9(i,n,r);case"Intersect":return _9(i,n,r);case"Object":return S9(i,n,r);case"Record":return P9(i,n,r);case"Ref":return E9(i,n,r);case"This":return T9(i,n,r);case"Tuple":return k9(i,n,r);case"Union":return F9(i,n,r);default:return r}}o(Fr,"Visit");function mf(...e){return e.length===3?Fr(e[0],e[1],e[2]):Fr(e[0],[],e[1])}o(mf,"Clean");c();function yf(e){return _e(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}o(yf,"IsStringNumeric");function A9(e){return Dt(e)||Fn(e)||X(e)}o(A9,"IsValueToString");function $c(e){return e===!0||X(e)&&e===1||Dt(e)&&e===BigInt("1")||_e(e)&&(e.toLowerCase()==="true"||e==="1")}o($c,"IsValueTrue");function vc(e){return e===!1||X(e)&&(e===0||Object.is(e,-0))||Dt(e)&&e===BigInt("0")||_e(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}o(vc,"IsValueFalse");function j9(e){return _e(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}o(j9,"IsTimeStringWithTimeZone");function N9(e){return _e(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(N9,"IsTimeStringWithoutTimeZone");function R9(e){return _e(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}o(R9,"IsDateTimeStringWithTimeZone");function C9(e){return _e(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(C9,"IsDateTimeStringWithoutTimeZone");function M9(e){return _e(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}o(M9,"IsDateString");function L9(e,t){let r=vP(e);return r===t?r:e}o(L9,"TryConvertLiteralString");function U9(e,t){let r=OP(e);return r===t?r:e}o(U9,"TryConvertLiteralNumber");function D9(e,t){let r=$P(e);return r===t?r:e}o(D9,"TryConvertLiteralBoolean");function q9(e,t){return _e(e.const)?L9(t,e.const):X(e.const)?U9(t,e.const):Fn(e.const)?D9(t,e.const):t}o(q9,"TryConvertLiteral");function $P(e){return $c(e)?!0:vc(e)?!1:e}o($P,"TryConvertBoolean");function z9(e){let t=o(r=>r.split(".")[0],"truncateInteger");return yf(e)?BigInt(t(e)):X(e)?BigInt(Math.trunc(e)):vc(e)?BigInt(0):$c(e)?BigInt(1):e}o(z9,"TryConvertBigInt");function vP(e){return A9(e)?e.toString():co(e)&&e.description!==void 0?e.description.toString():e}o(vP,"TryConvertString");function OP(e){return yf(e)?parseFloat(e):$c(e)?1:vc(e)?0:e}o(OP,"TryConvertNumber");function V9(e){return yf(e)?parseInt(e):X(e)?e|0:$c(e)?1:vc(e)?0:e}o(V9,"TryConvertInteger");function B9(e){return _e(e)&&e.toLowerCase()==="null"?null:e}o(B9,"TryConvertNull");function G9(e){return _e(e)&&e==="undefined"?void 0:e}o(G9,"TryConvertUndefined");function K9(e){return ur(e)?e:X(e)?new Date(e):$c(e)?new Date(1):vc(e)?new Date(0):yf(e)?new Date(parseInt(e)):N9(e)?new Date("1970-01-01T".concat(e,".000Z")):j9(e)?new Date("1970-01-01T".concat(e)):C9(e)?new Date("".concat(e,".000Z")):R9(e)?new Date(e):M9(e)?new Date("".concat(e,"T00:00:00.000Z")):e}o(K9,"TryConvertDate");function W9(e,t,r){return(se(r)?r:[r]).map(i=>Un(e.items,t,i))}o(W9,"FromArray");function H9(e,t,r){return z9(r)}o(H9,"FromBigInt");function J9(e,t,r){return $P(r)}o(J9,"FromBoolean");function Z9(e,t,r){return K9(r)}o(Z9,"FromDate");function Y9(e,t,r){return V9(r)}o(Y9,"FromInteger");function X9(e,t,r){return e.allOf.reduce((n,i)=>Un(i,t,n),r)}o(X9,"FromIntersect");function Q9(e,t,r){return q9(e,r)}o(Q9,"FromLiteral");function e4(e,t,r){return B9(r)}o(e4,"FromNull");function t4(e,t,r){return OP(r)}o(t4,"FromNumber");function r4(e,t,r){if(!ae(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))ne(r,n)&&(r[n]=Un(e.properties[n],t,r[n]));return r}o(r4,"FromObject");function n4(e,t,r){if(!ae(r))return r;let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=e.patternProperties[i];for(let[a,u]of Object.entries(r))r[a]=Un(s,t,u);return r}o(n4,"FromRecord");function o4(e,t,r){return Un(Ne(e,t),t,r)}o(o4,"FromRef");function i4(e,t,r){return vP(r)}o(i4,"FromString");function s4(e,t,r){return _e(r)||X(r)?Symbol(r):r}o(s4,"FromSymbol");function a4(e,t,r){return Un(Ne(e,t),t,r)}o(a4,"FromThis");function c4(e,t,r){return se(r)&&!ht(e.items)?r.map((i,s)=>s<e.items.length?Un(e.items[s],t,i):i):r}o(c4,"FromTuple");function u4(e,t,r){return G9(r)}o(u4,"FromUndefined");function f4(e,t,r){for(let n of e.anyOf){let i=Un(n,t,Re(r));if(he(n,t,i))return i}return r}o(f4,"FromUnion");function Un(e,t,r){let n=Zr(e,t),i=e;switch(e[v]){case"Array":return W9(i,n,r);case"BigInt":return H9(i,n,r);case"Boolean":return J9(i,n,r);case"Date":return Z9(i,n,r);case"Integer":return Y9(i,n,r);case"Intersect":return X9(i,n,r);case"Literal":return Q9(i,n,r);case"Null":return e4(i,n,r);case"Number":return t4(i,n,r);case"Object":return r4(i,n,r);case"Record":return n4(i,n,r);case"Ref":return o4(i,n,r);case"String":return i4(i,n,r);case"Symbol":return s4(i,n,r);case"This":return a4(i,n,r);case"Tuple":return c4(i,n,r);case"Undefined":return u4(i,n,r);case"Union":return f4(i,n,r);default:return r}}o(Un,"Visit");function hf(...e){return e.length===3?Un(e[0],e[1],e[2]):Un(e[0],[],e[1])}o(hf,"Convert");c();c();var By=class By extends re{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(By,"TransformDecodeCheckError");var Ys=By,Gy=class Gy extends re{constructor(t,r,n,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=i}};o(Gy,"TransformDecodeError");var Li=Gy;function gt(e,t,r){try{return it(e)?e[pt].Decode(r):r}catch(n){throw new Li(e,t,r,n)}}o(gt,"Default");function l4(e,t,r,n){return se(n)?gt(e,r,n.map((i,s)=>Dn(e.items,t,"".concat(r,"/").concat(s),i))):gt(e,r,n)}o(l4,"FromArray");function p4(e,t,r,n){if(!ae(n)||qt(n))return gt(e,r,n);let i=Jo(e),s=i.map(m=>m[0]),a=g({},n);for(let[m,h]of i)m in a&&(a[m]=Dn(h,t,"".concat(r,"/").concat(m),a[m]));if(!it(e.unevaluatedProperties))return gt(e,r,a);let u=Object.getOwnPropertyNames(a),l=e.unevaluatedProperties,d=g({},a);for(let m of u)s.includes(m)||(d[m]=gt(l,"".concat(r,"/").concat(m),d[m]));return gt(e,r,d)}o(p4,"FromIntersect");function d4(e,t,r,n){return gt(e,r,Dn(e.not,t,r,n))}o(d4,"FromNot");function m4(e,t,r,n){if(!ae(n))return gt(e,r,n);let i=At(e),s=g({},n);for(let d of i)ne(s,d)&&(ht(s[d])&&(!Ts(e.properties[d])||Ge.IsExactOptionalProperty(s,d))||(s[d]=Dn(e.properties[d],t,"".concat(r,"/").concat(d),s[d])));if(!Se(e.additionalProperties))return gt(e,r,s);let a=Object.getOwnPropertyNames(s),u=e.additionalProperties,l=g({},s);for(let d of a)i.includes(d)||(l[d]=gt(u,"".concat(r,"/").concat(d),l[d]));return gt(e,r,l)}o(m4,"FromObject");function y4(e,t,r,n){if(!ae(n))return gt(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),a=g({},n);for(let m of Object.getOwnPropertyNames(n))s.test(m)&&(a[m]=Dn(e.patternProperties[i],t,"".concat(r,"/").concat(m),a[m]));if(!Se(e.additionalProperties))return gt(e,r,a);let u=Object.getOwnPropertyNames(a),l=e.additionalProperties,d=g({},a);for(let m of u)s.test(m)||(d[m]=gt(l,"".concat(r,"/").concat(m),d[m]));return gt(e,r,d)}o(y4,"FromRecord");function h4(e,t,r,n){let i=Ne(e,t);return gt(e,r,Dn(i,t,r,n))}o(h4,"FromRef");function g4(e,t,r,n){let i=Ne(e,t);return gt(e,r,Dn(i,t,r,n))}o(g4,"FromThis");function x4(e,t,r,n){return se(n)&&se(e.items)?gt(e,r,e.items.map((i,s)=>Dn(i,t,"".concat(r,"/").concat(s),n[s]))):gt(e,r,n)}o(x4,"FromTuple");function I4(e,t,r,n){for(let i of e.anyOf){if(!he(i,t,n))continue;let s=Dn(i,t,r,n);return gt(e,r,s)}return gt(e,r,n)}o(I4,"FromUnion");function Dn(e,t,r,n){let i=Zr(e,t),s=e;switch(e[v]){case"Array":return l4(s,i,r,n);case"Intersect":return p4(s,i,r,n);case"Not":return d4(s,i,r,n);case"Object":return m4(s,i,r,n);case"Record":return y4(s,i,r,n);case"Ref":return h4(s,i,r,n);case"Symbol":return gt(s,r,n);case"This":return g4(s,i,r,n);case"Tuple":return x4(s,i,r,n);case"Union":return I4(s,i,r,n);default:return gt(s,r,n)}}o(Dn,"Visit");function Xs(e,t,r){return Dn(e,t,"",r)}o(Xs,"TransformDecode");c();var Ky=class Ky extends re{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(Ky,"TransformEncodeCheckError");var Qs=Ky,Wy=class Wy extends re{constructor(t,r,n,i){super("".concat(i instanceof Error?i.message:"Unknown error")),this.schema=t,this.path=r,this.value=n,this.error=i}};o(Wy,"TransformEncodeError");var Ui=Wy;function or(e,t,r){try{return it(e)?e[pt].Encode(r):r}catch(n){throw new Ui(e,t,r,n)}}o(or,"Default");function b4(e,t,r,n){let i=or(e,r,n);return se(i)?i.map((s,a)=>qn(e.items,t,"".concat(r,"/").concat(a),s)):i}o(b4,"FromArray");function w4(e,t,r,n){let i=or(e,r,n);if(!ae(n)||qt(n))return i;let s=Jo(e),a=s.map(h=>h[0]),u=g({},i);for(let[h,b]of s)h in u&&(u[h]=qn(b,t,"".concat(r,"/").concat(h),u[h]));if(!it(e.unevaluatedProperties))return u;let l=Object.getOwnPropertyNames(u),d=e.unevaluatedProperties,m=g({},u);for(let h of l)a.includes(h)||(m[h]=or(d,"".concat(r,"/").concat(h),m[h]));return m}o(w4,"FromIntersect");function $4(e,t,r,n){return or(e.not,r,or(e,r,n))}o($4,"FromNot");function v4(e,t,r,n){let i=or(e,r,n);if(!ae(i))return i;let s=At(e),a=g({},i);for(let m of s)ne(a,m)&&(ht(a[m])&&(!Ts(e.properties[m])||Ge.IsExactOptionalProperty(a,m))||(a[m]=qn(e.properties[m],t,"".concat(r,"/").concat(m),a[m])));if(!Se(e.additionalProperties))return a;let u=Object.getOwnPropertyNames(a),l=e.additionalProperties,d=g({},a);for(let m of u)s.includes(m)||(d[m]=or(l,"".concat(r,"/").concat(m),d[m]));return d}o(v4,"FromObject");function O4(e,t,r,n){let i=or(e,r,n);if(!ae(n))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(s),u=g({},i);for(let h of Object.getOwnPropertyNames(n))a.test(h)&&(u[h]=qn(e.patternProperties[s],t,"".concat(r,"/").concat(h),u[h]));if(!Se(e.additionalProperties))return u;let l=Object.getOwnPropertyNames(u),d=e.additionalProperties,m=g({},u);for(let h of l)a.test(h)||(m[h]=or(d,"".concat(r,"/").concat(h),m[h]));return m}o(O4,"FromRecord");function _4(e,t,r,n){let i=Ne(e,t),s=qn(i,t,r,n);return or(e,r,s)}o(_4,"FromRef");function S4(e,t,r,n){let i=Ne(e,t),s=qn(i,t,r,n);return or(e,r,s)}o(S4,"FromThis");function P4(e,t,r,n){let i=or(e,r,n);return se(e.items)?e.items.map((s,a)=>qn(s,t,"".concat(r,"/").concat(a),i[a])):[]}o(P4,"FromTuple");function E4(e,t,r,n){for(let i of e.anyOf){if(!he(i,t,n))continue;let s=qn(i,t,r,n);return or(e,r,s)}for(let i of e.anyOf){let s=qn(i,t,r,n);if(he(e,t,s))return or(e,r,s)}return or(e,r,n)}o(E4,"FromUnion");function qn(e,t,r,n){let i=Zr(e,t),s=e;switch(e[v]){case"Array":return b4(s,i,r,n);case"Intersect":return w4(s,i,r,n);case"Not":return $4(s,i,r,n);case"Object":return v4(s,i,r,n);case"Record":return O4(s,i,r,n);case"Ref":return _4(s,i,r,n);case"This":return S4(s,i,r,n);case"Tuple":return P4(s,i,r,n);case"Union":return E4(s,i,r,n);default:return or(s,r,n)}}o(qn,"Visit");function gf(e,t,r){return qn(e,t,"",r)}o(gf,"TransformEncode");c();function T4(e,t){return it(e)||jt(e.items,t)}o(T4,"FromArray");function k4(e,t){return it(e)||jt(e.items,t)}o(k4,"FromAsyncIterator");function F4(e,t){return it(e)||jt(e.returns,t)||e.parameters.some(r=>jt(r,t))}o(F4,"FromConstructor");function A4(e,t){return it(e)||jt(e.returns,t)||e.parameters.some(r=>jt(r,t))}o(A4,"FromFunction");function j4(e,t){return it(e)||it(e.unevaluatedProperties)||e.allOf.some(r=>jt(r,t))}o(j4,"FromIntersect");function N4(e,t){return it(e)||jt(e.items,t)}o(N4,"FromIterator");function R4(e,t){return it(e)||jt(e.not,t)}o(R4,"FromNot");function C4(e,t){return it(e)||Object.values(e.properties).some(r=>jt(r,t))||Se(e.additionalProperties)&&jt(e.additionalProperties,t)}o(C4,"FromObject");function M4(e,t){return it(e)||jt(e.item,t)}o(M4,"FromPromise");function L4(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return it(e)||jt(n,t)||Se(e.additionalProperties)&&it(e.additionalProperties)}o(L4,"FromRecord");function U4(e,t){return it(e)?!0:jt(Ne(e,t),t)}o(U4,"FromRef");function D4(e,t){return it(e)?!0:jt(Ne(e,t),t)}o(D4,"FromThis");function q4(e,t){return it(e)||!ht(e.items)&&e.items.some(r=>jt(r,t))}o(q4,"FromTuple");function z4(e,t){return it(e)||e.anyOf.some(r=>jt(r,t))}o(z4,"FromUnion");function jt(e,t){let r=Zr(e,t),n=e;if(e.$id&&Hy.has(e.$id))return!1;switch(e.$id&&Hy.add(e.$id),e[v]){case"Array":return T4(n,r);case"AsyncIterator":return k4(n,r);case"Constructor":return F4(n,r);case"Function":return A4(n,r);case"Intersect":return j4(n,r);case"Iterator":return N4(n,r);case"Not":return R4(n,r);case"Object":return C4(n,r);case"Promise":return M4(n,r);case"Record":return L4(n,r);case"Ref":return U4(n,r);case"This":return D4(n,r);case"Tuple":return q4(n,r);case"Union":return z4(n,r);default:return it(e)}}o(jt,"Visit");var Hy=new Set;function zn(e,t){return Hy.clear(),jt(e,t)}o(zn,"HasTransform");function _P(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!he(t,r,n))throw new Ys(t,n,Mn(t,r,n).First());return zn(t,r)?Xs(t,r,n):n}o(_P,"Decode");c();function wo(e,t){let r=ne(e,"default")?e.default:void 0,n=Bo(r)?r():Re(r);return ht(t)?n:ae(t)&&ae(n)?Object.assign(n,t):t}o(wo,"ValueOrDefault");function Jy(e){return Ko(e)&&"default"in e}o(Jy,"HasDefaultProperty");function V4(e,t,r){let n=wo(e,r);if(!se(n))return n;for(let i=0;i<n.length;i++)n[i]=Ar(e.items,t,n[i]);return n}o(V4,"FromArray");function B4(e,t,r){return ur(r)?r:wo(e,r)}o(B4,"FromDate");function G4(e,t,r){let n=wo(e,r);return e.allOf.reduce((i,s)=>{let a=Ar(s,t,n);return ae(a)?g(g({},i),a):a},{})}o(G4,"FromIntersect");function K4(e,t,r){let n=wo(e,r);if(!ae(n))return n;let i=Object.getOwnPropertyNames(e.properties);for(let s of i){let a=Ar(e.properties[s],t,n[s]);ht(a)||(n[s]=Ar(e.properties[s],t,n[s]))}if(!Jy(e.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))i.includes(s)||(n[s]=Ar(e.additionalProperties,t,n[s]));return n}o(K4,"FromObject");function W4(e,t,r){let n=wo(e,r);if(!ae(n))return n;let i=e.additionalProperties,[s,a]=Object.entries(e.patternProperties)[0],u=new RegExp(s);for(let l of Object.getOwnPropertyNames(n))u.test(l)&&Jy(a)&&(n[l]=Ar(a,t,n[l]));if(!Jy(i))return n;for(let l of Object.getOwnPropertyNames(n))u.test(l)||(n[l]=Ar(i,t,n[l]));return n}o(W4,"FromRecord");function H4(e,t,r){return Ar(Ne(e,t),t,wo(e,r))}o(H4,"FromRef");function J4(e,t,r){return Ar(Ne(e,t),t,r)}o(J4,"FromThis");function Z4(e,t,r){let n=wo(e,r);if(!se(n)||ht(e.items))return n;let[i,s]=[e.items,Math.max(e.items.length,n.length)];for(let a=0;a<s;a++)a<i.length&&(n[a]=Ar(i[a],t,n[a]));return n}o(Z4,"FromTuple");function Y4(e,t,r){let n=wo(e,r);for(let i of e.anyOf){let s=Ar(i,t,Re(n));if(he(i,t,s))return s}return n}o(Y4,"FromUnion");function Ar(e,t,r){let n=Zr(e,t),i=e;switch(i[v]){case"Array":return V4(i,n,r);case"Date":return B4(i,n,r);case"Intersect":return G4(i,n,r);case"Object":return K4(i,n,r);case"Record":return W4(i,n,r);case"Ref":return H4(i,n,r);case"This":return J4(i,n,r);case"Tuple":return Z4(i,n,r);case"Union":return Y4(i,n,r);default:return wo(i,r)}}o(Ar,"Visit");function xf(...e){return e.length===3?Ar(e[0],e[1],e[2]):Ar(e[0],[],e[1])}o(xf,"Default");c();c();var Qr={};To(Qr,{Delete:()=>Q4,Format:()=>Oc,Get:()=>tz,Has:()=>ez,Set:()=>X4,ValuePointerRootDeleteError:()=>bf,ValuePointerRootSetError:()=>If});c();var Zy=class Zy extends re{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};o(Zy,"ValuePointerRootSetError");var If=Zy,Yy=class Yy extends re{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};o(Yy,"ValuePointerRootDeleteError");var bf=Yy;function SP(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}o(SP,"Escape");function*Oc(e){if(e==="")return;let[t,r]=[0,0];for(let n=0;n<e.length;n++)e.charAt(n)==="/"?(n===0||(r=n,yield SP(e.slice(t,r))),t=n+1):r=n;yield SP(e.slice(t))}o(Oc,"Format");function X4(e,t,r){if(t==="")throw new If(e,t,r);let[n,i,s]=[null,e,""];for(let a of Oc(t))i[a]===void 0&&(i[a]={}),n=i,i=i[a],s=a;n[s]=r}o(X4,"Set");function Q4(e,t){if(t==="")throw new bf(e,t);let[r,n,i]=[null,e,""];for(let s of Oc(t)){if(n[s]===void 0||n[s]===null)return;r=n,n=n[s],i=s}if(Array.isArray(r)){let s=parseInt(i);r.splice(s,1)}else delete r[i]}o(Q4,"Delete");function ez(e,t){if(t==="")return!0;let[r,n,i]=[null,e,""];for(let s of Oc(t)){if(n[s]===void 0)return!1;r=n,n=n[s],i=s}return Object.getOwnPropertyNames(r).includes(i)}o(ez,"Has");function tz(e,t){if(t==="")return e;let r=e;for(let n of Oc(t)){if(r[n]===void 0)return;r=r[n]}return r}o(tz,"Get");c();function rz(e,t){if(!ae(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(i=>Di(e[i],t[i]))}o(rz,"ObjectType");function nz(e,t){return ur(t)&&e.getTime()===t.getTime()}o(nz,"DateType");function oz(e,t){return!se(t)||e.length!==t.length?!1:e.every((r,n)=>Di(r,t[n]))}o(oz,"ArrayType");function iz(e,t){return!zr(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>Di(r,t[n]))}o(iz,"TypedArrayType");function sz(e,t){return e===t}o(sz,"ValueType");function Di(e,t){if(ur(e))return nz(e,t);if(zr(e))return iz(e,t);if(se(e))return oz(e,t);if(ae(e))return rz(e,t);if(qt(e))return sz(e,t);throw new Error("ValueEquals: Unable to compare value")}o(Di,"Equal");var az=Qe({type:ze("insert"),path:Br(),value:go()}),cz=Qe({type:ze("update"),path:Br(),value:go()}),uz=Qe({type:ze("delete"),path:Br()}),EP=Je([az,cz,uz]),Xy=class Xy extends re{constructor(t,r){super(r),this.value=t}};o(Xy,"ValueDiffError");var wf=Xy;function $f(e,t){return{type:"update",path:e,value:t}}o($f,"CreateUpdate");function TP(e,t){return{type:"insert",path:e,value:t}}o(TP,"CreateInsert");function kP(e){return{type:"delete",path:e}}o(kP,"CreateDelete");function PP(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new wf(e,"Cannot diff objects with symbols")}o(PP,"AssertDiffable");function*fz(e,t,r){if(PP(t),PP(r),!xm(r))return yield $f(e,r);let n=globalThis.Object.getOwnPropertyNames(t),i=globalThis.Object.getOwnPropertyNames(r);for(let s of i)ne(t,s)||(yield TP("".concat(e,"/").concat(s),r[s]));for(let s of n)ne(r,s)&&(Di(t,r)||(yield*A(vf("".concat(e,"/").concat(s),t[s],r[s]))));for(let s of n)ne(r,s)||(yield kP("".concat(e,"/").concat(s)))}o(fz,"ObjectType");function*lz(e,t,r){if(!se(r))return yield $f(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*A(vf("".concat(e,"/").concat(n),t[n],r[n]));for(let n=0;n<r.length;n++)n<t.length||(yield TP("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield kP("".concat(e,"/").concat(n)))}o(lz,"ArrayType");function*pz(e,t,r){if(!zr(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield $f(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*A(vf("".concat(e,"/").concat(n),t[n],r[n]))}o(pz,"TypedArrayType");function*dz(e,t,r){t!==r&&(yield $f(e,r))}o(dz,"ValueType");function*vf(e,t,r){if(xm(t))return yield*A(fz(e,t,r));if(se(t))return yield*A(lz(e,t,r));if(zr(t))return yield*A(pz(e,t,r));if(qt(t))return yield*A(dz(e,t,r));throw new wf(t,"Unable to diff value")}o(vf,"Visit");function FP(e,t){return[...vf("",e,t)]}o(FP,"Diff");function mz(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}o(mz,"IsRootUpdate");function yz(e){return e.length===0}o(yz,"IsIdentity");function AP(e,t){if(mz(t))return Re(t[0].value);if(yz(t))return Re(e);let r=Re(e);for(let n of t)switch(n.type){case"insert":{Qr.Set(r,n.path,n.value);break}case"update":{Qr.Set(r,n.path,n.value);break}case"delete":{Qr.Delete(r,n.path);break}}return r}o(AP,"Patch");c();function jP(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],i=zn(t,r)?gf(t,r,n):n;if(!he(t,r,i))throw new Qs(t,i,Mn(t,r,i).First());return i}o(jP,"Encode");c();var eh=class eh extends re{constructor(t){super(t)}};o(eh,"ValueMutateError");var Of=eh;function hz(e,t,r,n){if(!ae(r))Qr.Set(e,t,Re(n));else{let i=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let a of i)s.includes(a)||delete r[a];for(let a of s)i.includes(a)||(r[a]=null);for(let a of s)Qy(e,"".concat(t,"/").concat(a),r[a],n[a])}}o(hz,"ObjectType");function gz(e,t,r,n){if(!se(r))Qr.Set(e,t,Re(n));else{for(let i=0;i<n.length;i++)Qy(e,"".concat(t,"/").concat(i),r[i],n[i]);r.splice(n.length)}}o(gz,"ArrayType");function xz(e,t,r,n){if(zr(r)&&r.length===n.length)for(let i=0;i<r.length;i++)r[i]=n[i];else Qr.Set(e,t,Re(n))}o(xz,"TypedArrayType");function Iz(e,t,r,n){r!==n&&Qr.Set(e,t,n)}o(Iz,"ValueType");function Qy(e,t,r,n){if(se(n))return gz(e,t,r,n);if(zr(n))return xz(e,t,r,n);if(ae(n))return hz(e,t,r,n);if(qt(n))return Iz(e,t,r,n)}o(Qy,"Visit");function NP(e){return zr(e)||qt(e)}o(NP,"IsNonMutableValue");function bz(e,t){return ae(e)&&se(t)||se(e)&&ae(t)}o(bz,"IsMismatchedValue");function RP(e,t){if(NP(e)||NP(t))throw new Of("Only object and array types can be mutated at the root level");if(bz(e,t))throw new Of("Cannot assign due type mismatch of assignable values");Qy(e,"",e,t)}o(RP,"Mutate");c();var wz=[(e,t,r)=>Re(r),(e,t,r)=>xf(e,t,r),(e,t,r)=>mf(e,t,r),(e,t,r)=>hf(e,t,r),(e,t,r)=>(pf(e,t,r),r),(e,t,r)=>zn(e,t)?Xs(e,t,r):r];function CP(e,t,r){return wz.reduce((n,i)=>i(e,t,n),r)}o(CP,"ParseValue");function MP(...e){return e.length===3?CP(e[0],e[1],e[2]):CP(e[0],[],e[1])}o(MP,"Parse");c();var $o={};To($o,{Assert:()=>pf,Cast:()=>zy,Check:()=>he,Clean:()=>mf,Clone:()=>Re,Convert:()=>hf,Create:()=>Xr,Decode:()=>_P,Default:()=>xf,Diff:()=>FP,Edit:()=>EP,Encode:()=>jP,Equal:()=>Di,Errors:()=>Mn,Hash:()=>Xo,Mutate:()=>RP,Parse:()=>MP,Patch:()=>AP,ValueErrorIterator:()=>Yr});c();c();var rh=class rh extends re{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));tt(this,"schema");this.schema=r}};o(rh,"TypeDereferenceError");var th=rh;function $z(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new th(e);return qi(r,t)}o($z,"Resolve");function _f(e,t){return!Oe.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(_f,"Pushref");function qi(e,t){return e[v]==="This"||e[v]==="Ref"?$z(e,t):e}o(qi,"Deref");c();function vz(e,t,r){let n=e.get(t);if(n!==void 0)return n;let i=zn(t,r);return e.set(t,i),i}o(vz,"HasTransformCached");function Sf(){let e=new WeakMap;return{HasTransform:o((t,r)=>vz(e,t,r),"HasTransform")}}o(Sf,"CreateTransformCache");function xt(e,t,r){try{return x.IsTransform(e)?e[pt].Decode(r):r}catch(n){throw new Li(e,t,r,n)}}o(xt,"Default");function Oz(e,t,r,n,i){return Oe.IsArray(n)?xt(e,r,n.map((s,a)=>Vn(e.items,t,"".concat(r,"/").concat(a),s,i))):xt(e,r,n)}o(Oz,"FromArray");function _z(e,t,r,n,i){if(!Oe.IsObject(n)||qt(n))return xt(e,r,n);let s=Jo(e),a=s.map(h=>h[0]),u=g({},n);for(let[h,b]of s)h in u&&(u[h]=Vn(b,t,"".concat(r,"/").concat(h),u[h],i));if(!x.IsTransform(e.unevaluatedProperties))return xt(e,r,u);let l=Object.getOwnPropertyNames(u),d=e.unevaluatedProperties,m=g({},u);for(let h of l)a.includes(h)||(m[h]=xt(d,"".concat(r,"/").concat(h),m[h]));return xt(e,r,m)}o(_z,"FromIntersect");function Sz(e,t,r,n,i){return xt(e,r,Vn(e.not,t,r,n,i))}o(Sz,"FromNot");function Pz(e,t,r,n,i){if(!Oe.IsObject(n))return xt(e,r,n);let s=At(e),a=g({},n);for(let m of s)Oe.HasPropertyKey(a,m)&&(Oe.IsUndefined(a[m])&&(!x.IsUndefined(e.properties[m])||Ge.IsExactOptionalProperty(a,m))||(a[m]=Vn(e.properties[m],t,"".concat(r,"/").concat(m),a[m],i)));if(!x.IsSchema(e.additionalProperties))return xt(e,r,a);let u=Object.getOwnPropertyNames(a),l=e.additionalProperties,d=g({},a);for(let m of u)s.includes(m)||(d[m]=xt(l,"".concat(r,"/").concat(m),d[m]));return xt(e,r,d)}o(Pz,"FromObject");function Ez(e,t,r,n,i){if(!Oe.IsObject(n))return xt(e,r,n);let s=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(s),u=g({},n);for(let h of Object.getOwnPropertyNames(n))a.test(h)&&(u[h]=Vn(e.patternProperties[s],t,"".concat(r,"/").concat(h),u[h],i));if(!x.IsSchema(e.additionalProperties))return xt(e,r,u);let l=Object.getOwnPropertyNames(u),d=e.additionalProperties,m=g({},u);for(let h of l)a.test(h)||(m[h]=xt(d,"".concat(r,"/").concat(h),m[h]));return xt(e,r,m)}o(Ez,"FromRecord");function Tz(e,t,r,n,i){let s=qi(e,t);return xt(e,r,Vn(s,t,r,n,i))}o(Tz,"FromRef");function kz(e,t,r,n,i){let s=qi(e,t);return xt(e,r,Vn(s,t,r,n,i))}o(kz,"FromThis");function Fz(e,t,r,n,i){return Oe.IsArray(n)&&Oe.IsArray(e.items)?xt(e,r,e.items.map((s,a)=>Vn(s,t,"".concat(r,"/").concat(a),n[a],i))):xt(e,r,n)}o(Fz,"FromTuple");function Az(e,t,r,n,i){for(let s of e.anyOf){if(!$o.Check(s,t,n))continue;let a=Vn(s,t,r,n,i);return xt(e,r,a)}return xt(e,r,n)}o(Az,"FromUnion");function Vn(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=_f(e,t),a=e;switch(e[v]){case"Array":return Oz(a,s,r,n,i);case"Intersect":return _z(a,s,r,n,i);case"Not":return Sz(a,s,r,n,i);case"Object":return Pz(a,s,r,n,i);case"Record":return Ez(a,s,r,n,i);case"Ref":return Tz(a,s,r,n,i);case"Symbol":return xt(a,r,n);case"This":return kz(a,s,r,n,i);case"Tuple":return Fz(a,s,r,n,i);case"Union":return Az(a,s,r,n,i);default:return xt(a,r,n)}}o(Vn,"Visit");function LP(e,t,r){let n=Sf();return Vn(e,t,"",r,n)}o(LP,"FastTransformDecode");c();function ir(e,t,r){try{return x.IsTransform(e)?e[pt].Encode(r):r}catch(n){throw new Ui(e,t,r,n)}}o(ir,"Default");function jz(e,t,r,n,i){let s=ir(e,r,n);return Oe.IsArray(s)?s.map((a,u)=>Bn(e.items,t,"".concat(r,"/").concat(u),a,i)):s}o(jz,"FromArray");function Nz(e,t,r,n,i){let s=ir(e,r,n);if(!Oe.IsObject(n)||qt(n))return s;let a=Jo(e),u=a.map(b=>b[0]),l=g({},s);for(let[b,$]of a)b in l&&(l[b]=Bn($,t,"".concat(r,"/").concat(b),l[b],i));if(!x.IsTransform(e.unevaluatedProperties))return l;let d=Object.getOwnPropertyNames(l),m=e.unevaluatedProperties,h=g({},l);for(let b of d)u.includes(b)||(h[b]=ir(m,"".concat(r,"/").concat(b),h[b]));return h}o(Nz,"FromIntersect");function Rz(e,t,r,n){return ir(e.not,r,ir(e,r,n))}o(Rz,"FromNot");function Cz(e,t,r,n,i){let s=ir(e,r,n);if(!Oe.IsObject(s))return s;let a=At(e),u=g({},s);for(let h of a)Oe.HasPropertyKey(u,h)&&(Oe.IsUndefined(u[h])&&(!x.IsUndefined(e.properties[h])||Ge.IsExactOptionalProperty(u,h))||(u[h]=Bn(e.properties[h],t,"".concat(r,"/").concat(h),u[h],i)));if(!x.IsSchema(e.additionalProperties))return u;let l=Object.getOwnPropertyNames(u),d=e.additionalProperties,m=g({},u);for(let h of l)a.includes(h)||(m[h]=ir(d,"".concat(r,"/").concat(h),m[h]));return m}o(Cz,"FromObject");function Mz(e,t,r,n,i){let s=ir(e,r,n);if(!Oe.IsObject(n))return s;let a=Object.getOwnPropertyNames(e.patternProperties)[0],u=new RegExp(a),l=g({},s);for(let b of Object.getOwnPropertyNames(n))u.test(b)&&(l[b]=Bn(e.patternProperties[a],t,"".concat(r,"/").concat(b),l[b],i));if(!x.IsSchema(e.additionalProperties))return l;let d=Object.getOwnPropertyNames(l),m=e.additionalProperties,h=g({},l);for(let b of d)u.test(b)||(h[b]=ir(m,"".concat(r,"/").concat(b),h[b]));return h}o(Mz,"FromRecord");function Lz(e,t,r,n,i){let s=qi(e,t),a=Bn(s,t,r,n,i);return ir(e,r,a)}o(Lz,"FromRef");function Uz(e,t,r,n,i){let s=qi(e,t),a=Bn(s,t,r,n,i);return ir(e,r,a)}o(Uz,"FromThis");function Dz(e,t,r,n,i){let s=ir(e,r,n);return Oe.IsArray(e.items)?e.items.map((a,u)=>Bn(a,t,"".concat(r,"/").concat(u),s[u],i)):[]}o(Dz,"FromTuple");function qz(e,t,r,n,i){for(let s of e.anyOf){if(!$o.Check(s,t,n))continue;let a=Bn(s,t,r,n,i);return ir(e,r,a)}for(let s of e.anyOf){let a=Bn(s,t,r,n,i);if($o.Check(e,t,a))return ir(e,r,a)}return ir(e,r,n)}o(qz,"FromUnion");function Bn(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=_f(e,t),a=e;switch(e[v]){case"Array":return jz(a,s,r,n,i);case"Intersect":return Nz(a,s,r,n,i);case"Not":return Rz(a,s,r,n);case"Object":return Cz(a,s,r,n,i);case"Record":return Mz(a,s,r,n,i);case"Ref":return Lz(a,s,r,n,i);case"This":return Uz(a,s,r,n,i);case"Tuple":return Dz(a,s,r,n,i);case"Union":return qz(a,s,r,n,i);default:return ir(a,r,n)}}o(Bn,"Visit");function UP(e,t,r){let n=Sf();return Bn(e,t,"",r,n)}o(UP,"FastTransformEncode");c();var ah=class ah{constructor(t,r,n,i){this.schema=t,this.references=r,this.checkFunc=n,this.code=i,this.hasTransform=zn(t,r)}Code(){return this.code}Errors(t){return Mn(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new Ys(this.schema,t,this.Errors(t).First());return this.hasTransform?Xs(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?gf(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new Qs(this.schema,t,this.Errors(t).First());return r}};o(ah,"TypeCheck");var nh=ah,vo;(function(e){function t(s){return s===36}o(t,"DollarSign"),e.DollarSign=t;function r(s){return s===95}o(r,"IsUnderscore"),e.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}o(n,"IsAlpha"),e.IsAlpha=n;function i(s){return s>=48&&s<=57}o(i,"IsNumeric"),e.IsNumeric=i})(vo||(vo={}));var Pf;(function(e){function t(s){return s.length===0?!1:vo.IsNumeric(s.charCodeAt(0))}o(t,"IsFirstCharacterNumeric");function r(s){if(t(s))return!1;for(let a=0;a<s.length;a++){let u=s.charCodeAt(a);if(!(vo.IsAlpha(u)||vo.IsNumeric(u)||vo.DollarSign(u)||vo.IsUnderscore(u)))return!1}return!0}o(r,"IsAccessor");function n(s){return s.replace(/'/g,"\\'")}o(n,"EscapeHyphen");function i(s,a){return r(a)?"".concat(s,".").concat(a):"".concat(s,"['").concat(n(a),"']")}o(i,"Encode"),e.Encode=i})(Pf||(Pf={}));var oh;(function(e){function t(r){let n=[];for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);vo.IsNumeric(s)||vo.IsAlpha(s)?n.push(r.charAt(i)):n.push("_".concat(s,"_"))}return n.join("").replace(/__/g,"_")}o(t,"Encode"),e.Encode=t})(oh||(oh={}));var ih;(function(e){function t(r){return r.replace(/'/g,"\\'")}o(t,"Escape"),e.Escape=t})(ih||(ih={}));var ch=class ch extends re{constructor(t){super("Unknown type"),this.schema=t}};o(ch,"TypeCompilerUnknownTypeError");var sh=ch,uh=class uh extends re{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};o(uh,"TypeCompilerTypeGuardError");var Ef=uh,zi;(function(e){function t(a,u,l){return Ge.ExactOptionalPropertyTypes?"('".concat(u,"' in ").concat(a," ? ").concat(l," : true)"):"(".concat(Pf.Encode(a,u)," !== undefined ? ").concat(l," : true)")}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(a){return Ge.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null)"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,"))")}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(a){return Ge.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,") && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))")}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(a){return Ge.AllowNaN?"typeof ".concat(a," === 'number'"):"Number.isFinite(".concat(a,")")}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(a){return Ge.AllowNullVoid?"(".concat(a," === undefined || ").concat(a," === null)"):"".concat(a," === undefined")}o(s,"IsVoidLike"),e.IsVoidLike=s})(zi||(zi={}));var Tf;(function(e){function t(I){return I[v]==="Any"||I[v]==="Unknown"}o(t,"IsAnyOrUnknown");function*r(I,U,w){yield"true"}o(r,"FromAny");function*n(I,U,w){yield"Array.isArray(".concat(w,")");let[Q,q]=[Ft("value","any"),Ft("acc","number")];X(I.maxItems)&&(yield"".concat(w,".length <= ").concat(I.maxItems)),X(I.minItems)&&(yield"".concat(w,".length >= ").concat(I.minItems));let K=Nt(I.items,U,"value");if(yield"".concat(w,".every((").concat(Q,") => ").concat(K,")"),Se(I.contains)||X(I.minContains)||X(I.maxContains)){let ct=Se(I.contains)?I.contains:He(),sr=Nt(ct,U,"value"),Zn=X(I.minContains)?["(count >= ".concat(I.minContains,")")]:[],nn=X(I.maxContains)?["(count <= ".concat(I.maxContains,")")]:[],wn="const count = value.reduce((".concat(q,", ").concat(Q,") => ").concat(sr," ? acc + 1 : acc, 0)"),Fc=["(count > 0)",...Zn,...nn].join(" && ");yield"((".concat(Q,") => { ").concat(wn,"; return ").concat(Fc,"})(").concat(w,")")}if(I.uniqueItems===!0){let sr="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(Q,") => { ").concat(sr," )(").concat(w,")")}}o(n,"FromArray");function*i(I,U,w){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(w,")")}o(i,"FromAsyncIterator");function*s(I,U,w){yield"(typeof ".concat(w," === 'bigint')"),Dt(I.exclusiveMaximum)&&(yield"".concat(w," < BigInt(").concat(I.exclusiveMaximum,")")),Dt(I.exclusiveMinimum)&&(yield"".concat(w," > BigInt(").concat(I.exclusiveMinimum,")")),Dt(I.maximum)&&(yield"".concat(w," <= BigInt(").concat(I.maximum,")")),Dt(I.minimum)&&(yield"".concat(w," >= BigInt(").concat(I.minimum,")")),Dt(I.multipleOf)&&(yield"(".concat(w," % BigInt(").concat(I.multipleOf,")) === 0"))}o(s,"FromBigInt");function*a(I,U,w){yield"(typeof ".concat(w," === 'boolean')")}o(a,"FromBoolean");function*u(I,U,w){yield*A(vt(I.returns,U,"".concat(w,".prototype")))}o(u,"FromConstructor");function*l(I,U,w){yield"(".concat(w," instanceof Date) && Number.isFinite(").concat(w,".getTime())"),X(I.exclusiveMaximumTimestamp)&&(yield"".concat(w,".getTime() < ").concat(I.exclusiveMaximumTimestamp)),X(I.exclusiveMinimumTimestamp)&&(yield"".concat(w,".getTime() > ").concat(I.exclusiveMinimumTimestamp)),X(I.maximumTimestamp)&&(yield"".concat(w,".getTime() <= ").concat(I.maximumTimestamp)),X(I.minimumTimestamp)&&(yield"".concat(w,".getTime() >= ").concat(I.minimumTimestamp)),X(I.multipleOfTimestamp)&&(yield"(".concat(w,".getTime() % ").concat(I.multipleOfTimestamp,") === 0"))}o(l,"FromDate");function*d(I,U,w){yield"(typeof ".concat(w," === 'function')")}o(d,"FromFunction");function*m(I,U,w){yield"Number.isInteger(".concat(w,")"),X(I.exclusiveMaximum)&&(yield"".concat(w," < ").concat(I.exclusiveMaximum)),X(I.exclusiveMinimum)&&(yield"".concat(w," > ").concat(I.exclusiveMinimum)),X(I.maximum)&&(yield"".concat(w," <= ").concat(I.maximum)),X(I.minimum)&&(yield"".concat(w," >= ").concat(I.minimum)),X(I.multipleOf)&&(yield"(".concat(w," % ").concat(I.multipleOf,") === 0"))}o(m,"FromInteger");function*h(I,U,w){let Q=I.allOf.map(q=>Nt(q,U,w)).join(" && ");if(I.unevaluatedProperties===!1){let q=Kt("".concat(new RegExp(ho(I)),";")),K="Object.getOwnPropertyNames(".concat(w,").every(key => ").concat(q,".test(key))");yield"(".concat(Q," && ").concat(K,")")}else if(Se(I.unevaluatedProperties)){let q=Kt("".concat(new RegExp(ho(I)),";")),K="Object.getOwnPropertyNames(".concat(w,").every(key => ").concat(q,".test(key) || ").concat(Nt(I.unevaluatedProperties,U,"".concat(w,"[key]")),")");yield"(".concat(Q," && ").concat(K,")")}else yield"(".concat(Q,")")}o(h,"FromIntersect");function*b(I,U,w){yield"(typeof value === 'object' && Symbol.iterator in ".concat(w,")")}o(b,"FromIterator");function*$(I,U,w){typeof I.const=="number"||typeof I.const=="boolean"?yield"(".concat(w," === ").concat(I.const,")"):yield"(".concat(w," === '").concat(ih.Escape(I.const),"')")}o($,"FromLiteral");function*O(I,U,w){yield"false"}o(O,"FromNever");function*_(I,U,w){let Q=Nt(I.not,U,w);yield"(!".concat(Q,")")}o(_,"FromNot");function*E(I,U,w){yield"(".concat(w," === null)")}o(E,"FromNull");function*k(I,U,w){yield zi.IsNumberLike(w),X(I.exclusiveMaximum)&&(yield"".concat(w," < ").concat(I.exclusiveMaximum)),X(I.exclusiveMinimum)&&(yield"".concat(w," > ").concat(I.exclusiveMinimum)),X(I.maximum)&&(yield"".concat(w," <= ").concat(I.maximum)),X(I.minimum)&&(yield"".concat(w," >= ").concat(I.minimum)),X(I.multipleOf)&&(yield"(".concat(w," % ").concat(I.multipleOf,") === 0"))}o(k,"FromNumber");function*G(I,U,w){yield zi.IsObjectLike(w),X(I.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(w,").length >= ").concat(I.minProperties)),X(I.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(w,").length <= ").concat(I.maxProperties));let Q=Object.getOwnPropertyNames(I.properties);for(let q of Q){let K=Pf.Encode(w,q),ct=I.properties[q];if(I.required&&I.required.includes(q))yield*A(vt(ct,U,K)),(xo(ct)||t(ct))&&(yield"('".concat(q,"' in ").concat(w,")"));else{let sr=Nt(ct,U,K);yield zi.IsExactOptionalProperty(w,q,sr)}}if(I.additionalProperties===!1)if(I.required&&I.required.length===Q.length)yield"Object.getOwnPropertyNames(".concat(w,").length === ").concat(Q.length);else{let q="[".concat(Q.map(K=>"'".concat(K,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(w,").every(key => ").concat(q,".includes(key))")}if(typeof I.additionalProperties=="object"){let q=Nt(I.additionalProperties,U,"".concat(w,"[key]")),K="[".concat(Q.map(ct=>"'".concat(ct,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(w,").every(key => ").concat(K,".includes(key) || ").concat(q,"))")}}o(G,"FromObject");function*R(I,U,w){yield"(typeof value === 'object' && typeof ".concat(w,".then === 'function')")}o(R,"FromPromise");function*N(I,U,w){yield zi.IsRecordLike(w),X(I.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(w,").length >= ").concat(I.minProperties)),X(I.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(w,").length <= ").concat(I.maxProperties));let[Q,q]=Object.entries(I.patternProperties)[0],K=Kt("".concat(new RegExp(Q))),ct=Nt(q,U,"value"),sr=Se(I.additionalProperties)?Nt(I.additionalProperties,U,w):I.additionalProperties===!1?"false":"true",Zn="(".concat(K,".test(key) ? ").concat(ct," : ").concat(sr,")");yield"(Object.entries(".concat(w,").every(([key, value]) => ").concat(Zn,"))")}o(N,"FromRecord");function*C(I,U,w){let Q=Ne(I,U);if(Te.functions.has(I.$ref))return yield"".concat(Rt(I.$ref),"(").concat(w,")");yield*A(vt(Q,U,w))}o(C,"FromRef");function*me(I,U,w){let Q=Kt("".concat(new RegExp(I.source,I.flags),";"));yield"(typeof ".concat(w," === 'string')"),X(I.maxLength)&&(yield"".concat(w,".length <= ").concat(I.maxLength)),X(I.minLength)&&(yield"".concat(w,".length >= ").concat(I.minLength)),yield"".concat(Q,".test(").concat(w,")")}o(me,"FromRegExp");function*le(I,U,w){if(yield"(typeof ".concat(w," === 'string')"),X(I.maxLength)&&(yield"".concat(w,".length <= ").concat(I.maxLength)),X(I.minLength)&&(yield"".concat(w,".length >= ").concat(I.minLength)),I.pattern!==void 0){let Q=Kt("".concat(new RegExp(I.pattern),";"));yield"".concat(Q,".test(").concat(w,")")}I.format!==void 0&&(yield"format('".concat(I.format,"', ").concat(w,")"))}o(le,"FromString");function*ee(I,U,w){yield"(typeof ".concat(w," === 'symbol')")}o(ee,"FromSymbol");function*Z(I,U,w){yield"(typeof ".concat(w," === 'string')");let Q=Kt("".concat(new RegExp(I.pattern),";"));yield"".concat(Q,".test(").concat(w,")")}o(Z,"FromTemplateLiteral");function*we(I,U,w){yield"".concat(Rt(I.$ref),"(").concat(w,")")}o(we,"FromThis");function*$e(I,U,w){if(yield"Array.isArray(".concat(w,")"),I.items===void 0)return yield"".concat(w,".length === 0");yield"(".concat(w,".length === ").concat(I.maxItems,")");for(let Q=0;Q<I.items.length;Q++){let q=Nt(I.items[Q],U,"".concat(w,"[").concat(Q,"]"));yield"".concat(q)}}o($e,"FromTuple");function*V(I,U,w){yield"".concat(w," === undefined")}o(V,"FromUndefined");function*De(I,U,w){let Q=I.anyOf.map(q=>Nt(q,U,w));yield"(".concat(Q.join(" || "),")")}o(De,"FromUnion");function*ue(I,U,w){yield"".concat(w," instanceof Uint8Array"),X(I.maxByteLength)&&(yield"(".concat(w,".length <= ").concat(I.maxByteLength,")")),X(I.minByteLength)&&(yield"(".concat(w,".length >= ").concat(I.minByteLength,")"))}o(ue,"FromUint8Array");function*Ve(I,U,w){yield"true"}o(Ve,"FromUnknown");function*Ee(I,U,w){yield zi.IsVoidLike(w)}o(Ee,"FromVoid");function*et(I,U,w){let Q=Te.instances.size;Te.instances.set(Q,I),yield"kind('".concat(I[v],"', ").concat(Q,", ").concat(w,")")}o(et,"FromKind");function*vt(I,U,w,Q=!0){let q=_e(I.$id)?[...U,I]:U,K=I;if(Q&&_e(I.$id)){let ct=Rt(I.$id);if(Te.functions.has(ct))return yield"".concat(ct,"(").concat(w,")");{let sr=Wt(ct,I,U,"value",!1);return Te.functions.set(ct,sr),yield"".concat(ct,"(").concat(w,")")}}switch(K[v]){case"Any":return yield*A(r(K,q,w));case"Array":return yield*A(n(K,q,w));case"AsyncIterator":return yield*A(i(K,q,w));case"BigInt":return yield*A(s(K,q,w));case"Boolean":return yield*A(a(K,q,w));case"Constructor":return yield*A(u(K,q,w));case"Date":return yield*A(l(K,q,w));case"Function":return yield*A(d(K,q,w));case"Integer":return yield*A(m(K,q,w));case"Intersect":return yield*A(h(K,q,w));case"Iterator":return yield*A(b(K,q,w));case"Literal":return yield*A($(K,q,w));case"Never":return yield*A(O(K,q,w));case"Not":return yield*A(_(K,q,w));case"Null":return yield*A(E(K,q,w));case"Number":return yield*A(k(K,q,w));case"Object":return yield*A(G(K,q,w));case"Promise":return yield*A(R(K,q,w));case"Record":return yield*A(N(K,q,w));case"Ref":return yield*A(C(K,q,w));case"RegExp":return yield*A(me(K,q,w));case"String":return yield*A(le(K,q,w));case"Symbol":return yield*A(ee(K,q,w));case"TemplateLiteral":return yield*A(Z(K,q,w));case"This":return yield*A(we(K,q,w));case"Tuple":return yield*A($e(K,q,w));case"Undefined":return yield*A(V(K,q,w));case"Union":return yield*A(De(K,q,w));case"Uint8Array":return yield*A(ue(K,q,w));case"Unknown":return yield*A(Ve(K,q,w));case"Void":return yield*A(Ee(K,q,w));default:if(!Tt.Has(K[v]))throw new sh(I);return yield*A(et(K,q,w))}}o(vt,"Visit");let Te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Nt(I,U,w,Q=!0){return"(".concat([...vt(I,U,w,Q)].join(" && "),")")}o(Nt,"CreateExpression");function Rt(I){return"check_".concat(oh.Encode(I))}o(Rt,"CreateFunctionName");function Kt(I){let U="local_".concat(Te.variables.size);return Te.variables.set(U,"const ".concat(U," = ").concat(I)),U}o(Kt,"CreateVariable");function Wt(I,U,w,Q,q=!0){let[K,ct]=["\n",wn=>"".padStart(wn," ")],sr=Ft("value","any"),Zn=at("boolean"),nn=[...vt(U,w,Q,q)].map(wn=>"".concat(ct(4)).concat(wn)).join(" &&".concat(K));return"function ".concat(I,"(").concat(sr,")").concat(Zn," {").concat(K).concat(ct(2),"return (").concat(K).concat(nn).concat(K).concat(ct(2),")\n}")}o(Wt,"CreateFunction");function Ft(I,U){let w=Te.language==="typescript"?": ".concat(U):"";return"".concat(I).concat(w)}o(Ft,"CreateParameter");function at(I){return Te.language==="typescript"?": ".concat(I):""}o(at,"CreateReturns");function Nr(I,U,w){let Q=Wt("check",I,U,"value"),q=Ft("value","any"),K=at("boolean"),ct=[...Te.functions.values()],sr=[...Te.variables.values()],Zn=_e(I.$id)?"return function check(".concat(q,")").concat(K," {\n return ").concat(Rt(I.$id),"(value)\n}"):"return ".concat(Q);return[...sr,...ct,Zn].join("\n")}o(Nr,"Build");function Jn(...I){let U={language:"javascript"},[w,Q,q]=I.length===2&&se(I[1])?[I[0],I[1],U]:I.length===2&&!se(I[1])?[I[0],[],I[1]]:I.length===3?[I[0],I[1],I[2]]:I.length===1?[I[0],[],U]:[null,[],U];if(Te.language=q.language,Te.variables.clear(),Te.functions.clear(),Te.instances.clear(),!Se(w))throw new Ef(w);for(let K of Q)if(!Se(K))throw new Ef(K);return Nr(w,Q,q)}o(Jn,"Code"),e.Code=Jn;function Eo(I,U=[]){let w=Jn(I,U,{language:"javascript"}),Q=globalThis.Function("kind","format","hash",w),q=new Map(Te.instances);function K(nn,wn,Fc){if(!Tt.Has(nn)||!q.has(wn))return!1;let bk=Tt.Get(nn),wk=q.get(wn);return bk(wk,Fc)}o(K,"typeRegistryFunction");function ct(nn,wn){return lr.Has(nn)?lr.Get(nn)(wn):!1}o(ct,"formatRegistryFunction");function sr(nn){return Xo(nn)}o(sr,"hashFunction");let Zn=Q(K,ct,sr);return new nh(I,U,Zn,w)}o(Eo,"Compile"),e.Compile=Eo})(Tf||(Tf={}));c();c();var DP={},zz=o(function(e,t,r,n,i){var s=new Worker(DP[t]||(DP[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return s.onmessage=function(a){var u=a.data,l=u.$e$;if(l){var d=new Error(l[0]);d.code=l[1],d.stack=l[2],i(d,null)}else i(null,u)},s.postMessage(r,n),s},"wk"),st=Uint8Array,dr=Uint16Array,Pc=Int32Array,na=new st([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),oa=new st([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_c=new st([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),BP=o(function(e,t){for(var r=new dr(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Pc(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return{b:r,r:i}},"freb"),GP=BP(na,2),hh=GP.b,Nf=GP.r;hh[28]=258,Nf[258]=28;var KP=BP(oa,0),WP=KP.b,lh=KP.r,Sc=new dr(32768);for(Be=0;Be<32768;++Be)Oo=(Be&43690)>>1|(Be&21845)<<1,Oo=(Oo&52428)>>2|(Oo&13107)<<2,Oo=(Oo&61680)>>4|(Oo&3855)<<4,Sc[Be]=((Oo&65280)>>8|(Oo&255)<<8)>>1;var Oo,Be,tn=o(function(e,t,r){for(var n=e.length,i=0,s=new dr(t);i<n;++i)e[i]&&++s[e[i]-1];var a=new dr(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var u;if(r){u=new dr(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var d=i<<4|e[i],m=t-e[i],h=a[e[i]-1]++<<m,b=h|(1<<m)-1;h<=b;++h)u[Sc[h]>>l]=d}else for(u=new dr(n),i=0;i<n;++i)e[i]&&(u[i]=Sc[a[e[i]-1]++]>>15-e[i]);return u},"hMap"),_o=new st(288);for(Be=0;Be<144;++Be)_o[Be]=8;var Be;for(Be=144;Be<256;++Be)_o[Be]=9;var Be;for(Be=256;Be<280;++Be)_o[Be]=7;var Be;for(Be=280;Be<288;++Be)_o[Be]=8;var Be,ra=new st(32);for(Be=0;Be<32;++Be)ra[Be]=5;var Be,HP=tn(_o,9,0),JP=tn(_o,9,1),ZP=tn(ra,5,0),YP=tn(ra,5,1),Ff=o(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),en=o(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),Af=o(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),Ec=o(function(e){return(e+7)/8|0},"shft"),Vi=o(function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new st(e.subarray(t,r))},"slc"),Lf={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},XP=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],St=o(function(e,t,r){var n=new Error(t||XP[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,St),!r)throw n;return n},"err"),QP=o(function(e,t,r,n){var i=e.length,s=n?n.length:0;if(!i||t.f&&!t.l)return r||new st(0);var a=!r,u=a||t.i!=2,l=t.i;a&&(r=new st(i*3));var d=o(function(w){var Q=r.length;if(w>Q){var q=new st(Math.max(Q*2,w));q.set(r),r=q}},"cbuf"),m=t.f||0,h=t.p||0,b=t.b||0,$=t.l,O=t.d,_=t.m,E=t.n,k=i*8;do{if(!$){m=en(e,h,1);var G=en(e,h+1,3);if(h+=3,G)if(G==1)$=JP,O=YP,_=9,E=5;else if(G==2){var me=en(e,h,31)+257,le=en(e,h+10,15)+4,ee=me+en(e,h+5,31)+1;h+=14;for(var Z=new st(ee),we=new st(19),$e=0;$e<le;++$e)we[_c[$e]]=en(e,h+$e*3,7);h+=le*3;for(var V=Ff(we),De=(1<<V)-1,ue=tn(we,V,1),$e=0;$e<ee;){var Ve=ue[en(e,h,De)];h+=Ve&15;var R=Ve>>4;if(R<16)Z[$e++]=R;else{var Ee=0,et=0;for(R==16?(et=3+en(e,h,3),h+=2,Ee=Z[$e-1]):R==17?(et=3+en(e,h,7),h+=3):R==18&&(et=11+en(e,h,127),h+=7);et--;)Z[$e++]=Ee}}var vt=Z.subarray(0,me),Te=Z.subarray(me);_=Ff(vt),E=Ff(Te),$=tn(vt,_,1),O=tn(Te,E,1)}else St(1);else{var R=Ec(h)+4,N=e[R-4]|e[R-3]<<8,C=R+N;if(C>i){l&&St(0);break}u&&d(b+N),r.set(e.subarray(R,C),b),t.b=b+=N,t.p=h=C*8,t.f=m;continue}if(h>k){l&&St(0);break}}u&&d(b+131072);for(var Nt=(1<<_)-1,Rt=(1<<E)-1,Kt=h;;Kt=h){var Ee=$[Af(e,h)&Nt],Wt=Ee>>4;if(h+=Ee&15,h>k){l&&St(0);break}if(Ee||St(2),Wt<256)r[b++]=Wt;else if(Wt==256){Kt=h,$=null;break}else{var Ft=Wt-254;if(Wt>264){var $e=Wt-257,at=na[$e];Ft=en(e,h,(1<<at)-1)+hh[$e],h+=at}var Nr=O[Af(e,h)&Rt],Jn=Nr>>4;Nr||St(3),h+=Nr&15;var Te=WP[Jn];if(Jn>3){var at=oa[Jn];Te+=Af(e,h)&(1<<at)-1,h+=at}if(h>k){l&&St(0);break}u&&d(b+131072);var Eo=b+Ft;if(b<Te){var I=s-Te,U=Math.min(Te,Eo);for(I+b<0&&St(3);b<U;++b)r[b]=n[I+b]}for(;b<Eo;++b)r[b]=r[b-Te]}}t.l=$,t.p=Kt,t.b=b,t.f=m,$&&(m=1,t.m=_,t.d=O,t.n=E)}while(!m);return b!=r.length&&a?Vi(r,0,b):r.subarray(0,b)},"inflt"),Gn=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),ea=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},"wbits16"),jf=o(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return{t:xh,l:0};if(i==1){var a=new st(r[0].s+1);return a[r[0].s]=1,{t:a,l:1}}r.sort(function(C,me){return C.f-me.f}),r.push({s:-1,f:25001});var u=r[0],l=r[1],d=0,m=1,h=2;for(r[0]={s:-1,f:u.f+l.f,l:u,r:l};m!=i-1;)u=r[r[d].f<r[h].f?d++:h++],l=r[d!=m&&r[d].f<r[h].f?d++:h++],r[m++]={s:-1,f:u.f+l.f,l:u,r:l};for(var b=s[0].s,n=1;n<i;++n)s[n].s>b&&(b=s[n].s);var $=new dr(b+1),O=Rf(r[m-1],$,0);if(O>t){var n=0,_=0,E=O-t,k=1<<E;for(s.sort(function(me,le){return $[le.s]-$[me.s]||me.f-le.f});n<i;++n){var G=s[n].s;if($[G]>t)_+=k-(1<<O-$[G]),$[G]=t;else break}for(_>>=E;_>0;){var R=s[n].s;$[R]<t?_-=1<<t-$[R]++-1:++n}for(;n>=0&&_;--n){var N=s[n].s;$[N]==t&&(--$[N],++_)}O=t}return{t:new st($),l:O}},"hTree"),Rf=o(function(e,t,r){return e.s==-1?Math.max(Rf(e.l,t,r+1),Rf(e.r,t,r+1)):t[e.s]=r},"ln"),ph=o(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new dr(++t),n=0,i=e[0],s=1,a=o(function(l){r[n++]=l},"w"),u=1;u<=t;++u)if(e[u]==i&&u!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[u]}return{c:r.subarray(0,n),n:t}},"lc"),ta=o(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),gh=o(function(e,t,r){var n=r.length,i=Ec(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<n;++s)e[i+s+4]=r[s];return(i+4+n)*8},"wfblk"),dh=o(function(e,t,r,n,i,s,a,u,l,d,m){Gn(t,m++,r),++i[256];for(var h=jf(i,15),b=h.t,$=h.l,O=jf(s,15),_=O.t,E=O.l,k=ph(b),G=k.c,R=k.n,N=ph(_),C=N.c,me=N.n,le=new dr(19),ee=0;ee<G.length;++ee)++le[G[ee]&31];for(var ee=0;ee<C.length;++ee)++le[C[ee]&31];for(var Z=jf(le,7),we=Z.t,$e=Z.l,V=19;V>4&&!we[_c[V-1]];--V);var De=d+5<<3,ue=ta(i,_o)+ta(s,ra)+a,Ve=ta(i,b)+ta(s,_)+a+14+3*V+ta(le,we)+2*le[16]+3*le[17]+7*le[18];if(l>=0&&De<=ue&&De<=Ve)return gh(t,m,e.subarray(l,l+d));var Ee,et,vt,Te;if(Gn(t,m,1+(Ve<ue)),m+=2,Ve<ue){Ee=tn(b,$,0),et=b,vt=tn(_,E,0),Te=_;var Nt=tn(we,$e,0);Gn(t,m,R-257),Gn(t,m+5,me-1),Gn(t,m+10,V-4),m+=14;for(var ee=0;ee<V;++ee)Gn(t,m+3*ee,we[_c[ee]]);m+=3*V;for(var Rt=[G,C],Kt=0;Kt<2;++Kt)for(var Wt=Rt[Kt],ee=0;ee<Wt.length;++ee){var Ft=Wt[ee]&31;Gn(t,m,Nt[Ft]),m+=we[Ft],Ft>15&&(Gn(t,m,Wt[ee]>>5&127),m+=Wt[ee]>>12)}}else Ee=HP,et=_o,vt=ZP,Te=ra;for(var ee=0;ee<u;++ee){var at=n[ee];if(at>255){var Ft=at>>18&31;ea(t,m,Ee[Ft+257]),m+=et[Ft+257],Ft>7&&(Gn(t,m,at>>23&31),m+=na[Ft]);var Nr=at&31;ea(t,m,vt[Nr]),m+=Te[Nr],Nr>3&&(ea(t,m,at>>5&8191),m+=oa[Nr])}else ea(t,m,Ee[at]),m+=et[at]}return ea(t,m,Ee[256]),m+et[256]},"wblk"),eE=new Pc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xh=new st(0),tE=o(function(e,t,r,n,i,s){var a=s.z||e.length,u=new st(n+a+5*(1+Math.ceil(a/7e3))+i),l=u.subarray(n,u.length-i),d=s.l,m=(s.r||0)&7;if(t){m&&(l[0]=s.r>>3);for(var h=eE[t-1],b=h>>13,$=h&8191,O=(1<<r)-1,_=s.p||new dr(32768),E=s.h||new dr(O+1),k=Math.ceil(r/3),G=2*k,R=o(function(K){return(e[K]^e[K+1]<<k^e[K+2]<<G)&O},"hsh"),N=new Pc(25e3),C=new dr(288),me=new dr(32),le=0,ee=0,Z=s.i||0,we=0,$e=s.w||0,V=0;Z+2<a;++Z){var De=R(Z),ue=Z&32767,Ve=E[De];if(_[ue]=Ve,E[De]=ue,$e<=Z){var Ee=a-Z;if((le>7e3||we>24576)&&(Ee>423||!d)){m=dh(e,l,0,N,C,me,ee,we,V,Z-V,m),we=le=ee=0,V=Z;for(var et=0;et<286;++et)C[et]=0;for(var et=0;et<30;++et)me[et]=0}var vt=2,Te=0,Nt=$,Rt=ue-Ve&32767;if(Ee>2&&De==R(Z-Rt))for(var Kt=Math.min(b,Ee)-1,Wt=Math.min(32767,Z),Ft=Math.min(258,Ee);Rt<=Wt&&--Nt&&ue!=Ve;){if(e[Z+vt]==e[Z+vt-Rt]){for(var at=0;at<Ft&&e[Z+at]==e[Z+at-Rt];++at);if(at>vt){if(vt=at,Te=Rt,at>Kt)break;for(var Nr=Math.min(Rt,at-2),Jn=0,et=0;et<Nr;++et){var Eo=Z-Rt+et&32767,I=_[Eo],U=Eo-I&32767;U>Jn&&(Jn=U,Ve=Eo)}}}ue=Ve,Ve=_[ue],Rt+=ue-Ve&32767}if(Te){N[we++]=268435456|Nf[vt]<<18|lh[Te];var w=Nf[vt]&31,Q=lh[Te]&31;ee+=na[w]+oa[Q],++C[257+w],++me[Q],$e=Z+vt,++le}else N[we++]=e[Z],++C[e[Z]]}}for(Z=Math.max(Z,$e);Z<a;++Z)N[we++]=e[Z],++C[e[Z]];m=dh(e,l,d,N,C,me,ee,we,V,Z-V,m),d||(s.r=m&7|l[m/8|0]<<3,m-=7,s.h=E,s.p=_,s.i=Z,s.w=$e)}else{for(var Z=s.w||0;Z<a+d;Z+=65535){var q=Z+65535;q>=a&&(l[m/8|0]=d,q=a),m=gh(l,m+1,e.subarray(Z,q))}s.i=a}return Vi(u,0,n+Ec(m)+i)},"dflt"),Vz=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),Bz=o(function(){var e=-1;return{p:o(function(t){for(var r=e,n=0;n<t.length;++n)r=Vz[r&255^t[n]]^r>>>8;e=r},"p"),d:o(function(){return~e},"d")}},"crc");var rE=o(function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new st(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return tE(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},"dopt"),Ih=o(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg"),qP=o(function(e,t,r){for(var n=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<n.length;++a){var u=n[a],l=s[a];if(typeof u=="function"){t+=";"+l+"=";var d=u.toString();if(u.prototype)if(d.indexOf("[native code]")!=-1){var m=d.indexOf(" ",8)+1;t+=d.slice(m,d.indexOf("(",m))}else{t+=d;for(var h in u.prototype)t+=";"+l+".prototype."+h+"="+u.prototype[h].toString()}else t+=d}else r[l]=u}return t},"wcln"),kf=[],Gz=o(function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},"cbfs"),Kz=o(function(e,t,r,n){if(!kf[r]){for(var i="",s={},a=e.length-1,u=0;u<a;++u)i=qP(e[u],i,s);kf[r]={c:qP(e[a],i,s),e:s}}var l=Ih({},kf[r].e);return zz(kf[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,Gz(l),n)},"wrkr"),Wz=o(function(){return[st,dr,Pc,na,oa,_c,hh,WP,JP,YP,Sc,XP,tn,Ff,en,Af,Ec,Vi,St,QP,wh,Uf,nE]},"bInflt"),Hz=o(function(){return[st,dr,Pc,na,oa,_c,Nf,lh,HP,_o,ZP,ra,Sc,eE,xh,tn,Gn,ea,jf,Rf,ph,ta,gh,dh,Ec,Vi,tE,rE,bh,Uf]},"bDflt");var Uf=o(function(e){return postMessage(e,[e.buffer])},"pbf"),nE=o(function(e){return e&&{out:e.size&&new st(e.size),dictionary:e.dictionary}},"gopt"),oE=o(function(e,t,r,n,i,s){var a=Kz(r,n,i,function(u,l){a.terminate(),s(u,l)});return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},"cbify");var Kn=o(function(e,t){return e[t]|e[t+1]<<8},"b2"),xn=o(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),fh=o(function(e,t){return xn(e,t)+xn(e,t+4)*4294967296},"b8"),Gt=o(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function Jz(e,t,r){return r||(r=t,t={}),typeof r!="function"&&St(7),oE(e,t,[Hz],function(n){return Uf(bh(n.data[0],n.data[1]))},0,r)}o(Jz,"deflate");function bh(e,t){return rE(e,t||{},0,0)}o(bh,"deflateSync");function Zz(e,t,r){return r||(r=t,t={}),typeof r!="function"&&St(7),oE(e,t,[Wz],function(n){return Uf(wh(n.data[0],nE(n.data[1])))},1,r)}o(Zz,"inflate");function wh(e,t){return QP(e,{i:2},t&&t.out,t&&t.dictionary)}o(wh,"inflateSync");var iE=o(function(e,t,r,n){for(var i in e){var s=e[i],a=t+i,u=n;Array.isArray(s)&&(u=Ih(n,s[1]),s=s[0]),s instanceof st?r[a]=[s,u]:(r[a+="/"]=[new st(0),u],iE(s,a,r,n))}},"fltn"),zP=typeof TextEncoder<"u"&&new TextEncoder,mh=typeof TextDecoder<"u"&&new TextDecoder,Yz=0;try{mh.decode(xh,{stream:!0}),Yz=1}catch(e){}var Xz=o(function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return{s:t,r:Vi(e,r-1)};i?i==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}},"dutf8");function Cf(e,t){if(t){for(var r=new st(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(zP)return zP.encode(e);for(var i=e.length,s=new st(e.length+(e.length>>1)),a=0,u=o(function(m){s[a++]=m},"w"),n=0;n<i;++n){if(a+5>s.length){var l=new st(a+8+(i-n<<1));l.set(s),s=l}var d=e.charCodeAt(n);d<128||t?u(d):d<2048?(u(192|d>>6),u(128|d&63)):d>55295&&d<57344?(d=65536+(d&1047552)|e.charCodeAt(++n)&1023,u(240|d>>18),u(128|d>>12&63),u(128|d>>6&63),u(128|d&63)):(u(224|d>>12),u(128|d>>6&63),u(128|d&63))}return Vi(s,0,a)}o(Cf,"strToU8");function $h(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(mh)return mh.decode(e);var i=Xz(e),s=i.s,r=i.r;return r.length&&St(8),s}}o($h,"strFromU8");var Qz=o(function(e,t){return t+30+Kn(e,t+26)+Kn(e,t+28)},"slzh"),eV=o(function(e,t,r){var n=Kn(e,t+28),i=$h(e.subarray(t+46,t+46+n),!(Kn(e,t+8)&2048)),s=t+46+n,a=xn(e,t+20),u=r&&a==4294967295?tV(e,s):[a,xn(e,t+24),xn(e,t+42)],l=u[0],d=u[1],m=u[2];return[Kn(e,t+10),l,d,i,s+Kn(e,t+30)+Kn(e,t+32),m]},"zh"),tV=o(function(e,t){for(;Kn(e,t)!=1;t+=4+Kn(e,t+2));return[fh(e,t+12),fh(e,t+4),fh(e,t+20)]},"z64e"),yh=o(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&St(9),t+=n+4}return t},"exfl"),VP=o(function(e,t,r,n,i,s,a,u){var l=n.length,d=r.extra,m=u&&u.length,h=yh(d);Gt(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var b=new Date(r.mtime==null?Date.now():r.mtime),$=b.getFullYear()-1980;if(($<0||$>119)&&St(10),Gt(e,t,$<<25|b.getMonth()+1<<21|b.getDate()<<16|b.getHours()<<11|b.getMinutes()<<5|b.getSeconds()>>1),t+=4,s!=-1&&(Gt(e,t,r.crc),Gt(e,t+4,s<0?-s-2:s),Gt(e,t+8,r.size)),Gt(e,t+12,l),Gt(e,t+14,h),t+=16,a!=null&&(Gt(e,t,m),Gt(e,t+6,r.attrs),Gt(e,t+10,a),t+=14),e.set(n,t),t+=l,h)for(var O in d){var _=d[O],E=_.length;Gt(e,t,+O),Gt(e,t+2,E),e.set(_,t+4),t+=4+E}return m&&(e.set(u,t),t+=m),t},"wzh"),rV=o(function(e,t,r,n,i){Gt(e,t,101010256),Gt(e,t+8,r),Gt(e,t+10,r),Gt(e,t+12,n),Gt(e,t+16,i)},"wzf");function sE(e,t,r){r||(r=t,t={}),typeof r!="function"&&St(7);var n={};iE(e,"",n,t);var i=Object.keys(n),s=i.length,a=0,u=0,l=s,d=new Array(s),m=[],h=o(function(){for(var E=0;E<m.length;++E)m[E]()},"tAll"),b=o(function(E,k){Mf(function(){r(E,k)})},"cbd");Mf(function(){b=r});var $=o(function(){var E=new st(u+22),k=a,G=u-a;u=0;for(var R=0;R<l;++R){var N=d[R];try{var C=N.c.length;VP(E,u,N,N.f,N.u,C);var me=30+N.f.length+yh(N.extra),le=u+me;E.set(N.c,le),VP(E,a,N,N.f,N.u,C,u,N.m),a+=16+me+(N.m?N.m.length:0),u=le+C}catch(ee){return b(ee,null)}}rV(E,a,d.length,G,k),b(null,E)},"cbf");s||$();for(var O=o(function(E){var k=i[E],G=n[k],R=G[0],N=G[1],C=Bz(),me=R.length;C.p(R);var le=Cf(k),ee=le.length,Z=N.comment,we=Z&&Cf(Z),$e=we&&we.length,V=yh(N.extra),De=N.level==0?0:8,ue=o(function(Ve,Ee){if(Ve)h(),b(Ve,null);else{var et=Ee.length;d[E]=Ih(N,{size:me,crc:C.d(),c:Ee,f:le,m:we,u:ee!=k.length||we&&Z.length!=$e,compression:De}),a+=30+ee+V+et,u+=76+2*(ee+V)+($e||0)+et,--s||$()}},"cbl");if(ee>65535&&ue(St(11,0,1),null),!De)ue(null,R);else if(me<16e4)try{ue(null,bh(R,N))}catch(Ve){ue(Ve,null)}else m.push(Jz(R,N,ue))},"_loop_1"),_=0;_<l;++_)O(_);return h}o(sE,"zip");var Mf=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function aE(e,t,r){r||(r=t,t={}),typeof r!="function"&&St(7);var n=[],i=o(function(){for(var E=0;E<n.length;++E)n[E]()},"tAll"),s={},a=o(function(E,k){Mf(function(){r(E,k)})},"cbd");Mf(function(){a=r});for(var u=e.length-22;xn(e,u)!=101010256;--u)if(!u||e.length-u>65558)return a(St(13,0,1),null),i;var l=Kn(e,u+8);if(l){var d=l,m=xn(e,u+16),h=m==4294967295||d==65535;if(h){var b=xn(e,u-12);h=xn(e,b)==101075792,h&&(d=l=xn(e,b+32),m=xn(e,b+48))}for(var $=t&&t.filter,O=o(function(E){var k=eV(e,m,h),G=k[0],R=k[1],N=k[2],C=k[3],me=k[4],le=k[5],ee=Qz(e,le);m=me;var Z=o(function($e,V){$e?(i(),a($e,null)):(V&&(s[C]=V),--l||a(null,s))},"cbl");if(!$||$({name:C,size:R,originalSize:N,compression:G}))if(!G)Z(null,Vi(e,ee,ee+R));else if(G==8){var we=e.subarray(ee,ee+R);if(N<524288||R>.8*N)try{Z(null,wh(we,{out:new st(N)}))}catch($e){Z($e,null)}else n.push(Zz(we,{size:N},Z))}else Z(St(14,"unknown compression type "+G,1),null);else Z(null,null)},"_loop_3"),_=0;_<d;++_)O(_)}else a(null,{});return i}o(aE,"unzip");c();var nV=o(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),oV=o(e=>e!=null,"notNull"),Df=o((e,t,r=0)=>{var n;if(x.IsNull(e))return"null";if(x.IsUndefined(e))return"undefined";if(x.IsString(e))return"<string>";if(x.IsNumber(e))return"<number>";if(x.IsBoolean(e))return"<boolean>";if(x.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(x.IsRef(e)){let i=t.find(s=>s.$id===e.$ref);return i==null?e.$ref:Df(i,t,r)}if(x.IsArray(e))return"".concat(Df(e.items,t,r+1),"[]");if(x.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let s="".concat(e.anyOf.map(a=>Df(a,t,r+1)).filter(oV).join(" | "));return r>0?"(".concat(s,")"):s}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),iV=o((e,t,r)=>{var s;let n=t.message;x.IsUnion(t.schema)&&(n="Expected one of: ".concat(Df(t.schema,r)));let i="#/definitions/".concat(e).concat((s=nV(t.path))!=null?s:"");return"".concat(i,": ").concat(n)},"errorHandler"),qf=o((e,t,r)=>{let n=t.First();if(n!=null)return iV(e,n,r)},"shortError");var ia;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(ia||(ia={}));var Oh=class Oh extends Error{constructor(r,n){super(n);tt(this,"name");tt(this,"kind");this.name="CompressError",this.kind=r}};o(Oh,"CompressError");var sa=Oh,sV=o(e=>new sa(ia.Archive,e.message),"flateErrorIntoCompressError"),aV=o(e=>{let t=Object.values(Lf);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),cV=o((e,t,r)=>{var n;return new sa(ia.Validate,(n=qf(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),uV=o(e=>new sa(ia.Encode,e.message),"encodeErrorIntoCompressError"),fV=o(e=>new sa(ia.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),vh=o((e,t,r)=>t instanceof Ui?uV(t):t instanceof Yr?cV(e,t,r):aV(t)?sV(t):fV(t),"intoCompressError");c();var aa;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(aa||(aa={}));var Sh=class Sh extends Error{constructor(r,n){super(n);tt(this,"name");tt(this,"kind");this.name="DecompressError",this.kind=r}};o(Sh,"DecompressError");var ca=Sh,lV=o(e=>new ca(aa.Unarchive,e.message),"flateErrorIntoDecompressError"),pV=o(e=>{let t=Object.values(Lf);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),dV=o((e,t,r)=>{var n;return new ca(aa.Validate,(n=qf(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),mV=o(e=>new ca(aa.Decode,e.message),"decodeErrorIntoDecompressError"),yV=o(e=>new ca(aa.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),_h=o((e,t,r)=>t instanceof Li?mV(t):t instanceof Yr?dV(e,t,r):pV(t)?lV(t):yV(t),"intoDecompressError");c();c();c();var hV=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,gV=[0,31,28,31,30,31,30,31,31,30,31,30,31],xV=o(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),zf=o(e=>{let t=hV.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&xV(r)?29:gV[n])},"date");c();var IV=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,Vf=o(e=>{let t=IV.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3],s=t[4],a=t[5]==="-"?-1:1,u=+(t[6]||0),l=+(t[7]||0);if(u>23||l>59||!s)return!1;if(r<=23&&n<=59&&i<60)return!0;let d=n-l*a,m=r-u*a-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&i<61},"time");var bV=/t|\s/i,cE=o(e=>{let t=e.split(bV);return t.length===2&&zf(t[0])&&Vf(t[1])},"dateTime");c();var wV=/\/|:/,$V=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,uE=o(e=>wV.test(e)&&$V.test(e),"uri");var vV=[["date",zf],["time",Vf],["date-time",cE],["uri",uE]],fE=o(()=>{for(let[e,t]of vV)try{ff.Format(e,t)}catch(r){if(r instanceof wc)continue;throw r}},"registerFormats");c();c();c();var lE=o(e=>e instanceof Error?e:new Error(String(e)),"asError");var Bf=o(e=>(...t)=>{try{return B(e(...t))}catch(r){return W(lE(r))}},"safeFn");var OV=Bf((e,t)=>{let r={};for(let n of t)for(let i of n.intoBundle(e))r[i.path]=Cf(JSON.stringify(i.contents));return r}),Ph=o(async(e,t,r)=>OV(e,t).andThenAsync(n=>new Promise(i=>{sE(n,F(g({},r),{consume:!0}),(s,a)=>{i(s?W(s):B(a))})})),"compress");c();c();function Gf(e,t,r=[]){let n=g({},e);for(let[i,s]of Object.entries(t))if(s!==void 0)if(i in n){let a=i;if(Array.isArray(s)&&s.length>0){let u=_V(s[0],r);if(u){let l=n[a];if(!Array.isArray(l))throw new Error("Expected array at ".concat(i,", got ").concat(typeof l));let d=new Map(s.map(b=>[pE(b,u),b])),h=l.map(b=>{let $=d.get(pE(b,u));return $?Gf(b,$,r):b});n[a]=h}else n[a]=s}else{let u=n[a];typeof u=="object"&&u!==null&&typeof s=="object"&&s!==null?Object.keys(s).length===0?n[a]=s:n[a]=Gf(u,s,r):n[i]=s}}else n[i]=s;return n}o(Gf,"deepMergeOn");function _V(e,t){function r(n){if(typeof n!="object"||n===null)return null;for(let i of t)if(i in n&&typeof n[i]<"u")return[i];if(Array.isArray(n))return null;for(let[i,s]of Object.entries(n)){let a=r(s);if(a)return[i,...a]}return null}return o(r,"search"),r(e)}o(_V,"findIdentifierKey");function pE(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}o(pE,"getValueByKeyPath");var SV=o(e=>e,"identity"),PV=o(e=>JSON.parse($h(e)),"jsonDecode"),EV=o((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,SV)!==void 0),"isFileExpected"),TV=Bf((e,t)=>{let r={};for(let n of Object.keys(e)){let i=e[n];for(let s of t){let a=s.fromBundle(n,i,PV);if(a){r=Gf(r,a,[]);break}}}return r}),Eh=o(async(e,t)=>new Promise(r=>aE(e,{filter:o(n=>EV(n,t),"filter")},(n,i)=>{r(n?W(n):B(i))})).then(r=>r.andThen(n=>TV(n,t))),"decompress");c();var kV=o(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),FV=o(e=>{if(e.length<2)return!1;let t=e.filter(kV);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),Kf=o(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&FV(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Kf(r)])):Array.isArray(e)?e.map(Kf):e,"fixDuplicateAllOf");c();var Wf=o(e=>typeof e=="object"&&e!=null&&"$ref"in e?F(g({},e),{$ref:"#/definitions/".concat(e.$ref)}):typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Wf(r)])):Array.isArray(e)?e.map(Wf):e,"prefixReferences");var ua;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(ua||(ua={}));var AV=o(e=>({next(){for(let r of e){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),jV=o((...e)=>{let t=new Map;for(let r of AV(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return W({kind:ua.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});t.set(r.$id,r)}return B(t)},"computeReferenceMap"),rn,Bi,So,In,Jf=class Jf{constructor(t,r,n,i){Pt(this,rn);Pt(this,Bi);Pt(this,So,[]);Pt(this,In);Ct(this,rn,t),Ct(this,Bi,r),Ct(this,So,n),Ct(this,In,i),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(t,r="CoreMVF"){let n=f.Composite(t.extensions.map(s=>s.schema),{$id:r});if(!x.IsSchema(n))return W({kind:ua.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=jV(yy.values(),cy.values(),fy.values(),py.values(),dy.values(),Oy.values(),t.extensions.flatMap(s=>{var a;return(a=s.references)!=null?a:[]}).values());if(!i.isOk())return i;try{fE();let s=Tf.Compile(n,[...i.value.values()]);return B(new Jf(n,s,t.extensions,i.value))}catch(s){return s instanceof re?W({kind:ua.TypeboxError,message:s.message,original:s}):W({kind:ua.UnknownError,message:"An unknown error occurred while compiling the schema",original:s})}}is(t){return H(this,Bi).Check(t)}parse(t){return H(this,Bi).Check(t)?B(t):W(H(this,Bi).Errors(t))}decode(t){try{return B(LP(H(this,rn),[...H(this,In).values()],t))}catch(r){return W(r)}}encode(t){try{return B(UP(H(this,rn),[...H(this,In).values()],t))}catch(r){return W(r)}}verify(t){for(let r of H(this,So))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return W(n.error)}return B(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([H(this,rn),...H(this,In).values()])),r=Kf(Wf({$id:"#/definitions/".concat((n=H(this,rn).$id)!=null?n:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:t}));return JSON.stringify(r,null,2)}async compress(t){return this.encode(t).andThen(r=>this.parse(r)).andThenAsync(r=>Ph(r,H(this,So))).then(r=>r.mapErr(n=>{var i;return vh((i=H(this,rn).$id)!=null?i:"CoreMVF",n,[...H(this,In).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>Ph(r,H(this,So))).then(r=>r.mapErr(n=>{var i;return vh((i=H(this,rn).$id)!=null?i:"CoreMVF",n,[...H(this,In).values()])}))}async decompress(t){return Eh(t,H(this,So)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var i;return _h((i=H(this,rn).$id)!=null?i:"CoreMVF",n,[...H(this,In).values()])}))}async decompressUnsafe(t){return Eh(t,H(this,So)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var i;return _h((i=H(this,rn).$id)!=null?i:"CoreMVF",n,[...H(this,In).values()])}))}};rn=new WeakMap,Bi=new WeakMap,So=new WeakMap,In=new WeakMap,o(Jf,"MVFParser");var Hf=Jf;var fa,Th=class Th{constructor(){Pt(this,fa,[]);this.extend=this.extend.bind(this)}extend(t){return H(this,fa).push(t),this}extendOptional(t){let r=F(g({},t),{schema:f.Partial(t.schema)});return H(this,fa).push(r),this}build(){return Hf.create(this)}get extensions(){return H(this,fa)}};fa=new WeakMap,o(Th,"MVFParserBuilder");var Zf=Th;var dE=o(()=>new Zf().extend(XS).extend(oP).extend(cP),"createParser");var Gi=mt("lcat","LocationCategoryId"),kh=f.Intersect([f.Object({id:f.Ref(Gi),parent:f.Optional(f.Ref(Gi))}),Ri(["name"]),gn],{$id:"LocationCategory"}),mE=[Gi,kh];c();c();var Ki;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Ki||(Ki={}));var yE=o(e=>{var i,s,a,u,l,d,m,h,b;if(e.locationCategories==null&&e.locations==null)return B(!0);let t=new Set((s=(i=e.locationCategories)==null?void 0:i.map($=>$.id))!=null?s:[]);for(let $ of(a=e.locationCategories)!=null?a:[])if($.parent!=null&&!t.has($.parent))return W({kind:Ki.UnknownParentCategoryError,properties:{categoryId:$.id,parentCategoryId:$.parent}});let r=kt(e);for(let $ of(u=e.locations)!=null?u:[]){for(let O of $.categories)if(!t.has(O))return W({kind:Ki.UnknownCategoryError,properties:{locationId:$.id,categoryId:O}});for(let O of $.geometryAnchors){let _=r(O.floorId,O.geometryId);if(_.isErr())return _}}let n=new Set((d=(l=e.locations)==null?void 0:l.map($=>$.id))!=null?d:[]);for(let $ of(m=e.locationInstances)!=null?m:[]){if(!n.has($.parentId))return W({kind:Ki.UnknownParentLocationError,properties:{locationInstanceId:$.id,parentLocationId:$.parentId}});for(let O of(h=$.categories)!=null?h:[])if(!t.has(O))return W({kind:Ki.UnknownCategoryError,properties:{locationId:$.id,categoryId:O}});for(let O of(b=$.geometryAnchors)!=null?b:[]){let _=r(O.floorId,O.geometryId);if(_.isErr())return _}}return B(!0)},"validateLocations");c();var Wi=mt("loc","LocationId"),Yf=mt("loci","LocationInstanceId"),hE=f.Object({name:f.String(),url:f.String({format:"uri"})},{$id:"LocationSocial"}),gE=f.Object({url:f.String({format:"uri"})},{$id:"LocationImage"}),Fh=f.Object({label:f.String(),url:f.String({format:"uri"})},{$id:"LocationLink"}),Ah=f.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),xE=f.Union([f.Literal("Sunday"),f.Literal("Monday"),f.Literal("Tuesday"),f.Literal("Wednesday"),f.Literal("Thursday"),f.Literal("Friday"),f.Literal("Saturday")],{$id:"OpeningHoursDay"}),NV="PublicHolidays",jh=f.Union([xE,f.Literal(NV)],{$id:"OpeningHoursDayOrPublicHoliday"}),Xf=f.Object({"@type":f.Optional(f.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:f.Optional(f.Ref(Ah,{description:"The time the opening hours start"})),closes:f.Optional(f.Ref(Ah,{description:"The time the opening hours end"})),dayOfWeek:f.Optional(f.Union([f.Ref(jh),f.Array(f.Ref(jh))],{description:"The days of the week the opening hours apply to"})),validFrom:f.Optional(f.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:f.Optional(f.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),Qf=f.Intersect([f.Object({id:f.Ref(Wi),categories:f.Array(f.Ref(Gi)),logo:f.Optional(f.String({format:"uri"})),phone:f.Optional(f.String()),social:f.Array(f.Ref(hE)),images:f.Array(f.Ref(gE)),links:f.Array(f.Ref(Fh)),website:f.Optional(f.Ref(Fh)),openingHours:f.Optional(f.Array(f.Ref(Xf)))}),Ri(["name"]),Ci(),gn],{$id:"Location"}),Nh=f.Intersect([f.Object({id:f.Ref(Yf),parentId:f.Ref(Wi)}),f.Partial(f.Omit(Qf,["id","parentId"]))],{$id:"LocationInstance"}),el=[Wi,Yf,hE,gE,Fh,Ah,xE,jh,Xf,Qf,Nh];var RV=f.Object({locations:f.Array(f.Ref(Qf)),locationCategories:f.Array(f.Ref(kh)),locationInstances:f.Optional(f.Array(f.Ref(Nh)))},{$id:"LocationsExtensionSchema"}),IE="locations.json",bE="location-categories.json",wE="location-instances.json",$E={name:"ext:locations",schema:RV,intoBundle:o(function*(e){e.locations!=null&&(yield{path:IE,contents:e.locations}),e.locationCategories!=null&&(yield{path:bE,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:wE,contents:e.locationInstances})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===IE)return{locations:r(t)};if(e===bE)return{locationCategories:r(t)};if(e===wE)return{locationInstances:r(t)}},"fromBundle"),references:[...mE,...el],integrityCheck:yE};c();c();var Wn;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(Wn||(Wn={}));var vE=o(e=>{var l,d,m,h,b,$,O,_,E,k,G,R,N,C,me,le,ee,Z,we,$e;if(e.enterprise==null)return B(!0);let t=e.enterprise,r=new Set((d=(l=e.locationCategories)==null?void 0:l.map(V=>V.id))!=null?d:[]);for(let V of(m=t.categories)!=null?m:[])if(!r.has(V.categoryId))return W({kind:Wn.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:V.id,locationCategoryId:V.categoryId}});let n=new Set((b=(h=e.locations)==null?void 0:h.map(V=>V.id))!=null?b:[]);for(let V of($=t.locations)!=null?$:[]){if(!n.has(V.locationId))return W({kind:Wn.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:V.id,locationId:V.locationId}});for(let De of(O=V.siblingGroups)!=null?O:[])for(let ue of(_=De.siblings)!=null?_:[])if(!n.has(ue))return W({kind:Wn.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:V.id,siblingLocationId:ue,label:De.label}})}let i=new Set((k=(E=e.enterprise.locations)==null?void 0:E.map(V=>V.id))!=null?k:[]);if(((G=t.venue)==null?void 0:G.topLocations)!=null){for(let V of t.venue.topLocations)if(!i.has(V))return W({kind:Wn.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:V}})}let s=new Set((N=(R=e.locationInstances)==null?void 0:R.map(V=>V.id))!=null?N:[]);for(let V of(C=t.locationInstances)!=null?C:[]){if(!i.has(V.parentId))return W({kind:Wn.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:V.id,enterpriseLocationId:V.parentId}});if(!s.has(V.locationInstanceId))return W({kind:Wn.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:V.id,locationInstanceId:V.locationInstanceId}});for(let De of(me=V.siblingGroups)!=null?me:[])for(let ue of(le=De.siblings)!=null?le:[])if(!n.has(ue))return W({kind:Wn.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:V.id,siblingLocationId:ue,label:De.label}})}let a=Io(e),u=kt(e);for(let[V,De]of rr((ee=t.floorText)!=null?ee:{})){let ue=a(V);if(ue.isErr())return ue;for(let Ve of De.features){if(!("geometryId"in Ve.properties))continue;let Ee=u(V,Ve.properties.geometryId);if(Ee.isErr())return Ee}}for(let[V,De]of rr((Z=t.textures)!=null?Z:{})){let ue=a(V);if(ue.isErr())return ue;for(let Ve of De){let Ee=u(V,Ve.geometryId);if(Ee.isErr())return Ee}}for(let[V,De]of rr((we=t.layers)!=null?we:{})){let ue=a(V);if(ue.isErr())return ue;for(let Ve of Ke(De!=null?De:{})){let Ee=u(V,Ve);if(Ee.isErr())return Ee}}for(let[V,De]of rr(($e=t.textAreas)!=null?$e:{})){let ue=a(V);if(ue.isErr())return ue;for(let Ve of De.features)if("geometryId"in Ve.properties){let Ee=u(V,Ve.properties.geometryId);if(Ee.isErr())return Ee}}return B(!0)},"validateCMS");c();c();var Hi=mt("el","EnterpriseLocationId"),Rh=mt("ec","EnterpriseCategoryId"),Ch=mt("eli","EnterpriseLocationInstanceId"),Mh=mt("ev","EnterpriseVenueId"),Lh=mt("eft","EnterpriseFloorTextId"),OE=[Hi,Rh,Ch,Mh,Lh];var _E=f.Object({id:f.Ref(Rh),categoryId:f.Ref(Gi),color:f.Optional(f.String()),sortOrder:f.Number(),iconFromDefaultList:f.Optional(f.Union([f.String(),f.Null()])),picture:f.Optional(f.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),Uh=f.Object({categories:f.Optional(f.Array(f.Ref(_E)))},{$id:"EnterpriseCategoriesSchema"}),SE=[_E,Uh];c();var PE=Or(["left","center","right"]),CV=PE.schema,Khe=PE.values,Dh=f.Object({id:f.Ref(Lh),text:f.String(),visible:f.Boolean({default:!0}),fontSize:f.Number({default:12,minimum:1}),fontFamily:f.String({default:"Droid Sans"}),color:f.String({default:"black"}),rotation:f.Number({minimum:0,maximum:360}),align:CV},{$id:"FloorTextCommonProperties"}),qh=f.Intersect([f.Ref(Dh),Jr],{$id:"AnchoredFloorTextProperties"}),zh=f.Intersect([f.Ref(Dh),f.Object({verticalOffset:f.Number()})],{$id:"FloatingFloorTextProperties"}),EE=f.Union([f.Ref(qh),f.Ref(zh)],{$id:"FloorTextProperties"}),TE=zt(tr,f.Ref(EE),{$id:"FloorTextFeature"}),MV=zt(tr,f.Ref(qh),{$id:"AnchoredFloorTextFeature"}),LV=zt(tr,f.Ref(zh),{$id:"FloatingFloorTextFeature"}),kE=pr(f.Ref(TE),{$id:"EnterpriseFloorTextFeatureCollection"}),FE=f.Record(je,f.Ref(kE),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),Vh=f.Object({floorText:f.Optional(f.Ref(FE))},{$id:"EnterpriseFloorTextSchema"}),AE=[Dh,qh,zh,EE,TE,MV,LV,kE,FE,Vh];c();var jE=bt(f.Record(er,f.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),NE=bt(f.Record(je,f.Ref(jE),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),Bh=f.Object({layers:f.Optional(f.Ref(NE))},{$id:"EnterpriseLayersSchema"}),RE=[jE,NE,Bh];c();c();c();var Gh=Or(["closed-temporarily","new","pop-up","coming-soon","relocated"]),UV=Gh.schema,nge=Gh.values,oge=Gh.record,Kh=f.Object({type:UV,start:f.Optional(f.String({format:"date",description:"The start date of the state"})),end:f.Optional(f.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),Wh=f.Object({label:f.String(),siblings:f.Array(f.Ref(Wi))},{$id:"SiblingGroup"}),tl=f.Object({name:f.String(),code:f.String()},{$id:"Language"}),CE=[Kh,Wh,tl];var rl=f.Object({id:f.Ref(Hi),locationId:f.Ref(Wi),type:f.String(),sortOrder:f.Number(),tags:f.Optional(f.Array(f.String())),picture:f.Optional(f.String({format:"uri",description:"The picture of the location"})),states:f.Optional(f.Array(f.Ref(Kh),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:f.Optional(f.Array(f.Ref(Wh))),gallery:f.Optional(f.Array(f.Object({caption:f.Optional(f.String()),image:f.String({format:"uri"}),embeddedUrl:f.Optional(f.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:f.Optional(f.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:f.Optional(f.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:f.Optional(f.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),Hh=f.Object({locations:f.Optional(f.Array(f.Ref(rl)))},{$id:"EnterpriseLocationsSchema"}),ME=[rl,Hh];var LE=f.Intersect([f.Object({id:f.Ref(Ch),parentId:f.Ref(Hi),locationInstanceId:f.Ref(Yf)}),f.Partial(f.Omit(rl,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),Jh=f.Object({locationInstances:f.Optional(f.Array(f.Ref(LE)))},{$id:"EnterpriseLocationInstancesSchema"}),UE=[LE,Jh];c();var Zh=Or(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),DE=Zh.schema,vge=Zh.values,Oge=Zh.record,Yh=f.Object({maxWidth:f.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:f.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:f.Ref(DE),rotation:f.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),qE=f.Intersect([f.Ref(Yh),Jr],{$id:"EnterpriseAnchoredTextAreaProperties"}),zE=f.Intersect([f.Ref(Yh),f.Object({verticalOffset:f.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),VE=f.Union([qE,zE],{$id:"EnterpriseTextAreaProperties"}),BE=zt(f.Ref(tr),VE,{$id:"EnterpriseTextAreaFeature"}),GE=pr(f.Ref(BE),{$id:"EnterpriseTextAreaCollection"}),KE=f.Record(je,f.Ref(GE),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),WE=f.Object({textAreas:f.Optional(f.Ref(KE))},{$id:"EnterpriseTextAreasSchema"}),HE=[DE,Yh,qE,zE,VE,BE,GE,KE];c();var Xh=f.Object({u:f.Number(),v:f.Number()},{$id:"EnterpriseTextureUV"}),Qh=Or(["top","side"],{$id:"EnterpriseTextureFace"}),JE=Qh.schema,Tge=Qh.values,kge=Qh.record,eg=Or(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),ZE=eg.schema,Fge=eg.values,Age=eg.record,YE=f.Tuple([Bs,Gs,Bs,Gs],{$id:"EnterpriseTextureBounds"}),XE=f.Intersect([f.Object({repeat:f.Ref(Xh),offset:f.Ref(Xh),rotation:f.Number({minimum:0,maximum:360}),path:f.String({format:"uri"}),face:f.Ref(JE),surface:f.Ref(ZE),bounds:f.Ref(YE)},{$id:"EnterpriseTextureProperties"}),Jr],{$id:"EnterpriseTexture"}),QE=f.Array(f.Ref(XE),{$id:"EnterpriseTextures"}),eT=f.Record(je,f.Ref(QE),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),tg=f.Object({textures:f.Optional(f.Ref(eT))},{$id:"EnterpriseTexturesSchema"}),tT=[XE,QE,tg,Xh,JE,ZE,YE,eT];c();var rT=f.Intersect([f.Object({id:f.Ref(Mh),slug:f.String(),defaultLanguage:f.Ref(tl),languages:f.Array(f.Ref(tl)),countrycode:f.Optional(f.String()),logo:f.Optional(f.String({format:"uri"})),mappedinWebUrl:f.Optional(f.String({format:"uri"})),topLocations:f.Optional(f.Array(f.Ref(Hi))),operationHours:f.Optional(f.Array(f.Ref(Xf))),coverImage:f.Optional(f.String({format:"uri"}))}),Ri(["name"]),gn],{$id:"EnterpriseVenue"}),rg=f.Object({venue:f.Optional(f.Ref(rT))},{$id:"EnterpriseVenueSchema"}),nT=[rT,rg];var iT=f.Intersect([rg,Hh,Jh,Uh,tg,Vh,Bh,WE],{$id:"EnterpriseProperties"}),oT=f.Object({enterprise:f.Optional(f.Ref(iT))},{$id:"CMSExtensionSchema"}),DV=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,sT={name:"ext:cms",schema:oT,intoBundle:o(function*(e){var r,n,i,s,a,u;if(e.enterprise==null)return;let t=e.enterprise;for(let l of Ke(t))switch(l){case"floorText":for(let d of Ke((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(d,".geojson"),contents:((n=t.floorText)!=null?n:{})[d]};continue;case"textures":for(let d of Ke((i=t.textures)!=null?i:{}))yield{path:"enterprise/textures/".concat(d,".json"),contents:((s=t.textures)!=null?s:{})[d]};continue;case"textAreas":for(let d of Ke((a=t.textAreas)!=null?a:{}))yield{path:"enterprise/textAreas/".concat(d,".geojson"),contents:((u=t.textAreas)!=null?u:{})[d]};continue;default:yield{path:"enterprise/".concat(l,".json"),contents:t[l]};continue}},"intoBundle"),fromBundle:o((e,t,r)=>{let n=e.match(DV);if(!n)return;let[,i,s]=n,a=r(t);switch(i){case"floorText":case"textures":case"textAreas":return{enterprise:{[i]:{[s]:a}}};default:return{enterprise:{[s]:a}}}},"fromBundle"),references:[iT,oT,...nT,...ME,...UE,...SE,...tT,...RE,...AE,...HE,...OE,...CE,...el],integrityCheck:vE};c();c();c();c();var bn;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(bn||(bn={}));var aT=o(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return B(!0);let r=Object.entries(t).map(([s,a])=>g({key:s},a)).sort((s,a)=>s.index!==a.index?s.index-a.index:s.bit-a.bit),n=0,i=-1;for(let s of r){if(s.bit===i)return W({kind:bn.NavigationFlagDuplicateBit,properties:{index:s.index,bit:s.bit,path:"navigationFlags.".concat(s.key)}});if(s.index!=n){if(i!=31)return W({kind:bn.NavigationFlagMissingDeclaration,properties:{index:n,bit:i+1,path:"navigationFlags"}});if(s.index!=n+1||s.bit!=0)return W({kind:bn.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=s.index,i=0}else{if(s.bit!==i+1)return W({kind:bn.NavigationFlagMissingDeclaration,properties:{index:s.index,bit:i+1,path:"navigationFlags"}});i=s.bit}}return B(!0)},"validateNavigationFlags");c();var cT=2**32-1,Tc=o(e=>{var i;let t=Object.keys((i=e.navigationFlags)!=null?i:{}).length;if(t===0)return{index:-1,flag:0};let r=Math.floor(t/32),n=t%32;return{index:r,flag:2**n-1}},"determineMaxNavigationFlags"),la=o((e,t,r)=>{if(t.index==-1&&e.length===0)return B(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return W({kind:bn.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let i=0;i<e.length;i++){let s=e[i];if(i<t.index){if(s>cT)return W({kind:bn.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:cT,path:r}});continue}else if(s>t.flag)return W({kind:bn.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:t.flag,path:r}})}return B(!0)},"validateFlags");var qV=f.Object({index:f.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:f.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),uT=f.Intersect([qV,hn],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'});var fT=f.Record(f.String(),uT,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),zV=f.Object({navigationFlags:f.Ref(fT)},{$id:"NavigationFlagsSchema"}),nl=f.Array(f.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),ng=f.Object({flags:f.Ref(nl)},{$id:"WithFlags"}),Ji=f.Intersect([Vs,ng],{$id:"FlaggedGeometryAnchor"}),VV=f.Object({geometryAnchor:Ji},{$id:"WithFlaggedGeometryAnchor"}),BV=f.Object({geometryAnchors:f.Array(Ji)},{$id:"WithFlaggedGeometryAnchors"}),lT={name:"ext:mvf-navigation-flags",schema:zV,intoBundle:o(function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},"intoBundle"),fromBundle:o((e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},"fromBundle"),references:[uT,fT,nl,Ji,VV,BV],integrityCheck:aT};c();var pT=o(e=>{if(e.connections==null)return B(!0);let t=kt(e),r=Tc(e);for(let[n,i]of e.connections.entries()){for(let[s,a]of i.entrances.entries()){let u=t(a.floorId,a.geometryId);if(u.isErr())return u;let l=la(a.flags,r,"connections[".concat(n,"].entrances[").concat(s,"]"));if(l.isErr())return l}for(let[s,a]of i.exits.entries()){let u=t(a.floorId,a.geometryId);if(u.isErr())return u;let l=la(a.flags,r,"connections[".concat(n,"].exits[").concat(s,"]"));if(l.isErr())return l}}return B(!0)},"validateConnections");var mT=mt("c","ConnectionId"),{schema:GV,values:Rxe,record:Cxe}=Or(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),yT=GV;var hT=f.Intersect([f.Object({id:f.Ref(mT,{description:"The unique identifier for the connection."}),entrances:f.Array(f.Ref(Ji)),exits:f.Array(f.Ref(Ji)),entryCost:f.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:f.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:f.Ref(yT,{description:"The type of connection."})}),hn,gn],{$id:"ConnectionsProperties"}),gT=f.Array(f.Ref(hT),{$id:"ConnectionsCollection"}),KV=f.Object({connections:f.Ref(gT)},{$id:"ConnectionsExtensionSchema"}),dT="connections.json",xT={name:"ext:connections",schema:KV,intoBundle:o(function*(e){e.connections!=null&&(yield{path:dT,contents:e.connections})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===dT)return{connections:r(t)}},"fromBundle"),references:[hT,gT,yT,mT,Ji,nl],integrityCheck:pT};c();c();var IT=o(e=>{if(e.defaultStyle==null)return B(!0);let t=kt(e);for(let r of Object.values(e.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let i=t(n.floorId,n.geometryId);if(i.isErr())return i}return B(!0)},"validateDefaultStyle");var bT=f.Intersect([Ci(),gn,f.Object({altitude:f.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:f.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:f.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:f.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:f.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:f.Optional(f.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),wT=f.Record(f.String(),f.Ref(bT),{$id:"DefaultStyleCollection",additionalProperties:!1}),WV=f.Object({defaultStyle:f.Ref(wT)},{$id:"DefaultStyleSchema"}),$T={name:"ext:mvf-default-style",schema:WV,intoBundle:o(function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},"fromBundle"),references:[bT,wT],integrityCheck:IT};c();c();c();c();var ol;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(ol||(ol={}));var vT=o(e=>{if(e.floorStacks==null)return B(!0);let t=Io(e);for(let r of e.floorStacks){for(let n of r.floors){let i=t(n);if(i.isErr())return i}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return W({kind:ol.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return B(!0)},"validateFloorStacks");var il=mt("fs","FloorStackId"),_T=f.Intersect([f.Object({id:f.Ref(il,{description:"The unique identifier for the floor stack."}),floors:f.Array(f.Ref(je),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:f.Optional(f.Ref(je,{description:"The default floor for the floor stack."}))}),hn],{$id:"FloorStacksProperties"}),ST=f.Array(f.Ref(_T),{$id:"FloorStackCollection"}),HV=f.Object({floorStacks:f.Ref(ST)},{$id:"FloorStackExtensionSchema"}),OT="floor-stacks.json",PT={name:"ext:floor-stacks",schema:HV,intoBundle:o(function*(e){e.floorStacks!=null&&(yield{path:OT,contents:e.floorStacks})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===OT)return{floorStacks:r(t)}},"fromBundle"),references:[il,_T,ST],integrityCheck:vT};c();c();var kc;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(kc||(kc={}));var ET=o(e=>{if(e.facade==null)return B(!0);if(e.floorStacks==null)return W({kind:kc.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=kt(e);for(let[n,i]of rr(e.facade))if(i!=null){if(!t.has(n))return W({kind:kc.UnknownFloorStackError,properties:{floorStackId:n}});for(let s of i.geometryAnchors){let a=r(s.floorId,s.geometryId);if(a.isErr())return a}}return B(!0)},"validateFacade");var TT=mt("fc","FacadeId"),kT=f.Intersect([f.Object({id:f.Ref(TT)}),Ci({minItems:1})],{$id:"FacadeProperties"}),JV=f.Object({facade:bt(f.Record(il,f.Ref(kT),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),ZV=/^facade\/(.*)\.json$/,FT={name:"ext:facade",schema:JV,intoBundle:o(function*(e){if(e.facade!=null)for(let t of Ke(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(ZV))==null?void 0:i[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[TT,kT],integrityCheck:ET};c();c();var AT=o(e=>{if(e.floorImages==null)return B(!0);let t=kt(e);for(let[r,n]of rr(e.floorImages))if(n!=null)for(let i of n.features){if(!("geometryId"in i.properties))continue;let s=i.properties.geometryId,a=t(r,s);if(a.isErr())return a}return B(!0)},"validateFloorImages");var og=f.Object({path:f.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:f.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:f.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:f.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),jT=f.Intersect([f.Ref(og),Jr],{$id:"AnchoredFloorImageProperties"}),NT=f.Intersect([f.Ref(og),f.Object({verticalOffset:f.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),RT=f.Union([jT,NT],{$id:"FloorImageProperties"}),CT=zt(f.Ref(tr),RT,{$id:"FloorImageFeature"}),MT=pr(f.Ref(CT),{$id:"FloorImageCollection"}),YV=f.Object({floorImages:bt(f.Record(je,f.Ref(MT),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),XV=/^floorImages\/(.*)\.geojson$/,LT={name:"ext:floor-images",schema:YV,intoBundle:o(function*(e){if(e.floorImages!=null)for(let t of Ke(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(XV))==null?void 0:i[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[og,jT,NT,RT,CT,MT],integrityCheck:AT};c();c();var UT=o(e=>{if(e.kinds==null)return B(!0);let t=kt(e);for(let[r,n]of rr(e.kinds))if(n!=null)for(let i of Ke(n)){let s=t(r,i);if(s.isErr())return s}return B(!0)},"validateKinds");var{values:rbe,schema:QV,record:nbe}=Or(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),DT=QV;var qT=bt(f.Record(er,f.Ref(DT),{additionalProperties:!1,$id:"GeometryKinds"})),eB=f.Object({kinds:bt(f.Record(je,f.Ref(qT),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),tB=/^kinds\/(.*)\.json$/,zT={name:"ext:kinds",schema:eB,intoBundle:o(function*(e){if(e.kinds!=null)for(let t of Ke(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(tB))==null?void 0:i[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[DT,qT],integrityCheck:UT};c();c();c();var sl;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(sl||(sl={}));var VT=o(e=>{if(e.nodes==null)return B(!0);let t=kt(e),r=Tc(e);for(let[n,i]of rr(e.nodes)){if(i==null)continue;let s=new Set(i.features.map(a=>a.properties.id));for(let[a,u]of i.features.entries()){for(let l of u.properties.geometryIds){let d=t(n,l);if(d.isErr())return d}for(let[l,d]of u.properties.neighbors.entries()){if(!s.has(d.id))return W({kind:sl.UnknownNeighbor,properties:{floorId:n,nodeId:u.properties.id,neighborId:d.id}});let m=la(d.flags,r,'nodes["'.concat(n,'"].features[').concat(a,"].properties.neighbors[").concat(l,"]"));if(m.isErr())return m}}}return B(!0)},"validateNodes");var ig=mt("n","NodeId"),BT=f.Intersect([f.Object({id:f.Ref(ig,{description:"The unique identifier for the node."}),extraCost:f.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),ng],{$id:"NodeNeighbor"}),GT=f.Intersect([f.Object({id:f.Ref(ig,{description:"The unique identifier for the node."}),neighbors:f.Array(f.Ref(BT),{description:"The neighbors of the node."})}),uf],{$id:"NodeProperties"}),KT=zt(f.Ref(tr),GT,{$id:"NodeFeature"}),WT=pr(f.Ref(KT),{$id:"NodeCollection"}),rB=f.Object({nodes:bt(f.Record(je,f.Ref(WT),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),nB=/^nodes\/(.*)\.json$/,HT={name:"ext:nodes",schema:rB,intoBundle:o(function*(e){if(e.nodes!=null)for(let t of Ke(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(nB))==null?void 0:i[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[ig,BT,GT,KT,WT],integrityCheck:VT};c();c();c();var al;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(al||(al={}));var JT=o(e=>{if(e.outdoors==null)return B(!0);let t=Io(e);for(let r of e.outdoors.floors){let n=t(r);if(n.isErr())return n;if(e.floorStacks!=null){for(let i of e.floorStacks)if(i.floors.includes(r))return W({kind:al.FloorInFloorStackError,properties:{floorId:r,floorStackId:i.id}})}}return B(!0)},"validateOutdoors");var YT=f.Object({floors:f.Array(f.Ref(je),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),oB=f.Object({outdoors:f.Ref(YT)},{$id:"OutdoorsExtensionSchema"}),ZT="outdoors.json",XT={name:"ext:outdoors",schema:oB,intoBundle:o(function*(e){e.outdoors!=null&&(yield{path:ZT,contents:e.outdoors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===ZT)return{outdoors:r(t)}},"fromBundle"),references:[YT],integrityCheck:JT};c();c();c();var cl;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(cl||(cl={}));var QT=o(e=>{if(e.tileset==null)return B(!0);let t=new Set;if(t.add(e.tileset.default.key),e.tileset.others)for(let r of e.tileset.others){if(t.has(r.key))return W({kind:cl.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return B(!0)},"validateTilesets");var sg=f.Object({key:f.String({minLength:1,description:"Unique identifier for the tileset style."}),name:f.String({minLength:1,description:"Display name of the tileset style."}),url:f.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),ek=f.Object({default:f.Ref(sg,{description:"The default tileset style, which should be used."}),others:f.Optional(f.Array(f.Ref(sg,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),iB=f.Object({tileset:f.Ref(ek)},{$id:"TilesetExtensionSchema"}),tk={name:"ext:mvf-tileset",schema:iB,intoBundle:o(function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},"fromBundle"),references:[sg,ek],integrityCheck:QT};c();var rk=f.Object({},{$id:"WalkableProperties"}),nk=f.Object({},{$id:"NonWalkableProperties"}),ok=bt(f.Record(er,f.Ref(rk),{$id:"WalkableGeometries",additionalProperties:!1})),ik=bt(f.Record(er,f.Ref(nk),{$id:"NonWalkableGeometries",additionalProperties:!1})),sB=f.Object({walkable:bt(f.Record(je,f.Ref(ok),{additionalProperties:!1})),nonwalkable:bt(f.Record(je,f.Ref(ik),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),aB=/^walkable\/(.*)\.json$/,cB=/^nonwalkable\/(.*)\.json$/,sk={name:"ext:mvf-traversability",schema:sB,intoBundle:o(function*(e){if(e.walkable!=null)for(let t of Ke(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of Ke(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var s,a;let n=(s=e.match(aB))==null?void 0:s[1];if(n!=null)return{walkable:{[n]:r(t)}};let i=(a=e.match(cB))==null?void 0:a[1];if(i!=null)return{nonwalkable:{[i]:r(t)}}},"fromBundle"),references:[rk,nk,ok,ik]};c();c();c();c();c();c();c();c();c();c();c();var dB=ll(uk(),1);c();c();c();c();var Xwe=dE().extendOptional(lT).extendOptional(HT).extendOptional(xT).extendOptional(zT).extendOptional(sk).extendOptional($T).extendOptional(PT).extendOptional(XT).extendOptional(tk).extendOptional(LT).extendOptional(FT).extendOptional(dP).extendOptional($E).extendOptional(sT).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");c();c();c();c();var hB=60,A$e=hB*60*1e3;c();var gB=60,q$e=gB*60*1e3;var pk=globalThis.fetch,dk,J$e=(dk=p==null?void 0:p.env)==null?void 0:dk.npm_package_version;function fl(){if(pk==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return pk}o(fl,"isomorphicFetch");var xB=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Z$e=Object.freeze(F(g({},xB),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),Y$e=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),X$e=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Q$e=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});var mk={id:qe.string(),name:qe.string(),type:qe.string(),startDate:qe.number(),endDate:qe.number(),externalId:qe.string().optional(),description:qe.string().optional(),location:qe.string().optional(),image:qe.object({original:qe.string(),xxsmall:qe.string().optional(),xsmall:qe.string().optional(),small:qe.string().optional(),medium:qe.string().optional(),large:qe.string().optional(),xlarge:qe.string().optional(),xxlarge:qe.string().optional()}).optional(),video:qe.object({width:qe.number(),height:qe.number(),thumbnail:qe.string(),content:qe.string(),original:qe.string()}).optional(),_locale:qe.record(qe.string(),qe.record(qe.string(),qe.unknown())).optional()},yk=qe.object(mk),hk=Object.keys(mk),gk=o(async(e,t,r,n={})=>{let i=new URLSearchParams(n),s=new URL("/public/1/event/".concat(e),t);return s.search=i.toString(),await(await fl()(s.toString(),{headers:{Authorization:"Bearer ".concat(r)}})).json()},"fetchEvents");var Po,jr,Hn,pa,da,ma,xk,Ik,lg=class lg{constructor(t,r={}){Pt(this,ma);Pt(this,Po);Pt(this,jr,{eventsById:new Map,eventsByLocationId:new Map});Pt(this,Hn,null);Pt(this,pa,!1);Pt(this,da);var n;Ct(this,Po,t),Ct(this,da,F(g({includeExpired:!1},r),{fields:hk.concat((n=r.fields)!=null?n:[])}))}async load(){return H(this,Hn)!=null?H(this,Hn):(Ct(this,Hn,(async()=>{let t=await ko(this,ma,xk).call(this);H(this,Hn)!=null&&(await ko(this,ma,Ik).call(this,t),Ct(this,pa,!0),Ct(this,Hn,null))})()),H(this,Hn))}get ready(){return H(this,pa)}get events(){return Array.from(H(this,jr).eventsById.values())}getById(t){return H(this,jr).eventsById.get(t)}getByLocationId(t){var r;return(r=H(this,jr).eventsByLocationId.get(t))!=null?r:[]}destroy(){H(this,jr).eventsById.clear(),H(this,jr).eventsByLocationId.clear(),Ct(this,Hn,null),Ct(this,pa,!1)}};Po=new WeakMap,jr=new WeakMap,Hn=new WeakMap,pa=new WeakMap,da=new WeakMap,ma=new WeakSet,xk=o(async function(){if(!H(this,Po).internal.enterpriseMode)return Zi.warn("Events are currently only supported for CMS maps!"),[];let t=H(this,Po).mapId;if(t==null)throw new Error("Failed to fetch events! Map ID was not specified in getMapData.");let r=H(this,Po).getAccessToken();if(r==null)throw new Error("Failed to fetch events! Could not get access token from MapData.");let n={fields:H(this,da).fields.join(","),lang:"all"};H(this,da).includeExpired||(n.activeAtOrAfter="now");let i=await gk(t,H(this,Po).getEnv().baseUri,r,n);if(!Array.isArray(i))throw new Error("Failed to fetch events! Invalid response format.");return i.filter(s=>{let a=yk.safeParse(s);return a.success||Zi.warn("Failed to parse event!",s,a.error),a.success})},"#fetchEvents"),Ik=o(async function(t){var r,n;H(this,jr).eventsById.clear(),H(this,jr).eventsByLocationId.clear();for(let i of t){let s=new jc(i,H(this,Po));H(this,jr).eventsById.set(s.id,s);let a=(r=s.location)==null?void 0:r.id;a!=null&&H(this,jr).eventsByLocationId.set(a,[...(n=H(this,jr).eventsByLocationId.get(a))!=null?n:[],s])}},"#createEvents"),o(lg,"EventsManager");var fg=lg;export{fg as EventsManager};
1
+ import{a as m,b as E,c as u,g as ar,i as Oe,j as U,k as ie,l as se,m as Ae,q as v,r as I}from"./chunk-ESMYGLKP.js";v();v();v();v();var ms="[MappedinJS]";function or(a="",{prefix:e=ms}={}){let t="".concat(e).concat(a?"-".concat(a):""),n=u((i,s)=>{if(typeof window<"u"&&window.rnDebug){let r=s.map(o=>o instanceof Error&&o.stack?"".concat(o.message,"\n").concat(o.stack):o);window.rnDebug("".concat(a," ").concat(i,": ").concat(r.join(" ")))}},"rnDebug");return{logState:I.env.NODE_ENV==="test"?3:0,log(...i){this.logState<=0&&(console.log(t,...i),n("log",i))},warn(...i){this.logState<=1&&(console.warn(t,...i),n("warn",i))},error(...i){this.logState<=2&&(console.error(t,...i),n("error",i))},assert(...i){console.assert(...i)},time(i){console.time(i)},timeEnd(i){console.timeEnd(i)},setLevel(i){0<=i&&i<=3&&(this.logState=i)}}}u(or,"createLogger");var cr=or();var st=cr;v();v();v();var Ln=class Ln extends Error{};u(Ln,"InvalidTokenError");var Dn=Ln;Dn.prototype.name="InvalidTokenError";v();v();v();var ri="173";var ai=0,oi=1,ci=2,li=3,hi=4,ui=5,di=6,fi=7;var Is=300;var Vn=1e3,Pt=1001,Gn=1002;var Ps=1006;var Ds=1008;var Ls=1009;var Ns=1023;var dn=2300,Hn=2301,Nn=2302,gs=2400,_s=2401,xs=2402;var pi="",ae="srgb",Wn="srgb-linear",Xn="linear",un="srgb";var Dt=2e3,ys=2001;var xi=class xi{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let i=n[e];if(i!==void 0){let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let i=n.slice(0);for(let s=0,r=i.length;s<r;s++)i[s].call(this,e);e.target=null}}};u(xi,"EventDispatcher");var Nt=xi,$=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var Ol=Math.PI/180,lr=180/Math.PI;function mi(){let a=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return($[a&255]+$[a>>8&255]+$[a>>16&255]+$[a>>24&255]+"-"+$[e&255]+$[e>>8&255]+"-"+$[e>>16&15|64]+$[e>>24&255]+"-"+$[t&63|128]+$[t>>8&255]+"-"+$[t>>16&255]+$[t>>24&255]+$[n&255]+$[n>>8&255]+$[n>>16&255]+$[n>>24&255]).toLowerCase()}u(mi,"generateUUID");function z(a,e,t){return Math.max(e,Math.min(t,a))}u(z,"clamp");function hr(a,e){return(a%e+e)%e}u(hr,"euclideanModulo");function Un(a,e,t){return(1-t)*a+t*e}u(Un,"lerp");var mn=class mn{constructor(e=0,t=0){mn.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=z(this.x,e.x,t.x),this.y=z(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=z(this.x,e,t),this.y=z(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(z(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(z(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,r=this.y-e.y;return this.x=s*n-r*i+e.x,this.y=s*i+r*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};u(mn,"Vector2");var ue=mn,gn=class gn{constructor(e,t,n,i,s,r,o,c,l){gn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,r,o,c,l)}set(e,t,n,i,s,r,o,c,l){let h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=s,h[5]=c,h[6]=n,h[7]=r,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,r=n[0],o=n[3],c=n[6],l=n[1],h=n[4],d=n[7],p=n[2],f=n[5],g=n[8],x=i[0],A=i[3],T=i[6],W=i[1],X=i[4],G=i[7],O=i[2],q=i[5],k=i[8];return s[0]=r*x+o*W+c*O,s[3]=r*A+o*X+c*q,s[6]=r*T+o*G+c*k,s[1]=l*x+h*W+d*O,s[4]=l*A+h*X+d*q,s[7]=l*T+h*G+d*k,s[2]=p*x+f*W+g*O,s[5]=p*A+f*X+g*q,s[8]=p*T+f*G+g*k,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],c=e[6],l=e[7],h=e[8];return t*r*h-t*o*l-n*s*h+n*o*c+i*s*l-i*r*c}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],c=e[6],l=e[7],h=e[8],d=h*r-o*l,p=o*c-h*s,f=l*s-r*c,g=t*d+n*p+i*f;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);let x=1/g;return e[0]=d*x,e[1]=(i*l-h*n)*x,e[2]=(o*n-i*r)*x,e[3]=p*x,e[4]=(h*t-i*c)*x,e[5]=(i*s-o*t)*x,e[6]=f*x,e[7]=(n*c-l*t)*x,e[8]=(r*t-n*s)*x,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,r,o){let c=Math.cos(s),l=Math.sin(s);return this.set(n*c,n*l,-n*(c*r+l*o)+r+e,-i*l,i*c,-i*(-l*r+c*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(On.makeScale(e,t)),this}rotate(e){return this.premultiply(On.makeRotation(-e)),this}translate(e,t){return this.premultiply(On.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};u(gn,"Matrix3");var D=gn,On=new D;function qn(a){return document.createElementNS("http://www.w3.org/1999/xhtml",a)}u(qn,"createElementNS");var vs=new D().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ms=new D().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function ur(){let a={enabled:!0,workingColorSpace:Wn,spaces:{},convert:u(function(i,s,r){return this.enabled===!1||s===r||!s||!r||(this.spaces[s].transfer===un&&(i.r=ve(i.r),i.g=ve(i.g),i.b=ve(i.b)),this.spaces[s].primaries!==this.spaces[r].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[r].fromXYZ)),this.spaces[r].transfer===un&&(i.r=ut(i.r),i.g=ut(i.g),i.b=ut(i.b))),i},"convert"),fromWorkingColorSpace:u(function(i,s){return this.convert(i,this.workingColorSpace,s)},"fromWorkingColorSpace"),toWorkingColorSpace:u(function(i,s){return this.convert(i,s,this.workingColorSpace)},"toWorkingColorSpace"),getPrimaries:u(function(i){return this.spaces[i].primaries},"getPrimaries"),getTransfer:u(function(i){return i===pi?Xn:this.spaces[i].transfer},"getTransfer"),getLuminanceCoefficients:u(function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},"getLuminanceCoefficients"),define:u(function(i){Object.assign(this.spaces,i)},"define"),_getMatrix:u(function(i,s,r){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[r].fromXYZ)},"_getMatrix"),_getDrawingBufferColorSpace:u(function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},"_getDrawingBufferColorSpace"),_getUnpackColorSpace:u(function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},"_getUnpackColorSpace")},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return a.define({[Wn]:{primaries:e,whitePoint:n,transfer:Xn,toXYZ:vs,fromXYZ:Ms,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:ae},outputColorSpaceConfig:{drawingBufferColorSpace:ae}},[ae]:{primaries:e,whitePoint:n,transfer:un,toXYZ:vs,fromXYZ:Ms,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:ae}}}),a}u(ur,"createColorManagement");var re=ur();function ve(a){return a<.04045?a*.0773993808:Math.pow(a*.9478672986+.0521327014,2.4)}u(ve,"SRGBToLinear");function ut(a){return a<.0031308?a*12.92:1.055*Math.pow(a,.41666)-.055}u(ut,"LinearToSRGB");var rt,yi=class yi{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{rt===void 0&&(rt=qn("canvas")),rt.width=e.width,rt.height=e.height;let n=rt.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=rt}return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=qn("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let r=0;r<s.length;r++)s[r]=ve(s[r]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){let t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(ve(t[n]/255)*255):t[n]=ve(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}};u(yi,"ImageUtils");var Yn=yi,dr=0,vi=class vi{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:dr++}),this.uuid=mi(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let r=0,o=i.length;r<o;r++)i[r].isDataTexture?s.push(Fn(i[r].image)):s.push(Fn(i[r]))}else s=Fn(i);n.url=s}return t||(e.images[this.uuid]=n),n}};u(vi,"Source");var $n=vi;function Fn(a){return typeof HTMLImageElement<"u"&&a instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&a instanceof ImageBitmap?Yn.getDataURL(a):a.data?{data:Array.from(a.data),width:a.width,height:a.height,type:a.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}u(Fn,"serializeImage");var fr=0,lt=class lt extends Nt{constructor(e=lt.DEFAULT_IMAGE,t=lt.DEFAULT_MAPPING,n=Pt,i=Pt,s=Ps,r=Ds,o=Ns,c=Ls,l=lt.DEFAULT_ANISOTROPY,h=pi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:fr++}),this.uuid=mi(),this.name="",this.source=new $n(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=r,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=c,this.offset=new ue(0,0),this.repeat=new ue(1,1),this.center=new ue(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new D,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Is)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Vn:e.x=e.x-Math.floor(e.x);break;case Pt:e.x=e.x<0?0:1;break;case Gn:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Vn:e.y=e.y-Math.floor(e.y);break;case Pt:e.y=e.y<0?0:1;break;case Gn:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};u(lt,"Texture");var dt=lt;dt.DEFAULT_IMAGE=null;dt.DEFAULT_MAPPING=Is;dt.DEFAULT_ANISOTROPY=1;var Mi=class Mi{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,r,o){let c=n[i+0],l=n[i+1],h=n[i+2],d=n[i+3],p=s[r+0],f=s[r+1],g=s[r+2],x=s[r+3];if(o===0){e[t+0]=c,e[t+1]=l,e[t+2]=h,e[t+3]=d;return}if(o===1){e[t+0]=p,e[t+1]=f,e[t+2]=g,e[t+3]=x;return}if(d!==x||c!==p||l!==f||h!==g){let A=1-o,T=c*p+l*f+h*g+d*x,W=T>=0?1:-1,X=1-T*T;if(X>Number.EPSILON){let O=Math.sqrt(X),q=Math.atan2(O,T*W);A=Math.sin(A*q)/O,o=Math.sin(o*q)/O}let G=o*W;if(c=c*A+p*G,l=l*A+f*G,h=h*A+g*G,d=d*A+x*G,A===1-o){let O=1/Math.sqrt(c*c+l*l+h*h+d*d);c*=O,l*=O,h*=O,d*=O}}e[t]=c,e[t+1]=l,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,i,s,r){let o=n[i],c=n[i+1],l=n[i+2],h=n[i+3],d=s[r],p=s[r+1],f=s[r+2],g=s[r+3];return e[t]=o*g+h*d+c*f-l*p,e[t+1]=c*g+h*p+l*d-o*f,e[t+2]=l*g+h*f+o*p-c*d,e[t+3]=h*g-o*d-c*p-l*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,s=e._z,r=e._order,o=Math.cos,c=Math.sin,l=o(n/2),h=o(i/2),d=o(s/2),p=c(n/2),f=c(i/2),g=c(s/2);switch(r){case"XYZ":this._x=p*h*d+l*f*g,this._y=l*f*d-p*h*g,this._z=l*h*g+p*f*d,this._w=l*h*d-p*f*g;break;case"YXZ":this._x=p*h*d+l*f*g,this._y=l*f*d-p*h*g,this._z=l*h*g-p*f*d,this._w=l*h*d+p*f*g;break;case"ZXY":this._x=p*h*d-l*f*g,this._y=l*f*d+p*h*g,this._z=l*h*g+p*f*d,this._w=l*h*d-p*f*g;break;case"ZYX":this._x=p*h*d-l*f*g,this._y=l*f*d+p*h*g,this._z=l*h*g-p*f*d,this._w=l*h*d+p*f*g;break;case"YZX":this._x=p*h*d+l*f*g,this._y=l*f*d+p*h*g,this._z=l*h*g-p*f*d,this._w=l*h*d-p*f*g;break;case"XZY":this._x=p*h*d-l*f*g,this._y=l*f*d-p*h*g,this._z=l*h*g+p*f*d,this._w=l*h*d+p*f*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],r=t[1],o=t[5],c=t[9],l=t[2],h=t[6],d=t[10],p=n+o+d;if(p>0){let f=.5/Math.sqrt(p+1);this._w=.25/f,this._x=(h-c)*f,this._y=(s-l)*f,this._z=(r-i)*f}else if(n>o&&n>d){let f=2*Math.sqrt(1+n-o-d);this._w=(h-c)/f,this._x=.25*f,this._y=(i+r)/f,this._z=(s+l)/f}else if(o>d){let f=2*Math.sqrt(1+o-n-d);this._w=(s-l)/f,this._x=(i+r)/f,this._y=.25*f,this._z=(c+h)/f}else{let f=2*Math.sqrt(1+d-n-o);this._w=(r-i)/f,this._x=(s+l)/f,this._y=(c+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(z(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,r=e._w,o=t._x,c=t._y,l=t._z,h=t._w;return this._x=n*h+r*o+i*l-s*c,this._y=i*h+r*c+s*o-n*l,this._z=s*h+r*l+n*c-i*o,this._w=r*h-n*o-i*c-s*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,r=this._w,o=r*e._w+n*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=r,this._x=n,this._y=i,this._z=s,this;let c=1-o*o;if(c<=Number.EPSILON){let f=1-t;return this._w=f*r+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}let l=Math.sqrt(c),h=Math.atan2(l,o),d=Math.sin((1-t)*h)/l,p=Math.sin(t*h)/l;return this._w=r*d+this._w*p,this._x=n*d+this._x*p,this._y=i*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};u(Mi,"Quaternion");var Pe=Mi,_n=class _n{constructor(e=0,t=0,n=0){_n.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Ss.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ss.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,r=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*r,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*r,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*r,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,r=e.y,o=e.z,c=e.w,l=2*(r*i-o*n),h=2*(o*t-s*i),d=2*(s*n-r*t);return this.x=t+c*l+r*d-o*h,this.y=n+c*h+o*l-s*d,this.z=i+c*d+s*h-r*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=z(this.x,e.x,t.x),this.y=z(this.y,e.y,t.y),this.z=z(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=z(this.x,e,t),this.y=z(this.y,e,t),this.z=z(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(z(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,r=t.x,o=t.y,c=t.z;return this.x=i*c-s*o,this.y=s*r-n*c,this.z=n*o-i*r,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Bn.copy(this).projectOnVector(e),this.sub(Bn)}reflect(e){return this.sub(Bn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(z(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};u(_n,"Vector3");var B=_n,Bn=new B,Ss=new Pe;var Lt=class Lt{constructor(e,t,n,i,s,r,o,c,l,h,d,p,f,g,x,A){Lt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,r,o,c,l,h,d,p,f,g,x,A)}set(e,t,n,i,s,r,o,c,l,h,d,p,f,g,x,A){let T=this.elements;return T[0]=e,T[4]=t,T[8]=n,T[12]=i,T[1]=s,T[5]=r,T[9]=o,T[13]=c,T[2]=l,T[6]=h,T[10]=d,T[14]=p,T[3]=f,T[7]=g,T[11]=x,T[15]=A,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Lt().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/at.setFromMatrixColumn(e,0).length(),s=1/at.setFromMatrixColumn(e,1).length(),r=1/at.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*r,t[9]=n[9]*r,t[10]=n[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,s=e.z,r=Math.cos(n),o=Math.sin(n),c=Math.cos(i),l=Math.sin(i),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){let p=r*h,f=r*d,g=o*h,x=o*d;t[0]=c*h,t[4]=-c*d,t[8]=l,t[1]=f+g*l,t[5]=p-x*l,t[9]=-o*c,t[2]=x-p*l,t[6]=g+f*l,t[10]=r*c}else if(e.order==="YXZ"){let p=c*h,f=c*d,g=l*h,x=l*d;t[0]=p+x*o,t[4]=g*o-f,t[8]=r*l,t[1]=r*d,t[5]=r*h,t[9]=-o,t[2]=f*o-g,t[6]=x+p*o,t[10]=r*c}else if(e.order==="ZXY"){let p=c*h,f=c*d,g=l*h,x=l*d;t[0]=p-x*o,t[4]=-r*d,t[8]=g+f*o,t[1]=f+g*o,t[5]=r*h,t[9]=x-p*o,t[2]=-r*l,t[6]=o,t[10]=r*c}else if(e.order==="ZYX"){let p=r*h,f=r*d,g=o*h,x=o*d;t[0]=c*h,t[4]=g*l-f,t[8]=p*l+x,t[1]=c*d,t[5]=x*l+p,t[9]=f*l-g,t[2]=-l,t[6]=o*c,t[10]=r*c}else if(e.order==="YZX"){let p=r*c,f=r*l,g=o*c,x=o*l;t[0]=c*h,t[4]=x-p*d,t[8]=g*d+f,t[1]=d,t[5]=r*h,t[9]=-o*h,t[2]=-l*h,t[6]=f*d+g,t[10]=p-x*d}else if(e.order==="XZY"){let p=r*c,f=r*l,g=o*c,x=o*l;t[0]=c*h,t[4]=-d,t[8]=l*h,t[1]=p*d+x,t[5]=r*h,t[9]=f*d-g,t[2]=g*d-f,t[6]=o*h,t[10]=x*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(pr,e,mr)}lookAt(e,t,n){let i=this.elements;return ee.subVectors(e,t),ee.lengthSq()===0&&(ee.z=1),ee.normalize(),Re.crossVectors(n,ee),Re.lengthSq()===0&&(Math.abs(n.z)===1?ee.x+=1e-4:ee.z+=1e-4,ee.normalize(),Re.crossVectors(n,ee)),Re.normalize(),on.crossVectors(ee,Re),i[0]=Re.x,i[4]=on.x,i[8]=ee.x,i[1]=Re.y,i[5]=on.y,i[9]=ee.y,i[2]=Re.z,i[6]=on.z,i[10]=ee.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,r=n[0],o=n[4],c=n[8],l=n[12],h=n[1],d=n[5],p=n[9],f=n[13],g=n[2],x=n[6],A=n[10],T=n[14],W=n[3],X=n[7],G=n[11],O=n[15],q=i[0],k=i[4],qt=i[8],Yt=i[12],$t=i[1],jt=i[5],Zt=i[9],Jt=i[13],Kt=i[2],Qt=i[6],en=i[10],tn=i[14],nn=i[3],sn=i[7],rn=i[11],an=i[15];return s[0]=r*q+o*$t+c*Kt+l*nn,s[4]=r*k+o*jt+c*Qt+l*sn,s[8]=r*qt+o*Zt+c*en+l*rn,s[12]=r*Yt+o*Jt+c*tn+l*an,s[1]=h*q+d*$t+p*Kt+f*nn,s[5]=h*k+d*jt+p*Qt+f*sn,s[9]=h*qt+d*Zt+p*en+f*rn,s[13]=h*Yt+d*Jt+p*tn+f*an,s[2]=g*q+x*$t+A*Kt+T*nn,s[6]=g*k+x*jt+A*Qt+T*sn,s[10]=g*qt+x*Zt+A*en+T*rn,s[14]=g*Yt+x*Jt+A*tn+T*an,s[3]=W*q+X*$t+G*Kt+O*nn,s[7]=W*k+X*jt+G*Qt+O*sn,s[11]=W*qt+X*Zt+G*en+O*rn,s[15]=W*Yt+X*Jt+G*tn+O*an,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],r=e[1],o=e[5],c=e[9],l=e[13],h=e[2],d=e[6],p=e[10],f=e[14],g=e[3],x=e[7],A=e[11],T=e[15];return g*(+s*c*d-i*l*d-s*o*p+n*l*p+i*o*f-n*c*f)+x*(+t*c*f-t*l*p+s*r*p-i*r*f+i*l*h-s*c*h)+A*(+t*l*d-t*o*f-s*r*d+n*r*f+s*o*h-n*l*h)+T*(-i*o*h-t*c*d+t*o*p+i*r*d-n*r*p+n*c*h)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],c=e[6],l=e[7],h=e[8],d=e[9],p=e[10],f=e[11],g=e[12],x=e[13],A=e[14],T=e[15],W=d*A*l-x*p*l+x*c*f-o*A*f-d*c*T+o*p*T,X=g*p*l-h*A*l-g*c*f+r*A*f+h*c*T-r*p*T,G=h*x*l-g*d*l+g*o*f-r*x*f-h*o*T+r*d*T,O=g*d*c-h*x*c-g*o*p+r*x*p+h*o*A-r*d*A,q=t*W+n*X+i*G+s*O;if(q===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let k=1/q;return e[0]=W*k,e[1]=(x*p*s-d*A*s-x*i*f+n*A*f+d*i*T-n*p*T)*k,e[2]=(o*A*s-x*c*s+x*i*l-n*A*l-o*i*T+n*c*T)*k,e[3]=(d*c*s-o*p*s-d*i*l+n*p*l+o*i*f-n*c*f)*k,e[4]=X*k,e[5]=(h*A*s-g*p*s+g*i*f-t*A*f-h*i*T+t*p*T)*k,e[6]=(g*c*s-r*A*s-g*i*l+t*A*l+r*i*T-t*c*T)*k,e[7]=(r*p*s-h*c*s+h*i*l-t*p*l-r*i*f+t*c*f)*k,e[8]=G*k,e[9]=(g*d*s-h*x*s-g*n*f+t*x*f+h*n*T-t*d*T)*k,e[10]=(r*x*s-g*o*s+g*n*l-t*x*l-r*n*T+t*o*T)*k,e[11]=(h*o*s-r*d*s-h*n*l+t*d*l+r*n*f-t*o*f)*k,e[12]=O*k,e[13]=(h*x*i-g*d*i+g*n*p-t*x*p-h*n*A+t*d*A)*k,e[14]=(g*o*i-r*x*i-g*n*c+t*x*c+r*n*A-t*o*A)*k,e[15]=(r*d*i-h*o*i+h*n*c-t*d*c-r*n*p+t*o*p)*k,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,r=e.x,o=e.y,c=e.z,l=s*r,h=s*o;return this.set(l*r+n,l*o-i*c,l*c+i*o,0,l*o+i*c,h*o+n,h*c-i*r,0,l*c-i*o,h*c+i*r,s*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,r){return this.set(1,n,s,0,e,1,r,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,r=t._y,o=t._z,c=t._w,l=s+s,h=r+r,d=o+o,p=s*l,f=s*h,g=s*d,x=r*h,A=r*d,T=o*d,W=c*l,X=c*h,G=c*d,O=n.x,q=n.y,k=n.z;return i[0]=(1-(x+T))*O,i[1]=(f+G)*O,i[2]=(g-X)*O,i[3]=0,i[4]=(f-G)*q,i[5]=(1-(p+T))*q,i[6]=(A+W)*q,i[7]=0,i[8]=(g+X)*k,i[9]=(A-W)*k,i[10]=(1-(p+x))*k,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=at.set(i[0],i[1],i[2]).length(),r=at.set(i[4],i[5],i[6]).length(),o=at.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],he.copy(this);let l=1/s,h=1/r,d=1/o;return he.elements[0]*=l,he.elements[1]*=l,he.elements[2]*=l,he.elements[4]*=h,he.elements[5]*=h,he.elements[6]*=h,he.elements[8]*=d,he.elements[9]*=d,he.elements[10]*=d,t.setFromRotationMatrix(he),n.x=s,n.y=r,n.z=o,this}makePerspective(e,t,n,i,s,r,o=Dt){let c=this.elements,l=2*s/(t-e),h=2*s/(n-i),d=(t+e)/(t-e),p=(n+i)/(n-i),f,g;if(o===Dt)f=-(r+s)/(r-s),g=-2*r*s/(r-s);else if(o===ys)f=-r/(r-s),g=-r*s/(r-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=g,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,s,r,o=Dt){let c=this.elements,l=1/(t-e),h=1/(n-i),d=1/(r-s),p=(t+e)*l,f=(n+i)*h,g,x;if(o===Dt)g=(r+s)*d,x=-2*d;else if(o===ys)g=s*d,x=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-p,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=x,c[14]=-g,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};u(Lt,"Matrix4");var Me=Lt,at=new B,he=new Me,pr=new B(0,0,0),mr=new B(1,1,1),Re=new B,on=new B,ee=new B,bs=new Me,Es=new Pe,xn=class xn{constructor(e=0,t=0,n=0,i=xn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],r=i[4],o=i[8],c=i[1],l=i[5],h=i[9],d=i[2],p=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(z(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-r,s)):(this._x=Math.atan2(p,l),this._z=0);break;case"YXZ":this._x=Math.asin(-z(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(z(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-r,l)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-z(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,f),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-r,l));break;case"YZX":this._z=Math.asin(z(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-z(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return bs.makeRotationFromQuaternion(e),this.setFromRotationMatrix(bs,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Es.setFromEuler(this),this.setFromQuaternion(Es,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};u(xn,"Euler");var Ut=xn;Ut.DEFAULT_ORDER="XYZ";var Si=class Si{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}};u(Si,"Layers");var fn=Si,gr=0,Ts=new B,ot=new Pe,ye=new Me,cn=new B,It=new B,_r=new B,xr=new Pe,ws=new B(1,0,0),As=new B(0,1,0),Rs=new B(0,0,1),Cs={type:"added"},yr={type:"removed"},ct={type:"childadded",child:null},kn={type:"childremoved",child:null},ht=class ht extends Nt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:gr++}),this.uuid=mi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ht.DEFAULT_UP.clone();let e=new B,t=new Ut,n=new Pe,i=new B(1,1,1);function s(){n.setFromEuler(t,!1)}u(s,"onRotationChange");function r(){t.setFromQuaternion(n,void 0,!1)}u(r,"onQuaternionChange"),t._onChange(s),n._onChange(r),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Me},normalMatrix:{value:new D}}),this.matrix=new Me,this.matrixWorld=new Me,this.matrixAutoUpdate=ht.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=ht.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new fn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ot.setFromAxisAngle(e,t),this.quaternion.multiply(ot),this}rotateOnWorldAxis(e,t){return ot.setFromAxisAngle(e,t),this.quaternion.premultiply(ot),this}rotateX(e){return this.rotateOnAxis(ws,e)}rotateY(e){return this.rotateOnAxis(As,e)}rotateZ(e){return this.rotateOnAxis(Rs,e)}translateOnAxis(e,t){return Ts.copy(e).applyQuaternion(this.quaternion),this.position.add(Ts.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ws,e)}translateY(e){return this.translateOnAxis(As,e)}translateZ(e){return this.translateOnAxis(Rs,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ye.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?cn.copy(e):cn.set(e,t,n);let i=this.parent;this.updateWorldMatrix(!0,!1),It.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ye.lookAt(It,cn,this.up):ye.lookAt(cn,It,this.up),this.quaternion.setFromRotationMatrix(ye),i&&(ye.extractRotation(i.matrixWorld),ot.setFromRotationMatrix(ye),this.quaternion.premultiply(ot.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Cs),ct.child=e,this.dispatchEvent(ct),ct.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(yr),kn.child=e,this.dispatchEvent(kn),kn.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),ye.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ye.multiply(e.parent.matrixWorld)),e.applyMatrix4(ye),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Cs),ct.child=e,this.dispatchEvent(ct),ct.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let i=this.children;for(let s=0,r=i.length;s<r;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(It,e,_r),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(It,xr,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){let n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){let i=this.children;for(let s=0,r=i.length;s<r;s++)i[s].updateWorldMatrix(!1,!0)}}toJSON(e){let t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(e)),c.uuid}if(u(s,"serialize"),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);let o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){let c=o.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l<h;l++){let d=c[l];s(e.shapes,d)}else s(e.shapes,c)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let o=[];for(let c=0,l=this.material.length;c<l;c++)o.push(s(e.materials,this.material[c]));i.material=o}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){let c=this.animations[o];i.animations.push(s(e.animations,c))}}if(t){let o=r(e.geometries),c=r(e.materials),l=r(e.textures),h=r(e.images),d=r(e.shapes),p=r(e.skeletons),f=r(e.animations),g=r(e.nodes);o.length>0&&(n.geometries=o),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),p.length>0&&(n.skeletons=p),f.length>0&&(n.animations=f),g.length>0&&(n.nodes=g)}return n.object=i,n;function r(o){let c=[];for(let l in o){let h=o[l];delete h.metadata,c.push(h)}return c}u(r,"extractFromCache")}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){let i=e.children[n];this.add(i.clone())}return this}};u(ht,"Object3D");var Ot=ht;Ot.DEFAULT_UP=new B(0,1,0);Ot.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ot.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Us={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ce={h:0,s:0,l:0},ln={h:0,s:0,l:0};function zn(a,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?a+(e-a)*6*t:t<1/2?e:t<2/3?a+(e-a)*6*(2/3-t):a}u(zn,"hue2rgb");var bi=class bi{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ae){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,re.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=re.workingColorSpace){return this.r=e,this.g=t,this.b=n,re.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=re.workingColorSpace){if(e=hr(e,1),t=z(t,0,1),n=z(n,0,1),t===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+t):n+t-n*t,r=2*n-s;this.r=zn(r,s,e+1/3),this.g=zn(r,s,e),this.b=zn(r,s,e-1/3)}return re.toWorkingColorSpace(this,i),this}setStyle(e,t=ae){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}u(n,"handleAlpha");let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s,r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let s=i[1],r=s.length;if(r===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(r===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ae){let n=Us[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ve(e.r),this.g=ve(e.g),this.b=ve(e.b),this}copyLinearToSRGB(e){return this.r=ut(e.r),this.g=ut(e.g),this.b=ut(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ae){return re.fromWorkingColorSpace(j.copy(this),e),Math.round(z(j.r*255,0,255))*65536+Math.round(z(j.g*255,0,255))*256+Math.round(z(j.b*255,0,255))}getHexString(e=ae){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=re.workingColorSpace){re.fromWorkingColorSpace(j.copy(this),t);let n=j.r,i=j.g,s=j.b,r=Math.max(n,i,s),o=Math.min(n,i,s),c,l,h=(o+r)/2;if(o===r)c=0,l=0;else{let d=r-o;switch(l=h<=.5?d/(r+o):d/(2-r-o),r){case n:c=(i-s)/d+(i<s?6:0);break;case i:c=(s-n)/d+2;break;case s:c=(n-i)/d+4;break}c/=6}return e.h=c,e.s=l,e.l=h,e}getRGB(e,t=re.workingColorSpace){return re.fromWorkingColorSpace(j.copy(this),t),e.r=j.r,e.g=j.g,e.b=j.b,e}getStyle(e=ae){re.fromWorkingColorSpace(j.copy(this),e);let t=j.r,n=j.g,i=j.b;return e!==ae?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(n.toFixed(3)," ").concat(i.toFixed(3),")"):"rgb(".concat(Math.round(t*255),",").concat(Math.round(n*255),",").concat(Math.round(i*255),")")}offsetHSL(e,t,n){return this.getHSL(Ce),this.setHSL(Ce.h+e,Ce.s+t,Ce.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Ce),e.getHSL(ln);let n=Un(Ce.h,ln.h,t),i=Un(Ce.s,ln.s,t),s=Un(Ce.l,ln.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};u(bi,"Color");var H=bi,j=new H;H.NAMES=Us;function Os(a){let e={};for(let t in a){e[t]={};for(let n in a[t]){let i=a[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}u(Os,"cloneUniforms");function J(a){let e={};for(let t=0;t<a.length;t++){let n=Os(a[t]);for(let i in n)e[i]=n[i]}return e}u(J,"mergeUniforms");function hn(a,e,t){return!a||!t&&a.constructor===e?a:typeof e.BYTES_PER_ELEMENT=="number"?new e(a):Array.prototype.slice.call(a)}u(hn,"convertArray");function vr(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)}u(vr,"isTypedArray");var Ei=class Ei{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,i=t[n],s=t[n-1];n:{e:{let r;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(s=i,i=t[++n],e<i)break e}r=t.length;break t}if(!(e>=s)){let o=t[1];e<o&&(n=2,s=o);for(let c=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(i=s,s=t[--n-1],e>=s)break e}r=n,n=0;break t}break n}for(;n<r;){let o=n+r>>>1;e<t[o]?r=o:n=o+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let r=0;r!==i;++r)t[r]=n[s+r];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}};u(Ei,"Interpolant");var ft=Ei,Ti=class Ti extends ft{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:gs,endingEnd:gs}}intervalChanged_(e,t,n){let i=this.parameterPositions,s=e-2,r=e+1,o=i[s],c=i[r];if(o===void 0)switch(this.getSettings_().endingStart){case _s:s=e,o=2*t-n;break;case xs:s=i.length-2,o=t+i[s]-i[s+1];break;default:s=e,o=n}if(c===void 0)switch(this.getSettings_().endingEnd){case _s:r=e,c=2*n-t;break;case xs:r=1,c=n+i[1]-i[0];break;default:r=e-1,c=t}let l=(n-t)*.5,h=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(c-n),this._offsetPrev=s*h,this._offsetNext=r*h}interpolate_(e,t,n,i){let s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,f=this._weightNext,g=(n-t)/(i-t),x=g*g,A=x*g,T=-p*A+2*p*x-p*g,W=(1+p)*A+(-1.5-2*p)*x+(-.5+p)*g+1,X=(-1-f)*A+(1.5+f)*x+.5*g,G=f*A-f*x;for(let O=0;O!==o;++O)s[O]=T*r[h+O]+W*r[l+O]+X*r[c+O]+G*r[d+O];return s}};u(Ti,"CubicInterpolant");var jn=Ti,wi=class wi extends ft{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,c=e*o,l=c-o,h=(n-t)/(i-t),d=1-h;for(let p=0;p!==o;++p)s[p]=r[l+p]*d+r[c+p]*h;return s}};u(wi,"LinearInterpolant");var Zn=wi,Ai=class Ai extends ft{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}};u(Ai,"DiscreteInterpolant");var Jn=Ai,Ri=class Ri{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=hn(t,this.TimeBufferType),this.values=hn(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:hn(e.times,Array),values:hn(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Jn(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Zn(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new jn(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case dn:t=this.InterpolantFactoryMethodDiscrete;break;case Hn:t=this.InterpolantFactoryMethodLinear;break;case Nn:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return dn;case this.InterpolantFactoryMethodLinear:return Hn;case this.InterpolantFactoryMethodSmooth:return Nn}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){let n=this.times,i=n.length,s=0,r=i-1;for(;s!==i&&n[s]<e;)++s;for(;r!==-1&&n[r]>t;)--r;if(++r,s!==0||r!==i){s>=r&&(r=Math.max(r,1),s=r-1);let o=this.getValueSize();this.times=n.slice(s,r),this.values=this.values.slice(s*o,r*o)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let o=0;o!==s;o++){let c=n[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(r!==null&&r>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,r),e=!1;break}r=c}if(i!==void 0&&vr(i))for(let o=0,c=i.length;o!==c;++o){let l=i[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Nn,s=e.length-1,r=1;for(let o=1;o<s;++o){let c=!1,l=e[o],h=e[o+1];if(l!==h&&(o!==1||l!==e[0]))if(i)c=!0;else{let d=o*n,p=d-n,f=d+n;for(let g=0;g!==n;++g){let x=t[d+g];if(x!==t[p+g]||x!==t[f+g]){c=!0;break}}}if(c){if(o!==r){e[r]=e[o];let d=o*n,p=r*n;for(let f=0;f!==n;++f)t[p+f]=t[d+f]}++r}}if(s>0){e[r]=e[s];for(let o=s*n,c=r*n,l=0;l!==n;++l)t[c+l]=t[o+l];++r}return r!==e.length?(this.times=e.slice(0,r),this.values=t.slice(0,r*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};u(Ri,"KeyframeTrack");var de=Ri;de.prototype.TimeBufferType=Float32Array;de.prototype.ValueBufferType=Float32Array;de.prototype.DefaultInterpolation=Hn;var Ci=class Ci extends de{constructor(e,t,n){super(e,t,n)}};u(Ci,"BooleanKeyframeTrack");var Fe=Ci;Fe.prototype.ValueTypeName="bool";Fe.prototype.ValueBufferType=Array;Fe.prototype.DefaultInterpolation=dn;Fe.prototype.InterpolantFactoryMethodLinear=void 0;Fe.prototype.InterpolantFactoryMethodSmooth=void 0;var Ii=class Ii extends de{};u(Ii,"ColorKeyframeTrack");var Kn=Ii;Kn.prototype.ValueTypeName="color";var Pi=class Pi extends de{};u(Pi,"NumberKeyframeTrack");var Qn=Pi;Qn.prototype.ValueTypeName="number";var Di=class Di extends ft{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,c=(n-t)/(i-t),l=e*o;for(let h=l+o;l!==h;l+=4)Pe.slerpFlat(s,0,r,l-o,r,l,c);return s}};u(Di,"QuaternionLinearInterpolant");var ei=Di,Li=class Li extends de{InterpolantFactoryMethodLinear(e){return new ei(this.times,this.values,this.getValueSize(),e)}};u(Li,"QuaternionKeyframeTrack");var pn=Li;pn.prototype.ValueTypeName="quaternion";pn.prototype.InterpolantFactoryMethodSmooth=void 0;var Ni=class Ni extends de{constructor(e,t,n){super(e,t,n)}};u(Ni,"StringKeyframeTrack");var Be=Ni;Be.prototype.ValueTypeName="string";Be.prototype.ValueBufferType=Array;Be.prototype.DefaultInterpolation=dn;Be.prototype.InterpolantFactoryMethodLinear=void 0;Be.prototype.InterpolantFactoryMethodSmooth=void 0;var Ui=class Ui extends de{};u(Ui,"VectorKeyframeTrack");var ti=Ui;ti.prototype.ValueTypeName="vector";var Oi=class Oi{constructor(e,t,n){let i=this,s=!1,r=0,o=0,c,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){o++,s===!1&&i.onStart!==void 0&&i.onStart(h,r,o),s=!0},this.itemEnd=function(h){r++,i.onProgress!==void 0&&i.onProgress(h,r,o),r===o&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,d){return l.push(h,d),this},this.removeHandler=function(h){let d=l.indexOf(h);return d!==-1&&l.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=l.length;d<p;d+=2){let f=l[d],g=l[d+1];if(f.global&&(f.lastIndex=0),f.test(h))return g}return null}}};u(Oi,"LoadingManager");var ni=Oi,Mr=new ni,Fi=class Fi{constructor(e){this.manager=e!==void 0?e:Mr,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};u(Fi,"Loader");var ii=Fi;ii.DEFAULT_MATERIAL_NAME="__DEFAULT";var gi="\\[\\]\\.:\\/",Sr=new RegExp("["+gi+"]","g"),_i="[^"+gi+"]",br="[^"+gi.replace("\\.","")+"]",Er=/((?:WC+[\/:])*)/.source.replace("WC",_i),Tr=/(WCOD+)?/.source.replace("WCOD",br),wr=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_i),Ar=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_i),Rr=new RegExp("^"+Er+Tr+wr+Ar+"$"),Cr=["material","materials","bones","map"],Bi=class Bi{constructor(e,t,n){let i=n||V.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}};u(Bi,"Composite");var si=Bi,Ie=class Ie{constructor(e,t,n){this.path=t,this.parsedPath=n||Ie.parseTrackName(t),this.node=Ie.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ie.Composite(e,t,n):new Ie(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Sr,"")}static parseTrackName(e){let t=Rr.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);Cr.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=u(function(s){for(let r=0;r<s.length;r++){let o=s[r];if(o.name===t||o.uuid===t)return o;let c=n(o.children);if(c)return c}return null},"searchNodeSubtree"),i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,s=t.propertyIndex;if(e||(e=Ie.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let l=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===l){l=h;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(l!==void 0){if(e[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}let r=e[i];if(r===void 0){let l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}c=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=s}else r.fromArray!==void 0&&r.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(c=this.BindingType.EntireArray,this.resolvedProperty=r):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};u(Ie,"PropertyBinding");var V=Ie;V.Composite=si;V.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};V.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};V.prototype.GetterByBindingType=[V.prototype._getValue_direct,V.prototype._getValue_array,V.prototype._getValue_arrayElement,V.prototype._getValue_toArray];V.prototype.SetterByBindingTypeAndVersioning=[[V.prototype._setValue_direct,V.prototype._setValue_direct_setNeedsUpdate,V.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[V.prototype._setValue_array,V.prototype._setValue_array_setNeedsUpdate,V.prototype._setValue_array_setMatrixWorldNeedsUpdate],[V.prototype._setValue_arrayElement,V.prototype._setValue_arrayElement_setNeedsUpdate,V.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[V.prototype._setValue_fromArray,V.prototype._setValue_fromArray_setNeedsUpdate,V.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Fl=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ri}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ri);var Ir="#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",Pr="#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",Dr="#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",Lr="#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",Nr="#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",Ur="#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",Or="#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",Fr="#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",Br="#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",kr="#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",zr="vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",Vr="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",Gr="float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",Hr="#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",Wr="#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",Xr="#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",qr="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",Yr="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",$r="#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",jr="#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",Zr="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",Jr="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",Kr="#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif",Qr="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",ea="#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",ta="vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",na="#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",ia="#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",sa="#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",ra="#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",aa="gl_FragColor = linearToOutputTexel( gl_FragColor );",oa="vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",ca="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",la="#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",ha="#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",ua="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",da="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fa="#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",pa="#ifdef USE_FOG\n varying float vFogDepth;\n#endif",ma="#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",ga="#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",_a="#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",xa="#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",ya="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",va="varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",Ma="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",Sa="#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",ba="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",Ea="varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",Ta="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",wa="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",Aa="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",Ra="struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",Ca="\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",Ia="#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",Pa="#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",Da="#if defined( USE_LOGDEPTHBUF )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",La="#if defined( USE_LOGDEPTHBUF )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",Na="#ifdef USE_LOGDEPTHBUF\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",Ua="#ifdef USE_LOGDEPTHBUF\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",Oa="#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",Fa="#ifdef USE_MAP\n uniform sampler2D map;\n#endif",Ba="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",ka="#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",za="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",Va="#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",Ga="#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",Ha="#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",Wa="#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",Xa="#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",qa="#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",Ya="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",$a="#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",ja="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",Za="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",Ja="#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",Ka="#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",Qa="#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",eo="#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",to="#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",no="#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",io="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",so="vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",ro="#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",ao="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",oo="#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",co="#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",lo="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",ho="#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",uo="#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif",fo="#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",po="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",mo="float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",go="#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",_o="#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",xo="#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",yo="#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",vo="float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",Mo="#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",So="#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",bo="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",Eo="#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",To="#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",wo="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",Ao="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",Ro="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",Co="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",Io="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",Po="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",Do="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",Lo="#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",No="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",Uo="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",Oo="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",Fo="#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",Bo="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",ko="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",zo="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",Vo="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",Go="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",Ho="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",Wo="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",Xo="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",qo="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",Yo="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",$o="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",jo="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",Zo="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",Jo="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",Ko="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",Qo="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",ec="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",tc="#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",nc="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",ic="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",sc="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",rc="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",ac="#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",oc="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",cc="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",lc="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",N={alphahash_fragment:Ir,alphahash_pars_fragment:Pr,alphamap_fragment:Dr,alphamap_pars_fragment:Lr,alphatest_fragment:Nr,alphatest_pars_fragment:Ur,aomap_fragment:Or,aomap_pars_fragment:Fr,batching_pars_vertex:Br,batching_vertex:kr,begin_vertex:zr,beginnormal_vertex:Vr,bsdfs:Gr,iridescence_fragment:Hr,bumpmap_pars_fragment:Wr,clipping_planes_fragment:Xr,clipping_planes_pars_fragment:qr,clipping_planes_pars_vertex:Yr,clipping_planes_vertex:$r,color_fragment:jr,color_pars_fragment:Zr,color_pars_vertex:Jr,color_vertex:Kr,common:Qr,cube_uv_reflection_fragment:ea,defaultnormal_vertex:ta,displacementmap_pars_vertex:na,displacementmap_vertex:ia,emissivemap_fragment:sa,emissivemap_pars_fragment:ra,colorspace_fragment:aa,colorspace_pars_fragment:oa,envmap_fragment:ca,envmap_common_pars_fragment:la,envmap_pars_fragment:ha,envmap_pars_vertex:ua,envmap_physical_pars_fragment:Sa,envmap_vertex:da,fog_vertex:fa,fog_pars_vertex:pa,fog_fragment:ma,fog_pars_fragment:ga,gradientmap_pars_fragment:_a,lightmap_pars_fragment:xa,lights_lambert_fragment:ya,lights_lambert_pars_fragment:va,lights_pars_begin:Ma,lights_toon_fragment:ba,lights_toon_pars_fragment:Ea,lights_phong_fragment:Ta,lights_phong_pars_fragment:wa,lights_physical_fragment:Aa,lights_physical_pars_fragment:Ra,lights_fragment_begin:Ca,lights_fragment_maps:Ia,lights_fragment_end:Pa,logdepthbuf_fragment:Da,logdepthbuf_pars_fragment:La,logdepthbuf_pars_vertex:Na,logdepthbuf_vertex:Ua,map_fragment:Oa,map_pars_fragment:Fa,map_particle_fragment:Ba,map_particle_pars_fragment:ka,metalnessmap_fragment:za,metalnessmap_pars_fragment:Va,morphinstance_vertex:Ga,morphcolor_vertex:Ha,morphnormal_vertex:Wa,morphtarget_pars_vertex:Xa,morphtarget_vertex:qa,normal_fragment_begin:Ya,normal_fragment_maps:$a,normal_pars_fragment:ja,normal_pars_vertex:Za,normal_vertex:Ja,normalmap_pars_fragment:Ka,clearcoat_normal_fragment_begin:Qa,clearcoat_normal_fragment_maps:eo,clearcoat_pars_fragment:to,iridescence_pars_fragment:no,opaque_fragment:io,packing:so,premultiplied_alpha_fragment:ro,project_vertex:ao,dithering_fragment:oo,dithering_pars_fragment:co,roughnessmap_fragment:lo,roughnessmap_pars_fragment:ho,shadowmap_pars_fragment:uo,shadowmap_pars_vertex:fo,shadowmap_vertex:po,shadowmask_pars_fragment:mo,skinbase_vertex:go,skinning_pars_vertex:_o,skinning_vertex:xo,skinnormal_vertex:yo,specularmap_fragment:vo,specularmap_pars_fragment:Mo,tonemapping_fragment:So,tonemapping_pars_fragment:bo,transmission_fragment:Eo,transmission_pars_fragment:To,uv_pars_fragment:wo,uv_pars_vertex:Ao,uv_vertex:Ro,worldpos_vertex:Co,background_vert:Io,background_frag:Po,backgroundCube_vert:Do,backgroundCube_frag:Lo,cube_vert:No,cube_frag:Uo,depth_vert:Oo,depth_frag:Fo,distanceRGBA_vert:Bo,distanceRGBA_frag:ko,equirect_vert:zo,equirect_frag:Vo,linedashed_vert:Go,linedashed_frag:Ho,meshbasic_vert:Wo,meshbasic_frag:Xo,meshlambert_vert:qo,meshlambert_frag:Yo,meshmatcap_vert:$o,meshmatcap_frag:jo,meshnormal_vert:Zo,meshnormal_frag:Jo,meshphong_vert:Ko,meshphong_frag:Qo,meshphysical_vert:ec,meshphysical_frag:tc,meshtoon_vert:nc,meshtoon_frag:ic,points_vert:sc,points_frag:rc,shadow_vert:ac,shadow_frag:oc,sprite_vert:cc,sprite_frag:lc},M={common:{diffuse:{value:new H(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new D},alphaMap:{value:null},alphaMapTransform:{value:new D},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new D}},envmap:{envMap:{value:null},envMapRotation:{value:new D},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new D}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new D}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new D},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new D},normalScale:{value:new ue(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new D},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new D}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new D}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new D}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new H(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new H(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new D},alphaTest:{value:0},uvTransform:{value:new D}},sprite:{diffuse:{value:new H(16777215)},opacity:{value:1},center:{value:new ue(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new D},alphaMap:{value:null},alphaMapTransform:{value:new D},alphaTest:{value:0}}},Fs={basic:{uniforms:J([M.common,M.specularmap,M.envmap,M.aomap,M.lightmap,M.fog]),vertexShader:N.meshbasic_vert,fragmentShader:N.meshbasic_frag},lambert:{uniforms:J([M.common,M.specularmap,M.envmap,M.aomap,M.lightmap,M.emissivemap,M.bumpmap,M.normalmap,M.displacementmap,M.fog,M.lights,{emissive:{value:new H(0)}}]),vertexShader:N.meshlambert_vert,fragmentShader:N.meshlambert_frag},phong:{uniforms:J([M.common,M.specularmap,M.envmap,M.aomap,M.lightmap,M.emissivemap,M.bumpmap,M.normalmap,M.displacementmap,M.fog,M.lights,{emissive:{value:new H(0)},specular:{value:new H(1118481)},shininess:{value:30}}]),vertexShader:N.meshphong_vert,fragmentShader:N.meshphong_frag},standard:{uniforms:J([M.common,M.envmap,M.aomap,M.lightmap,M.emissivemap,M.bumpmap,M.normalmap,M.displacementmap,M.roughnessmap,M.metalnessmap,M.fog,M.lights,{emissive:{value:new H(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:N.meshphysical_vert,fragmentShader:N.meshphysical_frag},toon:{uniforms:J([M.common,M.aomap,M.lightmap,M.emissivemap,M.bumpmap,M.normalmap,M.displacementmap,M.gradientmap,M.fog,M.lights,{emissive:{value:new H(0)}}]),vertexShader:N.meshtoon_vert,fragmentShader:N.meshtoon_frag},matcap:{uniforms:J([M.common,M.bumpmap,M.normalmap,M.displacementmap,M.fog,{matcap:{value:null}}]),vertexShader:N.meshmatcap_vert,fragmentShader:N.meshmatcap_frag},points:{uniforms:J([M.points,M.fog]),vertexShader:N.points_vert,fragmentShader:N.points_frag},dashed:{uniforms:J([M.common,M.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:N.linedashed_vert,fragmentShader:N.linedashed_frag},depth:{uniforms:J([M.common,M.displacementmap]),vertexShader:N.depth_vert,fragmentShader:N.depth_frag},normal:{uniforms:J([M.common,M.bumpmap,M.normalmap,M.displacementmap,{opacity:{value:1}}]),vertexShader:N.meshnormal_vert,fragmentShader:N.meshnormal_frag},sprite:{uniforms:J([M.sprite,M.fog]),vertexShader:N.sprite_vert,fragmentShader:N.sprite_frag},background:{uniforms:{uvTransform:{value:new D},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:N.background_vert,fragmentShader:N.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new D}},vertexShader:N.backgroundCube_vert,fragmentShader:N.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:N.cube_vert,fragmentShader:N.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:N.equirect_vert,fragmentShader:N.equirect_frag},distanceRGBA:{uniforms:J([M.common,M.displacementmap,{referencePosition:{value:new B},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:N.distanceRGBA_vert,fragmentShader:N.distanceRGBA_frag},shadow:{uniforms:J([M.lights,M.fog,{color:{value:new H(0)},opacity:{value:1}}]),vertexShader:N.shadow_vert,fragmentShader:N.shadow_frag}};Fs.physical={uniforms:J([Fs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new D},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new D},clearcoatNormalScale:{value:new ue(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new D},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new D},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new D},sheen:{value:0},sheenColor:{value:new H(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new D},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new D},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new D},transmissionSamplerSize:{value:new ue},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new D},attenuationDistance:{value:0},attenuationColor:{value:new H(0)},specularColor:{value:new H(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new D},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new D},anisotropyVector:{value:new ue},anisotropyMap:{value:null},anisotropyMapTransform:{value:new D}}]),vertexShader:N.meshphysical_vert,fragmentShader:N.meshphysical_frag};var ke=(1+Math.sqrt(5))/2,pt=1/ke,Nd=[new B(-ke,pt,0),new B(ke,pt,0),new B(-pt,0,ke),new B(pt,0,ke),new B(0,ke,-pt),new B(0,ke,pt),new B(-1,1,-1),new B(1,1,-1),new B(-1,1,1),new B(1,1,1)];var Ud=new Float32Array(16),Od=new Float32Array(9),Fd=new Float32Array(4);var Bd={[ai]:oi,[ci]:di,[hi]:fi,[li]:ui,[oi]:ai,[di]:ci,[fi]:hi,[ui]:li};v();v();v();v();v();v();var mf=new Set(Object.keys(H.NAMES));v();v();var pe,gt,ze,Ft,mt=class mt{constructor(e,t){ie(this,ze);Oe(this,"__type",mt.__type);ie(this,pe);ie(this,gt);Oe(this,"id");Oe(this,"type");se(this,pe,e),se(this,gt,t),this.id="ev_".concat(e.id),this.type=e.type}static is(e){return e!=null&&typeof e=="object"&&"__type"in e&&e.__type===mt.__type}get name(){var e;return(e=Ae(this,ze,Ft).call(this,"name"))!=null?e:""}get startDate(){return new Date(U(this,pe).startDate)}get endDate(){return new Date(U(this,pe).endDate)}get externalId(){return U(this,pe).externalId}get description(){return Ae(this,ze,Ft).call(this,"description")}get location(){let e=U(this,pe).location,t=e!=null&&e.startsWith("el_")?e:"el_".concat(e);return U(this,gt).getById("enterprise-location",t)}get image(){let e=Ae(this,ze,Ft).call(this,"image");if(e!=null)return m({url:e.original},e)}get video(){let e=Ae(this,ze,Ft).call(this,"video");if(e!=null)return{url:e.original,thumbnail:e.thumbnail,width:e.width,height:e.height}}};pe=new WeakMap,gt=new WeakMap,ze=new WeakSet,Ft=u(function(e){var t,n,i,s,r;return(r=(s=(i=U(this,pe)._locale)==null?void 0:i[(n=(t=U(this,gt).currentLanguage)==null?void 0:t.code)!=null?n:"en"])==null?void 0:s[e])!=null?r:U(this,pe)[e]},"#getLocalizedResource"),u(mt,"EventMetaData"),Oe(mt,"__type","event");var yn=mt;v();v();v();var F={};ar(F,{BRAND:()=>Uc,DIRTY:()=>Ve,EMPTY_PATH:()=>fc,INVALID:()=>w,NEVER:()=>yl,OK:()=>Z,ParseStatus:()=>Y,Schema:()=>P,ZodAny:()=>Ne,ZodArray:()=>Te,ZodBigInt:()=>We,ZodBoolean:()=>Xe,ZodBranded:()=>Wt,ZodCatch:()=>nt,ZodDate:()=>qe,ZodDefault:()=>tt,ZodDiscriminatedUnion:()=>En,ZodEffects:()=>le,ZodEnum:()=>Qe,ZodError:()=>K,ZodFirstPartyTypeKind:()=>R,ZodFunction:()=>wn,ZodIntersection:()=>Ze,ZodIssueCode:()=>_,ZodLazy:()=>Je,ZodLiteral:()=>Ke,ZodMap:()=>Et,ZodNaN:()=>wt,ZodNativeEnum:()=>et,ZodNever:()=>fe,ZodNull:()=>$e,ZodNullable:()=>_e,ZodNumber:()=>He,ZodObject:()=>Q,ZodOptional:()=>oe,ZodParsedType:()=>S,ZodPipeline:()=>Xt,ZodPromise:()=>Ue,ZodReadonly:()=>it,ZodRecord:()=>Tn,ZodSchema:()=>P,ZodSet:()=>Tt,ZodString:()=>Le,ZodSymbol:()=>St,ZodTransformer:()=>le,ZodTuple:()=>ge,ZodType:()=>P,ZodUndefined:()=>Ye,ZodUnion:()=>je,ZodUnknown:()=>Ee,ZodVoid:()=>bt,addIssueToContext:()=>y,any:()=>Wc,array:()=>$c,bigint:()=>kc,boolean:()=>js,coerce:()=>xl,custom:()=>qs,date:()=>zc,datetimeRegex:()=>Ws,defaultErrorMap:()=>Se,discriminatedUnion:()=>Kc,effect:()=>hl,enum:()=>ol,function:()=>sl,getErrorMap:()=>_t,getParsedType:()=>me,instanceof:()=>Fc,intersection:()=>Qc,isAborted:()=>Sn,isAsync:()=>xt,isDirty:()=>bn,isValid:()=>De,late:()=>Oc,lazy:()=>rl,literal:()=>al,makeIssue:()=>Bt,map:()=>nl,nan:()=>Bc,nativeEnum:()=>cl,never:()=>qc,null:()=>Hc,nullable:()=>dl,number:()=>$s,object:()=>jc,objectUtil:()=>ki,oboolean:()=>_l,onumber:()=>gl,optional:()=>ul,ostring:()=>ml,pipeline:()=>pl,preprocess:()=>fl,promise:()=>ll,quotelessJson:()=>hc,record:()=>tl,set:()=>il,setErrorMap:()=>dc,strictObject:()=>Zc,string:()=>Ys,symbol:()=>Vc,transformer:()=>hl,tuple:()=>el,undefined:()=>Gc,union:()=>Jc,unknown:()=>Xc,util:()=>L,void:()=>Yc});v();v();v();v();v();var L;(function(a){a.assertEqual=i=>{};function e(i){}u(e,"assertIs"),a.assertIs=e;function t(i){throw new Error}u(t,"assertNever"),a.assertNever=t,a.arrayToEnum=i=>{let s={};for(let r of i)s[r]=r;return s},a.getValidEnumValues=i=>{let s=a.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),r={};for(let o of s)r[o]=i[o];return a.objectValues(r)},a.objectValues=i=>a.objectKeys(i).map(function(s){return i[s]}),a.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let r in i)Object.prototype.hasOwnProperty.call(i,r)&&s.push(r);return s},a.find=(i,s)=>{for(let r of i)if(s(r))return r},a.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(r=>typeof r=="string"?"'".concat(r,"'"):r).join(s)}u(n,"joinValues"),a.joinValues=n,a.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(L||(L={}));var ki;(function(a){a.mergeShapes=(e,t)=>m(m({},e),t)})(ki||(ki={}));var S=L.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),me=u(a=>{switch(typeof a){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(a)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(a)?S.array:a===null?S.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?S.promise:typeof Map<"u"&&a instanceof Map?S.map:typeof Set<"u"&&a instanceof Set?S.set:typeof Date<"u"&&a instanceof Date?S.date:S.object;default:return S.unknown}},"getParsedType");var _=L.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hc=u(a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),vn=class vn extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(s){return s.message},n={_errors:[]},i=u(s=>{for(let r of s.issues)if(r.code==="invalid_union")r.unionErrors.map(i);else if(r.code==="invalid_return_type")i(r.returnTypeError);else if(r.code==="invalid_arguments")i(r.argumentsError);else if(r.path.length===0)n._errors.push(t(r));else{let o=n,c=0;for(;c<r.path.length;){let l=r.path[c];c===r.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(r))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof vn))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,L.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};u(vn,"ZodError");var K=vn;K.create=a=>new K(a);var uc=u((a,e)=>{let t;switch(a.code){case _.invalid_type:a.received===S.undefined?t="Required":t="Expected ".concat(a.expected,", received ").concat(a.received);break;case _.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(a.expected,L.jsonStringifyReplacer));break;case _.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(L.joinValues(a.keys,", "));break;case _.invalid_union:t="Invalid input";break;case _.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(L.joinValues(a.options));break;case _.invalid_enum_value:t="Invalid enum value. Expected ".concat(L.joinValues(a.options),", received '").concat(a.received,"'");break;case _.invalid_arguments:t="Invalid function arguments";break;case _.invalid_return_type:t="Invalid function return type";break;case _.invalid_date:t="Invalid date";break;case _.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t='Invalid input: must include "'.concat(a.validation.includes,'"'),typeof a.validation.position=="number"&&(t="".concat(t," at one or more positions greater than or equal to ").concat(a.validation.position))):"startsWith"in a.validation?t='Invalid input: must start with "'.concat(a.validation.startsWith,'"'):"endsWith"in a.validation?t='Invalid input: must end with "'.concat(a.validation.endsWith,'"'):L.assertNever(a.validation):a.validation!=="regex"?t="Invalid ".concat(a.validation):t="Invalid";break;case _.too_small:a.type==="array"?t="Array must contain ".concat(a.exact?"exactly":a.inclusive?"at least":"more than"," ").concat(a.minimum," element(s)"):a.type==="string"?t="String must contain ".concat(a.exact?"exactly":a.inclusive?"at least":"over"," ").concat(a.minimum," character(s)"):a.type==="number"?t="Number must be ".concat(a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than ").concat(a.minimum):a.type==="date"?t="Date must be ".concat(a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(a.minimum))):t="Invalid input";break;case _.too_big:a.type==="array"?t="Array must contain ".concat(a.exact?"exactly":a.inclusive?"at most":"less than"," ").concat(a.maximum," element(s)"):a.type==="string"?t="String must contain ".concat(a.exact?"exactly":a.inclusive?"at most":"under"," ").concat(a.maximum," character(s)"):a.type==="number"?t="Number must be ".concat(a.exact?"exactly":a.inclusive?"less than or equal to":"less than"," ").concat(a.maximum):a.type==="bigint"?t="BigInt must be ".concat(a.exact?"exactly":a.inclusive?"less than or equal to":"less than"," ").concat(a.maximum):a.type==="date"?t="Date must be ".concat(a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(a.maximum))):t="Invalid input";break;case _.custom:t="Invalid input";break;case _.invalid_intersection_types:t="Intersection results could not be merged";break;case _.not_multiple_of:t="Number must be a multiple of ".concat(a.multipleOf);break;case _.not_finite:t="Number must be finite";break;default:t=e.defaultError,L.assertNever(a)}return{message:t}},"errorMap"),Se=uc;var ks=Se;function dc(a){ks=a}u(dc,"setErrorMap");function _t(){return ks}u(_t,"getErrorMap");v();var Bt=u(a=>{let{data:e,path:t,errorMaps:n,issueData:i}=a,s=[...t,...i.path||[]],r=E(m({},i),{path:s});if(i.message!==void 0)return E(m({},i),{path:s,message:i.message});let o="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)o=l(r,{data:e,defaultError:o}).message;return E(m({},i),{path:s,message:o})},"makeIssue"),fc=[];function y(a,e){let t=_t(),n=Bt({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===Se?void 0:Se].filter(i=>!!i)});a.common.issues.push(n)}u(y,"addIssueToContext");var Mn=class Mn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return w;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let s=await i.key,r=await i.value;n.push({key:s,value:r})}return Mn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:r}=i;if(s.status==="aborted"||r.status==="aborted")return w;s.status==="dirty"&&e.dirty(),r.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof r.value<"u"||i.alwaysSet)&&(n[s.value]=r.value)}return{status:e.value,value:n}}};u(Mn,"ParseStatus");var Y=Mn,w=Object.freeze({status:"aborted"}),Ve=u(a=>({status:"dirty",value:a}),"DIRTY"),Z=u(a=>({status:"valid",value:a}),"OK"),Sn=u(a=>a.status==="aborted","isAborted"),bn=u(a=>a.status==="dirty","isDirty"),De=u(a=>a.status==="valid","isValid"),xt=u(a=>typeof Promise<"u"&&a instanceof Promise,"isAsync");v();v();v();var b;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));var Gi=class Gi{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};u(Gi,"ParseInputLazyPath");var ce=Gi,zs=u((a,e)=>{if(De(e))return{success:!0,data:e.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new K(a.common.issues);return this._error=t,this._error}}},"handleResult");function C(a){if(!a)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=a;if(e&&(t||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:u((r,o)=>{var l,h;let{message:c}=a;return r.code==="invalid_enum_value"?{message:c!=null?c:o.defaultError}:typeof o.data>"u"?{message:(l=c!=null?c:n)!=null?l:o.defaultError}:r.code!=="invalid_type"?{message:o.defaultError}:{message:(h=c!=null?c:t)!=null?h:o.defaultError}},"customMap"),description:i}}u(C,"processCreateParams");var Hi=class Hi{get description(){return this._def.description}_getType(e){return me(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:me(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Y,ctx:{common:e.parent.common,data:e.data,parsedType:me(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(xt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var s;let n={common:{issues:[],async:(s=t==null?void 0:t.async)!=null?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:me(e)},i=this._parseSync({data:e,path:n.path,parent:n});return zs(n,i)}"~validate"(e){var n,i;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:me(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return De(s)?{value:s.value}:{issues:t.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>De(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:me(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(xt(i)?i:Promise.resolve(i));return zs(n,s)}refine(e,t){let n=u(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let r=e(i),o=u(()=>s.addIssue(m({code:_.custom},n(i))),"setError");return typeof Promise<"u"&&r instanceof Promise?r.then(c=>c?!0:(o(),!1)):r?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new le({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:u(t=>this["~validate"](t),"validate")}}optional(){return oe.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Te.create(this)}promise(){return Ue.create(this,this._def)}or(e){return je.create([this,e],this._def)}and(e){return Ze.create(this,e,this._def)}transform(e){return new le(E(m({},C(this._def)),{schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new tt(E(m({},C(this._def)),{innerType:this,defaultValue:t,typeName:R.ZodDefault}))}brand(){return new Wt(m({typeName:R.ZodBranded,type:this},C(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new nt(E(m({},C(this._def)),{innerType:this,catchValue:t,typeName:R.ZodCatch}))}describe(e){let t=this.constructor;return new t(E(m({},this._def),{description:e}))}pipe(e){return Xt.create(this,e)}readonly(){return it.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};u(Hi,"ZodType");var P=Hi,pc=/^c[^\s-]{8,}$/i,mc=/^[0-9a-z]+$/,gc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xc=/^[a-z0-9_-]{21}$/i,yc=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Mc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Sc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zi,bc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ec=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Tc=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,wc=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ac=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Rc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gs="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Cc=new RegExp("^".concat(Gs,"$"));function Hs(a){let e="[0-5]\\d";a.precision?e="".concat(e,"\\.\\d{").concat(a.precision,"}"):a.precision==null&&(e="".concat(e,"(\\.\\d+)?"));let t=a.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(e,")").concat(t)}u(Hs,"timeRegexSource");function Ic(a){return new RegExp("^".concat(Hs(a),"$"))}u(Ic,"timeRegex");function Ws(a){let e="".concat(Gs,"T").concat(Hs(a)),t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(t.join("|"),")"),new RegExp("^".concat(e,"$"))}u(Ws,"datetimeRegex");function Pc(a,e){return!!((e==="v4"||!e)&&bc.test(a)||(e==="v6"||!e)&&Tc.test(a))}u(Pc,"isValidIP");function Dc(a,e){if(!yc.test(a))return!1;try{let[t]=a.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch(t){return!1}}u(Dc,"isValidJWT");function Lc(a,e){return!!((e==="v4"||!e)&&Ec.test(a)||(e==="v6"||!e)&&wc.test(a))}u(Lc,"isValidCidr");var Ge=class Ge extends P{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){let s=this._getOrReturnCtx(e);return y(s,{code:_.invalid_type,expected:S.string,received:s.parsedType}),w}let n=new Y,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let r=e.data.length>s.value,o=e.data.length<s.value;(r||o)&&(i=this._getOrReturnCtx(e,i),r?y(i,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&y(i,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Mc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"email",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")zi||(zi=new RegExp(Sc,"u")),zi.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"emoji",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")_c.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"uuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")xc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"nanoid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")pc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")mc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid2",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")gc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ulid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch(r){i=this._getOrReturnCtx(e,i),y(i,{validation:"url",code:_.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"regex",code:_.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),y(i,{code:_.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),y(i,{code:_.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),y(i,{code:_.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ws(s).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:_.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Cc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:_.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Ic(s).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:_.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?vc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"duration",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Pc(e.data,s.version)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ip",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Dc(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"jwt",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Lc(e.data,s.version)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cidr",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Ac.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"base64",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Rc.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"base64url",code:_.invalid_string,message:s.message}),n.dirty()):L.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),m({validation:t,code:_.invalid_string},b.errToObj(n)))}_addCheck(e){return new Ge(E(m({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(m({kind:"email"},b.errToObj(e)))}url(e){return this._addCheck(m({kind:"url"},b.errToObj(e)))}emoji(e){return this._addCheck(m({kind:"emoji"},b.errToObj(e)))}uuid(e){return this._addCheck(m({kind:"uuid"},b.errToObj(e)))}nanoid(e){return this._addCheck(m({kind:"nanoid"},b.errToObj(e)))}cuid(e){return this._addCheck(m({kind:"cuid"},b.errToObj(e)))}cuid2(e){return this._addCheck(m({kind:"cuid2"},b.errToObj(e)))}ulid(e){return this._addCheck(m({kind:"ulid"},b.errToObj(e)))}base64(e){return this._addCheck(m({kind:"base64"},b.errToObj(e)))}base64url(e){return this._addCheck(m({kind:"base64url"},b.errToObj(e)))}jwt(e){return this._addCheck(m({kind:"jwt"},b.errToObj(e)))}ip(e){return this._addCheck(m({kind:"ip"},b.errToObj(e)))}cidr(e){return this._addCheck(m({kind:"cidr"},b.errToObj(e)))}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(m({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},b.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(m({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision},b.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(m({kind:"duration"},b.errToObj(e)))}regex(e,t){return this._addCheck(m({kind:"regex",regex:e},b.errToObj(t)))}includes(e,t){return this._addCheck(m({kind:"includes",value:e,position:t==null?void 0:t.position},b.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(m({kind:"startsWith",value:e},b.errToObj(t)))}endsWith(e,t){return this._addCheck(m({kind:"endsWith",value:e},b.errToObj(t)))}min(e,t){return this._addCheck(m({kind:"min",value:e},b.errToObj(t)))}max(e,t){return this._addCheck(m({kind:"max",value:e},b.errToObj(t)))}length(e,t){return this._addCheck(m({kind:"length",value:e},b.errToObj(t)))}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new Ge(E(m({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new Ge(E(m({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ge(E(m({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};u(Ge,"ZodString");var Le=Ge;Le.create=a=>{var e;return new Le(m({checks:[],typeName:R.ZodString,coerce:(e=a==null?void 0:a.coerce)!=null?e:!1},C(a)))};function Nc(a,e){let t=(a.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,s=Number.parseInt(a.toFixed(i).replace(".","")),r=Number.parseInt(e.toFixed(i).replace(".",""));return s%r/10**i}u(Nc,"floatSafeRemainder");var kt=class kt extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){let s=this._getOrReturnCtx(e);return y(s,{code:_.invalid_type,expected:S.number,received:s.parsedType}),w}let n,i=new Y;for(let s of this._def.checks)s.kind==="int"?L.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:_.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:_.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:_.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Nc(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),y(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:_.not_finite,message:s.message}),i.dirty()):L.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,i){return new kt(E(m({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(i)}]}))}_addCheck(e){return new kt(E(m({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&L.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};u(kt,"ZodNumber");var He=kt;He.create=a=>new He(m({checks:[],typeName:R.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1},C(a)));var zt=class zt extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(s){return this._getInvalidInput(e)}if(this._getType(e)!==S.bigint)return this._getInvalidInput(e);let n,i=new Y;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:_.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:_.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),y(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):L.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return y(t,{code:_.invalid_type,expected:S.bigint,received:t.parsedType}),w}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,i){return new zt(E(m({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(i)}]}))}_addCheck(e){return new zt(E(m({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};u(zt,"ZodBigInt");var We=zt;We.create=a=>{var e;return new We(m({checks:[],typeName:R.ZodBigInt,coerce:(e=a==null?void 0:a.coerce)!=null?e:!1},C(a)))};var Wi=class Wi extends P{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){let n=this._getOrReturnCtx(e);return y(n,{code:_.invalid_type,expected:S.boolean,received:n.parsedType}),w}return Z(e.data)}};u(Wi,"ZodBoolean");var Xe=Wi;Xe.create=a=>new Xe(m({typeName:R.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1},C(a)));var An=class An extends P{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){let s=this._getOrReturnCtx(e);return y(s,{code:_.invalid_type,expected:S.date,received:s.parsedType}),w}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return y(s,{code:_.invalid_date}),w}let n=new Y,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:_.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:_.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):L.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new An(E(m({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};u(An,"ZodDate");var qe=An;qe.create=a=>new qe(m({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:R.ZodDate},C(a)));var Xi=class Xi extends P{_parse(e){if(this._getType(e)!==S.symbol){let n=this._getOrReturnCtx(e);return y(n,{code:_.invalid_type,expected:S.symbol,received:n.parsedType}),w}return Z(e.data)}};u(Xi,"ZodSymbol");var St=Xi;St.create=a=>new St(m({typeName:R.ZodSymbol},C(a)));var qi=class qi extends P{_parse(e){if(this._getType(e)!==S.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:_.invalid_type,expected:S.undefined,received:n.parsedType}),w}return Z(e.data)}};u(qi,"ZodUndefined");var Ye=qi;Ye.create=a=>new Ye(m({typeName:R.ZodUndefined},C(a)));var Yi=class Yi extends P{_parse(e){if(this._getType(e)!==S.null){let n=this._getOrReturnCtx(e);return y(n,{code:_.invalid_type,expected:S.null,received:n.parsedType}),w}return Z(e.data)}};u(Yi,"ZodNull");var $e=Yi;$e.create=a=>new $e(m({typeName:R.ZodNull},C(a)));var $i=class $i extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}};u($i,"ZodAny");var Ne=$i;Ne.create=a=>new Ne(m({typeName:R.ZodAny},C(a)));var ji=class ji extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}};u(ji,"ZodUnknown");var Ee=ji;Ee.create=a=>new Ee(m({typeName:R.ZodUnknown},C(a)));var Zi=class Zi extends P{_parse(e){let t=this._getOrReturnCtx(e);return y(t,{code:_.invalid_type,expected:S.never,received:t.parsedType}),w}};u(Zi,"ZodNever");var fe=Zi;fe.create=a=>new fe(m({typeName:R.ZodNever},C(a)));var Ji=class Ji extends P{_parse(e){if(this._getType(e)!==S.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:_.invalid_type,expected:S.void,received:n.parsedType}),w}return Z(e.data)}};u(Ji,"ZodVoid");var bt=Ji;bt.create=a=>new bt(m({typeName:R.ZodVoid},C(a)));var vt=class vt extends P{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==S.array)return y(t,{code:_.invalid_type,expected:S.array,received:t.parsedType}),w;if(i.exactLength!==null){let r=t.data.length>i.exactLength.value,o=t.data.length<i.exactLength.value;(r||o)&&(y(t,{code:r?_.too_big:_.too_small,minimum:o?i.exactLength.value:void 0,maximum:r?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(y(t,{code:_.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(y(t,{code:_.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((r,o)=>i.type._parseAsync(new ce(t,r,t.path,o)))).then(r=>Y.mergeArray(n,r));let s=[...t.data].map((r,o)=>i.type._parseSync(new ce(t,r,t.path,o)));return Y.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new vt(E(m({},this._def),{minLength:{value:e,message:b.toString(t)}}))}max(e,t){return new vt(E(m({},this._def),{maxLength:{value:e,message:b.toString(t)}}))}length(e,t){return new vt(E(m({},this._def),{exactLength:{value:e,message:b.toString(t)}}))}nonempty(e){return this.min(1,e)}};u(vt,"ZodArray");var Te=vt;Te.create=(a,e)=>new Te(m({type:a,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray},C(e)));function yt(a){if(a instanceof Q){let e={};for(let t in a.shape){let n=a.shape[t];e[t]=oe.create(yt(n))}return new Q(E(m({},a._def),{shape:u(()=>e,"shape")}))}else return a instanceof Te?new Te(E(m({},a._def),{type:yt(a.element)})):a instanceof oe?oe.create(yt(a.unwrap())):a instanceof _e?_e.create(yt(a.unwrap())):a instanceof ge?ge.create(a.items.map(e=>yt(e))):a}u(yt,"deepPartialify");var te=class te extends P{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=L.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==S.object){let l=this._getOrReturnCtx(e);return y(l,{code:_.invalid_type,expected:S.object,received:l.parsedType}),w}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:r}=this._getCached(),o=[];if(!(this._def.catchall instanceof fe&&this._def.unknownKeys==="strip"))for(let l in i.data)r.includes(l)||o.push(l);let c=[];for(let l of r){let h=s[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:h._parse(new ce(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof fe){let l=this._def.unknownKeys;if(l==="passthrough")for(let h of o)c.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(l==="strict")o.length>0&&(y(i,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let h of o){let d=i.data[h];c.push({key:{status:"valid",value:h},value:l._parse(new ce(i,d,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let h of c){let d=await h.key,p=await h.value;l.push({key:d,value:p,alwaysSet:h.alwaysSet})}return l}).then(l=>Y.mergeObjectSync(n,l)):Y.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new te(m(E(m({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:u((t,n)=>{var s,r,o,c;let i=(o=(r=(s=this._def).errorMap)==null?void 0:r.call(s,t,n).message)!=null?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(c=b.errToObj(e).message)!=null?c:i}:{message:i}},"errorMap")}:{}))}strip(){return new te(E(m({},this._def),{unknownKeys:"strip"}))}passthrough(){return new te(E(m({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new te(E(m({},this._def),{shape:u(()=>m(m({},this._def.shape()),e),"shape")}))}merge(e){return new te({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:u(()=>m(m({},this._def.shape()),e._def.shape()),"shape"),typeName:R.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new te(E(m({},this._def),{catchall:e}))}pick(e){let t={};for(let n of L.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new te(E(m({},this._def),{shape:u(()=>t,"shape")}))}omit(e){let t={};for(let n of L.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new te(E(m({},this._def),{shape:u(()=>t,"shape")}))}deepPartial(){return yt(this)}partial(e){let t={};for(let n of L.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}return new te(E(m({},this._def),{shape:u(()=>t,"shape")}))}required(e){let t={};for(let n of L.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof oe;)s=s._def.innerType;t[n]=s}return new te(E(m({},this._def),{shape:u(()=>t,"shape")}))}keyof(){return Xs(L.objectKeys(this.shape))}};u(te,"ZodObject");var Q=te;Q.create=(a,e)=>new Q(m({shape:u(()=>a,"shape"),unknownKeys:"strip",catchall:fe.create(),typeName:R.ZodObject},C(e)));Q.strictCreate=(a,e)=>new Q(m({shape:u(()=>a,"shape"),unknownKeys:"strict",catchall:fe.create(),typeName:R.ZodObject},C(e)));Q.lazycreate=(a,e)=>new Q(m({shape:a,unknownKeys:"strip",catchall:fe.create(),typeName:R.ZodObject},C(e)));var Ki=class Ki extends P{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let r=s.map(o=>new K(o.ctx.common.issues));return y(t,{code:_.invalid_union,unionErrors:r}),w}if(u(i,"handleResults"),t.common.async)return Promise.all(n.map(async s=>{let r=E(m({},t),{common:E(m({},t.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(i);{let s,r=[];for(let c of n){let l=E(m({},t),{common:E(m({},t.common),{issues:[]}),parent:null}),h=c._parseSync({data:t.data,path:t.path,parent:l});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:l}),l.common.issues.length&&r.push(l.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let o=r.map(c=>new K(c));return y(t,{code:_.invalid_union,unionErrors:o}),w}}get options(){return this._def.options}};u(Ki,"ZodUnion");var je=Ki;je.create=(a,e)=>new je(m({options:a,typeName:R.ZodUnion},C(e)));var be=u(a=>a instanceof Je?be(a.schema):a instanceof le?be(a.innerType()):a instanceof Ke?[a.value]:a instanceof Qe?a.options:a instanceof et?L.objectValues(a.enum):a instanceof tt?be(a._def.innerType):a instanceof Ye?[void 0]:a instanceof $e?[null]:a instanceof oe?[void 0,...be(a.unwrap())]:a instanceof _e?[null,...be(a.unwrap())]:a instanceof Wt||a instanceof it?be(a.unwrap()):a instanceof nt?be(a._def.innerType):[],"getDiscriminator"),Rn=class Rn extends P{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.object)return y(t,{code:_.invalid_type,expected:S.object,received:t.parsedType}),w;let n=this.discriminator,i=t.data[n],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let s of t){let r=be(s.shape[e]);if(!r.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let o of r){if(i.has(o))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(o)));i.set(o,s)}}return new Rn(m({typeName:R.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i},C(n)))}};u(Rn,"ZodDiscriminatedUnion");var En=Rn;function Vi(a,e){let t=me(a),n=me(e);if(a===e)return{valid:!0,data:a};if(t===S.object&&n===S.object){let i=L.objectKeys(e),s=L.objectKeys(a).filter(o=>i.indexOf(o)!==-1),r=m(m({},a),e);for(let o of s){let c=Vi(a[o],e[o]);if(!c.valid)return{valid:!1};r[o]=c.data}return{valid:!0,data:r}}else if(t===S.array&&n===S.array){if(a.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<a.length;s++){let r=a[s],o=e[s],c=Vi(r,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return t===S.date&&n===S.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}u(Vi,"mergeValues");var Qi=class Qi extends P{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=u((s,r)=>{if(Sn(s)||Sn(r))return w;let o=Vi(s.value,r.value);return o.valid?((bn(s)||bn(r))&&t.dirty(),{status:t.value,value:o.data}):(y(n,{code:_.invalid_intersection_types}),w)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,r])=>i(s,r)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};u(Qi,"ZodIntersection");var Ze=Qi;Ze.create=(a,e,t)=>new Ze(m({left:a,right:e,typeName:R.ZodIntersection},C(t)));var Cn=class Cn extends P{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.array)return y(n,{code:_.invalid_type,expected:S.array,received:n.parsedType}),w;if(n.data.length<this._def.items.length)return y(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...n.data].map((r,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new ce(n,r,n.path,o)):null}).filter(r=>!!r);return n.common.async?Promise.all(s).then(r=>Y.mergeArray(t,r)):Y.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Cn(E(m({},this._def),{rest:e}))}};u(Cn,"ZodTuple");var ge=Cn;ge.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge(m({items:a,typeName:R.ZodTuple,rest:null},C(e)))};var Vt=class Vt extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.object)return y(n,{code:_.invalid_type,expected:S.object,received:n.parsedType}),w;let i=[],s=this._def.keyType,r=this._def.valueType;for(let o in n.data)i.push({key:s._parse(new ce(n,o,n.path,o)),value:r._parse(new ce(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?Y.mergeObjectAsync(t,i):Y.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof P?new Vt(m({keyType:e,valueType:t,typeName:R.ZodRecord},C(n))):new Vt(m({keyType:Le.create(),valueType:e,typeName:R.ZodRecord},C(t)))}};u(Vt,"ZodRecord");var Tn=Vt,es=class es extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.map)return y(n,{code:_.invalid_type,expected:S.map,received:n.parsedType}),w;let i=this._def.keyType,s=this._def.valueType,r=[...n.data.entries()].map(([o,c],l)=>({key:i._parse(new ce(n,o,n.path,[l,"key"])),value:s._parse(new ce(n,c,n.path,[l,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of r){let l=await c.key,h=await c.value;if(l.status==="aborted"||h.status==="aborted")return w;(l.status==="dirty"||h.status==="dirty")&&t.dirty(),o.set(l.value,h.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let c of r){let l=c.key,h=c.value;if(l.status==="aborted"||h.status==="aborted")return w;(l.status==="dirty"||h.status==="dirty")&&t.dirty(),o.set(l.value,h.value)}return{status:t.value,value:o}}}};u(es,"ZodMap");var Et=es;Et.create=(a,e,t)=>new Et(m({valueType:e,keyType:a,typeName:R.ZodMap},C(t)));var Gt=class Gt extends P{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.set)return y(n,{code:_.invalid_type,expected:S.set,received:n.parsedType}),w;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(y(n,{code:_.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(y(n,{code:_.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function r(c){let l=new Set;for(let h of c){if(h.status==="aborted")return w;h.status==="dirty"&&t.dirty(),l.add(h.value)}return{status:t.value,value:l}}u(r,"finalizeSet");let o=[...n.data.values()].map((c,l)=>s._parse(new ce(n,c,n.path,l)));return n.common.async?Promise.all(o).then(c=>r(c)):r(o)}min(e,t){return new Gt(E(m({},this._def),{minSize:{value:e,message:b.toString(t)}}))}max(e,t){return new Gt(E(m({},this._def),{maxSize:{value:e,message:b.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};u(Gt,"ZodSet");var Tt=Gt;Tt.create=(a,e)=>new Tt(m({valueType:a,minSize:null,maxSize:null,typeName:R.ZodSet},C(e)));var Mt=class Mt extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.function)return y(t,{code:_.invalid_type,expected:S.function,received:t.parsedType}),w;function n(o,c){return Bt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_t(),Se].filter(l=>!!l),issueData:{code:_.invalid_arguments,argumentsError:c}})}u(n,"makeArgsIssue");function i(o,c){return Bt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_t(),Se].filter(l=>!!l),issueData:{code:_.invalid_return_type,returnTypeError:c}})}u(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Ue){let o=this;return Z(async function(...c){let l=new K([]),h=await o._def.args.parseAsync(c,s).catch(f=>{throw l.addIssue(n(c,f)),l}),d=await Reflect.apply(r,this,h);return await o._def.returns._def.type.parseAsync(d,s).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{let o=this;return Z(function(...c){let l=o._def.args.safeParse(c,s);if(!l.success)throw new K([n(c,l.error)]);let h=Reflect.apply(r,this,l.data),d=o._def.returns.safeParse(h,s);if(!d.success)throw new K([i(h,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mt(E(m({},this._def),{args:ge.create(e).rest(Ee.create())}))}returns(e){return new Mt(E(m({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Mt(m({args:e||ge.create([]).rest(Ee.create()),returns:t||Ee.create(),typeName:R.ZodFunction},C(n)))}};u(Mt,"ZodFunction");var wn=Mt,ts=class ts extends P{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};u(ts,"ZodLazy");var Je=ts;Je.create=(a,e)=>new Je(m({getter:a,typeName:R.ZodLazy},C(e)));var ns=class ns extends P{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:_.invalid_literal,expected:this._def.value}),w}return{status:"valid",value:e.data}}get value(){return this._def.value}};u(ns,"ZodLiteral");var Ke=ns;Ke.create=(a,e)=>new Ke(m({value:a,typeName:R.ZodLiteral},C(e)));function Xs(a,e){return new Qe(m({values:a,typeName:R.ZodEnum},C(e)))}u(Xs,"createZodEnum");var Ht=class Ht extends P{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:L.joinValues(n),received:t.parsedType,code:_.invalid_type}),w}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:_.invalid_enum_value,options:n}),w}return Z(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ht.create(e,m(m({},this._def),t))}exclude(e,t=this._def){return Ht.create(this.options.filter(n=>!e.includes(n)),m(m({},this._def),t))}};u(Ht,"ZodEnum");var Qe=Ht;Qe.create=Xs;var is=class is extends P{_parse(e){let t=L.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==S.string&&n.parsedType!==S.number){let i=L.objectValues(t);return y(n,{expected:L.joinValues(i),received:n.parsedType,code:_.invalid_type}),w}if(this._cache||(this._cache=new Set(L.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=L.objectValues(t);return y(n,{received:n.data,code:_.invalid_enum_value,options:i}),w}return Z(e.data)}get enum(){return this._def.values}};u(is,"ZodNativeEnum");var et=is;et.create=(a,e)=>new et(m({values:a,typeName:R.ZodNativeEnum},C(e)));var ss=class ss extends P{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return y(t,{code:_.invalid_type,expected:S.promise,received:t.parsedType}),w;let n=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return Z(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};u(ss,"ZodPromise");var Ue=ss;Ue.create=(a,e)=>new Ue(m({type:a,typeName:R.ZodPromise},C(e)));var rs=class rs extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:u(r=>{y(n,r),r.fatal?t.abort():t.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let r=i.transform(n.data,s);if(n.common.async)return Promise.resolve(r).then(async o=>{if(t.value==="aborted")return w;let c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?w:c.status==="dirty"?Ve(c.value):t.value==="dirty"?Ve(c.value):c});{if(t.value==="aborted")return w;let o=this._def.schema._parseSync({data:r,path:n.path,parent:n});return o.status==="aborted"?w:o.status==="dirty"?Ve(o.value):t.value==="dirty"?Ve(o.value):o}}if(i.type==="refinement"){let r=u(o=>{let c=i.refinement(o,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o},"executeRefinement");if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?w:(o.status==="dirty"&&t.dirty(),r(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?w:(o.status==="dirty"&&t.dirty(),r(o.value).then(()=>({status:t.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!De(r))return w;let o=i.transform(r.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(r=>De(r)?Promise.resolve(i.transform(r.value,s)).then(o=>({status:t.value,value:o})):w);L.assertNever(i)}};u(rs,"ZodEffects");var le=rs;le.create=(a,e,t)=>new le(m({schema:a,typeName:R.ZodEffects,effect:e},C(t)));le.createWithPreprocess=(a,e,t)=>new le(m({schema:e,effect:{type:"preprocess",transform:a},typeName:R.ZodEffects},C(t)));var as=class as extends P{_parse(e){return this._getType(e)===S.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};u(as,"ZodOptional");var oe=as;oe.create=(a,e)=>new oe(m({innerType:a,typeName:R.ZodOptional},C(e)));var os=class os extends P{_parse(e){return this._getType(e)===S.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};u(os,"ZodNullable");var _e=os;_e.create=(a,e)=>new _e(m({innerType:a,typeName:R.ZodNullable},C(e)));var cs=class cs extends P{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};u(cs,"ZodDefault");var tt=cs;tt.create=(a,e)=>new tt(m({innerType:a,typeName:R.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},C(e)));var ls=class ls extends P{_parse(e){let{ctx:t}=this._processInputParams(e),n=E(m({},t),{common:E(m({},t.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:m({},n)});return xt(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new K(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new K(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};u(ls,"ZodCatch");var nt=ls;nt.create=(a,e)=>new nt(m({innerType:a,typeName:R.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},C(e)));var hs=class hs extends P{_parse(e){if(this._getType(e)!==S.nan){let n=this._getOrReturnCtx(e);return y(n,{code:_.invalid_type,expected:S.nan,received:n.parsedType}),w}return{status:"valid",value:e.data}}};u(hs,"ZodNaN");var wt=hs;wt.create=a=>new wt(m({typeName:R.ZodNaN},C(a)));var Uc=Symbol("zod_brand"),us=class us extends P{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};u(us,"ZodBranded");var Wt=us,In=class In extends P{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return u(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?w:s.status==="dirty"?(t.dirty(),Ve(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?w:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new In({in:e,out:t,typeName:R.ZodPipeline})}};u(In,"ZodPipeline");var Xt=In,ds=class ds extends P{_parse(e){let t=this._def.innerType._parse(e),n=u(i=>(De(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return xt(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};u(ds,"ZodReadonly");var it=ds;it.create=(a,e)=>new it(m({innerType:a,typeName:R.ZodReadonly},C(e)));function Vs(a,e){let t=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof t=="string"?{message:t}:t}u(Vs,"cleanParams");function qs(a,e={},t){return a?Ne.create().superRefine((n,i)=>{var r,o;let s=a(n);if(s instanceof Promise)return s.then(c=>{var l,h;if(!c){let d=Vs(e,n),p=(h=(l=d.fatal)!=null?l:t)!=null?h:!0;i.addIssue(E(m({code:"custom"},d),{fatal:p}))}});if(!s){let c=Vs(e,n),l=(o=(r=c.fatal)!=null?r:t)!=null?o:!0;i.addIssue(E(m({code:"custom"},c),{fatal:l}))}}):Ne.create()}u(qs,"custom");var Oc={object:Q.lazycreate},R;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(R||(R={}));var Fc=u((a,e={message:"Input not instance of ".concat(a.name)})=>qs(t=>t instanceof a,e),"instanceOfType"),Ys=Le.create,$s=He.create,Bc=wt.create,kc=We.create,js=Xe.create,zc=qe.create,Vc=St.create,Gc=Ye.create,Hc=$e.create,Wc=Ne.create,Xc=Ee.create,qc=fe.create,Yc=bt.create,$c=Te.create,jc=Q.create,Zc=Q.strictCreate,Jc=je.create,Kc=En.create,Qc=Ze.create,el=ge.create,tl=Tn.create,nl=Et.create,il=Tt.create,sl=wn.create,rl=Je.create,al=Ke.create,ol=Qe.create,cl=et.create,ll=Ue.create,hl=le.create,ul=oe.create,dl=_e.create,fl=le.createWithPreprocess,pl=Xt.create,ml=u(()=>Ys().optional(),"ostring"),gl=u(()=>$s().optional(),"onumber"),_l=u(()=>js().optional(),"oboolean"),xl={string:u(a=>Le.create(E(m({},a),{coerce:!0})),"string"),number:u(a=>He.create(E(m({},a),{coerce:!0})),"number"),boolean:u(a=>Xe.create(E(m({},a),{coerce:!0})),"boolean"),bigint:u(a=>We.create(E(m({},a),{coerce:!0})),"bigint"),date:u(a=>qe.create(E(m({},a),{coerce:!0})),"date")};var yl=w;v();v();v();v();v();var Ml=60,jp=Ml*60*1e3;v();var Sl=60,sm=Sl*60*1e3;var Ks=globalThis.fetch,Qs,um=(Qs=I==null?void 0:I.env)==null?void 0:Qs.npm_package_version;function Pn(){if(Ks==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Ks}u(Pn,"isomorphicFetch");var bl=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),dm=Object.freeze(E(m({},bl),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),fm=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),pm=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),mm=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});var er={id:F.string(),name:F.string(),type:F.string(),startDate:F.number(),endDate:F.number(),externalId:F.string().optional(),description:F.string().optional(),location:F.string().optional(),image:F.object({original:F.string(),xxsmall:F.string().optional(),xsmall:F.string().optional(),small:F.string().optional(),medium:F.string().optional(),large:F.string().optional(),xlarge:F.string().optional(),xxlarge:F.string().optional()}).optional(),video:F.object({width:F.number(),height:F.number(),thumbnail:F.string(),content:F.string(),original:F.string()}).optional(),_locale:F.record(F.string(),F.record(F.string(),F.unknown())).optional()},tr=F.object(er),nr=Object.keys(er),ir=u(async(a,e,t,n={})=>{let i=new URLSearchParams(n),s=new URL("/public/1/event/".concat(a),e);return s.search=i.toString(),await(await Pn()(s.toString(),{headers:{Authorization:"Bearer ".concat(t)}})).json()},"fetchEvents");var we,ne,xe,At,Rt,Ct,sr,rr,ps=class ps{constructor(e,t={}){ie(this,Ct);ie(this,we);ie(this,ne,{eventsById:new Map,eventsByLocationId:new Map});ie(this,xe,null);ie(this,At,!1);ie(this,Rt);var n;se(this,we,e),se(this,Rt,E(m({includeExpired:!1},t),{fields:nr.concat((n=t.fields)!=null?n:[])}))}async load(){return U(this,xe)!=null?U(this,xe):(se(this,xe,(async()=>{let e=await Ae(this,Ct,sr).call(this);U(this,xe)!=null&&(await Ae(this,Ct,rr).call(this,e),se(this,At,!0),se(this,xe,null))})()),U(this,xe))}get ready(){return U(this,At)}get events(){return Array.from(U(this,ne).eventsById.values())}getById(e){return U(this,ne).eventsById.get(e)}getByLocationId(e){var t;return(t=U(this,ne).eventsByLocationId.get(e))!=null?t:[]}destroy(){U(this,ne).eventsById.clear(),U(this,ne).eventsByLocationId.clear(),se(this,xe,null),se(this,At,!1)}};we=new WeakMap,ne=new WeakMap,xe=new WeakMap,At=new WeakMap,Rt=new WeakMap,Ct=new WeakSet,sr=u(async function(){if(!U(this,we).internal.enterpriseMode)return st.warn("Events are currently only supported for CMS maps!"),[];let e=U(this,we).mapId;if(e==null)throw new Error("Failed to fetch events! Map ID was not specified in getMapData.");let t=U(this,we).getAccessToken();if(t==null)throw new Error("Failed to fetch events! Could not get access token from MapData.");let n={fields:U(this,Rt).fields.join(","),lang:"all"};U(this,Rt).includeExpired||(n.activeAtOrAfter="now");let i=await ir(e,U(this,we).getEnv().baseUri,t,n);if(!Array.isArray(i))throw new Error("Failed to fetch events! Invalid response format.");return i.filter(s=>{let r=tr.safeParse(s);return r.success||st.warn("Failed to parse event!",s,r.error),r.success})},"#fetchEvents"),rr=u(async function(e){var t,n;U(this,ne).eventsById.clear(),U(this,ne).eventsByLocationId.clear();for(let i of e){let s=new yn(i,U(this,we));U(this,ne).eventsById.set(s.id,s);let r=(t=s.location)==null?void 0:t.id;r!=null&&U(this,ne).eventsByLocationId.set(r,[...(n=U(this,ne).eventsByLocationId.get(r))!=null?n:[],s])}},"#createEvents"),u(ps,"EventsManager");var fs=ps;export{fs as EventsManager};