@mappedin/maplibre-overlay 6.0.1-beta.56 → 6.0.1-beta.57
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/GLTFExporter-O644PVLV.js +1 -0
- package/lib/esm/GLTFLoader-AZWCPJ6N.js +1 -0
- package/lib/esm/chunk-5BCZO6LI.js +1 -0
- package/lib/esm/chunk-LUJQR5EH.js +1 -0
- package/lib/esm/chunk-QNFLY3SM.js +1 -0
- package/lib/esm/chunk-ZGSGFTWM.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/{roboto-regular-JDPVYXT5.js → roboto-regular-NXH7N2CY.js} +1 -1
- package/lib/esm/text3d-X7BWPJT4.js +1 -0
- package/package.json +3 -16
- package/lib/esm/GLTFExporter-BPHG4XL7.js +0 -1
- package/lib/esm/GLTFLoader-5XXRE2UW.js +0 -1
- package/lib/esm/chunk-6UGO67X2.js +0 -1
- package/lib/esm/chunk-BI3F3KS7.js +0 -1
- package/lib/esm/chunk-CU2O7JF6.js +0 -1
- package/lib/esm/chunk-F44NIQPP.js +0 -1
- package/lib/esm/chunk-IYKJ3SDZ.js +0 -1
- package/lib/esm/chunk-Q3N6EADX.js +0 -1
- package/lib/esm/outdoor-context-v5-FSCVFUVV.js +0 -1
- package/lib/esm/text3d-YQOBP3BF.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as Sn,j as So}from"./chunk-Q3N6EADX.js";import{a as Dr}from"./chunk-BI3F3KS7.js";import{$ as Fe,A as Lo,Ba as Ro,Ca as Xo,Da as Yo,I as Oe,Ia as Fo,P as wn,Q as z,R as On,T as Ke,U as Mn,V as he,W as xe,Y as Qe,aa as Do,c as Eo,cb as Lr,d as wo,e as Oo,g as tr,la as No,p as Mo,qa as ko,r as Ao,z as En,za as Bo}from"./chunk-6UGO67X2.js";import{a as d,b as T}from"./chunk-F44NIQPP.js";import{a as y,b as M,c as l,f as Co,g as rl,h as Io,i as p,j as se,k as Te,l as Ce}from"./chunk-CU2O7JF6.js";var ia=Co((hr,Vt)=>{d();var df=200,Ys="__lodash_hash_undefined__",mf=800,yf=16,Fs=9007199254740991,Gs="[object Arguments]",gf="[object Array]",vf="[object AsyncFunction]",xf="[object Boolean]",bf="[object Date]",Pf="[object Error]",Vs="[object Function]",_f="[object GeneratorFunction]",Tf="[object Map]",Cf="[object Number]",If="[object Null]",Ws="[object Object]",Sf="[object Proxy]",Ef="[object RegExp]",wf="[object Set]",Of="[object String]",Mf="[object Undefined]",Af="[object WeakMap]",Lf="[object ArrayBuffer]",Df="[object DataView]",Nf="[object Float32Array]",kf="[object Float64Array]",Bf="[object Int8Array]",Rf="[object Int16Array]",Xf="[object Int32Array]",Yf="[object Uint8Array]",Ff="[object Uint8ClampedArray]",Gf="[object Uint16Array]",Vf="[object Uint32Array]",Wf=/[\\^$.*+?()[\]{}|]/g,Hf=/^\[object .+?Constructor\]$/,jf=/^(?:0|[1-9]\d*)$/,W={};W[Nf]=W[kf]=W[Bf]=W[Rf]=W[Xf]=W[Yf]=W[Ff]=W[Gf]=W[Vf]=!0;W[Gs]=W[gf]=W[Lf]=W[xf]=W[Df]=W[bf]=W[Pf]=W[Vs]=W[Tf]=W[Cf]=W[Ws]=W[Ef]=W[wf]=W[Of]=W[Af]=!1;var Hs=typeof global=="object"&&global&&global.Object===Object&&global,Uf=typeof self=="object"&&self&&self.Object===Object&&self,yr=Hs||Uf||Function("return this")(),js=typeof hr=="object"&&hr&&!hr.nodeType&&hr,dr=js&&typeof Vt=="object"&&Vt&&!Vt.nodeType&&Vt,Us=dr&&dr.exports===js,xi=Us&&Hs.process,Ms=function(){try{var e=dr&&dr.require&&dr.require("util").types;return e||xi&&xi.binding&&xi.binding("util")}catch(t){}}(),As=Ms&&Ms.isTypedArray;function zf(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}l(zf,"apply");function qf(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}l(qf,"baseTimes");function Zf(e){return function(t){return e(t)}}l(Zf,"baseUnary");function Jf(e,t){return e==null?void 0:e[t]}l(Jf,"getValue");function $f(e,t){return function(r){return e(t(r))}}l($f,"overArg");var Kf=Array.prototype,Qf=Function.prototype,tn=Object.prototype,bi=yr["__core-js_shared__"],rn=Qf.toString,Be=tn.hasOwnProperty,Ls=function(){var e=/[^.]+$/.exec(bi&&bi.keys&&bi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),zs=tn.toString,ec=rn.call(Object),tc=RegExp("^"+rn.call(Be).replace(Wf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qr=Us?yr.Buffer:void 0,Ds=yr.Symbol,Ns=yr.Uint8Array,ks=Qr?Qr.allocUnsafe:void 0,qs=$f(Object.getPrototypeOf,Object),Bs=Object.create,rc=tn.propertyIsEnumerable,nc=Kf.splice,bt=Ds?Ds.toStringTag:void 0,en=function(){try{var e=Si(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),ic=Qr?Qr.isBuffer:void 0,Rs=Math.max,oc=Date.now,Zs=Si(yr,"Map"),mr=Si(Object,"create"),sc=function(){function e(){}return l(e,"object"),function(t){if(!_t(t))return{};if(Bs)return Bs(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Pt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l(Pt,"Hash");function ac(){this.__data__=mr?mr(null):{},this.size=0}l(ac,"hashClear");function lc(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}l(lc,"hashDelete");function uc(e){var t=this.__data__;if(mr){var r=t[e];return r===Ys?void 0:r}return Be.call(t,e)?t[e]:void 0}l(uc,"hashGet");function fc(e){var t=this.__data__;return mr?t[e]!==void 0:Be.call(t,e)}l(fc,"hashHas");function cc(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=mr&&t===void 0?Ys:t,this}l(cc,"hashSet");Pt.prototype.clear=ac;Pt.prototype.delete=lc;Pt.prototype.get=uc;Pt.prototype.has=fc;Pt.prototype.set=cc;function Re(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l(Re,"ListCache");function pc(){this.__data__=[],this.size=0}l(pc,"listCacheClear");function hc(e){var t=this.__data__,r=nn(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():nc.call(t,r,1),--this.size,!0}l(hc,"listCacheDelete");function dc(e){var t=this.__data__,r=nn(t,e);return r<0?void 0:t[r][1]}l(dc,"listCacheGet");function mc(e){return nn(this.__data__,e)>-1}l(mc,"listCacheHas");function yc(e,t){var r=this.__data__,n=nn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}l(yc,"listCacheSet");Re.prototype.clear=pc;Re.prototype.delete=hc;Re.prototype.get=dc;Re.prototype.has=mc;Re.prototype.set=yc;function Wt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l(Wt,"MapCache");function gc(){this.size=0,this.__data__={hash:new Pt,map:new(Zs||Re),string:new Pt}}l(gc,"mapCacheClear");function vc(e){var t=sn(this,e).delete(e);return this.size-=t?1:0,t}l(vc,"mapCacheDelete");function xc(e){return sn(this,e).get(e)}l(xc,"mapCacheGet");function bc(e){return sn(this,e).has(e)}l(bc,"mapCacheHas");function Pc(e,t){var r=sn(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}l(Pc,"mapCacheSet");Wt.prototype.clear=gc;Wt.prototype.delete=vc;Wt.prototype.get=xc;Wt.prototype.has=bc;Wt.prototype.set=Pc;function Ht(e){var t=this.__data__=new Re(e);this.size=t.size}l(Ht,"Stack");function _c(){this.__data__=new Re,this.size=0}l(_c,"stackClear");function Tc(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}l(Tc,"stackDelete");function Cc(e){return this.__data__.get(e)}l(Cc,"stackGet");function Ic(e){return this.__data__.has(e)}l(Ic,"stackHas");function Sc(e,t){var r=this.__data__;if(r instanceof Re){var n=r.__data__;if(!Zs||n.length<df-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wt(n)}return r.set(e,t),this.size=r.size,this}l(Sc,"stackSet");Ht.prototype.clear=_c;Ht.prototype.delete=Tc;Ht.prototype.get=Cc;Ht.prototype.has=Ic;Ht.prototype.set=Sc;function Ec(e,t){var r=Ci(e),n=!r&&Ti(e),i=!r&&!n&&Qs(e),o=!r&&!n&&!i&&ta(e),s=r||n||i||o,u=s?qf(e.length,String):[],f=u.length;for(var c in e)(t||Be.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$s(c,f)))&&u.push(c);return u}l(Ec,"arrayLikeKeys");function Pi(e,t,r){(r!==void 0&&!an(e[t],r)||r===void 0&&!(t in e))&&Ii(e,t,r)}l(Pi,"assignMergeValue");function wc(e,t,r){var n=e[t];(!(Be.call(e,t)&&an(n,r))||r===void 0&&!(t in e))&&Ii(e,t,r)}l(wc,"assignValue");function nn(e,t){for(var r=e.length;r--;)if(an(e[r][0],t))return r;return-1}l(nn,"assocIndexOf");function Ii(e,t,r){t=="__proto__"&&en?en(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}l(Ii,"baseAssignValue");var Oc=Vc();function on(e){return e==null?e===void 0?Mf:If:bt&&bt in Object(e)?Wc(e):Zc(e)}l(on,"baseGetTag");function Xs(e){return gr(e)&&on(e)==Gs}l(Xs,"baseIsArguments");function Mc(e){if(!_t(e)||zc(e))return!1;var t=wi(e)?tc:Hf;return t.test(Qc(e))}l(Mc,"baseIsNative");function Ac(e){return gr(e)&&ea(e.length)&&!!W[on(e)]}l(Ac,"baseIsTypedArray");function Lc(e){if(!_t(e))return qc(e);var t=Ks(e),r=[];for(var n in e)n=="constructor"&&(t||!Be.call(e,n))||r.push(n);return r}l(Lc,"baseKeysIn");function Js(e,t,r,n,i){e!==t&&Oc(t,function(o,s){if(i||(i=new Ht),_t(o))Dc(e,t,s,r,Js,n,i);else{var u=n?n(_i(e,s),o,s+"",e,t,i):void 0;u===void 0&&(u=o),Pi(e,s,u)}},ra)}l(Js,"baseMerge");function Dc(e,t,r,n,i,o,s){var u=_i(e,r),f=_i(t,r),c=s.get(f);if(c){Pi(e,r,c);return}var h=o?o(u,f,r+"",e,t,s):void 0,m=h===void 0;if(m){var g=Ci(f),b=!g&&Qs(f),_=!g&&!b&&ta(f);h=f,g||b||_?Ci(u)?h=u:ep(u)?h=Yc(u):b?(m=!1,h=Bc(f,!0)):_?(m=!1,h=Xc(f,!0)):h=[]:tp(f)||Ti(f)?(h=u,Ti(u)?h=rp(u):(!_t(u)||wi(u))&&(h=Hc(f))):m=!1}m&&(s.set(f,h),i(h,f,n,o,s),s.delete(f)),Pi(e,r,h)}l(Dc,"baseMergeDeep");function Nc(e,t){return $c(Jc(e,t,na),e+"")}l(Nc,"baseRest");var kc=en?function(e,t){return en(e,"toString",{configurable:!0,enumerable:!1,value:ip(t),writable:!0})}:na;function Bc(e,t){if(t)return e.slice();var r=e.length,n=ks?ks(r):new e.constructor(r);return e.copy(n),n}l(Bc,"cloneBuffer");function Rc(e){var t=new e.constructor(e.byteLength);return new Ns(t).set(new Ns(e)),t}l(Rc,"cloneArrayBuffer");function Xc(e,t){var r=t?Rc(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}l(Xc,"cloneTypedArray");function Yc(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}l(Yc,"copyArray");function Fc(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var u=t[o],f=n?n(r[u],e[u],u,r,e):void 0;f===void 0&&(f=e[u]),i?Ii(r,u,f):wc(r,u,f)}return r}l(Fc,"copyObject");function Gc(e){return Nc(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&jc(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var u=r[n];u&&e(t,u,n,o)}return t})}l(Gc,"createAssigner");function Vc(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),u=s.length;u--;){var f=s[e?u:++i];if(r(o[f],f,o)===!1)break}return t}}l(Vc,"createBaseFor");function sn(e,t){var r=e.__data__;return Uc(t)?r[typeof t=="string"?"string":"hash"]:r.map}l(sn,"getMapData");function Si(e,t){var r=Jf(e,t);return Mc(r)?r:void 0}l(Si,"getNative");function Wc(e){var t=Be.call(e,bt),r=e[bt];try{e[bt]=void 0;var n=!0}catch(o){}var i=zs.call(e);return n&&(t?e[bt]=r:delete e[bt]),i}l(Wc,"getRawTag");function Hc(e){return typeof e.constructor=="function"&&!Ks(e)?sc(qs(e)):{}}l(Hc,"initCloneObject");function $s(e,t){var r=typeof e;return t=t==null?Fs:t,!!t&&(r=="number"||r!="symbol"&&jf.test(e))&&e>-1&&e%1==0&&e<t}l($s,"isIndex");function jc(e,t,r){if(!_t(r))return!1;var n=typeof t;return(n=="number"?Ei(r)&&$s(t,r.length):n=="string"&&t in r)?an(r[t],e):!1}l(jc,"isIterateeCall");function Uc(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}l(Uc,"isKeyable");function zc(e){return!!Ls&&Ls in e}l(zc,"isMasked");function Ks(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||tn;return e===r}l(Ks,"isPrototype");function qc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}l(qc,"nativeKeysIn");function Zc(e){return zs.call(e)}l(Zc,"objectToString");function Jc(e,t,r){return t=Rs(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Rs(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var u=Array(t+1);++i<t;)u[i]=n[i];return u[t]=r(s),zf(e,this,u)}}l(Jc,"overRest");function _i(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}l(_i,"safeGet");var $c=Kc(kc);function Kc(e){var t=0,r=0;return function(){var n=oc(),i=yf-(n-r);if(r=n,i>0){if(++t>=mf)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}l(Kc,"shortOut");function Qc(e){if(e!=null){try{return rn.call(e)}catch(t){}try{return e+""}catch(t){}}return""}l(Qc,"toSource");function an(e,t){return e===t||e!==e&&t!==t}l(an,"eq");var Ti=Xs(function(){return arguments}())?Xs:function(e){return gr(e)&&Be.call(e,"callee")&&!rc.call(e,"callee")},Ci=Array.isArray;function Ei(e){return e!=null&&ea(e.length)&&!wi(e)}l(Ei,"isArrayLike");function ep(e){return gr(e)&&Ei(e)}l(ep,"isArrayLikeObject");var Qs=ic||op;function wi(e){if(!_t(e))return!1;var t=on(e);return t==Vs||t==_f||t==vf||t==Sf}l(wi,"isFunction");function ea(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Fs}l(ea,"isLength");function _t(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}l(_t,"isObject");function gr(e){return e!=null&&typeof e=="object"}l(gr,"isObjectLike");function tp(e){if(!gr(e)||on(e)!=Ws)return!1;var t=qs(e);if(t===null)return!0;var r=Be.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&rn.call(r)==ec}l(tp,"isPlainObject");var ta=As?Zf(As):Ac;function rp(e){return Fc(e,ra(e))}l(rp,"toPlainObject");function ra(e){return Ei(e)?Ec(e,!0):Lc(e)}l(ra,"keysIn");var np=Gc(function(e,t,r){Js(e,t,r)});function ip(e){return function(){return e}}l(ip,"constant");function na(e){return e}l(na,"identity");function op(){return!1}l(op,"stubFalse");Vt.exports=np});var Aa=Co((Yb,Ir)=>{"use strict";d();var Cp=!1,It=!1,Ca=!0,Ia=!1,a={},Sa=!1;typeof Ir<"u"&&Ir.exports?(Ir.exports=a,Sa=!0):typeof document<"u"?window.ClipperLib=a:self.ClipperLib=a;var dn;Sa?(J="chrome",dn="Netscape"):(J=navigator.userAgent.toString().toLowerCase(),dn=navigator.appName);var J,F={};J.indexOf("chrome")!=-1&&J.indexOf("chromium")==-1?F.chrome=1:F.chrome=0;J.indexOf("chromium")!=-1?F.chromium=1:F.chromium=0;J.indexOf("safari")!=-1&&J.indexOf("chrome")==-1&&J.indexOf("chromium")==-1?F.safari=1:F.safari=0;J.indexOf("firefox")!=-1?F.firefox=1:F.firefox=0;J.indexOf("firefox/17")!=-1?F.firefox17=1:F.firefox17=0;J.indexOf("firefox/15")!=-1?F.firefox15=1:F.firefox15=0;J.indexOf("firefox/3")!=-1?F.firefox3=1:F.firefox3=0;J.indexOf("opera")!=-1?F.opera=1:F.opera=0;J.indexOf("msie 10")!=-1?F.msie10=1:F.msie10=0;J.indexOf("msie 9")!=-1?F.msie9=1:F.msie9=0;J.indexOf("msie 8")!=-1?F.msie8=1:F.msie8=0;J.indexOf("msie 7")!=-1?F.msie7=1:F.msie7=0;J.indexOf("msie ")!=-1?F.msie=1:F.msie=0;a.biginteger_used=null;var Ze,Ip=0xdeadbeefcafe,_a=(Ip&16777215)==15715070;function x(e,t,r){a.biginteger_used=1,e!=null&&(typeof e=="number"&&typeof t>"u"?this.fromInt(e):typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}l(x,"BigInteger");function G(){return new x(null)}l(G,"nbi");function Sp(e,t,r,n,i,o){for(;--o>=0;){var s=t*this[e++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=s&67108863}return i}l(Sp,"am1");function Ep(e,t,r,n,i,o){for(var s=t&32767,u=t>>15;--o>=0;){var f=this[e]&32767,c=this[e++]>>15,h=u*f+c*s;f=s*f+((h&32767)<<15)+r[n]+(i&1073741823),i=(f>>>30)+(h>>>15)+u*c+(i>>>30),r[n++]=f&1073741823}return i}l(Ep,"am2");function wp(e,t,r,n,i,o){for(var s=t&16383,u=t>>14;--o>=0;){var f=this[e]&16383,c=this[e++]>>14,h=u*f+c*s;f=s*f+((h&16383)<<14)+r[n]+i,i=(f>>28)+(h>>14)+u*c,r[n++]=f&268435455}return i}l(wp,"am3");_a&&dn=="Microsoft Internet Explorer"?(x.prototype.am=Ep,Ze=30):_a&&dn!="Netscape"?(x.prototype.am=Sp,Ze=26):(x.prototype.am=wp,Ze=28);x.prototype.DB=Ze;x.prototype.DM=(1<<Ze)-1;x.prototype.DV=1<<Ze;var qi=52;x.prototype.FV=Math.pow(2,qi);x.prototype.F1=qi-Ze;x.prototype.F2=2*Ze-qi;var Op="0123456789abcdefghijklmnopqrstuvwxyz",yn=new Array,zt,ge;zt=48;for(ge=0;ge<=9;++ge)yn[zt++]=ge;zt=97;for(ge=10;ge<36;++ge)yn[zt++]=ge;zt=65;for(ge=10;ge<36;++ge)yn[zt++]=ge;function Ta(e){return Op.charAt(e)}l(Ta,"int2char");function Ea(e,t){var r=yn[e.charCodeAt(t)];return r==null?-1:r}l(Ea,"intAt");function Mp(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}l(Mp,"bnpCopyTo");function Ap(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}l(Ap,"bnpFromInt");function qe(e){var t=G();return t.fromInt(e),t}l(qe,"nbv");function Lp(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=r==8?e[n]&255:Ea(e,n);if(s<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,o==0?this[this.t++]=s:o+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,o+=r,o>=this.DB&&(o-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&x.ZERO.subTo(this,this)}l(Lp,"bnpFromString");function Dp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}l(Dp,"bnpClamp");function Np(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=!1,o="",s=this.t,u=this.DB-s*this.DB%t;if(s-- >0)for(u<this.DB&&(n=this[s]>>u)>0&&(i=!0,o=Ta(n));s>=0;)u<t?(n=(this[s]&(1<<u)-1)<<t-u,n|=this[--s]>>(u+=this.DB-t)):(n=this[s]>>(u-=t)&r,u<=0&&(u+=this.DB,--s)),n>0&&(i=!0),i&&(o+=Ta(n));return i?o:"0"}l(Np,"bnToString");function kp(){var e=G();return x.ZERO.subTo(this,e),e}l(kp,"bnNegate");function Bp(){return this.s<0?this.negate():this}l(Bp,"bnAbs");function Rp(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}l(Rp,"bnCompareTo");function gn(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}l(gn,"nbits");function Xp(){return this.t<=0?0:this.DB*(this.t-1)+gn(this[this.t-1]^this.s&this.DM)}l(Xp,"bnBitLength");function Yp(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}l(Yp,"bnpDLShiftTo");function Fp(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}l(Fp,"bnpDRShiftTo");function Gp(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,o=Math.floor(e/this.DB),s=this.s<<r&this.DM,u;for(u=this.t-1;u>=0;--u)t[u+o+1]=this[u]>>n|s,s=(this[u]&i)<<r;for(u=o-1;u>=0;--u)t[u]=0;t[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()}l(Gp,"bnpLShiftTo");function Vp(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&o)<<i,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}l(Vp,"bnpRShiftTo");function Wp(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}l(Wp,"bnpSubTo");function Hp(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&x.ZERO.subTo(t,t)}l(Hp,"bnpMultiplyTo");function jp(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}l(jp,"bnpSquareTo");function Up(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=G());var o=G(),s=this.s,u=e.s,f=this.DB-gn(n[n.t-1]);f>0?(n.lShiftTo(f,o),i.lShiftTo(f,r)):(n.copyTo(o),i.copyTo(r));var c=o.t,h=o[c-1];if(h!=0){var m=h*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),g=this.FV/m,b=(1<<this.F1)/m,_=1<<this.F2,I=r.t,O=I-c,A=t==null?G():t;for(o.dlShiftTo(O,A),r.compareTo(A)>=0&&(r[r.t++]=1,r.subTo(A,r)),x.ONE.dlShiftTo(c,A),A.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--O>=0;){var R=r[--I]==h?this.DM:Math.floor(r[I]*g+(r[I-1]+_)*b);if((r[I]+=o.am(0,R,r,O,0,c))<R)for(o.dlShiftTo(O,A),r.subTo(A,r);r[I]<--R;)r.subTo(A,r)}t!=null&&(r.drShiftTo(c,t),s!=u&&x.ZERO.subTo(t,t)),r.t=c,r.clamp(),f>0&&r.rShiftTo(f,r),s<0&&x.ZERO.subTo(r,r)}}}l(Up,"bnpDivRemTo");function zp(e){var t=G();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(x.ZERO)>0&&e.subTo(t,t),t}l(zp,"bnMod");function St(e){this.m=e}l(St,"Classic");function qp(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}l(qp,"cConvert");function Zp(e){return e}l(Zp,"cRevert");function Jp(e){e.divRemTo(this.m,null,e)}l(Jp,"cReduce");function $p(e,t,r){e.multiplyTo(t,r),this.reduce(r)}l($p,"cMulTo");function Kp(e,t){e.squareTo(t),this.reduce(t)}l(Kp,"cSqrTo");St.prototype.convert=qp;St.prototype.revert=Zp;St.prototype.reduce=Jp;St.prototype.mulTo=$p;St.prototype.sqrTo=Kp;function Qp(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}l(Qp,"bnpInvDigit");function Et(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}l(Et,"Montgomery");function eh(e){var t=G();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(x.ZERO)>0&&this.m.subTo(t,t),t}l(eh,"montConvert");function th(e){var t=G();return e.copyTo(t),this.reduce(t),t}l(th,"montRevert");function rh(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}l(rh,"montReduce");function nh(e,t){e.squareTo(t),this.reduce(t)}l(nh,"montSqrTo");function ih(e,t,r){e.multiplyTo(t,r),this.reduce(r)}l(ih,"montMulTo");Et.prototype.convert=eh;Et.prototype.revert=th;Et.prototype.reduce=rh;Et.prototype.mulTo=ih;Et.prototype.sqrTo=nh;function oh(){return(this.t>0?this[0]&1:this.s)==0}l(oh,"bnpIsEven");function sh(e,t){if(e>4294967295||e<1)return x.ONE;var r=G(),n=G(),i=t.convert(this),o=gn(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var s=r;r=n,n=s}return t.revert(r)}l(sh,"bnpExp");function ah(e,t){var r;return e<256||t.isEven()?r=new St(t):r=new Et(t),this.exp(e,r)}l(ah,"bnModPowInt");x.prototype.copyTo=Mp;x.prototype.fromInt=Ap;x.prototype.fromString=Lp;x.prototype.clamp=Dp;x.prototype.dlShiftTo=Yp;x.prototype.drShiftTo=Fp;x.prototype.lShiftTo=Gp;x.prototype.rShiftTo=Vp;x.prototype.subTo=Wp;x.prototype.multiplyTo=Hp;x.prototype.squareTo=jp;x.prototype.divRemTo=Up;x.prototype.invDigit=Qp;x.prototype.isEven=oh;x.prototype.exp=sh;x.prototype.toString=Np;x.prototype.negate=kp;x.prototype.abs=Bp;x.prototype.compareTo=Rp;x.prototype.bitLength=Xp;x.prototype.mod=zp;x.prototype.modPowInt=ah;x.ZERO=qe(0);x.ONE=qe(1);function lh(){var e=G();return this.copyTo(e),e}l(lh,"bnClone");function uh(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}l(uh,"bnIntValue");function fh(){return this.t==0?this.s:this[0]<<24>>24}l(fh,"bnByteValue");function ch(){return this.t==0?this.s:this[0]<<16>>16}l(ch,"bnShortValue");function ph(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}l(ph,"bnpChunkSize");function hh(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}l(hh,"bnSigNum");function dh(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=qe(r),i=G(),o=G(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(e)+s}l(dh,"bnpToRadix");function mh(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,u=0;u<e.length;++u){var f=Ea(e,u);if(f<0){e.charAt(u)=="-"&&this.signum()==0&&(i=!0);continue}s=t*s+f,++o>=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0)}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&x.ZERO.subTo(this,this)}l(mh,"bnpFromRadix");function yh(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(x.ONE.shiftLeft(e-1),Zi,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(x.ONE.shiftLeft(e-1),this);else{var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}l(yh,"bnpFromNumber");function gh(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(n&128)!=0&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}l(gh,"bnToByteArray");function vh(e){return this.compareTo(e)==0}l(vh,"bnEquals");function xh(e){return this.compareTo(e)<0?this:e}l(xh,"bnMin");function bh(e){return this.compareTo(e)>0?this:e}l(bh,"bnMax");function Ph(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}l(Ph,"bnpBitwiseTo");function _h(e,t){return e&t}l(_h,"op_and");function Th(e){var t=G();return this.bitwiseTo(e,_h,t),t}l(Th,"bnAnd");function Zi(e,t){return e|t}l(Zi,"op_or");function Ch(e){var t=G();return this.bitwiseTo(e,Zi,t),t}l(Ch,"bnOr");function wa(e,t){return e^t}l(wa,"op_xor");function Ih(e){var t=G();return this.bitwiseTo(e,wa,t),t}l(Ih,"bnXor");function Oa(e,t){return e&~t}l(Oa,"op_andnot");function Sh(e){var t=G();return this.bitwiseTo(e,Oa,t),t}l(Sh,"bnAndNot");function Eh(){for(var e=G(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}l(Eh,"bnNot");function wh(e){var t=G();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}l(wh,"bnShiftLeft");function Oh(e){var t=G();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}l(Oh,"bnShiftRight");function Mh(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}l(Mh,"lbit");function Ah(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+Mh(this[e]);return this.s<0?this.t*this.DB:-1}l(Ah,"bnGetLowestSetBit");function Lh(e){for(var t=0;e!=0;)e&=e-1,++t;return t}l(Lh,"cbit");function Dh(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Lh(this[r]^t);return e}l(Dh,"bnBitCount");function Nh(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}l(Nh,"bnTestBit");function kh(e,t){var r=x.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}l(kh,"bnpChangeBit");function Bh(e){return this.changeBit(e,Zi)}l(Bh,"bnSetBit");function Rh(e){return this.changeBit(e,Oa)}l(Rh,"bnClearBit");function Xh(e){return this.changeBit(e,wa)}l(Xh,"bnFlipBit");function Yh(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}l(Yh,"bnpAddTo");function Fh(e){var t=G();return this.addTo(e,t),t}l(Fh,"bnAdd");function Gh(e){var t=G();return this.subTo(e,t),t}l(Gh,"bnSubtract");function Vh(e){var t=G();return this.multiplyTo(e,t),t}l(Vh,"bnMultiply");function Wh(){var e=G();return this.squareTo(e),e}l(Wh,"bnSquare");function Hh(e){var t=G();return this.divRemTo(e,t,null),t}l(Hh,"bnDivide");function jh(e){var t=G();return this.divRemTo(e,null,t),t}l(jh,"bnRemainder");function Uh(e){var t=G(),r=G();return this.divRemTo(e,t,r),new Array(t,r)}l(Uh,"bnDivideAndRemainder");function zh(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}l(zh,"bnpDMultiply");function qh(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}l(qh,"bnpDAddOffset");function Sr(){}l(Sr,"NullExp");function Ma(e){return e}l(Ma,"nNop");function Zh(e,t,r){e.multiplyTo(t,r)}l(Zh,"nMulTo");function Jh(e,t){e.squareTo(t)}l(Jh,"nSqrTo");Sr.prototype.convert=Ma;Sr.prototype.revert=Ma;Sr.prototype.mulTo=Zh;Sr.prototype.sqrTo=Jh;function $h(e){return this.exp(e,new Sr)}l($h,"bnPow");function Kh(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}l(Kh,"bnpMultiplyLowerTo");function Qh(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}l(Qh,"bnpMultiplyUpperTo");function qt(e){this.r2=G(),this.q3=G(),x.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}l(qt,"Barrett");function ed(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=G();return e.copyTo(t),this.reduce(t),t}l(ed,"barrettConvert");function td(e){return e}l(td,"barrettRevert");function rd(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}l(rd,"barrettReduce");function nd(e,t){e.squareTo(t),this.reduce(t)}l(nd,"barrettSqrTo");function id(e,t,r){e.multiplyTo(t,r),this.reduce(r)}l(id,"barrettMulTo");qt.prototype.convert=ed;qt.prototype.revert=td;qt.prototype.reduce=rd;qt.prototype.mulTo=id;qt.prototype.sqrTo=nd;function od(e,t){var r=e.bitLength(),n,i=qe(1),o;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?o=new St(t):t.isEven()?o=new qt(t):o=new Et(t);var s=new Array,u=3,f=n-1,c=(1<<n)-1;if(s[1]=o.convert(this),n>1){var h=G();for(o.sqrTo(s[1],h);u<=c;)s[u]=G(),o.mulTo(h,s[u-2],s[u]),u+=2}var m=e.t-1,g,b=!0,_=G(),I;for(r=gn(e[m])-1;m>=0;){for(r>=f?g=e[m]>>r-f&c:(g=(e[m]&(1<<r+1)-1)<<f-r,m>0&&(g|=e[m-1]>>this.DB+r-f)),u=n;(g&1)==0;)g>>=1,--u;if((r-=u)<0&&(r+=this.DB,--m),b)s[g].copyTo(i),b=!1;else{for(;u>1;)o.sqrTo(i,_),o.sqrTo(_,i),u-=2;u>0?o.sqrTo(i,_):(I=i,i=_,_=I),o.mulTo(_,s[g],i)}for(;m>=0&&(e[m]&1<<r)==0;)o.sqrTo(i,_),I=i,i=_,_=I,--r<0&&(r=this.DB-1,--m)}return o.revert(i)}l(od,"bnModPow");function sd(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r}l(sd,"bnGCD");function ad(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}l(ad,"bnpModInt");function ld(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return x.ZERO;for(var r=e.clone(),n=this.clone(),i=qe(1),o=qe(0),s=qe(0),u=qe(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!o.isEven())&&(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?((!s.isEven()||!u.isEven())&&(s.addTo(this,s),u.subTo(e,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}if(n.compareTo(x.ONE)!=0)return x.ZERO;if(u.compareTo(e)>=0)return u.subtract(e);if(u.signum()<0)u.addTo(e,u);else return u;return u.signum()<0?u.add(e):u}l(ld,"bnModInverse");var ee=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ud=(1<<26)/ee[ee.length-1];function fd(e){var t,r=this.abs();if(r.t==1&&r[0]<=ee[ee.length-1]){for(t=0;t<ee.length;++t)if(r[0]==ee[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<ee.length;){for(var n=ee[t],i=t+1;i<ee.length&&n<ud;)n*=ee[i++];for(n=r.modInt(n);t<i;)if(n%ee[t++]==0)return!1}return r.millerRabin(e)}l(fd,"bnIsProbablePrime");function cd(e){var t=this.subtract(x.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>ee.length&&(e=ee.length);for(var i=G(),o=0;o<e;++o){i.fromInt(ee[Math.floor(Math.random()*ee.length)]);var s=i.modPow(n,this);if(s.compareTo(x.ONE)!=0&&s.compareTo(t)!=0){for(var u=1;u++<r&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(x.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}l(cd,"bnpMillerRabin");x.prototype.chunkSize=ph;x.prototype.toRadix=dh;x.prototype.fromRadix=mh;x.prototype.fromNumber=yh;x.prototype.bitwiseTo=Ph;x.prototype.changeBit=kh;x.prototype.addTo=Yh;x.prototype.dMultiply=zh;x.prototype.dAddOffset=qh;x.prototype.multiplyLowerTo=Kh;x.prototype.multiplyUpperTo=Qh;x.prototype.modInt=ad;x.prototype.millerRabin=cd;x.prototype.clone=lh;x.prototype.intValue=uh;x.prototype.byteValue=fh;x.prototype.shortValue=ch;x.prototype.signum=hh;x.prototype.toByteArray=gh;x.prototype.equals=vh;x.prototype.min=xh;x.prototype.max=bh;x.prototype.and=Th;x.prototype.or=Ch;x.prototype.xor=Ih;x.prototype.andNot=Sh;x.prototype.not=Eh;x.prototype.shiftLeft=wh;x.prototype.shiftRight=Oh;x.prototype.getLowestSetBit=Ah;x.prototype.bitCount=Dh;x.prototype.testBit=Nh;x.prototype.setBit=Bh;x.prototype.clearBit=Rh;x.prototype.flipBit=Xh;x.prototype.add=Fh;x.prototype.subtract=Gh;x.prototype.multiply=Vh;x.prototype.divide=Hh;x.prototype.remainder=jh;x.prototype.divideAndRemainder=Uh;x.prototype.modPow=od;x.prototype.modInverse=ld;x.prototype.pow=$h;x.prototype.gcd=sd;x.prototype.isProbablePrime=fd;x.prototype.square=Wh;var X=x;X.prototype.IsNegative=function(){return this.compareTo(X.ZERO)==-1};X.op_Equality=function(e,t){return e.compareTo(t)==0};X.op_Inequality=function(e,t){return e.compareTo(t)!=0};X.op_GreaterThan=function(e,t){return e.compareTo(t)>0};X.op_LessThan=function(e,t){return e.compareTo(t)<0};X.op_Addition=function(e,t){return new X(e).add(new X(t))};X.op_Subtraction=function(e,t){return new X(e).subtract(new X(t))};X.Int128Mul=function(e,t){return new X(e).multiply(new X(t))};X.op_Division=function(e,t){return e.divide(t)};X.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof mn>"u"&&(mn=l(function(e,t){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in t.prototype)(typeof e.prototype[r]>"u"||e.prototype[r]==Object.prototype[r])&&(e.prototype[r]=t.prototype[r]);for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),i=0;i<n.length;i++)typeof Object.getOwnPropertyDescriptor(e.prototype,n[i])>"u"&&Object.defineProperty(e.prototype,n[i],Object.getOwnPropertyDescriptor(t.prototype,n[i]));for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}},"Inherit"));var mn;a.Path=function(){return[]};a.Paths=function(){return[]};a.DoublePoint=function(){var e=arguments;this.X=0,this.Y=0,e.length==1?(this.X=e[0].X,this.Y=e[0].Y):e.length==2&&(this.X=e[0],this.Y=e[1])};a.DoublePoint0=function(){this.X=0,this.Y=0};a.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};a.DoublePoint2=function(e,t){this.X=e,this.Y=t};a.PolyNode=function(){this.m_Parent=null,this.m_polygon=new a.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};a.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};a.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};a.PolyNode.prototype.Contour=function(){return this.m_polygon};a.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};a.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};a.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};a.PolyNode.prototype.Childs=function(){return this.m_Childs};a.PolyNode.prototype.Parent=function(){return this.m_Parent};a.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};a.PolyTree=function(){this.m_AllPolys=[],a.PolyNode.call(this)};a.PolyTree.prototype.Clear=function(){for(var e=0,t=this.m_AllPolys.length;e<t;e++)this.m_AllPolys[e]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};a.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};a.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};mn(a.PolyTree,a.PolyNode);a.Math_Abs_Int64=a.Math_Abs_Int32=a.Math_Abs_Double=function(e){return Math.abs(e)};a.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};F.msie||F.opera||F.safari?a.Cast_Int32=function(e){return e|0}:a.Cast_Int32=function(e){return~~e};F.chrome?a.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:F.firefox&&typeof Number.toInteger=="function"?a.Cast_Int64=function(e){return Number.toInteger(e)}:F.msie7||F.msie8?a.Cast_Int64=function(e){return parseInt(e,10)}:F.msie?a.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:a.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};a.Clear=function(e){e.length=0};a.PI=3.141592653589793;a.PI2=2*3.141592653589793;a.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,It)if(this.Z=0,t==3)this.X=e[0],this.Y=e[1],this.Z=e[2];else if(t==2)this.X=e[0],this.Y=e[1],this.Z=0;else if(t==1)if(e[0]instanceof a.DoublePoint){var r=e[0];this.X=a.Clipper.Round(r.X),this.Y=a.Clipper.Round(r.Y),this.Z=0}else{var n=e[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=e[0],this.Y=e[1];else if(t==1)if(e[0]instanceof a.DoublePoint){var r=e[0];this.X=a.Clipper.Round(r.X),this.Y=a.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};a.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};a.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};It?(a.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},a.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},a.IntPoint1dp=function(e){this.X=a.Clipper.Round(e.X),this.Y=a.Clipper.Round(e.Y),this.Z=0},a.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},a.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(a.IntPoint0=function(){this.X=0,this.Y=0},a.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},a.IntPoint1dp=function(e){this.X=a.Clipper.Round(e.X),this.Y=a.Clipper.Round(e.Y)},a.IntPoint2=function(e,t){this.X=e,this.Y=t});a.IntRect=function(){var e=arguments,t=e.length;t==4?(this.left=e[0],this.top=e[1],this.right=e[2],this.bottom=e[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};a.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};a.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};a.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};a.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};a.PolyType={ptSubject:0,ptClip:1};a.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};a.JoinType={jtSquare:0,jtRound:1,jtMiter:2};a.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};Ia&&(a.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});a.EdgeSide={esLeft:0,esRight:1};a.Direction={dRightToLeft:0,dLeftToRight:1};a.TEdge=function(){this.Bot=new a.IntPoint,this.Curr=new a.IntPoint,this.Top=new a.IntPoint,this.Delta=new a.IntPoint,this.Dx=0,this.PolyTyp=a.PolyType.ptSubject,this.Side=a.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};a.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new a.IntPoint};a.MyIntersectNodeSort=function(){};a.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};a.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};a.Scanbeam=function(){this.Y=0,this.Next=null};a.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};a.OutPt=function(){this.Idx=0,this.Pt=new a.IntPoint,this.Next=null,this.Prev=null};a.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new a.IntPoint};a.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};a.ClipperBase.horizontal=-9007199254740992;a.ClipperBase.Skip=-2;a.ClipperBase.Unassigned=-1;a.ClipperBase.tolerance=1e-20;Cp?(a.ClipperBase.loRange=46340,a.ClipperBase.hiRange=46340):(a.ClipperBase.loRange=47453132,a.ClipperBase.hiRange=0xfffffffffffff);a.ClipperBase.near_zero=function(e){return e>-a.ClipperBase.tolerance&&e<a.ClipperBase.tolerance};a.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};a.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(a.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};a.ClipperBase.prototype.PointOnLineSegment=function(e,t,r,n){return n?e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&X.op_Equality(X.Int128Mul(e.X-t.X,r.Y-t.Y),X.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};a.ClipperBase.prototype.PointOnPolygon=function(e,t,r){for(var n=t;;){if(this.PointOnLineSegment(e,n.Pt,n.Next.Pt,r))return!0;if(n=n.Next,n==t)break}return!1};a.ClipperBase.prototype.SlopesEqual=a.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,i,o,s,u,f;return t==3?(r=e[0],n=e[1],f=e[2],f?X.op_Equality(X.Int128Mul(r.Delta.Y,n.Delta.X),X.Int128Mul(r.Delta.X,n.Delta.Y)):a.Cast_Int64(r.Delta.Y*n.Delta.X)==a.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(i=e[0],o=e[1],s=e[2],f=e[3],f?X.op_Equality(X.Int128Mul(i.Y-o.Y,o.X-s.X),X.Int128Mul(i.X-o.X,o.Y-s.Y)):a.Cast_Int64((i.Y-o.Y)*(o.X-s.X))-a.Cast_Int64((i.X-o.X)*(o.Y-s.Y))===0):(i=e[0],o=e[1],s=e[2],u=e[3],f=e[4],f?X.op_Equality(X.Int128Mul(i.Y-o.Y,s.X-u.X),X.Int128Mul(i.X-o.X,s.Y-u.Y)):a.Cast_Int64((i.Y-o.Y)*(s.X-u.X))-a.Cast_Int64((i.X-o.X)*(s.Y-u.Y))===0)};a.ClipperBase.SlopesEqual3=function(e,t,r){return r?X.op_Equality(X.Int128Mul(e.Delta.Y,t.Delta.X),X.Int128Mul(e.Delta.X,t.Delta.Y)):a.Cast_Int64(e.Delta.Y*t.Delta.X)==a.Cast_Int64(e.Delta.X*t.Delta.Y)};a.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?X.op_Equality(X.Int128Mul(e.Y-t.Y,t.X-r.X),X.Int128Mul(e.X-t.X,t.Y-r.Y)):a.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-a.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};a.ClipperBase.SlopesEqual5=function(e,t,r,n,i){return i?X.op_Equality(X.Int128Mul(e.Y-t.Y,r.X-n.X),X.Int128Mul(e.X-t.X,r.Y-n.Y)):a.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-a.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};a.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var e=0,t=this.m_edges.length;e<t;++e){for(var r=0,n=this.m_edges[e].length;r<n;++r)this.m_edges[e][r]=null;a.Clear(this.m_edges[e])}a.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};a.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var e=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=e}this.m_CurrentLM=null};a.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>a.ClipperBase.hiRange||e.Y>a.ClipperBase.hiRange||-e.X>a.ClipperBase.hiRange||-e.Y>a.ClipperBase.hiRange)&&a.Error("Coordinate outside allowed range in RangeTest()."):(e.X>a.ClipperBase.loRange||e.Y>a.ClipperBase.loRange||-e.X>a.ClipperBase.loRange||-e.Y>a.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};a.ClipperBase.prototype.InitEdge=function(e,t,r,n){e.Next=t,e.Prev=r,e.Curr.X=n.X,e.Curr.Y=n.Y,e.OutIdx=-1};a.ClipperBase.prototype.InitEdge2=function(e,t){e.Curr.Y>=e.Next.Curr.Y?(e.Bot.X=e.Curr.X,e.Bot.Y=e.Curr.Y,e.Top.X=e.Next.Curr.X,e.Top.Y=e.Next.Curr.Y):(e.Top.X=e.Curr.X,e.Top.Y=e.Curr.Y,e.Bot.X=e.Next.Curr.X,e.Bot.Y=e.Next.Curr.Y),this.SetDx(e),e.PolyTyp=t};a.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;a.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||a.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=a.ClipperBase.horizontal&&e.Prev.Dx!=a.ClipperBase.horizontal)break;for(;e.Prev.Dx==a.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==a.ClipperBase.horizontal;)e=e.Next;if(e.Top.Y!=e.Prev.Bot.Y){t.Prev.Bot.X<e.Bot.X&&(e=t);break}}return e};a.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,i,o;if(e.Dx==a.ClipperBase.horizontal&&(t?o=e.Prev.Bot.X:o=e.Next.Bot.X,e.Bot.X!=o&&this.ReverseHorizontal(e)),n.OutIdx!=a.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=a.ClipperBase.Skip;)n=n.Next;if(n.Dx==a.ClipperBase.horizontal&&n.Next.OutIdx!=a.ClipperBase.Skip){for(i=n;i.Prev.Dx==a.ClipperBase.horizontal;)i=i.Prev;i.Prev.Top.X==n.Next.Top.X?t||(n=i.Prev):i.Prev.Top.X>n.Next.Top.X&&(n=i.Prev)}for(;e!=n;)e.NextInLML=e.Next,e.Dx==a.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==a.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=a.ClipperBase.Skip;)n=n.Prev;if(n.Dx==a.ClipperBase.horizontal&&n.Prev.OutIdx!=a.ClipperBase.Skip){for(i=n;i.Next.Dx==a.ClipperBase.horizontal;)i=i.Next;i.Next.Top.X==n.Prev.Top.X?t||(n=i.Next):i.Next.Top.X>n.Prev.Top.X&&(n=i.Next)}for(;e!=n;)e.NextInLML=e.Prev,e.Dx==a.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==a.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==a.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==a.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==a.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var s=new a.LocalMinima;s.Next=null,s.Y=e.Bot.Y,s.LeftBound=null,s.RightBound=e,s.RightBound.WindDelta=0,n=this.ProcessBound(s.RightBound,t),this.InsertLocalMinima(s)}}return n};a.ClipperBase.prototype.AddPath=function(e,t,r){Ca?!r&&t==a.PolyType.ptClip&&a.Error("AddPath: Open paths must be subject."):r||a.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&a.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&a.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var i=new Array,o=0;o<=n;o++)i.push(new a.TEdge);var s=!0;i[1].Curr.X=e[1].X,i[1].Curr.Y=e[1].Y;var u={Value:this.m_UseFullRange};this.RangeTest(e[0],u),this.m_UseFullRange=u.Value,u.Value=this.m_UseFullRange,this.RangeTest(e[n],u),this.m_UseFullRange=u.Value,this.InitEdge(i[0],i[1],i[n],e[0]),this.InitEdge(i[n],i[0],i[n-1],e[n]);for(var o=n-1;o>=1;--o)u.Value=this.m_UseFullRange,this.RangeTest(e[o],u),this.m_UseFullRange=u.Value,this.InitEdge(i[o],i[o+1],i[o-1],e[o]);for(var f=i[0],c=f,h=f;;){if(a.IntPoint.op_Equality(c.Curr,c.Next.Curr)){if(c==c.Next)break;c==f&&(f=c.Next),c=this.RemoveEdge(c),h=c;continue}if(c.Prev==c.Next)break;if(r&&a.ClipperBase.SlopesEqual(c.Prev.Curr,c.Curr,c.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(c.Prev.Curr,c.Curr,c.Next.Curr))){c==f&&(f=c.Next),c=this.RemoveEdge(c),c=c.Prev,h=c;continue}if(c=c.Next,c==h)break}if(!r&&c==c.Next||r&&c.Prev==c.Next)return!1;r||(this.m_HasOpenPaths=!0,f.Prev.OutIdx=a.ClipperBase.Skip);var m=f;c=f;do this.InitEdge2(c,t),c=c.Next,s&&c.Curr.Y!=f.Curr.Y&&(s=!1);while(c!=f);if(s){if(r)return!1;c.Prev.OutIdx=a.ClipperBase.Skip,c.Prev.Bot.X<c.Prev.Top.X&&this.ReverseHorizontal(c.Prev);var g=new a.LocalMinima;for(g.Next=null,g.Y=c.Bot.Y,g.LeftBound=null,g.RightBound=c,g.RightBound.Side=a.EdgeSide.esRight,g.RightBound.WindDelta=0;c.Next.OutIdx!=a.ClipperBase.Skip;)c.NextInLML=c.Next,c.Bot.X!=c.Prev.Top.X&&this.ReverseHorizontal(c),c=c.Next;return this.InsertLocalMinima(g),this.m_edges.push(i),!0}this.m_edges.push(i);for(var b,_=null;c=this.FindNextLocMin(c),c!=_;){_==null&&(_=c);var g=new a.LocalMinima;g.Next=null,g.Y=c.Bot.Y,c.Dx<c.Prev.Dx?(g.LeftBound=c.Prev,g.RightBound=c,b=!1):(g.LeftBound=c,g.RightBound=c.Prev,b=!0),g.LeftBound.Side=a.EdgeSide.esLeft,g.RightBound.Side=a.EdgeSide.esRight,r?g.LeftBound.Next==g.RightBound?g.LeftBound.WindDelta=-1:g.LeftBound.WindDelta=1:g.LeftBound.WindDelta=0,g.RightBound.WindDelta=-g.LeftBound.WindDelta,c=this.ProcessBound(g.LeftBound,b);var I=this.ProcessBound(g.RightBound,!b);g.LeftBound.OutIdx==a.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==a.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),b||(c=I)}return!0};a.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,i=0,o=e.length;i<o;++i)this.AddPath(e[i],t,r)&&(n=!0);return n};a.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return a.IntPoint.op_Equality(e,r)||a.IntPoint.op_Equality(e,t)||a.IntPoint.op_Equality(r,t)?!1:e.X!=r.X?t.X>e.X==t.X<r.X:t.Y>e.Y==t.Y<r.Y};a.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};a.ClipperBase.prototype.SetDx=function(e){e.Delta.X=e.Top.X-e.Bot.X,e.Delta.Y=e.Top.Y-e.Bot.Y,e.Delta.Y===0?e.Dx=a.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};a.ClipperBase.prototype.InsertLocalMinima=function(e){if(this.m_MinimaList===null)this.m_MinimaList=e;else if(e.Y>=this.m_MinimaList.Y)e.Next=this.m_MinimaList,this.m_MinimaList=e;else{for(var t=this.m_MinimaList;t.Next!==null&&e.Y<t.Next.Y;)t=t.Next;e.Next=t.Next,t.Next=e}};a.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};a.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,It&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};a.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var e=this.m_MinimaList;e!=null;){var t=e.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=a.EdgeSide.esLeft,t.OutIdx=a.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=a.EdgeSide.esRight,t.OutIdx=a.ClipperBase.Unassigned),e=e.Next}};a.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=a.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=a.PolyFillType.pftEvenOdd,this.m_SubjFillType=a.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,a.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=a.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&e)!==0,this.StrictlySimple=(2&e)!==0,this.PreserveCollinear=(4&e)!==0,It&&(this.ZFillFunction=null)};a.Clipper.ioReverseSolution=1;a.Clipper.ioStrictlySimple=2;a.Clipper.ioPreserveCollinear=4;a.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),a.ClipperBase.prototype.Clear.call(this))};a.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};a.Clipper.prototype.Reset=function(){a.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var e=this.m_MinimaList;e!==null;)this.InsertScanbeam(e.Y),e=e.Next};a.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new a.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new a.Scanbeam;t.Y=e,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var r=this.m_Scanbeam;r.Next!==null&&e<=r.Next.Y;)r=r.Next;if(e==r.Y)return;var t=new a.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};a.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof a.PolyTree;if(t==4&&!r){var n=e[0],i=e[1],o=e[2],s=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&a.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,a.Clear(i),this.m_SubjFillType=o,this.m_ClipFillType=s,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var u=this.ExecuteInternal();u&&this.BuildResult(i)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return u}else if(t==4&&r){var n=e[0],f=e[1],o=e[2],s=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=s,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var u=this.ExecuteInternal();u&&this.BuildResult2(f)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return u}else if(t==2&&!r){var n=e[0],i=e[1];return this.Execute(n,i,a.PolyFillType.pftEvenOdd,a.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],f=e[1];return this.Execute(n,f,a.PolyFillType.pftEvenOdd,a.PolyFillType.pftEvenOdd)}};a.Clipper.prototype.FixHoleLinkage=function(e){if(!(e.FirstLeft===null||e.IsHole!=e.FirstLeft.IsHole&&e.FirstLeft.Pts!==null)){for(var t=e.FirstLeft;t!==null&&(t.IsHole==e.IsHole||t.Pts===null);)t=t.FirstLeft;e.FirstLeft=t}};a.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),a.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(e,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),e=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts===null||i.IsOpen||(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)}this.JoinCommonEdges();for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&!i.IsOpen&&this.FixupOutPolygon(i)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{a.Clear(this.m_Joins),a.Clear(this.m_GhostJoins)}};a.Clipper.prototype.PopScanbeam=function(){var e=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,e};a.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);a.Clear(this.m_PolyOuts)};a.Clipper.prototype.DisposeOutRec=function(e){var t=this.m_PolyOuts[e];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[e]=null};a.Clipper.prototype.DisposeOutPts=function(e){if(e!==null){var t=null;for(e.Prev.Next=null;e!==null;)t=e,e=e.Next,t=null}};a.Clipper.prototype.AddJoin=function(e,t,r){var n=new a.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};a.Clipper.prototype.AddGhostJoin=function(e,t){var r=new a.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};It&&(a.Clipper.prototype.SetZ=function(e,t){e.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,e):this.ZFillFunction(t.Top,t.Bot,e))});a.Clipper.prototype.InsertLocalMinimaIntoAEL=function(e){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==e;){var t=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(n=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(r,t),this.SetWindingCount(t),r.WindCnt=t.WindCnt,r.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,r,t.Bot)),this.InsertScanbeam(t.Top.Y)),r!=null&&(a.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&a.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var i=0,o=this.m_GhostJoins.length;i<o;i++){var s=this.m_GhostJoins[i];this.HorzSegmentsOverlap(s.OutPt1.Pt,s.OffPt,r.Bot,r.Top)&&this.AddJoin(s.OutPt1,n,s.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&a.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,u,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&a.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,u,r.Top)}var f=t.NextInAEL;if(f!==null)for(;f!=r;)this.IntersectEdges(r,f,t.Curr,!1),f=f.NextInAEL}}}};a.Clipper.prototype.InsertEdgeIntoAEL=function(e,t){if(this.m_ActiveEdges===null)e.PrevInAEL=null,e.NextInAEL=null,this.m_ActiveEdges=e;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,e))e.PrevInAEL=null,e.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=e,this.m_ActiveEdges=e;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,e);)t=t.NextInAEL;e.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=e),e.PrevInAEL=t,t.NextInAEL=e}};a.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<a.Clipper.TopX(e,t.Top.Y):e.Top.X>a.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};a.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==a.PolyType.ptSubject?this.m_SubjFillType==a.PolyFillType.pftEvenOdd:this.m_ClipFillType==a.PolyFillType.pftEvenOdd};a.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==a.PolyType.ptSubject?this.m_ClipFillType==a.PolyFillType.pftEvenOdd:this.m_SubjFillType==a.PolyFillType.pftEvenOdd};a.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==a.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case a.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case a.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case a.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case a.ClipType.ctIntersection:switch(r){case a.PolyFillType.pftEvenOdd:case a.PolyFillType.pftNonZero:return e.WindCnt2!==0;case a.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case a.ClipType.ctUnion:switch(r){case a.PolyFillType.pftEvenOdd:case a.PolyFillType.pftNonZero:return e.WindCnt2===0;case a.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case a.ClipType.ctDifference:if(e.PolyTyp==a.PolyType.ptSubject)switch(r){case a.PolyFillType.pftEvenOdd:case a.PolyFillType.pftNonZero:return e.WindCnt2===0;case a.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case a.PolyFillType.pftEvenOdd:case a.PolyFillType.pftNonZero:return e.WindCnt2!==0;case a.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case a.ClipType.ctXor:if(e.WindDelta===0)switch(r){case a.PolyFillType.pftEvenOdd:case a.PolyFillType.pftNonZero:return e.WindCnt2===0;case a.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};a.Clipper.prototype.SetWindingCount=function(e){for(var t=e.PrevInAEL;t!==null&&(t.PolyTyp!=e.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)e.WindCnt=e.WindDelta===0?1:e.WindDelta,e.WindCnt2=0,t=this.m_ActiveEdges;else if(e.WindDelta===0&&this.m_ClipType!=a.ClipType.ctUnion)e.WindCnt=1,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(e)){if(e.WindDelta===0){for(var r=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(r=!r),n=n.PrevInAEL;e.WindCnt=r?0:1}else e.WindCnt=e.WindDelta;e.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta:e.WindCnt=e.WindDelta===0?1:e.WindDelta:e.WindDelta===0?e.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(e))for(;t!=e;)t.WindDelta!==0&&(e.WindCnt2=e.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=e;)e.WindCnt2+=t.WindDelta,t=t.NextInAEL};a.Clipper.prototype.AddEdgeToSEL=function(e){this.m_SortedEdges===null?(this.m_SortedEdges=e,e.PrevInSEL=null,e.NextInSEL=null):(e.NextInSEL=this.m_SortedEdges,e.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=e,this.m_SortedEdges=e)};a.Clipper.prototype.CopyAELToSEL=function(){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e=e.NextInAEL};a.Clipper.prototype.SwapPositionsInAEL=function(e,t){if(!(e.NextInAEL==e.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else{var r=e.NextInAEL,n=e.PrevInAEL;e.NextInAEL=t.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=t.PrevInAEL,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e),t.NextInAEL=r,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}e.PrevInAEL===null?this.m_ActiveEdges=e:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};a.Clipper.prototype.SwapPositionsInSEL=function(e,t){if(!(e.NextInSEL===null&&e.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else{var r=e.NextInSEL,n=e.PrevInSEL;e.NextInSEL=t.NextInSEL,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=t.PrevInSEL,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e),t.NextInSEL=r,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}e.PrevInSEL===null?this.m_SortedEdges=e:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};a.Clipper.prototype.AddLocalMaxPoly=function(e,t,r){this.AddOutPt(e,r),t.WindDelta==0&&this.AddOutPt(t,r),e.OutIdx==t.OutIdx?(e.OutIdx=-1,t.OutIdx=-1):e.OutIdx<t.OutIdx?this.AppendPolygon(e,t):this.AppendPolygon(t,e)};a.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,i,o;if(a.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=a.EdgeSide.esLeft,t.Side=a.EdgeSide.esRight,i=e,i.PrevInAEL==t?o=t.PrevInAEL:o=i.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=a.EdgeSide.esRight,t.Side=a.EdgeSide.esLeft,i=t,i.PrevInAEL==e?o=e.PrevInAEL:o=i.PrevInAEL),o!==null&&o.OutIdx>=0&&a.Clipper.TopX(o,r.Y)==a.Clipper.TopX(i,r.Y)&&a.ClipperBase.SlopesEqual(i,o,this.m_UseFullRange)&&i.WindDelta!==0&&o.WindDelta!==0){var s=this.AddOutPt(o,r);this.AddJoin(n,s,i.Top)}return n};a.Clipper.prototype.CreateOutRec=function(){var e=new a.OutRec;return e.Idx=-1,e.IsHole=!1,e.IsOpen=!1,e.FirstLeft=null,e.Pts=null,e.BottomPt=null,e.PolyNode=null,this.m_PolyOuts.push(e),e.Idx=this.m_PolyOuts.length-1,e};a.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==a.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var i=new a.OutPt;return n.Pts=i,i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=i,i.Prev=i,n.IsOpen||this.SetHoleState(e,n),It&&(a.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):a.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),e.OutIdx=n.Idx,i}else{var n=this.m_PolyOuts[e.OutIdx],o=n.Pts;if(r&&a.IntPoint.op_Equality(t,o.Pt))return o;if(!r&&a.IntPoint.op_Equality(t,o.Prev.Pt))return o.Prev;var i=new a.OutPt;return i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=o,i.Prev=o.Prev,i.Prev.Next=i,o.Prev=i,r&&(n.Pts=i),It&&(a.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):a.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),i}};a.Clipper.prototype.SwapPoints=function(e,t){var r=new a.IntPoint(e.Value);e.Value.X=t.Value.X,e.Value.Y=t.Value.Y,t.Value.X=r.X,t.Value.Y=r.Y};a.Clipper.prototype.HorzSegmentsOverlap=function(e,t,r,n){return e.X>r.X==e.X<n.X||t.X>r.X==t.X<n.X||r.X>e.X==r.X<t.X||n.X>e.X==n.X<t.X||e.X==r.X&&t.X==n.X?!0:e.X==n.X&&t.X==r.X};a.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new a.OutPt;return n.Pt.X=r.X,n.Pt.Y=r.Y,t==e.Next?(e.Next=n,t.Prev=n,n.Next=t,n.Prev=e):(t.Next=n,e.Prev=n,n.Next=e,n.Prev=t),n};a.Clipper.prototype.SetHoleState=function(e,t){for(var r=!1,n=e.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(r=!r,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;r&&(t.IsHole=!0)};a.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?a.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};a.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;a.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var n=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;a.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var i=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=t.Prev;a.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var o=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;a.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var s=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=o&&n>=s||i>=o&&i>=s};a.Clipper.prototype.GetBottomPt=function(e){for(var t=null,r=e.Next;r!=e;)r.Pt.Y>e.Pt.Y?(e=r,t=null):r.Pt.Y==e.Pt.Y&&r.Pt.X<=e.Pt.X&&(r.Pt.X<e.Pt.X?(t=null,e=r):r.Next!=e&&r.Prev!=e&&(t=r)),r=r.Next;if(t!==null)for(;t!=r;)for(this.FirstIsBottomPt(r,t)||(e=t),t=t.Next;a.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};a.Clipper.prototype.GetLowermostRec=function(e,t){e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var r=e.BottomPt,n=t.BottomPt;return r.Pt.Y>n.Pt.Y?e:r.Pt.Y<n.Pt.Y?t:r.Pt.X<n.Pt.X?e:r.Pt.X>n.Pt.X||r.Next==r?t:n.Next==n||this.FirstIsBottomPt(r,n)?e:t};a.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};a.Clipper.prototype.GetOutRec=function(e){for(var t=this.m_PolyOuts[e];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};a.Clipper.prototype.AppendPolygon=function(e,t){var r=this.m_PolyOuts[e.OutIdx],n=this.m_PolyOuts[t.OutIdx],i;this.Param1RightOfParam2(r,n)?i=n:this.Param1RightOfParam2(n,r)?i=r:i=this.GetLowermostRec(r,n);var o=r.Pts,s=o.Prev,u=n.Pts,f=u.Prev,c;e.Side==a.EdgeSide.esLeft?(t.Side==a.EdgeSide.esLeft?(this.ReversePolyPtLinks(u),u.Next=o,o.Prev=u,s.Next=f,f.Prev=s,r.Pts=f):(f.Next=o,o.Prev=f,u.Prev=s,s.Next=u,r.Pts=u),c=a.EdgeSide.esLeft):(t.Side==a.EdgeSide.esRight?(this.ReversePolyPtLinks(u),s.Next=f,f.Prev=s,u.Next=o,o.Prev=u):(s.Next=u,u.Prev=s,o.Prev=f,f.Next=o),c=a.EdgeSide.esRight),r.BottomPt=null,i==n&&(n.FirstLeft!=r&&(r.FirstLeft=n.FirstLeft),r.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=r;var h=e.OutIdx,m=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==m){g.OutIdx=h,g.Side=c;break}g=g.NextInAEL}n.Idx=r.Idx};a.Clipper.prototype.ReversePolyPtLinks=function(e){if(e!==null){var t,r;t=e;do r=t.Next,t.Next=t.Prev,t.Prev=r,t=r;while(t!=e)}};a.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};a.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};a.Clipper.prototype.IntersectEdges=function(e,t,r,n){var i=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,o=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,s=e.OutIdx>=0,u=t.OutIdx>=0;if(Ca&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(i||o)&&s&&u&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==a.ClipType.ctUnion?e.WindDelta===0?u&&(this.AddOutPt(e,r),s&&(e.OutIdx=-1)):s&&(this.AddOutPt(t,r),u&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=a.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),s&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=a.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),u&&(t.OutIdx=-1))),i&&(e.OutIdx<0?this.DeleteFromAEL(e):a.Error("Error intersecting polylines")),o&&(t.OutIdx<0?this.DeleteFromAEL(t):a.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var f=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=f}else e.WindCnt+t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt+=t.WindDelta,t.WindCnt-e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=e.WindDelta;else this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=e.WindDelta;var c,h,m,g;e.PolyTyp==a.PolyType.ptSubject?(c=this.m_SubjFillType,m=this.m_ClipFillType):(c=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==a.PolyType.ptSubject?(h=this.m_SubjFillType,g=this.m_ClipFillType):(h=this.m_ClipFillType,g=this.m_SubjFillType);var b,_;switch(c){case a.PolyFillType.pftPositive:b=e.WindCnt;break;case a.PolyFillType.pftNegative:b=-e.WindCnt;break;default:b=Math.abs(e.WindCnt);break}switch(h){case a.PolyFillType.pftPositive:_=t.WindCnt;break;case a.PolyFillType.pftNegative:_=-t.WindCnt;break;default:_=Math.abs(t.WindCnt);break}if(s&&u)i||o||b!==0&&b!=1||_!==0&&_!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=a.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),a.Clipper.SwapSides(e,t),a.Clipper.SwapPolyIndexes(e,t));else if(s)(_===0||_==1)&&(this.AddOutPt(e,r),a.Clipper.SwapSides(e,t),a.Clipper.SwapPolyIndexes(e,t));else if(u)(b===0||b==1)&&(this.AddOutPt(t,r),a.Clipper.SwapSides(e,t),a.Clipper.SwapPolyIndexes(e,t));else if((b===0||b==1)&&(_===0||_==1)&&!i&&!o){var I,O;switch(m){case a.PolyFillType.pftPositive:I=e.WindCnt2;break;case a.PolyFillType.pftNegative:I=-e.WindCnt2;break;default:I=Math.abs(e.WindCnt2);break}switch(g){case a.PolyFillType.pftPositive:O=t.WindCnt2;break;case a.PolyFillType.pftNegative:O=-t.WindCnt2;break;default:O=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(b==1&&_==1)switch(this.m_ClipType){case a.ClipType.ctIntersection:I>0&&O>0&&this.AddLocalMinPoly(e,t,r);break;case a.ClipType.ctUnion:I<=0&&O<=0&&this.AddLocalMinPoly(e,t,r);break;case a.ClipType.ctDifference:(e.PolyTyp==a.PolyType.ptClip&&I>0&&O>0||e.PolyTyp==a.PolyType.ptSubject&&I<=0&&O<=0)&&this.AddLocalMinPoly(e,t,r);break;case a.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else a.Clipper.SwapSides(e,t)}i!=o&&(i&&e.OutIdx>=0||o&&t.OutIdx>=0)&&(a.Clipper.SwapSides(e,t),a.Clipper.SwapPolyIndexes(e,t)),i&&this.DeleteFromAEL(e),o&&this.DeleteFromAEL(t)};a.Clipper.prototype.DeleteFromAEL=function(e){var t=e.PrevInAEL,r=e.NextInAEL;t===null&&r===null&&e!=this.m_ActiveEdges||(t!==null?t.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=t),e.NextInAEL=null,e.PrevInAEL=null)};a.Clipper.prototype.DeleteFromSEL=function(e){var t=e.PrevInSEL,r=e.NextInSEL;t===null&&r===null&&e!=this.m_SortedEdges||(t!==null?t.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=t),e.NextInSEL=null,e.PrevInSEL=null)};a.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&a.Error("UpdateEdgeIntoAEL: invalid call");var t=e.PrevInAEL,r=e.NextInAEL;return e.NextInLML.OutIdx=e.OutIdx,t!==null?t.NextInAEL=e.NextInLML:this.m_ActiveEdges=e.NextInLML,r!==null&&(r.PrevInAEL=e.NextInLML),e.NextInLML.Side=e.Side,e.NextInLML.WindDelta=e.WindDelta,e.NextInLML.WindCnt=e.WindCnt,e.NextInLML.WindCnt2=e.WindCnt2,e=e.NextInLML,e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.PrevInAEL=t,e.NextInAEL=r,a.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};a.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};a.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=a.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=a.Direction.dRightToLeft)};a.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=a.EdgeSide.esLeft&&(r=r.Prev),t&&(a.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};a.Clipper.prototype.ProcessHorizontal=function(e,t){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(e,r);for(var n=r.Dir,i=r.Left,o=r.Right,s=e,u=null;s.NextInLML!==null&&a.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(u=this.GetMaximaPair(s));;){for(var f=e==s,c=this.GetNextInAEL(e,n);c!==null&&!(c.Curr.X==e.Top.X&&e.NextInLML!==null&&c.Dx<e.NextInLML.Dx);){var h=this.GetNextInAEL(c,n);if(n==a.Direction.dLeftToRight&&c.Curr.X<=o||n==a.Direction.dRightToLeft&&c.Curr.X>=i){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),c==u&&f){n==a.Direction.dLeftToRight?this.IntersectEdges(e,c,c.Top,!1):this.IntersectEdges(c,e,c.Top,!1),u.OutIdx>=0&&a.Error("ProcessHorizontal error");return}else if(n==a.Direction.dLeftToRight){var m=new a.IntPoint(c.Curr.X,e.Curr.Y);this.IntersectEdges(e,c,m,!0)}else{var m=new a.IntPoint(c.Curr.X,e.Curr.Y);this.IntersectEdges(c,e,m,!0)}this.SwapPositionsInAEL(e,c)}else if(n==a.Direction.dLeftToRight&&c.Curr.X>=o||n==a.Direction.dRightToLeft&&c.Curr.X<=i)break;c=h}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&a.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:i,Right:o};this.GetHorzDirection(e,r),n=r.Dir,i=r.Left,o=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var g=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var b=e.PrevInAEL,h=e.NextInAEL;if(b!==null&&b.Curr.X==e.Bot.X&&b.Curr.Y==e.Bot.Y&&b.WindDelta!==0&&b.OutIdx>=0&&b.Curr.Y>b.Top.Y&&a.ClipperBase.SlopesEqual(e,b,this.m_UseFullRange)){var _=this.AddOutPt(b,e.Bot);this.AddJoin(g,_,e.Top)}else if(h!==null&&h.Curr.X==e.Bot.X&&h.Curr.Y==e.Bot.Y&&h.WindDelta!==0&&h.OutIdx>=0&&h.Curr.Y>h.Top.Y&&a.ClipperBase.SlopesEqual(e,h,this.m_UseFullRange)){var _=this.AddOutPt(h,e.Bot);this.AddJoin(g,_,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else u!==null?u.OutIdx>=0?(n==a.Direction.dLeftToRight?this.IntersectEdges(e,u,e.Top,!1):this.IntersectEdges(u,e,e.Top,!1),u.OutIdx>=0&&a.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(u)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};a.Clipper.prototype.GetNextInAEL=function(e,t){return t==a.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};a.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};a.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};a.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};a.Clipper.prototype.GetMaximaPair=function(e){var t=null;return a.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:a.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!a.ClipperBase.IsHorizontal(t))?null:t};a.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(r){this.m_SortedEdges=null,this.m_IntersectList.length=0,a.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};a.Clipper.prototype.BuildIntersectList=function(e,t){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=a.Clipper.TopX(r,t),r=r.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var i=r.NextInSEL,o=new a.IntPoint;if(r.Curr.X>i.Curr.X){!this.IntersectPoint(r,i,o)&&r.Curr.X>i.Curr.X+1&&a.Error("Intersection error"),o.Y>e&&(o.Y=e,Math.abs(r.Dx)>Math.abs(i.Dx)?o.X=a.Clipper.TopX(i,e):o.X=a.Clipper.TopX(r,e));var s=new a.IntersectNode;s.Edge1=r,s.Edge2=i,s.Pt.X=o.X,s.Pt.Y=o.Y,this.m_IntersectList.push(s),this.SwapPositionsInSEL(r,i),n=!0}else r=i}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};a.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};a.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};a.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var e=this.m_IntersectList.length,t=0;t<e;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var r=t+1;r<e&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==e)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[r],this.m_IntersectList[r]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};a.Clipper.prototype.ProcessIntersectList=function(){for(var e=0,t=this.m_IntersectList.length;e<t;e++){var r=this.m_IntersectList[e];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var pd=l(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),hd=l(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),dd=l(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),md=l(function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)},"R4");F.msie?a.Clipper.Round=pd:F.chromium?a.Clipper.Round=dd:F.safari?a.Clipper.Round=md:a.Clipper.Round=hd;a.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+a.Clipper.Round(e.Dx*(t-e.Bot.Y))};a.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,i;if(a.ClipperBase.SlopesEqual(e,t,this.m_UseFullRange)||e.Dx==t.Dx)return t.Bot.Y>e.Bot.Y?(r.X=t.Bot.X,r.Y=t.Bot.Y):(r.X=e.Bot.X,r.Y=e.Bot.Y),!1;if(e.Delta.X===0)r.X=e.Bot.X,a.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(i=t.Bot.Y-t.Bot.X/t.Dx,r.Y=a.Clipper.Round(r.X/t.Dx+i));else if(t.Delta.X===0)r.X=t.Bot.X,a.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=a.Clipper.Round(r.X/e.Dx+n));else{n=e.Bot.X-e.Bot.Y*e.Dx,i=t.Bot.X-t.Bot.Y*t.Dx;var o=(i-n)/(e.Dx-t.Dx);r.Y=a.Clipper.Round(o),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=a.Clipper.Round(e.Dx*o+n):r.X=a.Clipper.Round(t.Dx*o+i)}if(r.Y<e.Top.Y||r.Y<t.Top.Y){if(e.Top.Y>t.Top.Y)return r.Y=e.Top.Y,r.X=a.Clipper.TopX(t,e.Top.Y),r.X<e.Top.X;r.Y=t.Top.Y,Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=a.Clipper.TopX(e,r.Y):r.X=a.Clipper.TopX(t,r.Y)}return!0};a.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(e){for(var t=this.m_ActiveEdges;t!==null;){var r=this.IsMaxima(t,e);if(r){var n=this.GetMaximaPair(t);r=n===null||!a.ClipperBase.IsHorizontal(n)}if(r){var i=t.PrevInAEL;this.DoMaxima(t),i===null?t=this.m_ActiveEdges:t=i.NextInAEL}else{if(this.IsIntermediate(t,e)&&a.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=a.Clipper.TopX(t,e),t.Curr.Y=e),this.StrictlySimple){var i=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&i!==null&&i.OutIdx>=0&&i.Curr.X==t.Curr.X&&i.WindDelta!==0){var o=this.AddOutPt(i,t.Curr),s=this.AddOutPt(t,t.Curr);this.AddJoin(o,s,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var o=null;t.OutIdx>=0&&(o=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var i=t.PrevInAEL,u=t.NextInAEL;if(i!==null&&i.Curr.X==t.Bot.X&&i.Curr.Y==t.Bot.Y&&o!==null&&i.OutIdx>=0&&i.Curr.Y>i.Top.Y&&a.ClipperBase.SlopesEqual(t,i,this.m_UseFullRange)&&t.WindDelta!==0&&i.WindDelta!==0){var s=this.AddOutPt(i,t.Bot);this.AddJoin(o,s,t.Top)}else if(u!==null&&u.Curr.X==t.Bot.X&&u.Curr.Y==t.Bot.Y&&o!==null&&u.OutIdx>=0&&u.Curr.Y>u.Top.Y&&a.ClipperBase.SlopesEqual(t,u,this.m_UseFullRange)&&t.WindDelta!==0&&u.WindDelta!==0){var s=this.AddOutPt(u,t.Bot);this.AddJoin(o,s,t.Top)}}t=t.NextInAEL}};a.Clipper.prototype.DoMaxima=function(e){var t=this.GetMaximaPair(e);if(t===null){e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e);return}for(var r=e.NextInAEL,n=!0;r!==null&&r!=t;)this.IntersectEdges(e,r,e.Top,!0),this.SwapPositionsInAEL(e,r),r=e.NextInAEL;e.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(e),this.DeleteFromAEL(t)):e.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(e,t,e.Top,!1):n&&e.WindDelta===0?(e.OutIdx>=0&&(this.AddOutPt(e,e.Top),e.OutIdx=-1),this.DeleteFromAEL(e),t.OutIdx>=0&&(this.AddOutPt(t,e.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):a.Error("DoMaxima error")};a.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};a.Clipper.Orientation=function(e){return a.Clipper.Area(e)>=0};a.Clipper.prototype.PointCount=function(e){if(e===null)return 0;var t=0,r=e;do t++,r=r.Next;while(r!=e);return t};a.Clipper.prototype.BuildResult=function(e){a.Clear(e);for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var i=n.Pts.Prev,o=this.PointCount(i);if(!(o<2)){for(var s=new Array(o),u=0;u<o;u++)s[u]=i.Pt,i=i.Prev;e.push(s)}}}};a.Clipper.prototype.BuildResult2=function(e){e.Clear();for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t],i=this.PointCount(n.Pts);if(!(n.IsOpen&&i<2||!n.IsOpen&&i<3)){this.FixHoleLinkage(n);var o=new a.PolyNode;e.m_AllPolys.push(o),n.PolyNode=o,o.m_polygon.length=i;for(var s=n.Pts.Prev,u=0;u<i;u++)o.m_polygon[u]=s.Pt,s=s.Prev}}for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,e.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):e.AddChild(n.PolyNode))}};a.Clipper.prototype.FixupOutPolygon=function(e){var t=null;e.BottomPt=null;for(var r=e.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),e.Pts=null;return}if(a.IntPoint.op_Equality(r.Pt,r.Next.Pt)||a.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||a.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){t=null;var n=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,n=null}else{if(r==t)break;t===null&&(t=r),r=r.Next}}e.Pts=r};a.Clipper.prototype.DupOutPt=function(e,t){var r=new a.OutPt;return r.Pt.X=e.Pt.X,r.Pt.Y=e.Pt.Y,r.Idx=e.Idx,t?(r.Next=e.Next,r.Prev=e,e.Next.Prev=r,e.Next=r):(r.Prev=e.Prev,r.Next=e,e.Prev.Next=r,e.Prev=r),r};a.Clipper.prototype.GetOverlap=function(e,t,r,n,i){return e<t?r<n?(i.Left=Math.max(e,r),i.Right=Math.min(t,n)):(i.Left=Math.max(e,n),i.Right=Math.min(t,r)):r<n?(i.Left=Math.max(t,r),i.Right=Math.min(e,n)):(i.Left=Math.max(t,n),i.Right=Math.min(e,r)),i.Left<i.Right};a.Clipper.prototype.JoinHorz=function(e,t,r,n,i,o){var s=e.Pt.X>t.Pt.X?a.Direction.dRightToLeft:a.Direction.dLeftToRight,u=r.Pt.X>n.Pt.X?a.Direction.dRightToLeft:a.Direction.dLeftToRight;if(s==u)return!1;if(s==a.Direction.dLeftToRight){for(;e.Next.Pt.X<=i.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;o&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,!o),a.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,!o))}else{for(;e.Next.Pt.X>=i.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;!o&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,o),a.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,o))}if(u==a.Direction.dLeftToRight){for(;r.Next.Pt.X<=i.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;o&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,!o),a.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,!o))}else{for(;r.Next.Pt.X>=i.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;!o&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,o),a.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,o))}return s==a.Direction.dLeftToRight==o?(e.Prev=r,r.Next=e,t.Next=n,n.Prev=t):(e.Next=r,r.Prev=e,t.Prev=n,n.Next=t),!0};a.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,i=new a.OutPt,o=e.OutPt2,s=new a.OutPt,u=e.OutPt1.Pt.Y==e.OffPt.Y;if(u&&a.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&a.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(i=e.OutPt1.Next;i!=n&&a.IntPoint.op_Equality(i.Pt,e.OffPt);)i=i.Next;var f=i.Pt.Y>e.OffPt.Y;for(s=e.OutPt2.Next;s!=o&&a.IntPoint.op_Equality(s.Pt,e.OffPt);)s=s.Next;var c=s.Pt.Y>e.OffPt.Y;return f==c?!1:f?(i=this.DupOutPt(n,!1),s=this.DupOutPt(o,!0),n.Prev=o,o.Next=n,i.Next=s,s.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),s=this.DupOutPt(o,!1),n.Next=o,o.Prev=n,i.Prev=s,s.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}else if(u){for(i=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=i&&n.Prev!=o;)n=n.Prev;for(;i.Next.Pt.Y==i.Pt.Y&&i.Next!=n&&i.Next!=o;)i=i.Next;if(i.Next==n||i.Next==o)return!1;for(s=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=s&&o.Prev!=i;)o=o.Prev;for(;s.Next.Pt.Y==s.Pt.Y&&s.Next!=o&&s.Next!=n;)s=s.Next;if(s.Next==o||s.Next==n)return!1;var h={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,o.Pt.X,s.Pt.X,h))return!1;var m=h.Left,g=h.Right,b=new a.IntPoint,_;return n.Pt.X>=m&&n.Pt.X<=g?(b.X=n.Pt.X,b.Y=n.Pt.Y,_=n.Pt.X>i.Pt.X):o.Pt.X>=m&&o.Pt.X<=g?(b.X=o.Pt.X,b.Y=o.Pt.Y,_=o.Pt.X>s.Pt.X):i.Pt.X>=m&&i.Pt.X<=g?(b.X=i.Pt.X,b.Y=i.Pt.Y,_=i.Pt.X>n.Pt.X):(b.X=s.Pt.X,b.Y=s.Pt.Y,_=s.Pt.X>o.Pt.X),e.OutPt1=n,e.OutPt2=o,this.JoinHorz(n,i,o,s,b,_)}else{for(i=n.Next;a.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var I=i.Pt.Y>n.Pt.Y||!a.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange);if(I){for(i=n.Prev;a.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Prev;if(i.Pt.Y>n.Pt.Y||!a.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange))return!1}for(s=o.Next;a.IntPoint.op_Equality(s.Pt,o.Pt)&&s!=o;)s=s.Next;var O=s.Pt.Y>o.Pt.Y||!a.ClipperBase.SlopesEqual(o.Pt,s.Pt,e.OffPt,this.m_UseFullRange);if(O){for(s=o.Prev;a.IntPoint.op_Equality(s.Pt,o.Pt)&&s!=o;)s=s.Prev;if(s.Pt.Y>o.Pt.Y||!a.ClipperBase.SlopesEqual(o.Pt,s.Pt,e.OffPt,this.m_UseFullRange))return!1}return i==n||s==o||i==s||t==r&&I==O?!1:I?(i=this.DupOutPt(n,!1),s=this.DupOutPt(o,!0),n.Prev=o,o.Next=n,i.Next=s,s.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),s=this.DupOutPt(o,!1),n.Next=o,o.Prev=n,i.Prev=s,s.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}};a.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new a.IntRect(0,0,0,0);var n=new a.IntRect;for(n.left=e[t][0].X,n.right=n.left,n.top=e[t][0].Y,n.bottom=n.top;t<r;t++)for(var i=0,o=e[t].length;i<o;i++)e[t][i].X<n.left?n.left=e[t][i].X:e[t][i].X>n.right&&(n.right=e[t][i].X),e[t][i].Y<n.top?n.top=e[t][i].Y:e[t][i].Y>n.bottom&&(n.bottom=e[t][i].Y);return n};a.Clipper.prototype.GetBounds2=function(e){var t=e,r=new a.IntRect;for(r.left=e.Pt.X,r.right=e.Pt.X,r.top=e.Pt.Y,r.bottom=e.Pt.Y,e=e.Next;e!=t;)e.Pt.X<r.left&&(r.left=e.Pt.X),e.Pt.X>r.right&&(r.right=e.Pt.X),e.Pt.Y<r.top&&(r.top=e.Pt.Y),e.Pt.Y>r.bottom&&(r.bottom=e.Pt.Y),e=e.Next;return r};a.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var i=t[0],o=1;o<=n;++o){var s=o==n?t[0]:t[o];if(s.Y==e.Y&&(s.X==e.X||i.Y==e.Y&&s.X>e.X==i.X<e.X))return-1;if(i.Y<e.Y!=s.Y<e.Y){if(i.X>=e.X)if(s.X>e.X)r=1-r;else{var u=(i.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(i.Y-e.Y);if(u==0)return-1;u>0==s.Y>i.Y&&(r=1-r)}else if(s.X>e.X){var u=(i.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(i.Y-e.Y);if(u==0)return-1;u>0==s.Y>i.Y&&(r=1-r)}}i=s}return r};a.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var i=t.Pt.X,o=t.Pt.Y,s=t.Next.Pt.X,u=t.Next.Pt.Y;if(u==e.Y&&(s==e.X||o==e.Y&&s>e.X==i<e.X))return-1;if(o<e.Y!=u<e.Y){if(i>=e.X)if(s>e.X)r=1-r;else{var f=(i-e.X)*(u-e.Y)-(s-e.X)*(o-e.Y);if(f==0)return-1;f>0==u>o&&(r=1-r)}else if(s>e.X){var f=(i-e.X)*(u-e.Y)-(s-e.X)*(o-e.Y);if(f==0)return-1;f>0==u>o&&(r=1-r)}}if(t=t.Next,n==t)break}return r};a.Clipper.prototype.Poly2ContainsPoly1=function(e,t){var r=e;do{var n=this.PointInPolygon(r.Pt,t);if(n>=0)return n!=0;r=r.Next}while(r!=e);return!0};a.Clipper.prototype.FixupFirstLefts1=function(e,t){for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&i.FirstLeft==e&&this.Poly2ContainsPoly1(i.Pts,t.Pts)&&(i.FirstLeft=t)}};a.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,i=n.length,o=n[r];r<i;r++,o=n[r])o.FirstLeft==e&&(o.FirstLeft=t)};a.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};a.Clipper.prototype.JoinCommonEdges=function(){for(var e=0,t=this.m_Joins.length;e<t;e++){var r=this.m_Joins[e],n=this.GetOutRec(r.OutPt1.Idx),i=this.GetOutRec(r.OutPt2.Idx);if(!(n.Pts==null||i.Pts==null)){var o;if(n==i?o=n:this.Param1RightOfParam2(n,i)?o=i:this.Param1RightOfParam2(i,n)?o=n:o=this.GetLowermostRec(n,i),!!this.JoinPoints(r,n,i))if(n==i){if(n.Pts=r.OutPt1,n.BottomPt=null,i=this.CreateOutRec(),i.Pts=r.OutPt2,this.UpdateOutPtIdxs(i),this.m_UsingPolyTree)for(var s=0,u=this.m_PolyOuts.length;s<u-1;s++){var f=this.m_PolyOuts[s];f.Pts==null||a.Clipper.ParseFirstLeft(f.FirstLeft)!=n||f.IsHole==n.IsHole||this.Poly2ContainsPoly1(f.Pts,r.OutPt2)&&(f.FirstLeft=i)}this.Poly2ContainsPoly1(i.Pts,n.Pts)?(i.IsHole=!n.IsHole,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):this.Poly2ContainsPoly1(n.Pts,i.Pts)?(i.IsHole=n.IsHole,n.IsHole=!i.IsHole,i.FirstLeft=n.FirstLeft,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):(i.IsHole=n.IsHole,i.FirstLeft=n.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(n,i))}else i.Pts=null,i.BottomPt=null,i.Idx=n.Idx,n.IsHole=o.IsHole,o==i&&(n.FirstLeft=i.FirstLeft),i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n)}}};a.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};a.Clipper.prototype.DoSimplePolygons=function(){for(var e=0;e<this.m_PolyOuts.length;){var t=this.m_PolyOuts[e++],r=t.Pts;if(r!==null)do{for(var n=r.Next;n!=t.Pts;){if(a.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var i=r.Prev,o=n.Prev;r.Prev=o,o.Next=r,n.Prev=i,i.Next=n,t.Pts=r;var s=this.CreateOutRec();s.Pts=n,this.UpdateOutPtIdxs(s),this.Poly2ContainsPoly1(s.Pts,t.Pts)?(s.IsHole=!t.IsHole,s.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,s.Pts)?(s.IsHole=t.IsHole,t.IsHole=!s.IsHole,s.FirstLeft=t.FirstLeft,t.FirstLeft=s):(s.IsHole=t.IsHole,s.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};a.Clipper.Area=function(e){var t=e.length;if(t<3)return 0;for(var r=0,n=0,i=t-1;n<t;++n)r+=(e[i].X+e[n].X)*(e[i].Y-e[n].Y),i=n;return-r*.5};a.Clipper.prototype.Area=function(e){var t=e.Pts;if(t==null)return 0;var r=0;do r=r+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=e.Pts);return r*.5};Ia&&(a.Clipper.OffsetPaths=function(e,t,r,n,i){var o=new a.Paths,s=new a.ClipperOffset(i,i);return s.AddPaths(e,r,n),s.Execute(o,t),o});a.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new a.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,a.PolyType.ptSubject,!0),n.Execute(a.ClipType.ctUnion,r,t,t),r};a.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=a.PolyFillType.pftEvenOdd);var r=new Array,n=new a.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,a.PolyType.ptSubject,!0),n.Execute(a.ClipType.ctUnion,r,t,t),r};a.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};a.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,i=r.X-t.X,o=n*t.X+i*t.Y;return o=n*e.X+i*e.Y-o,o*o/(n*n+i*i)};a.Clipper.SlopesNearCollinear=function(e,t,r,n){return a.Clipper.DistanceFromLineSqrd(t,e,r)<n};a.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,i=e.Y-t.Y;return n*n+i*i<=r};a.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};a.Clipper.CleanPolygon=function(e,t){typeof t>"u"&&(t=1.415);var r=e.length;if(r==0)return new Array;for(var n=new Array(r),i=0;i<r;++i)n[i]=new a.OutPt;for(var i=0;i<r;++i)n[i].Pt=e[i],n[i].Next=n[(i+1)%r],n[i].Next.Prev=n[i],n[i].Idx=0;for(var o=t*t,s=n[0];s.Idx==0&&s.Next!=s.Prev;)a.Clipper.PointsAreClose(s.Pt,s.Prev.Pt,o)?(s=a.Clipper.ExcludeOp(s),r--):a.Clipper.PointsAreClose(s.Prev.Pt,s.Next.Pt,o)?(a.Clipper.ExcludeOp(s.Next),s=a.Clipper.ExcludeOp(s),r-=2):a.Clipper.SlopesNearCollinear(s.Prev.Pt,s.Pt,s.Next.Pt,o)?(s=a.Clipper.ExcludeOp(s),r--):(s.Idx=1,s=s.Next);r<3&&(r=0);for(var u=new Array(r),i=0;i<r;++i)u[i]=new a.IntPoint(s.Pt),s=s.Next;return n=null,u};a.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++)r[n]=a.Clipper.CleanPolygon(e[n],t);return r};a.Clipper.Minkowski=function(e,t,r,n){var i=n?1:0,o=e.length,s=t.length,u=new Array;if(r)for(var f=0;f<s;f++){for(var c=new Array(o),h=0,m=e.length,g=e[h];h<m;h++,g=e[h])c[h]=new a.IntPoint(t[f].X+g.X,t[f].Y+g.Y);u.push(c)}else for(var f=0;f<s;f++){for(var c=new Array(o),h=0,m=e.length,g=e[h];h<m;h++,g=e[h])c[h]=new a.IntPoint(t[f].X-g.X,t[f].Y-g.Y);u.push(c)}for(var b=new Array,f=0;f<s-1+i;f++)for(var h=0;h<o;h++){var _=new Array;_.push(u[f%s][h%o]),_.push(u[(f+1)%s][h%o]),_.push(u[(f+1)%s][(h+1)%o]),_.push(u[f%s][(h+1)%o]),a.Clipper.Orientation(_)||_.reverse(),b.push(_)}var I=new a.Clipper(0);return I.AddPaths(b,a.PolyType.ptSubject,!0),I.Execute(a.ClipType.ctUnion,u,a.PolyFillType.pftNonZero,a.PolyFillType.pftNonZero),u};a.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],i=e[2];return a.Clipper.Minkowski(r,n,!0,i)}else if(t==4){for(var r=e[0],o=e[1],s=e[2],i=e[3],u=new a.Clipper,f,c=0,h=o.length;c<h;++c){var f=a.Clipper.Minkowski(r,o[c],!0,i);u.AddPaths(f,a.PolyType.ptSubject,!0)}i&&u.AddPaths(o,a.PolyType.ptClip,!0);var m=new a.Paths;return u.Execute(a.ClipType.ctUnion,m,s,s),m}};a.Clipper.MinkowskiDiff=function(e,t,r){return a.Clipper.Minkowski(e,t,!1,r)};a.Clipper.PolyTreeToPaths=function(e){var t=new Array;return a.Clipper.AddPolyNodeToPaths(e,a.Clipper.NodeType.ntAny,t),t};a.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case a.Clipper.NodeType.ntOpen:return;case a.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var i=0,o=e.Childs(),s=o.length,u=o[i];i<s;i++,u=o[i])a.Clipper.AddPolyNodeToPaths(u,t,r)};a.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new a.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};a.Clipper.ClosedPathsFromPolyTree=function(e){var t=new a.Paths;return a.Clipper.AddPolyNodeToPaths(e,a.Clipper.NodeType.ntClosed,t),t};mn(a.Clipper,a.ClipperBase);a.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};a.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=a.ClipperOffset.def_arc_tolerance),this.m_destPolys=new a.Paths,this.m_srcPoly=new a.Path,this.m_destPoly=new a.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new a.IntPoint,this.m_polyNodes=new a.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};a.ClipperOffset.two_pi=6.28318530717959;a.ClipperOffset.def_arc_tolerance=.25;a.ClipperOffset.prototype.Clear=function(){a.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};a.ClipperOffset.Round=a.Clipper.Round;a.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var i=new a.PolyNode;if(i.m_jointype=t,i.m_endtype=r,r==a.EndType.etClosedLine||r==a.EndType.etClosedPolygon)for(;n>0&&a.IntPoint.op_Equality(e[0],e[n]);)n--;i.m_polygon.push(e[0]);for(var o=0,s=0,u=1;u<=n;u++)a.IntPoint.op_Inequality(i.m_polygon[o],e[u])&&(o++,i.m_polygon.push(e[u]),(e[u].Y>i.m_polygon[s].Y||e[u].Y==i.m_polygon[s].Y&&e[u].X<i.m_polygon[s].X)&&(s=o));if(!(r==a.EndType.etClosedPolygon&&o<2||r!=a.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(i),r==a.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new a.IntPoint(0,s);else{var f=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[s].Y>f.Y||i.m_polygon[s].Y==f.Y&&i.m_polygon[s].X<f.X)&&(this.m_lowest=new a.IntPoint(this.m_polyNodes.ChildCount()-1,s))}}};a.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,i=e.length;n<i;n++)this.AddPath(e[n],t,r)};a.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!a.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];(t.m_endtype==a.EndType.etClosedPolygon||t.m_endtype==a.EndType.etClosedLine&&a.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==a.EndType.etClosedLine&&!a.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};a.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new a.DoublePoint(0,0);var i=1/Math.sqrt(r*r+n*n);return r*=i,n*=i,new a.DoublePoint(n,-r)};a.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,a.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==a.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=a.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*a.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*a.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var i=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(a.ClipperOffset.two_pi/i),this.m_cos=Math.cos(a.ClipperOffset.two_pi/i),this.m_StepsPerRad=i/a.ClipperOffset.two_pi,e<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];this.m_srcPoly=r.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||e<=0&&(o<3||r.m_endtype!=a.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(r.m_jointype==a.JoinType.jtRound)for(var s=1,u=0,f=1;f<=i;f++){this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[0].X+s*e),a.ClipperOffset.Round(this.m_srcPoly[0].Y+u*e)));var c=s;s=s*this.m_cos-this.m_sin*u,u=c*this.m_sin+u*this.m_cos}else for(var s=-1,u=-1,f=0;f<4;++f)this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[0].X+s*e),a.ClipperOffset.Round(this.m_srcPoly[0].Y+u*e))),s<0?s=1:u<0?u=1:s=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var f=0;f<o-1;f++)this.m_normals.push(a.ClipperOffset.GetUnitNormal(this.m_srcPoly[f],this.m_srcPoly[f+1]));if(r.m_endtype==a.EndType.etClosedLine||r.m_endtype==a.EndType.etClosedPolygon?this.m_normals.push(a.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new a.DoublePoint(this.m_normals[o-2])),r.m_endtype==a.EndType.etClosedPolygon){for(var h=o-1,f=0;f<o;f++)h=this.OffsetPoint(f,h,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==a.EndType.etClosedLine){for(var h=o-1,f=0;f<o;f++)h=this.OffsetPoint(f,h,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var m=this.m_normals[o-1],f=o-1;f>0;f--)this.m_normals[f]=new a.DoublePoint(-this.m_normals[f-1].X,-this.m_normals[f-1].Y);this.m_normals[0]=new a.DoublePoint(-m.X,-m.Y),h=0;for(var f=o-1;f>=0;f--)h=this.OffsetPoint(f,h,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var h=0,f=1;f<o-1;++f)h=this.OffsetPoint(f,h,r.m_jointype);var g;if(r.m_endtype==a.EndType.etOpenButt){var f=o-1;g=new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[f].X+this.m_normals[f].X*e),a.ClipperOffset.Round(this.m_srcPoly[f].Y+this.m_normals[f].Y*e)),this.m_destPoly.push(g),g=new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[f].X-this.m_normals[f].X*e),a.ClipperOffset.Round(this.m_srcPoly[f].Y-this.m_normals[f].Y*e)),this.m_destPoly.push(g)}else{var f=o-1;h=o-2,this.m_sinA=0,this.m_normals[f]=new a.DoublePoint(-this.m_normals[f].X,-this.m_normals[f].Y),r.m_endtype==a.EndType.etOpenSquare?this.DoSquare(f,h):this.DoRound(f,h)}for(var f=o-1;f>0;f--)this.m_normals[f]=new a.DoublePoint(-this.m_normals[f-1].X,-this.m_normals[f-1].Y);this.m_normals[0]=new a.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),h=o-1;for(var f=h-1;f>0;--f)h=this.OffsetPoint(f,h,r.m_jointype);r.m_endtype==a.EndType.etOpenButt?(g=new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),a.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(g),g=new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),a.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(g)):(h=1,this.m_sinA=0,r.m_endtype==a.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};a.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof a.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var i=new a.Clipper(0);if(i.AddPaths(this.m_destPolys,a.PolyType.ptSubject,!0),n>0)i.Execute(a.ClipType.ctUnion,r,a.PolyFillType.pftPositive,a.PolyFillType.pftPositive);else{var o=a.Clipper.GetBounds(this.m_destPolys),s=new a.Path;if(s.push(new a.IntPoint(o.left-10,o.bottom+10)),s.push(new a.IntPoint(o.right+10,o.bottom+10)),s.push(new a.IntPoint(o.right+10,o.top-10)),s.push(new a.IntPoint(o.left-10,o.top-10)),i.AddPath(s,a.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(a.ClipType.ctUnion,r,a.PolyFillType.pftNegative,a.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var u=r.Childs()[0];r.Childs()[0]=u.Childs()[0];for(var f=1;f<u.ChildCount();f++)r.AddChild(u.Childs()[f])}else r.Clear()}}else{var r=e[0],n=e[1];a.Clear(r),this.FixOrientations(),this.DoOffset(n);var i=new a.Clipper(0);if(i.AddPaths(this.m_destPolys,a.PolyType.ptSubject,!0),n>0)i.Execute(a.ClipType.ctUnion,r,a.PolyFillType.pftPositive,a.PolyFillType.pftPositive);else{var o=a.Clipper.GetBounds(this.m_destPolys),s=new a.Path;s.push(new a.IntPoint(o.left-10,o.bottom+10)),s.push(new a.IntPoint(o.right+10,o.bottom+10)),s.push(new a.IntPoint(o.right+10,o.top-10)),s.push(new a.IntPoint(o.left-10,o.top-10)),i.AddPath(s,a.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(a.ClipType.ctUnion,r,a.PolyFillType.pftNegative,a.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};a.ClipperOffset.prototype.OffsetPoint=function(e,t,r){if(this.m_sinA=this.m_normals[t].X*this.m_normals[e].Y-this.m_normals[e].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),a.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new a.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),a.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case a.JoinType.jtMiter:{var n=1+(this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(e,t,n):this.DoSquare(e,t);break}case a.JoinType.jtSquare:this.DoSquare(e,t);break;case a.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};a.ClipperOffset.prototype.DoSquare=function(e,t){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y)/4);this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),a.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*r)))),this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),a.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};a.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),a.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};a.ClipperOffset.prototype.DoRound=function(e,t){for(var r=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y),n=a.Cast_Int32(a.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),i=this.m_normals[t].X,o=this.m_normals[t].Y,s,u=0;u<n;++u)this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[e].X+i*this.m_delta),a.ClipperOffset.Round(this.m_srcPoly[e].Y+o*this.m_delta))),s=i,i=i*this.m_cos-this.m_sin*o,o=s*this.m_sin+o*this.m_cos;this.m_destPoly.push(new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),a.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};a.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};a.JS={};a.JS.AreaOfPolygon=function(e,t){return t||(t=1),a.Clipper.Area(e)/(t*t)};a.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=a.Clipper.Area(e[n]);return r/(t*t)};a.JS.BoundsOfPath=function(e,t){return a.JS.BoundsOfPaths([e],t)};a.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=a.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};a.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=a.JS.Clone(n);if(typeof t!="number"||t===null)return a.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;r||(n=[n]);for(var i=n.length,o,s,u,f,c,h,m,g=[],b=0;b<i;b++)if(s=n[b],o=s.length,o!==0){if(o<3){u=s,g.push(u);continue}for(u=s,f=t*t,c=s[0],h=1,m=1;m<o;m++)(s[m].X-c.X)*(s[m].X-c.X)+(s[m].Y-c.Y)*(s[m].Y-c.Y)<=f||(u[h]=s[m],c=s[m],h++);c=s[h-1],(s[0].X-c.X)*(s[0].X-c.X)+(s[0].Y-c.Y)*(s[0].Y-c.Y)<=f&&h--,h<o&&u.splice(h,o-h),u.length&&g.push(u)}return!r&&g.length?g=g[0]:!r&&g.length===0?g=[]:r&&g.length===0&&(g=[[]]),g};a.JS.Clone=function(e){if(!(e instanceof Array))return[];if(e.length===0)return[];if(e.length==1&&e[0].length===0)return[[]];var t=e[0]instanceof Array;t||(e=[e]);var r=e.length,n,i,o,s,u=new Array(r);for(i=0;i<r;i++){for(n=e[i].length,s=new Array(n),o=0;o<n;o++)s[o]={X:e[i][o].X,Y:e[i][o].Y};u[i]=s}return t||(u=u[0]),u};a.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return a.Error("Tolerance is not a number in Lighten()."),a.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return a.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,i,o,s,u,f,c,h,m,g,b,_,I,O,A,R,N=e.length,U=t*t,V=[];for(r=0;r<N;r++)if(i=e[r],u=i.length,u!=0){for(o=0;o<1e6;o++){for(s=[],u=i.length,i[u-1].X!=i[0].X||i[u-1].Y!=i[0].Y?(b=1,i.push({X:i[0].X,Y:i[0].Y}),u=i.length):b=0,g=[],n=0;n<u-2;n++)f=i[n],h=i[n+1],c=i[n+2],A=f.X,R=f.Y,_=c.X-A,I=c.Y-R,(_!==0||I!==0)&&(O=((h.X-A)*_+(h.Y-R)*I)/(_*_+I*I),O>1?(A=c.X,R=c.Y):O>0&&(A+=_*O,R+=I*O)),_=h.X-A,I=h.Y-R,m=_*_+I*I,m<=U&&(g[n+1]=1,n++);for(s.push({X:i[0].X,Y:i[0].Y}),n=1;n<u-1;n++)g[n]||s.push({X:i[n].X,Y:i[n].Y});if(s.push({X:i[u-1].X,Y:i[u-1].Y}),b&&i.pop(),g.length)i=s;else break}u=s.length,s[u-1].X==s[0].X&&s[u-1].Y==s[0].Y&&s.pop(),s.length>2&&V.push(s)}return!e[0]instanceof Array&&(V=V[0]),typeof V>"u"&&(V=[[]]),V};a.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,i=0,o,s,u=0,f=0,c=0,h=0,m=e.length;if(m<2)return 0;for(t&&(e[m]=e[0],m++);--m;)o=e[m],u=o.X,f=o.Y,s=e[m-1],c=s.X,h=s.Y,i+=n((u-c)*(u-c)+(f-h)*(f-h));return t&&e.pop(),i/r};a.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,i=0;i<e.length;i++)n+=a.JS.PerimeterOfPath(e[i],t,r);return n};a.JS.ScaleDownPath=function(e,t){var r,n;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=n.X/t,n.Y=n.Y/t};a.JS.ScaleDownPaths=function(e,t){var r,n,i,o=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=i.X/t,i.Y=i.Y/t};a.JS.ScaleUpPath=function(e,t){var r,n,i=Math.round;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=i(n.X*t),n.Y=i(n.Y*t)};a.JS.ScaleUpPaths=function(e,t){var r,n,i,o=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=o(i.X*t),i.Y=o(i.Y*t)};a.ExPolygons=function(){return[]};a.ExPolygon=function(){this.outer=null,this.holes=null};a.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new a.ExPolygon;r.outer=e.Contour();var n=e.Childs(),i=n.length;r.holes=new Array(i);var o,s,u,f,c,h;for(u=0;u<i;u++)for(o=n[u],r.holes[u]=o.Contour(),f=0,c=o.Childs(),h=c.length;f<h;f++)s=c[f],a.JS.AddOuterPolyNodeToExPolygons(s,t);t.push(r)};a.JS.ExPolygonsToPaths=function(e){var t,r,n,i,o=new a.Paths;for(t=0,n=e.length;t<n;t++)for(o.push(e[t].outer),r=0,i=e[t].holes.length;r<i;r++)o.push(e[t].holes[r]);return o};a.JS.PolyTreeToExPolygons=function(e){var t=new a.ExPolygons,r,n,i,o;for(n=0,i=e.Childs(),o=i.length;n<o;n++)r=i[n],a.JS.AddOuterPolyNodeToExPolygons(r,t);return t};Ir.exports=a});d();var An=class An{constructor(){p(this,"_subscribers",{});p(this,"_destroyed",!1)}publish(t,r){!this._subscribers||!this._subscribers[t]||this._destroyed||this._subscribers[t].forEach(function(n){typeof n=="function"&&n(r)})}on(t,r){(!this._subscribers||this._destroyed)&&(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(r)}off(t,r){if(!this._subscribers||this._subscribers[t]==null||this._destroyed)return;let n=this._subscribers[t].indexOf(r);n!==-1&&this._subscribers[t].splice(n,1)}destroy(){this._destroyed=!0,this._subscribers={}}};l(An,"PubSub");var rr=An;d();d();var Ln="[MappedinJS]";function nl(e="",{prefix:t=Ln}={}){let r="".concat(t).concat(e?"-".concat(e):""),n=l((i,o)=>{if(typeof window<"u"&&window.rnDebug){let s=o.map(u=>u instanceof Error&&u.stack?"".concat(u.message,"\n").concat(u.stack):u);window.rnDebug("".concat(e," ").concat(i,": ").concat(s.join(" ")))}},"rnDebug");return{logState:T.env.NODE_ENV==="test"?3:0,log(...i){this.logState<=0&&(console.log(r,...i),n("log",i))},warn(...i){this.logState<=1&&(console.warn(r,...i),n("warn",i))},error(...i){this.logState<=2&&(console.error(r,...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)}}}l(nl,"createLogger");var il=nl();var q=il;d();function ol(e,t){return"".concat(t," ").concat(e)}l(ol,"formatMessage");var Dn=class Dn extends Error{constructor(t,r=Ln){super(ol(t,r)),this.name="MappedinError"}};l(Dn,"MappedinError");var Nr=Dn;d();d();var kn=class kn extends Error{};l(kn,"InvalidTokenError");var Nn=kn;Nn.prototype.name="InvalidTokenError";d();var et=63710088e-1;d();function sl(e,t,r,n){return(e<t||e>r)&&q.warn(n),Math.min(r,Math.max(t,e))}l(sl,"clampWithWarning");d();function al(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}l(al,"arraysEqual");function kr(e){return e*(Math.PI/180)}l(kr,"toRadians");function fm(e,t){let r=Math.pow(10,t);return Math.sign(e)*Math.round(Math.abs(e)*r)/r}l(fm,"round");function Go(e,t){return(e%t+t)%t}l(Go,"euclideanModulo");function cm([e,t],[r,n]){let i=kr(n-t),o=kr(r-e),s=kr(t),u=kr(n),f=Math.sin(i/2)*Math.sin(i/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(s)*Math.cos(u),c=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return et*c}l(cm,"haversineDistance");function pm(e,t){let r=Go(e,Math.PI*2),n=Go(t,Math.PI*2),i=n-r,o=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:r,end:o}}l(pm,"shortestTweenRotation");function ll(e){return e instanceof Lr?Number.isFinite(e.min.x)&&Number.isFinite(e.min.y)&&Number.isFinite(e.max.x)&&Number.isFinite(e.max.y):Number.isFinite(e.min.x)&&Number.isFinite(e.min.y)&&Number.isFinite(e.max.x)&&Number.isFinite(e.max.y)&&Number.isFinite(e.min.z)&&Number.isFinite(e.max.z)}l(ll,"isFiniteBox");d();d();var Br=class Br extends Error{constructor(r){super(r);p(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,Br)}};l(Br,"AssertionError");var Bn=Br;function Vo(e,t){if(e==null){let r;if(t!=null&&t.customMessage)r=t.customMessage;else{let o=t!=null&&t.valueName?"'".concat(t.valueName,"'"):"value";r="Expected ".concat(o," to be defined, but received ").concat(e)}let n=(t==null?void 0:t.errorClass)||Bn,i=new n(r);throw(t==null?void 0:t.captureStackTrace)!==!1&&Error.captureStackTrace&&Error.captureStackTrace(i,Vo),i}}l(Vo,"assertExists");function Pm(e,t,r){if(Vo(e),(e==null?void 0:e.type)!==t){let n="Expected type ".concat(t," but got ").concat(e==null?void 0:e.type);throw new Error(r!=null?r:n)}}l(Pm,"assertType");d();var Rn=[0,4,6,8,10],Me=l(()=>{let e=new Array(16).fill(0),t=Math.random()*4294967296;for(let n=0;n<e.length;n++)n>0&&(n&3)===0&&(t=Math.random()*4294967296),e[n]=t>>>((n&3)<<3)&255;let r=e.map(n=>n.toString(16).padStart(2,"0"));return r[6]="4"+r[6][1],r[8]=["8","9","a","b"].includes(r[7][0])?r[7]:"a"+r[7][1],Rn.map((n,i)=>r.slice(n,i===Rn.length-1?void 0:Rn[i+1]).join("")).join("-")},"randomId");d();d();var ul=new Set(Object.keys(xe.NAMES));var fl=l(e=>ul.has(e.toLowerCase()),"isX11Color"),cl=l(e=>{if(!e.startsWith("#"))return!1;let t=e.slice(1);if(t.length!==3&&t.length!==6)return!1;for(let r=0;r<t.length;r++)if(!(t[r]>="0"&&t[r]<="9"||t[r]>="A"&&t[r]<="F"||t[r]>="a"&&t[r]<="f"))return!1;return!0},"isHexColor"),pl=l(e=>{if(!e.startsWith("rgb(")&&!e.startsWith("rgba("))return!1;let t=e.indexOf("("),r=e.lastIndexOf(")");if(t===-1||r===-1||r<=t||r!==e.length-1)return!1;let n=e.slice(t+1,r).split(",");if(n.length!==3&&n.length!==4)return!1;for(let i=0;i<n.length;i++){let o=n[i].trim();if(i<3)if(o.endsWith("%")){let s=parseFloat(o.slice(0,-1));if(isNaN(s)||s<0||s>100)return!1}else{let s=parseInt(o,10);if(isNaN(s)||s<0||s>255)return!1}else{let s=parseFloat(o);if(isNaN(s)||s<0||s>1)return!1}}return!0},"isRgbColor"),hl=l(e=>{if(!e.startsWith("hsl(")&&!e.startsWith("hsla("))return!1;let t=e.indexOf("("),r=e.lastIndexOf(")");if(t===-1||r===-1||r<=t||r!==e.length-1)return!1;let n=e.slice(t+1,r).split(",");if(n.length!==3&&n.length!==4)return!1;for(let i=0;i<n.length;i++){let o=n[i].trim();if(i===0){let s=parseFloat(o);if(isNaN(s))return!1}else if(i<3){if(!o.endsWith("%"))return!1;let s=parseFloat(o.slice(0,-1));if(isNaN(s)||s<0||s>100)return!1}else{let s=parseFloat(o);if(isNaN(s)||s<0||s>1)return!1}}return!0},"isHslColor"),Rr=l(e=>e==null||typeof e!="string"?!1:!!(cl(e)||pl(e)||hl(e)||fl(e)),"isColor");d();var Wo=["ease-in","ease-out","ease-in-out","linear"];var Ho=l(e=>e,"linearEase"),dl=l(e=>e*e,"quadEaseIn"),ml=l(e=>1-Math.cos(e*Math.PI/2),"easeIn"),yl=l(e=>1-(1-e)*(1-e),"quadEaseOut"),jo={linear:Ho,"ease-in":dl,"ease-out":yl,"ease-in-out":ml};function Rm(e,t,r,n,i,o=Ho){if(t===r)return i;e=Math.max(t,Math.min(e,r));let s=(e-Math.min(t,r))/Math.abs(r-t),u=typeof o=="function"?o(s):jo[o](s);return n+u*(i-n)}l(Rm,"interpolate");function gl(e,t){let r=0;if(t.length<2)return r;let i=t[0]<t[1]?(o,s)=>o>s:(o,s)=>o<s;for(;r<t.length-1&&i(e,t[r+1]);)r++;return r>t.length-2?Math.max(0,t.length-2):r}l(gl,"getInterpolationBreakpoint");function Xm(e,t,r,n="ease-in"){if(t.length!==r.length)throw new Nr("Input and output ranges must have the same number of values.");e=Math.max(t[0],Math.min(e,t[t.length-1]));let i=gl(e,t),o=(e-t[i])/(t[i+1]-t[i]),s=typeof n=="function"?n(o):jo[n](o);return r[i]+s*(r[i+1]-r[i])}l(Xm,"interpolateMulti");d();function Xr(e){return(e%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}l(Xr,"normalizeAngle");d();d();d();d();d();d();d();d();var Q=63710088e-1,sy={centimeters:Q*100,centimetres:Q*100,degrees:Q/111325,feet:Q*3.28084,inches:Q*39.37,kilometers:Q/1e3,kilometres:Q/1e3,meters:Q,metres:Q,miles:Q/1609.344,millimeters:Q*1e3,millimetres:Q*1e3,nauticalmiles:Q/1852,radians:1,yards:Q*1.0936},ay={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Q,yards:1.0936133};function Ge(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}l(Ge,"feature");function vl(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Uo(e[0])||!Uo(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return Ge(n,t,r)}l(vl,"point");function ly(e,t,r){r===void 0&&(r={});for(var n=0,i=e;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var u={type:"Polygon",coordinates:e};return Ge(u,t,r)}l(ly,"polygon");function xl(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return Ge(n,t,r)}l(xl,"lineString");function uy(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}l(uy,"featureCollection");function fy(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return Ge(n,t,r)}l(fy,"multiLineString");function cy(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return Ge(n,t,r)}l(cy,"multiPolygon");function Uo(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}l(Uo,"isNumber");function Xn(e,t,r){if(e!==null)for(var n,i,o,s,u,f,c,h=0,m=0,g,b=e.type,_=b==="FeatureCollection",I=b==="Feature",O=_?e.features.length:1,A=0;A<O;A++){c=_?e.features[A].geometry:I?e.geometry:e,g=c?c.type==="GeometryCollection":!1,u=g?c.geometries.length:1;for(var R=0;R<u;R++){var N=0,U=0;if(s=g?c.geometries[R]:c,s!==null){f=s.coordinates;var V=s.type;switch(h=r&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(f,m,A,N,U)===!1)return!1;m++,N++;break;case"LineString":case"MultiPoint":for(n=0;n<f.length;n++){if(t(f[n],m,A,N,U)===!1)return!1;m++,V==="MultiPoint"&&N++}V==="LineString"&&N++;break;case"Polygon":case"MultiLineString":for(n=0;n<f.length;n++){for(i=0;i<f[n].length-h;i++){if(t(f[n][i],m,A,N,U)===!1)return!1;m++}V==="MultiLineString"&&N++,V==="Polygon"&&U++}V==="Polygon"&&N++;break;case"MultiPolygon":for(n=0;n<f.length;n++){for(U=0,i=0;i<f[n].length;i++){for(o=0;o<f[n][i].length-h;o++){if(t(f[n][i][o],m,A,N,U)===!1)return!1;m++}U++}N++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Xn(s.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}l(Xn,"coordEach");function gy(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}l(gy,"featureEach");function bl(e,t){var r,n,i,o,s,u,f,c,h,m,g=0,b=e.type==="FeatureCollection",_=e.type==="Feature",I=b?e.features.length:1;for(r=0;r<I;r++){for(u=b?e.features[r].geometry:_?e.geometry:e,c=b?e.features[r].properties:_?e.properties:{},h=b?e.features[r].bbox:_?e.bbox:void 0,m=b?e.features[r].id:_?e.id:void 0,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1,i=0;i<s;i++){if(o=f?u.geometries[i]:u,o===null){if(t(null,g,c,h,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,c,h,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],g,c,h,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}l(bl,"geomEach");function vy(e,t){bl(e,function(r,n,i,o,s){var u=r===null?null:r.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return t(Ge(r,i,{bbox:o,id:s}),n,0)===!1?!1:void 0}var f;switch(u){case"MultiPoint":f="Point";break;case"MultiLineString":f="LineString";break;case"MultiPolygon":f="Polygon";break}for(var c=0;c<r.coordinates.length;c++){var h=r.coordinates[c],m={type:f,coordinates:h};if(t(Ge(m,i),n,c)===!1)return!1}})}l(vy,"flattenEach");function Yn(e){var t=[1/0,1/0,-1/0,-1/0];return Xn(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}l(Yn,"bbox");Yn.default=Yn;var zo=Yn;function qo(e){return zo(e)}l(qo,"getBoundingBoxFromFeature");d();d();d();d();d();var Fn=class Fn{constructor(){p(this,"hover",!1);p(this,"dirty",!1)}};l(Fn,"InteractionComponent");var Mt=Fn;d();d();d();d();var v={};rl(v,{BRAND:()=>Ul,DIRTY:()=>tt,EMPTY_PATH:()=>Cl,INVALID:()=>L,NEVER:()=>Mu,OK:()=>K,ParseStatus:()=>$,Schema:()=>B,ZodAny:()=>He,ZodArray:()=>Ne,ZodBigInt:()=>it,ZodBoolean:()=>ot,ZodBranded:()=>fr,ZodCatch:()=>yt,ZodDate:()=>st,ZodDefault:()=>mt,ZodDiscriminatedUnion:()=>Wr,ZodEffects:()=>ye,ZodEnum:()=>ht,ZodError:()=>re,ZodFirstPartyTypeKind:()=>D,ZodFunction:()=>jr,ZodIntersection:()=>ft,ZodIssueCode:()=>P,ZodLazy:()=>ct,ZodLiteral:()=>pt,ZodMap:()=>Xt,ZodNaN:()=>Ft,ZodNativeEnum:()=>dt,ZodNever:()=>be,ZodNull:()=>lt,ZodNullable:()=>Ee,ZodNumber:()=>nt,ZodObject:()=>ne,ZodOptional:()=>de,ZodParsedType:()=>S,ZodPipeline:()=>cr,ZodPromise:()=>je,ZodReadonly:()=>gt,ZodRecord:()=>Hr,ZodSchema:()=>B,ZodSet:()=>Yt,ZodString:()=>We,ZodSymbol:()=>Bt,ZodTransformer:()=>ye,ZodTuple:()=>Se,ZodType:()=>B,ZodUndefined:()=>at,ZodUnion:()=>ut,ZodUnknown:()=>De,ZodVoid:()=>Rt,addIssueToContext:()=>C,any:()=>tu,array:()=>ou,bigint:()=>Jl,boolean:()=>os,coerce:()=>Ou,custom:()=>rs,date:()=>$l,datetimeRegex:()=>es,defaultErrorMap:()=>Ae,discriminatedUnion:()=>uu,effect:()=>Pu,enum:()=>vu,function:()=>mu,getErrorMap:()=>At,getParsedType:()=>Ie,instanceof:()=>ql,intersection:()=>fu,isAborted:()=>Gr,isAsync:()=>Lt,isDirty:()=>Vr,isValid:()=>Ve,late:()=>zl,lazy:()=>yu,literal:()=>gu,makeIssue:()=>nr,map:()=>hu,nan:()=>Zl,nativeEnum:()=>xu,never:()=>nu,null:()=>eu,nullable:()=>Tu,number:()=>is,object:()=>su,objectUtil:()=>Gn,oboolean:()=>wu,onumber:()=>Eu,optional:()=>_u,ostring:()=>Su,pipeline:()=>Iu,preprocess:()=>Cu,promise:()=>bu,quotelessJson:()=>Pl,record:()=>pu,set:()=>du,setErrorMap:()=>Tl,strictObject:()=>au,string:()=>ns,symbol:()=>Kl,transformer:()=>Pu,tuple:()=>cu,undefined:()=>Ql,union:()=>lu,unknown:()=>ru,util:()=>Y,void:()=>iu});d();d();d();d();d();var Y;(function(e){e.assertEqual=i=>{};function t(i){}l(t,"assertIs"),e.assertIs=t;function r(i){throw new Error}l(r,"assertNever"),e.assertNever=r,e.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(let u of o)s[u]=i[u];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(let s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?"'".concat(s,"'"):s).join(o)}l(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Y||(Y={}));var Gn;(function(e){e.mergeShapes=(t,r)=>y(y({},t),r)})(Gn||(Gn={}));var S=Y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ie=l(e=>{switch(typeof e){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(e)?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(e)?S.array:e===null?S.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?S.promise:typeof Map<"u"&&e instanceof Map?S.map:typeof Set<"u"&&e instanceof Set?S.set:typeof Date<"u"&&e instanceof Date?S.date:S.object;default:return S.unknown}},"getParsedType");var P=Y.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"]),Pl=l(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Yr=class Yr 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(o){return o.message},n={_errors:[]},i=l(o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let u=n,f=0;for(;f<s.path.length;){let c=s.path[f];f===s.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(r(s))):u[c]=u[c]||{_errors:[]},u=u[c],f++}}},"processError");return i(this),n}static assert(t){if(!(t instanceof Yr))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,Y.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()}};l(Yr,"ZodError");var re=Yr;re.create=e=>new re(e);var _l=l((e,t)=>{let r;switch(e.code){case P.invalid_type:e.received===S.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case P.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,Y.jsonStringifyReplacer));break;case P.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(Y.joinValues(e.keys,", "));break;case P.invalid_union:r="Invalid input";break;case P.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(Y.joinValues(e.options));break;case P.invalid_enum_value:r="Invalid enum value. Expected ".concat(Y.joinValues(e.options),", received '").concat(e.received,"'");break;case P.invalid_arguments:r="Invalid function arguments";break;case P.invalid_return_type:r="Invalid function return type";break;case P.invalid_date:r="Invalid date";break;case P.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,'"'):Y.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case P.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 P.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 P.custom:r="Invalid input";break;case P.invalid_intersection_types:r="Intersection results could not be merged";break;case P.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case P.not_finite:r="Number must be finite";break;default:r=t.defaultError,Y.assertNever(e)}return{message:r}},"errorMap"),Ae=_l;var Zo=Ae;function Tl(e){Zo=e}l(Tl,"setErrorMap");function At(){return Zo}l(At,"getErrorMap");d();var nr=l(e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s=M(y({},i),{path:o});if(i.message!==void 0)return M(y({},i),{path:o,message:i.message});let u="",f=n.filter(c=>!!c).slice().reverse();for(let c of f)u=c(s,{data:t,defaultError:u}).message;return M(y({},i),{path:o,message:u})},"makeIssue"),Cl=[];function C(e,t){let r=At(),n=nr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ae?void 0:Ae].filter(i=>!!i)});e.common.issues.push(n)}l(C,"addIssueToContext");var Fr=class Fr{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 L;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 o=await i.key,s=await i.value;n.push({key:o,value:s})}return Fr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return L;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:t.value,value:n}}};l(Fr,"ParseStatus");var $=Fr,L=Object.freeze({status:"aborted"}),tt=l(e=>({status:"dirty",value:e}),"DIRTY"),K=l(e=>({status:"valid",value:e}),"OK"),Gr=l(e=>e.status==="aborted","isAborted"),Vr=l(e=>e.status==="dirty","isDirty"),Ve=l(e=>e.status==="valid","isValid"),Lt=l(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");d();d();d();var E;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(E||(E={}));var Hn=class Hn{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}};l(Hn,"ParseInputLazyPath");var me=Hn,Jo=l((e,t)=>{if(Ve(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 re(e.common.issues);return this._error=r,this._error}}},"handleResult");function k(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:l((s,u)=>{var c,h;let{message:f}=e;return s.code==="invalid_enum_value"?{message:f!=null?f:u.defaultError}:typeof u.data>"u"?{message:(c=f!=null?f:n)!=null?c:u.defaultError}:s.code!=="invalid_type"?{message:u.defaultError}:{message:(h=f!=null?f:r)!=null?h:u.defaultError}},"customMap"),description:i}}l(k,"processCreateParams");var jn=class jn{get description(){return this._def.description}_getType(t){return Ie(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ie(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new $,ctx:{common:t.parent.common,data:t.data,parsedType:Ie(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Lt(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 o;let n={common:{issues:[],async:(o=r==null?void 0:r.async)!=null?o:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ie(t)},i=this._parseSync({data:t,path:n.path,parent:n});return Jo(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:Ie(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:r});return Ve(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(i=(n=o==null?void 0:o.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(o=>Ve(o)?{value:o.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:Ie(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(Lt(i)?i:Promise.resolve(i));return Jo(n,o)}refine(t,r){let n=l(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,o)=>{let s=t(i),u=l(()=>o.addIssue(y({code:P.custom},n(i))),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(f=>f?!0:(u(),!1)):s?!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 ye({schema:this,typeName:D.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:l(r=>this["~validate"](r),"validate")}}optional(){return de.create(this,this._def)}nullable(){return Ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ne.create(this)}promise(){return je.create(this,this._def)}or(t){return ut.create([this,t],this._def)}and(t){return ft.create(this,t,this._def)}transform(t){return new ye(M(y({},k(this._def)),{schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let r=typeof t=="function"?t:()=>t;return new mt(M(y({},k(this._def)),{innerType:this,defaultValue:r,typeName:D.ZodDefault}))}brand(){return new fr(y({typeName:D.ZodBranded,type:this},k(this._def)))}catch(t){let r=typeof t=="function"?t:()=>t;return new yt(M(y({},k(this._def)),{innerType:this,catchValue:r,typeName:D.ZodCatch}))}describe(t){let r=this.constructor;return new r(M(y({},this._def),{description:t}))}pipe(t){return cr.create(this,t)}readonly(){return gt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l(jn,"ZodType");var B=jn,Il=/^c[^\s-]{8,}$/i,Sl=/^[0-9a-z]+$/,El=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wl=/^[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,Ol=/^[a-z0-9_-]{21}$/i,Ml=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Al=/^[-+]?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)?)??$/,Ll=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vn,Nl=/^(?:(?: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])$/,kl=/^(?:(?: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])$/,Bl=/^(([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]))$/,Rl=/^(([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])$/,Xl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ko="((\\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])))",Fl=new RegExp("^".concat(Ko,"$"));function Qo(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)}l(Qo,"timeRegexSource");function Gl(e){return new RegExp("^".concat(Qo(e),"$"))}l(Gl,"timeRegex");function es(e){let t="".concat(Ko,"T").concat(Qo(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,"$"))}l(es,"datetimeRegex");function Vl(e,t){return!!((t==="v4"||!t)&&Nl.test(e)||(t==="v6"||!t)&&Bl.test(e))}l(Vl,"isValidIP");function Wl(e,t){if(!Ml.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}}l(Wl,"isValidJWT");function Hl(e,t){return!!((t==="v4"||!t)&&kl.test(e)||(t==="v6"||!t)&&Rl.test(e))}l(Hl,"isValidCidr");var rt=class rt extends B{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==S.string){let o=this._getOrReturnCtx(t);return C(o,{code:P.invalid_type,expected:S.string,received:o.parsedType}),L}let n=new $,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),C(i,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),C(i,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=t.data.length>o.value,u=t.data.length<o.value;(s||u)&&(i=this._getOrReturnCtx(t,i),s?C(i,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&C(i,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Ll.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"email",code:P.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Vn||(Vn=new RegExp(Dl,"u")),Vn.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"emoji",code:P.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")wl.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"uuid",code:P.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Ol.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"nanoid",code:P.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Il.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"cuid",code:P.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Sl.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"cuid2",code:P.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")El.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"ulid",code:P.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch(s){i=this._getOrReturnCtx(t,i),C(i,{validation:"url",code:P.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"regex",code:P.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),C(i,{code:P.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),C(i,{code:P.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),C(i,{code:P.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?es(o).test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{code:P.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Fl.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{code:P.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Gl(o).test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{code:P.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Al.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"duration",code:P.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Vl(t.data,o.version)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"ip",code:P.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Wl(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"jwt",code:P.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Hl(t.data,o.version)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"cidr",code:P.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Xl.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"base64",code:P.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Yl.test(t.data)||(i=this._getOrReturnCtx(t,i),C(i,{validation:"base64url",code:P.invalid_string,message:o.message}),n.dirty()):Y.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),y({validation:r,code:P.invalid_string},E.errToObj(n)))}_addCheck(t){return new rt(M(y({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(y({kind:"email"},E.errToObj(t)))}url(t){return this._addCheck(y({kind:"url"},E.errToObj(t)))}emoji(t){return this._addCheck(y({kind:"emoji"},E.errToObj(t)))}uuid(t){return this._addCheck(y({kind:"uuid"},E.errToObj(t)))}nanoid(t){return this._addCheck(y({kind:"nanoid"},E.errToObj(t)))}cuid(t){return this._addCheck(y({kind:"cuid"},E.errToObj(t)))}cuid2(t){return this._addCheck(y({kind:"cuid2"},E.errToObj(t)))}ulid(t){return this._addCheck(y({kind:"ulid"},E.errToObj(t)))}base64(t){return this._addCheck(y({kind:"base64"},E.errToObj(t)))}base64url(t){return this._addCheck(y({kind:"base64url"},E.errToObj(t)))}jwt(t){return this._addCheck(y({kind:"jwt"},E.errToObj(t)))}ip(t){return this._addCheck(y({kind:"ip"},E.errToObj(t)))}cidr(t){return this._addCheck(y({kind:"cidr"},E.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(y({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},E.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(y({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},E.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(y({kind:"duration"},E.errToObj(t)))}regex(t,r){return this._addCheck(y({kind:"regex",regex:t},E.errToObj(r)))}includes(t,r){return this._addCheck(y({kind:"includes",value:t,position:r==null?void 0:r.position},E.errToObj(r==null?void 0:r.message)))}startsWith(t,r){return this._addCheck(y({kind:"startsWith",value:t},E.errToObj(r)))}endsWith(t,r){return this._addCheck(y({kind:"endsWith",value:t},E.errToObj(r)))}min(t,r){return this._addCheck(y({kind:"min",value:t},E.errToObj(r)))}max(t,r){return this._addCheck(y({kind:"max",value:t},E.errToObj(r)))}length(t,r){return this._addCheck(y({kind:"length",value:t},E.errToObj(r)))}nonempty(t){return this.min(1,E.errToObj(t))}trim(){return new rt(M(y({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new rt(M(y({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new rt(M(y({},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}};l(rt,"ZodString");var We=rt;We.create=e=>{var t;return new We(y({checks:[],typeName:D.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},k(e)))};function jl(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}l(jl,"floatSafeRemainder");var or=class or extends B{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)!==S.number){let o=this._getOrReturnCtx(t);return C(o,{code:P.invalid_type,expected:S.number,received:o.parsedType}),L}let n,i=new $;for(let o of this._def.checks)o.kind==="int"?Y.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),C(n,{code:P.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),C(n,{code:P.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),C(n,{code:P.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?jl(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),C(n,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),C(n,{code:P.not_finite,message:o.message}),i.dirty()):Y.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,E.toString(r))}gt(t,r){return this.setLimit("min",t,!1,E.toString(r))}lte(t,r){return this.setLimit("max",t,!0,E.toString(r))}lt(t,r){return this.setLimit("max",t,!1,E.toString(r))}setLimit(t,r,n,i){return new or(M(y({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:E.toString(i)}]}))}_addCheck(t){return new or(M(y({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:E.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:E.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:E.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.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"&&Y.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)}};l(or,"ZodNumber");var nt=or;nt.create=e=>new nt(y({checks:[],typeName:D.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},k(e)));var sr=class sr extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(o){return this._getInvalidInput(t)}if(this._getType(t)!==S.bigint)return this._getInvalidInput(t);let n,i=new $;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),C(n,{code:P.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),C(n,{code:P.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),C(n,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Y.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return C(r,{code:P.invalid_type,expected:S.bigint,received:r.parsedType}),L}gte(t,r){return this.setLimit("min",t,!0,E.toString(r))}gt(t,r){return this.setLimit("min",t,!1,E.toString(r))}lte(t,r){return this.setLimit("max",t,!0,E.toString(r))}lt(t,r){return this.setLimit("max",t,!1,E.toString(r))}setLimit(t,r,n,i){return new sr(M(y({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:E.toString(i)}]}))}_addCheck(t){return new sr(M(y({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:E.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}};l(sr,"ZodBigInt");var it=sr;it.create=e=>{var t;return new it(y({checks:[],typeName:D.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},k(e)))};var Un=class Un extends B{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==S.boolean){let n=this._getOrReturnCtx(t);return C(n,{code:P.invalid_type,expected:S.boolean,received:n.parsedType}),L}return K(t.data)}};l(Un,"ZodBoolean");var ot=Un;ot.create=e=>new ot(y({typeName:D.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},k(e)));var Ur=class Ur extends B{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==S.date){let o=this._getOrReturnCtx(t);return C(o,{code:P.invalid_type,expected:S.date,received:o.parsedType}),L}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return C(o,{code:P.invalid_date}),L}let n=new $,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),C(i,{code:P.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),C(i,{code:P.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Y.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ur(M(y({},this._def),{checks:[...this._def.checks,t]}))}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:E.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:E.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}};l(Ur,"ZodDate");var st=Ur;st.create=e=>new st(y({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:D.ZodDate},k(e)));var zn=class zn extends B{_parse(t){if(this._getType(t)!==S.symbol){let n=this._getOrReturnCtx(t);return C(n,{code:P.invalid_type,expected:S.symbol,received:n.parsedType}),L}return K(t.data)}};l(zn,"ZodSymbol");var Bt=zn;Bt.create=e=>new Bt(y({typeName:D.ZodSymbol},k(e)));var qn=class qn extends B{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return C(n,{code:P.invalid_type,expected:S.undefined,received:n.parsedType}),L}return K(t.data)}};l(qn,"ZodUndefined");var at=qn;at.create=e=>new at(y({typeName:D.ZodUndefined},k(e)));var Zn=class Zn extends B{_parse(t){if(this._getType(t)!==S.null){let n=this._getOrReturnCtx(t);return C(n,{code:P.invalid_type,expected:S.null,received:n.parsedType}),L}return K(t.data)}};l(Zn,"ZodNull");var lt=Zn;lt.create=e=>new lt(y({typeName:D.ZodNull},k(e)));var Jn=class Jn extends B{constructor(){super(...arguments),this._any=!0}_parse(t){return K(t.data)}};l(Jn,"ZodAny");var He=Jn;He.create=e=>new He(y({typeName:D.ZodAny},k(e)));var $n=class $n extends B{constructor(){super(...arguments),this._unknown=!0}_parse(t){return K(t.data)}};l($n,"ZodUnknown");var De=$n;De.create=e=>new De(y({typeName:D.ZodUnknown},k(e)));var Kn=class Kn extends B{_parse(t){let r=this._getOrReturnCtx(t);return C(r,{code:P.invalid_type,expected:S.never,received:r.parsedType}),L}};l(Kn,"ZodNever");var be=Kn;be.create=e=>new be(y({typeName:D.ZodNever},k(e)));var Qn=class Qn extends B{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return C(n,{code:P.invalid_type,expected:S.void,received:n.parsedType}),L}return K(t.data)}};l(Qn,"ZodVoid");var Rt=Qn;Rt.create=e=>new Rt(y({typeName:D.ZodVoid},k(e)));var Nt=class Nt extends B{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==S.array)return C(r,{code:P.invalid_type,expected:S.array,received:r.parsedType}),L;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,u=r.data.length<i.exactLength.value;(s||u)&&(C(r,{code:s?P.too_big:P.too_small,minimum:u?i.exactLength.value:void 0,maximum:s?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&&(C(r,{code:P.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&&(C(r,{code:P.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((s,u)=>i.type._parseAsync(new me(r,s,r.path,u)))).then(s=>$.mergeArray(n,s));let o=[...r.data].map((s,u)=>i.type._parseSync(new me(r,s,r.path,u)));return $.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Nt(M(y({},this._def),{minLength:{value:t,message:E.toString(r)}}))}max(t,r){return new Nt(M(y({},this._def),{maxLength:{value:t,message:E.toString(r)}}))}length(t,r){return new Nt(M(y({},this._def),{exactLength:{value:t,message:E.toString(r)}}))}nonempty(t){return this.min(1,t)}};l(Nt,"ZodArray");var Ne=Nt;Ne.create=(e,t)=>new Ne(y({type:e,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray},k(t)));function Dt(e){if(e instanceof ne){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=de.create(Dt(n))}return new ne(M(y({},e._def),{shape:l(()=>t,"shape")}))}else return e instanceof Ne?new Ne(M(y({},e._def),{type:Dt(e.element)})):e instanceof de?de.create(Dt(e.unwrap())):e instanceof Ee?Ee.create(Dt(e.unwrap())):e instanceof Se?Se.create(e.items.map(t=>Dt(t))):e}l(Dt,"deepPartialify");var ae=class ae extends B{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=Y.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==S.object){let c=this._getOrReturnCtx(t);return C(c,{code:P.invalid_type,expected:S.object,received:c.parsedType}),L}let{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),u=[];if(!(this._def.catchall instanceof be&&this._def.unknownKeys==="strip"))for(let c in i.data)s.includes(c)||u.push(c);let f=[];for(let c of s){let h=o[c],m=i.data[c];f.push({key:{status:"valid",value:c},value:h._parse(new me(i,m,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof be){let c=this._def.unknownKeys;if(c==="passthrough")for(let h of u)f.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(c==="strict")u.length>0&&(C(i,{code:P.unrecognized_keys,keys:u}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let h of u){let m=i.data[h];f.push({key:{status:"valid",value:h},value:c._parse(new me(i,m,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let h of f){let m=await h.key,g=await h.value;c.push({key:m,value:g,alwaysSet:h.alwaysSet})}return c}).then(c=>$.mergeObjectSync(n,c)):$.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return E.errToObj,new ae(y(M(y({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:l((r,n)=>{var o,s,u,f;let i=(u=(s=(o=this._def).errorMap)==null?void 0:s.call(o,r,n).message)!=null?u:n.defaultError;return r.code==="unrecognized_keys"?{message:(f=E.errToObj(t).message)!=null?f:i}:{message:i}},"errorMap")}:{}))}strip(){return new ae(M(y({},this._def),{unknownKeys:"strip"}))}passthrough(){return new ae(M(y({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new ae(M(y({},this._def),{shape:l(()=>y(y({},this._def.shape()),t),"shape")}))}merge(t){return new ae({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:l(()=>y(y({},this._def.shape()),t._def.shape()),"shape"),typeName:D.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ae(M(y({},this._def),{catchall:t}))}pick(t){let r={};for(let n of Y.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ae(M(y({},this._def),{shape:l(()=>r,"shape")}))}omit(t){let r={};for(let n of Y.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new ae(M(y({},this._def),{shape:l(()=>r,"shape")}))}deepPartial(){return Dt(this)}partial(t){let r={};for(let n of Y.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new ae(M(y({},this._def),{shape:l(()=>r,"shape")}))}required(t){let r={};for(let n of Y.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof de;)o=o._def.innerType;r[n]=o}return new ae(M(y({},this._def),{shape:l(()=>r,"shape")}))}keyof(){return ts(Y.objectKeys(this.shape))}};l(ae,"ZodObject");var ne=ae;ne.create=(e,t)=>new ne(y({shape:l(()=>e,"shape"),unknownKeys:"strip",catchall:be.create(),typeName:D.ZodObject},k(t)));ne.strictCreate=(e,t)=>new ne(y({shape:l(()=>e,"shape"),unknownKeys:"strict",catchall:be.create(),typeName:D.ZodObject},k(t)));ne.lazycreate=(e,t)=>new ne(y({shape:e,unknownKeys:"strip",catchall:be.create(),typeName:D.ZodObject},k(t)));var ei=class ei extends B{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(o){for(let u of o)if(u.result.status==="valid")return u.result;for(let u of o)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let s=o.map(u=>new re(u.ctx.common.issues));return C(r,{code:P.invalid_union,unionErrors:s}),L}if(l(i,"handleResults"),r.common.async)return Promise.all(n.map(async o=>{let s=M(y({},r),{common:M(y({},r.common),{issues:[]}),parent:null});return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let f of n){let c=M(y({},r),{common:M(y({},r.common),{issues:[]}),parent:null}),h=f._parseSync({data:r.data,path:r.path,parent:c});if(h.status==="valid")return h;h.status==="dirty"&&!o&&(o={result:h,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let u=s.map(f=>new re(f));return C(r,{code:P.invalid_union,unionErrors:u}),L}}get options(){return this._def.options}};l(ei,"ZodUnion");var ut=ei;ut.create=(e,t)=>new ut(y({options:e,typeName:D.ZodUnion},k(t)));var Le=l(e=>e instanceof ct?Le(e.schema):e instanceof ye?Le(e.innerType()):e instanceof pt?[e.value]:e instanceof ht?e.options:e instanceof dt?Y.objectValues(e.enum):e instanceof mt?Le(e._def.innerType):e instanceof at?[void 0]:e instanceof lt?[null]:e instanceof de?[void 0,...Le(e.unwrap())]:e instanceof Ee?[null,...Le(e.unwrap())]:e instanceof fr||e instanceof gt?Le(e.unwrap()):e instanceof yt?Le(e._def.innerType):[],"getDiscriminator"),zr=class zr extends B{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.object)return C(r,{code:P.invalid_type,expected:S.object,received:r.parsedType}),L;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(C(r,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}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 o of r){let s=Le(o.shape[t]);if(!s.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let u of s){if(i.has(u))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(u)));i.set(u,o)}}return new zr(y({typeName:D.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i},k(n)))}};l(zr,"ZodDiscriminatedUnion");var Wr=zr;function Wn(e,t){let r=Ie(e),n=Ie(t);if(e===t)return{valid:!0,data:e};if(r===S.object&&n===S.object){let i=Y.objectKeys(t),o=Y.objectKeys(e).filter(u=>i.indexOf(u)!==-1),s=y(y({},e),t);for(let u of o){let f=Wn(e[u],t[u]);if(!f.valid)return{valid:!1};s[u]=f.data}return{valid:!0,data:s}}else if(r===S.array&&n===S.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let s=e[o],u=t[o],f=Wn(s,u);if(!f.valid)return{valid:!1};i.push(f.data)}return{valid:!0,data:i}}else return r===S.date&&n===S.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}l(Wn,"mergeValues");var ti=class ti extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=l((o,s)=>{if(Gr(o)||Gr(s))return L;let u=Wn(o.value,s.value);return u.valid?((Vr(o)||Vr(s))&&r.dirty(),{status:r.value,value:u.data}):(C(n,{code:P.invalid_intersection_types}),L)},"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(([o,s])=>i(o,s)):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}))}};l(ti,"ZodIntersection");var ft=ti;ft.create=(e,t,r)=>new ft(y({left:e,right:t,typeName:D.ZodIntersection},k(r)));var qr=class qr extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.array)return C(n,{code:P.invalid_type,expected:S.array,received:n.parsedType}),L;if(n.data.length<this._def.items.length)return C(n,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L;!this._def.rest&&n.data.length>this._def.items.length&&(C(n,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,u)=>{let f=this._def.items[u]||this._def.rest;return f?f._parse(new me(n,s,n.path,u)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>$.mergeArray(r,s)):$.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new qr(M(y({},this._def),{rest:t}))}};l(qr,"ZodTuple");var Se=qr;Se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Se(y({items:e,typeName:D.ZodTuple,rest:null},k(t)))};var ar=class ar extends B{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!==S.object)return C(n,{code:P.invalid_type,expected:S.object,received:n.parsedType}),L;let i=[],o=this._def.keyType,s=this._def.valueType;for(let u in n.data)i.push({key:o._parse(new me(n,u,n.path,u)),value:s._parse(new me(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?$.mergeObjectAsync(r,i):$.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof B?new ar(y({keyType:t,valueType:r,typeName:D.ZodRecord},k(n))):new ar(y({keyType:We.create(),valueType:t,typeName:D.ZodRecord},k(r)))}};l(ar,"ZodRecord");var Hr=ar,ri=class ri extends B{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!==S.map)return C(n,{code:P.invalid_type,expected:S.map,received:n.parsedType}),L;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([u,f],c)=>({key:i._parse(new me(n,u,n.path,[c,"key"])),value:o._parse(new me(n,f,n.path,[c,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let f of s){let c=await f.key,h=await f.value;if(c.status==="aborted"||h.status==="aborted")return L;(c.status==="dirty"||h.status==="dirty")&&r.dirty(),u.set(c.value,h.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let f of s){let c=f.key,h=f.value;if(c.status==="aborted"||h.status==="aborted")return L;(c.status==="dirty"||h.status==="dirty")&&r.dirty(),u.set(c.value,h.value)}return{status:r.value,value:u}}}};l(ri,"ZodMap");var Xt=ri;Xt.create=(e,t,r)=>new Xt(y({valueType:t,keyType:e,typeName:D.ZodMap},k(r)));var lr=class lr extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.set)return C(n,{code:P.invalid_type,expected:S.set,received:n.parsedType}),L;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(C(n,{code:P.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&&(C(n,{code:P.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(f){let c=new Set;for(let h of f){if(h.status==="aborted")return L;h.status==="dirty"&&r.dirty(),c.add(h.value)}return{status:r.value,value:c}}l(s,"finalizeSet");let u=[...n.data.values()].map((f,c)=>o._parse(new me(n,f,n.path,c)));return n.common.async?Promise.all(u).then(f=>s(f)):s(u)}min(t,r){return new lr(M(y({},this._def),{minSize:{value:t,message:E.toString(r)}}))}max(t,r){return new lr(M(y({},this._def),{maxSize:{value:t,message:E.toString(r)}}))}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};l(lr,"ZodSet");var Yt=lr;Yt.create=(e,t)=>new Yt(y({valueType:e,minSize:null,maxSize:null,typeName:D.ZodSet},k(t)));var kt=class kt extends B{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.function)return C(r,{code:P.invalid_type,expected:S.function,received:r.parsedType}),L;function n(u,f){return nr({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ae].filter(c=>!!c),issueData:{code:P.invalid_arguments,argumentsError:f}})}l(n,"makeArgsIssue");function i(u,f){return nr({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ae].filter(c=>!!c),issueData:{code:P.invalid_return_type,returnTypeError:f}})}l(i,"makeReturnsIssue");let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof je){let u=this;return K(async function(...f){let c=new re([]),h=await u._def.args.parseAsync(f,o).catch(b=>{throw c.addIssue(n(f,b)),c}),m=await Reflect.apply(s,this,h);return await u._def.returns._def.type.parseAsync(m,o).catch(b=>{throw c.addIssue(i(m,b)),c})})}else{let u=this;return K(function(...f){let c=u._def.args.safeParse(f,o);if(!c.success)throw new re([n(f,c.error)]);let h=Reflect.apply(s,this,c.data),m=u._def.returns.safeParse(h,o);if(!m.success)throw new re([i(h,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new kt(M(y({},this._def),{args:Se.create(t).rest(De.create())}))}returns(t){return new kt(M(y({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new kt(y({args:t||Se.create([]).rest(De.create()),returns:r||De.create(),typeName:D.ZodFunction},k(n)))}};l(kt,"ZodFunction");var jr=kt,ni=class ni extends B{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})}};l(ni,"ZodLazy");var ct=ni;ct.create=(e,t)=>new ct(y({getter:e,typeName:D.ZodLazy},k(t)));var ii=class ii extends B{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return C(r,{received:r.data,code:P.invalid_literal,expected:this._def.value}),L}return{status:"valid",value:t.data}}get value(){return this._def.value}};l(ii,"ZodLiteral");var pt=ii;pt.create=(e,t)=>new pt(y({value:e,typeName:D.ZodLiteral},k(t)));function ts(e,t){return new ht(y({values:e,typeName:D.ZodEnum},k(t)))}l(ts,"createZodEnum");var ur=class ur extends B{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return C(r,{expected:Y.joinValues(n),received:r.parsedType,code:P.invalid_type}),L}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 C(r,{received:r.data,code:P.invalid_enum_value,options:n}),L}return K(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 ur.create(t,y(y({},this._def),r))}exclude(t,r=this._def){return ur.create(this.options.filter(n=>!t.includes(n)),y(y({},this._def),r))}};l(ur,"ZodEnum");var ht=ur;ht.create=ts;var oi=class oi extends B{_parse(t){let r=Y.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==S.string&&n.parsedType!==S.number){let i=Y.objectValues(r);return C(n,{expected:Y.joinValues(i),received:n.parsedType,code:P.invalid_type}),L}if(this._cache||(this._cache=new Set(Y.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=Y.objectValues(r);return C(n,{received:n.data,code:P.invalid_enum_value,options:i}),L}return K(t.data)}get enum(){return this._def.values}};l(oi,"ZodNativeEnum");var dt=oi;dt.create=(e,t)=>new dt(y({values:e,typeName:D.ZodNativeEnum},k(t)));var si=class si extends B{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.promise&&r.common.async===!1)return C(r,{code:P.invalid_type,expected:S.promise,received:r.parsedType}),L;let n=r.parsedType===S.promise?r.data:Promise.resolve(r.data);return K(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};l(si,"ZodPromise");var je=si;je.create=(e,t)=>new je(y({type:e,typeName:D.ZodPromise},k(t)));var ai=class ai extends B{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:l(s=>{C(n,s),s.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async u=>{if(r.value==="aborted")return L;let f=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return f.status==="aborted"?L:f.status==="dirty"?tt(f.value):r.value==="dirty"?tt(f.value):f});{if(r.value==="aborted")return L;let u=this._def.schema._parseSync({data:s,path:n.path,parent:n});return u.status==="aborted"?L:u.status==="dirty"?tt(u.value):r.value==="dirty"?tt(u.value):u}}if(i.type==="refinement"){let s=l(u=>{let f=i.refinement(u,o);if(n.common.async)return Promise.resolve(f);if(f 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"?L:(u.status==="dirty"&&r.dirty(),s(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"?L:(u.status==="dirty"&&r.dirty(),s(u.value).then(()=>({status:r.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ve(s))return L;let u=i.transform(s.value,o);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(s=>Ve(s)?Promise.resolve(i.transform(s.value,o)).then(u=>({status:r.value,value:u})):L);Y.assertNever(i)}};l(ai,"ZodEffects");var ye=ai;ye.create=(e,t,r)=>new ye(y({schema:e,typeName:D.ZodEffects,effect:t},k(r)));ye.createWithPreprocess=(e,t,r)=>new ye(y({schema:t,effect:{type:"preprocess",transform:e},typeName:D.ZodEffects},k(r)));var li=class li extends B{_parse(t){return this._getType(t)===S.undefined?K(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};l(li,"ZodOptional");var de=li;de.create=(e,t)=>new de(y({innerType:e,typeName:D.ZodOptional},k(t)));var ui=class ui extends B{_parse(t){return this._getType(t)===S.null?K(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};l(ui,"ZodNullable");var Ee=ui;Ee.create=(e,t)=>new Ee(y({innerType:e,typeName:D.ZodNullable},k(t)));var fi=class fi extends B{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};l(fi,"ZodDefault");var mt=fi;mt.create=(e,t)=>new mt(y({innerType:e,typeName:D.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},k(t)));var ci=class ci extends B{_parse(t){let{ctx:r}=this._processInputParams(t),n=M(y({},r),{common:M(y({},r.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:y({},n)});return Lt(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new re(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};l(ci,"ZodCatch");var yt=ci;yt.create=(e,t)=>new yt(y({innerType:e,typeName:D.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},k(t)));var pi=class pi extends B{_parse(t){if(this._getType(t)!==S.nan){let n=this._getOrReturnCtx(t);return C(n,{code:P.invalid_type,expected:S.nan,received:n.parsedType}),L}return{status:"valid",value:t.data}}};l(pi,"ZodNaN");var Ft=pi;Ft.create=e=>new Ft(y({typeName:D.ZodNaN},k(e)));var Ul=Symbol("zod_brand"),hi=class hi extends B{_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}};l(hi,"ZodBranded");var fr=hi,Zr=class Zr extends B{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return l(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?L:o.status==="dirty"?(r.dirty(),tt(o.value)):this._def.out._parseAsync({data:o.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"?L: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 Zr({in:t,out:r,typeName:D.ZodPipeline})}};l(Zr,"ZodPipeline");var cr=Zr,di=class di extends B{_parse(t){let r=this._def.innerType._parse(t),n=l(i=>(Ve(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return Lt(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};l(di,"ZodReadonly");var gt=di;gt.create=(e,t)=>new gt(y({innerType:e,typeName:D.ZodReadonly},k(t)));function $o(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}l($o,"cleanParams");function rs(e,t={},r){return e?He.create().superRefine((n,i)=>{var s,u;let o=e(n);if(o instanceof Promise)return o.then(f=>{var c,h;if(!f){let m=$o(t,n),g=(h=(c=m.fatal)!=null?c:r)!=null?h:!0;i.addIssue(M(y({code:"custom"},m),{fatal:g}))}});if(!o){let f=$o(t,n),c=(u=(s=f.fatal)!=null?s:r)!=null?u:!0;i.addIssue(M(y({code:"custom"},f),{fatal:c}))}}):He.create()}l(rs,"custom");var zl={object:ne.lazycreate},D;(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"})(D||(D={}));var ql=l((e,t={message:"Input not instance of ".concat(e.name)})=>rs(r=>r instanceof e,t),"instanceOfType"),ns=We.create,is=nt.create,Zl=Ft.create,Jl=it.create,os=ot.create,$l=st.create,Kl=Bt.create,Ql=at.create,eu=lt.create,tu=He.create,ru=De.create,nu=be.create,iu=Rt.create,ou=Ne.create,su=ne.create,au=ne.strictCreate,lu=ut.create,uu=Wr.create,fu=ft.create,cu=Se.create,pu=Hr.create,hu=Xt.create,du=Yt.create,mu=jr.create,yu=ct.create,gu=pt.create,vu=ht.create,xu=dt.create,bu=je.create,Pu=ye.create,_u=de.create,Tu=Ee.create,Cu=ye.createWithPreprocess,Iu=cr.create,Su=l(()=>ns().optional(),"ostring"),Eu=l(()=>is().optional(),"onumber"),wu=l(()=>os().optional(),"oboolean"),Ou={string:l(e=>We.create(M(y({},e),{coerce:!0})),"string"),number:l(e=>nt.create(M(y({},e),{coerce:!0})),"number"),boolean:l(e=>ot.create(M(y({},e),{coerce:!0})),"boolean"),bigint:l(e=>it.create(M(y({},e),{coerce:!0})),"bigint"),date:l(e=>st.create(M(y({},e),{coerce:!0})),"date")};var Mu=L;var ss=v;var Ue=ss;var as=v.union([v.enum(["low","medium","high","always-visible"]),v.number()]),ls=["","","low","medium","high","always-visible"],Au=2,Lu=3;var Du=5;function us(e){return Math.min(Du,Math.max(Au,e))}l(us,"clampTierNumber");function Gt(e){if(typeof e=="number")return us(e);let t=ls.indexOf(e);return t===-1?Lu:t}l(Gt,"convertCollisionRankingTierToNumber");function Sg(e){let t=us(e);return ls[t]}l(Sg,"convertNumberToCollisionRankingTier");d();d();d();var Nu=Ue.enum(Wo),ku=l(e=>{let t=e[0];for(let r=1;r<e.length;r++){let n=e[r];if(n<=t)return!1;t=n}return!0},"isStrictlyIncreasing"),Bu=l(e=>{let t=e[0];for(let r=1;r<e.length;r++){let n=e[r];if(n>=t)return!1;t=n}return!0},"isStrictlyDecreasing"),Ru=l(e=>ku(e)||Bu(e),"isStrictlyIncreasingOrDecreasing"),fs=Ue.object({on:Ue.literal("zoom-level"),input:Ue.array(Ue.number()).nonempty().refine(Ru,{message:"input array must be strictly increasing or decreasing"}),output:Ue.array(Ue.number()).nonempty(),easing:Nu.default("linear")}).refine(e=>e.input.length===e.output.length,{message:"input and output must have the same length"});d();function Jr(e){"@babel/helpers - typeof";return Jr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(e)}l(Jr,"_typeof");var Xu=/^\s+/,Yu=/\s+$/;function w(e,t){if(e=e||"",t=t||{},e instanceof w)return e;if(!(this instanceof w))return new w(e,t);var r=Fu(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}l(w,"tinycolor");w.prototype={isDark:l(function(){return this.getBrightness()<128},"isDark"),isLight:l(function(){return!this.isDark()},"isLight"),isValid:l(function(){return this._ok},"isValid"),getOriginalInput:l(function(){return this._originalInput},"getOriginalInput"),getFormat:l(function(){return this._format},"getFormat"),getAlpha:l(function(){return this._a},"getAlpha"),getBrightness:l(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:l(function(){var t=this.toRgb(),r,n,i,o,s,u;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),i<=.03928?u=i/12.92:u=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*s+.0722*u},"getLuminance"),setAlpha:l(function(t){return this._a=gs(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:l(function(){var t=ps(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:l(function(){var t=ps(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:l(function(){var t=cs(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:l(function(){var t=cs(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:l(function(t){return hs(this._r,this._g,this._b,t)},"toHex"),toHexString:l(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:l(function(t){return Hu(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:l(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:l(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:l(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:l(function(){return{r:Math.round(j(this._r,255)*100)+"%",g:Math.round(j(this._g,255)*100)+"%",b:Math.round(j(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:l(function(){return this._a==1?"rgb("+Math.round(j(this._r,255)*100)+"%, "+Math.round(j(this._g,255)*100)+"%, "+Math.round(j(this._b,255)*100)+"%)":"rgba("+Math.round(j(this._r,255)*100)+"%, "+Math.round(j(this._g,255)*100)+"%, "+Math.round(j(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:l(function(){return this._a===0?"transparent":this._a<1?!1:rf[hs(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:l(function(t){var r="#"+ds(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var o=w(t);n="#"+ds(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},"toFilter"),toString:l(function(t){var r=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,o=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:l(function(){return w(this.toString())},"clone"),_applyModification:l(function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:l(function(){return this._applyModification(qu,arguments)},"lighten"),brighten:l(function(){return this._applyModification(Zu,arguments)},"brighten"),darken:l(function(){return this._applyModification(Ju,arguments)},"darken"),desaturate:l(function(){return this._applyModification(ju,arguments)},"desaturate"),saturate:l(function(){return this._applyModification(Uu,arguments)},"saturate"),greyscale:l(function(){return this._applyModification(zu,arguments)},"greyscale"),spin:l(function(){return this._applyModification($u,arguments)},"spin"),_applyCombination:l(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:l(function(){return this._applyCombination(ef,arguments)},"analogous"),complement:l(function(){return this._applyCombination(Ku,arguments)},"complement"),monochromatic:l(function(){return this._applyCombination(tf,arguments)},"monochromatic"),splitcomplement:l(function(){return this._applyCombination(Qu,arguments)},"splitcomplement"),triad:l(function(){return this._applyCombination(ms,[3])},"triad"),tetrad:l(function(){return this._applyCombination(ms,[4])},"tetrad")};w.fromRatio=function(e,t){if(Jr(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=pr(e[n]));e=r}return w(e,t)};function Fu(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,o=null,s=!1,u=!1;return typeof e=="string"&&(e=af(e)),Jr(e)=="object"&&(ke(e.r)&&ke(e.g)&&ke(e.b)?(t=Gu(e.r,e.g,e.b),s=!0,u=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ke(e.h)&&ke(e.s)&&ke(e.v)?(n=pr(e.s),i=pr(e.v),t=Wu(e.h,n,i),s=!0,u="hsv"):ke(e.h)&&ke(e.s)&&ke(e.l)&&(n=pr(e.s),o=pr(e.l),t=Vu(e.h,n,o),s=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=gs(r),{ok:s,format:e.format||u,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}l(Fu,"inputToRGB");function Gu(e,t,r){return{r:j(e,255)*255,g:j(t,255)*255,b:j(r,255)*255}}l(Gu,"rgbToRgb");function cs(e,t,r){e=j(e,255),t=j(t,255),r=j(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),o,s,u=(n+i)/2;if(n==i)o=s=0;else{var f=n-i;switch(s=u>.5?f/(2-n-i):f/(n+i),n){case e:o=(t-r)/f+(t<r?6:0);break;case t:o=(r-e)/f+2;break;case r:o=(e-t)/f+4;break}o/=6}return{h:o,s,l:u}}l(cs,"rgbToHsl");function Vu(e,t,r){var n,i,o;e=j(e,360),t=j(t,100),r=j(r,100);function s(c,h,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?c+(h-c)*6*m:m<1/2?h:m<2/3?c+(h-c)*(2/3-m)*6:c}if(l(s,"hue2rgb"),t===0)n=i=o=r;else{var u=r<.5?r*(1+t):r+t-r*t,f=2*r-u;n=s(f,u,e+1/3),i=s(f,u,e),o=s(f,u,e-1/3)}return{r:n*255,g:i*255,b:o*255}}l(Vu,"hslToRgb");function ps(e,t,r){e=j(e,255),t=j(t,255),r=j(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),o,s,u=n,f=n-i;if(s=n===0?0:f/n,n==i)o=0;else{switch(n){case e:o=(t-r)/f+(t<r?6:0);break;case t:o=(r-e)/f+2;break;case r:o=(e-t)/f+4;break}o/=6}return{h:o,s,v:u}}l(ps,"rgbToHsv");function Wu(e,t,r){e=j(e,360)*6,t=j(t,100),r=j(r,100);var n=Math.floor(e),i=e-n,o=r*(1-t),s=r*(1-i*t),u=r*(1-(1-i)*t),f=n%6,c=[r,s,o,o,u,r][f],h=[u,r,r,s,o,o][f],m=[o,o,u,r,r,s][f];return{r:c*255,g:h*255,b:m*255}}l(Wu,"hsvToRgb");function hs(e,t,r,n){var i=[_e(Math.round(e).toString(16)),_e(Math.round(t).toString(16)),_e(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}l(hs,"rgbToHex");function Hu(e,t,r,n,i){var o=[_e(Math.round(e).toString(16)),_e(Math.round(t).toString(16)),_e(Math.round(r).toString(16)),_e(vs(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}l(Hu,"rgbaToHex");function ds(e,t,r,n){var i=[_e(vs(n)),_e(Math.round(e).toString(16)),_e(Math.round(t).toString(16)),_e(Math.round(r).toString(16))];return i.join("")}l(ds,"rgbaToArgbHex");w.equals=function(e,t){return!e||!t?!1:w(e).toRgbString()==w(t).toRgbString()};w.random=function(){return w.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ju(e,t){t=t===0?0:t||10;var r=w(e).toHsl();return r.s-=t/100,r.s=$r(r.s),w(r)}l(ju,"_desaturate");function Uu(e,t){t=t===0?0:t||10;var r=w(e).toHsl();return r.s+=t/100,r.s=$r(r.s),w(r)}l(Uu,"_saturate");function zu(e){return w(e).desaturate(100)}l(zu,"_greyscale");function qu(e,t){t=t===0?0:t||10;var r=w(e).toHsl();return r.l+=t/100,r.l=$r(r.l),w(r)}l(qu,"_lighten");function Zu(e,t){t=t===0?0:t||10;var r=w(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),w(r)}l(Zu,"_brighten");function Ju(e,t){t=t===0?0:t||10;var r=w(e).toHsl();return r.l-=t/100,r.l=$r(r.l),w(r)}l(Ju,"_darken");function $u(e,t){var r=w(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,w(r)}l($u,"_spin");function Ku(e){var t=w(e).toHsl();return t.h=(t.h+180)%360,w(t)}l(Ku,"_complement");function ms(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=w(e).toHsl(),n=[w(e)],i=360/t,o=1;o<t;o++)n.push(w({h:(r.h+o*i)%360,s:r.s,l:r.l}));return n}l(ms,"polyad");function Qu(e){var t=w(e).toHsl(),r=t.h;return[w(e),w({h:(r+72)%360,s:t.s,l:t.l}),w({h:(r+216)%360,s:t.s,l:t.l})]}l(Qu,"_splitcomplement");function ef(e,t,r){t=t||6,r=r||30;var n=w(e).toHsl(),i=360/r,o=[w(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,o.push(w(n));return o}l(ef,"_analogous");function tf(e,t){t=t||6;for(var r=w(e).toHsv(),n=r.h,i=r.s,o=r.v,s=[],u=1/t;t--;)s.push(w({h:n,s:i,v:o})),o=(o+u)%1;return s}l(tf,"_monochromatic");w.mix=function(e,t,r){r=r===0?0:r||50;var n=w(e).toRgb(),i=w(t).toRgb(),o=r/100,s={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a};return w(s)};w.readability=function(e,t){var r=w(e),n=w(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};w.isReadable=function(e,t,r){var n=w.readability(e,t),i,o;switch(o=!1,i=lf(r),i.level+i.size){case"AAsmall":case"AAAlarge":o=n>=4.5;break;case"AAlarge":o=n>=3;break;case"AAAsmall":o=n>=7;break}return o};w.mostReadable=function(e,t,r){var n=null,i=0,o,s,u,f;r=r||{},s=r.includeFallbackColors,u=r.level,f=r.size;for(var c=0;c<t.length;c++)o=w.readability(e,t[c]),o>i&&(i=o,n=w(t[c]));return w.isReadable(e,n,{level:u,size:f})||!s?n:(r.includeFallbackColors=!1,w.mostReadable(e,["#fff","#000"],r))};var mi=w.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},rf=w.hexNames=nf(mi);function nf(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}l(nf,"flip");function gs(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}l(gs,"boundAlpha");function j(e,t){of(e)&&(e="100%");var r=sf(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}l(j,"bound01");function $r(e){return Math.min(1,Math.max(0,e))}l($r,"clamp01");function le(e){return parseInt(e,16)}l(le,"parseIntFromHex");function of(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}l(of,"isOnePointZero");function sf(e){return typeof e=="string"&&e.indexOf("%")!=-1}l(sf,"isPercentage");function _e(e){return e.length==1?"0"+e:""+e}l(_e,"pad2");function pr(e){return e<=1&&(e=e*100+"%"),e}l(pr,"convertToPercentage");function vs(e){return Math.round(parseFloat(e)*255).toString(16)}l(vs,"convertDecimalToHex");function ys(e){return le(e)/255}l(ys,"convertHexToDecimal");var Pe=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ke(e){return!!Pe.CSS_UNIT.exec(e)}l(ke,"isValidCSSUnit");function af(e){e=e.replace(Xu,"").replace(Yu,"").toLowerCase();var t=!1;if(mi[e])e=mi[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Pe.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Pe.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Pe.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Pe.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Pe.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Pe.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Pe.hex8.exec(e))?{r:le(r[1]),g:le(r[2]),b:le(r[3]),a:ys(r[4]),format:t?"name":"hex8"}:(r=Pe.hex6.exec(e))?{r:le(r[1]),g:le(r[2]),b:le(r[3]),format:t?"name":"hex"}:(r=Pe.hex4.exec(e))?{r:le(r[1]+""+r[1]),g:le(r[2]+""+r[2]),b:le(r[3]+""+r[3]),a:ys(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=Pe.hex3.exec(e))?{r:le(r[1]+""+r[1]),g:le(r[2]+""+r[2]),b:le(r[3]+""+r[3]),format:t?"name":"hex"}:!1}l(af,"stringInputToObject");function lf(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}l(lf,"validateWCAG2Parms");var Z={RIGHT:"right",LEFT:"left",TOP:"top",HIDDEN:"hidden",CENTER:"center"},vt="low-priority",xs=Object.values(Z),yi=[Z.RIGHT,Z.LEFT,Z.TOP,Z.HIDDEN],bs=v.object({margin:v.number().min(6).default(6),maxLines:v.number().min(1).default(2),textSize:v.number().min(0).default(11.5),maxWidth:v.number().min(0).default(150),lineHeight:v.number().min(0).default(1.2),color:v.string().default("#333"),outlineColor:v.string().default("white"),textColor:v.string().optional(),textOutlineColor:v.string().optional(),pinColor:v.string().optional(),pinOutlineColor:v.string().optional(),pinColorInactive:v.string().optional(),pinOutlineColorInactive:v.string().optional(),icon:v.string().optional(),iconSize:v.number().min(0).default(20),iconScale:v.union([v.number(),fs]).default(1),iconPadding:v.number().min(0).default(2),iconFit:v.enum(["fill","contain","cover"]).default("cover"),iconOverflow:v.enum(["visible","hidden"]).default("hidden"),iconVisible:v.union([v.boolean(),v.number()]).default(!0)}),Ps=bs.transform(e=>{var t,r,n,i,o,s,u,f;return M(y({},e),{textColor:(t=e.textColor)!=null?t:e.color,textOutlineColor:(r=e.textOutlineColor)!=null?r:e.outlineColor,pinColor:(n=e.pinColor)!=null?n:e.color,pinOutlineColor:(i=e.pinOutlineColor)!=null?i:e.outlineColor,pinColorInactive:(s=e.pinColorInactive)!=null?s:w((o=e.pinColor)!=null?o:e.color).toRgbString(),pinOutlineColorInactive:(f=e.pinOutlineColorInactive)!=null?f:w((u=e.pinOutlineColor)!=null?u:e.outlineColor).toRgbString()})}),Hg=bs.strict(),_s=l(e=>Ps.parse(e),"parseLabelAppearance"),uf=v.object({rank:as.optional(),appearance:Ps.optional(),interactive:v.boolean().default(!1),textPlacement:v.union([v.enum(xs),v.array(v.enum(xs))]).default(yi)}),gi=l(e=>{uf.parse(e!=null?e:{})},"validateLabelOptions"),jg=l((e,t,r)=>{v.array(v.number()).min(2).max(3).parse(e),v.string().parse(t),gi(r)},"validateLabel"),Ts=["color","outlineColor","margin"],ff=[...Ts,"maxLines","lineHeight","textSize","maxWidth","textColor","textOutlineColor"],cf=[...Ts,"icon","pinColor","pinOutlineColor","pinColorInactive","pinOutlineColorInactive"],Cs=l((e,t)=>ff.some(r=>t[r]!=null&&e[r]!==t[r]),"isOneOfTextDirtyOptions"),Is=l((e,t)=>cf.some(r=>t[r]!=null&&e[r]!==t[r]),"isOneOfPinDirtyOptions");var Ss=4,hf=6,ws=6.5,Kr=ws/2,Es=[Kr,Kr,Kr,Kr],xt=class xt{constructor(t,r,n){p(this,"lines",0);p(this,"id");p(this,"rank");p(this,"type","label");p(this,"initialRank");p(this,"contextConfigured",!1);p(this,"fillText");p(this,"newStyle",{});p(this,"opacity",0);p(this,"visibilityNeedsUpdate",!1);p(this,"activePlacement",Z.RIGHT);p(this,"text");p(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});p(this,"projection",new Oe);p(this,"labelCacheId");p(this,"_cache",{});p(this,"appearance");p(this,"options");p(this,"visible",!0);p(this,"enabled",!0);p(this,"isOccluded",!1);p(this,"offscreen",!1);p(this,"canShow",!1);p(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});p(this,"dimensions",{width:0,height:0});p(this,"currentStrategyIndex",-1);p(this,"totalPinSize",0);p(this,"iconScale",1);p(this,"iconPadding");p(this,"dirty",!0);p(this,"textDirty",!0);p(this,"pinDirty",!0);p(this,"attachedDirty",!0);p(this,"collisionDirty",!0);p(this,"lastTextAlign");p(this,"imageHash");p(this,"pinSize",0);p(this,"iconVisible",!1);p(this,"dp");p(this,"animate",!0);p(this,"onStrategySelected",l(t=>{var n;if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let r=this.strategies[t];if(this.activePlacement=(n=r==null?void 0:r.name)!=null?n:this.activePlacement,r){r.onStrategySelected();let i=this.style;this.style=this.newStyle,this.newStyle=i}},"onStrategySelected"));p(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,s,u;if(this.id=(o=r.id)!=null?o:Me(),this.options=r!=null?r:{},this.text=t,this.dp=(f=1)=>f*n.pixelRatio,typeof r.rank=="string")this.rank=Gt(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let f=Math.trunc(T.env.NODE_ENV==="test"?xt.testId:xt.testId*10)/10;xt.testId+=.001,this.rank=f,this.initialRank=f}this.options.textPlacement=(s=r.textPlacement)!=null?s:yi;let i=_s((u=r.appearance)!=null?u:{});this.appearance=i,this.iconPadding=i.iconPadding}get scaledPinSize(){return this.totalPinSize*this.iconScale}get scaledIconPadding(){return this.appearance.iconPadding*this.iconScale}calculatePinSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.iconSize<"u"&&this.imageHash?this.pinSize=this.dp(this.appearance.iconSize):this.pinSize=this.dp(ws),this.totalPinSize=Math.ceil((this.pinSize+2.5)/t)}getNoTextBbox(t){let r=this.scaledPinSize/2+t;return[r,r,r,r]}getHiddenTextPlacementBbox(t){return this.iconVisible?this.getNoTextBbox(t):Es}getBoundingBoxForPlacement(t){let{width:r,height:n}=this.dimensions,{margin:i}=this.appearance,o=Math.max(hf,i);if(this.text==="")return this.getNoTextBbox(o);let s=Math.max(this.scaledPinSize,n);switch(t){case Z.RIGHT:return[s/2+o,s/2+o,this.scaledPinSize/2+o,this.scaledPinSize/2+r+o];case Z.LEFT:return[s/2+o,s/2+o,this.scaledPinSize/2+r+o,this.scaledPinSize/2+o];case Z.TOP:{let u=this.dp();return[n+this.scaledPinSize/2/u+o,this.scaledPinSize/2+o,r/2+o,r/2+o]}case Z.CENTER:return[n/2+o,n/2+o,r/2+o,r/2+o];case Z.HIDDEN:return this.getHiddenTextPlacementBbox(o);case vt:return Es;default:return this.getNoTextBbox(o)}}getStrategyStyleForPlacement(t){let{width:r,height:n}=this.dimensions;switch(t){case Z.TOP:this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-n-this.scaledPinSize/2,this.newStyle.left=-r/2;return;case Z.LEFT:this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-n/2,this.newStyle.left=-r-this.scaledPinSize/2-Ss,this.newStyle.textLabelVisible=!0;return;case Z.RIGHT:this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-n/2,this.newStyle.left=this.scaledPinSize/2+Ss,this.newStyle.textLabelVisible=!0;return;case Z.CENTER:this.newStyle.pinVisibility=0,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-n/2,this.newStyle.left=-r/2;return;case Z.HIDDEN:this.newStyle.pinVisibility=this.iconVisible?1:.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0;return;case vt:default:this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0;return}}get strategies(){let t=Array.isArray(this.options.textPlacement)?this.options.textPlacement:[this.options.textPlacement],r=[],n=!1;for(let i of t)r.push({name:i,getBoundingBox:l(()=>this.getBoundingBoxForPlacement(i),"getBoundingBox"),onStrategySelected:l(()=>this.getStrategyStyleForPlacement(i),"onStrategySelected")}),i===Z.HIDDEN&&(n=!0);return n&&r.push({name:vt,getBoundingBox:l(()=>this.getBoundingBoxForPlacement(vt),"getBoundingBox"),onStrategySelected:l(()=>this.getStrategyStyleForPlacement(vt),"onStrategySelected")}),r}recomputeCurrentStrategy(t=this.iconScale){if(this.iconScale!==t||this.dirty){let r=this.strategies[this.currentStrategyIndex];if(this.iconScale=t,this.collisionDirty=!0,r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}this.dirty=!1}}toPackedMessage(t=!1){var i;this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank;let r=this.strategies[this.currentStrategyIndex],n=this.text===""||(r==null?void 0:r.name)===Z.HIDDEN||(r==null?void 0:r.name)===vt;if(!n&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==((i=this.packedMessage.bboxes[0])==null?void 0:i[4])){let o=this.packedMessage.bboxes.findIndex(s=>s[4]===this.currentStrategyIndex);if(o!==-1){let s=this.packedMessage.bboxes.splice(o,1)[0];this.packedMessage.bboxes.unshift(s)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let o=0;o<this.strategies.length;o++){let s=this.strategies[o];!n&&o===this.currentStrategyIndex&&this.currentStrategyIndex!==-1?this.packedMessage.bboxes.unshift([...s.getBoundingBox(),o]):this.packedMessage.bboxes.push([...s.getBoundingBox(),o])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};l(xt,"LabelComponent"),p(xt,"testId",0);var vi=xt,Os=vi;d();var ua=Io(ia());d();var oa="0.6",H={TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",CENTER:"center",TOP_LEFT:"top-left",TOP_RIGHT:"top-right",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",HIDDEN:"hidden"},Oi=Object.values(H),sa=[H.CENTER,H.HIDDEN],aa=Object.freeze({size:8,color:"#666"});var Mi=v.object({rank:v.union([v.enum(["low","medium","high","always-visible"]),v.number()]).optional(),interactive:v.union([v.boolean(),v.literal("pointer-events-auto")]).optional(),id:v.string().optional(),placement:v.union([v.enum(Oi),v.array(v.enum(Oi))]).optional(),dynamicResize:v.boolean().optional(),zIndex:v.number().optional(),lowPriorityPin:v.object({size:v.number().positive().optional(),color:v.string().optional()}).optional()});function gv(e,t,r){v.array(v.number()).min(2).max(3).parse(e),v.string().parse(t),Mi.parse(r)}l(gv,"validateMarker");var Tt=class Tt{constructor(t,r={}){p(this,"id");p(this,"type","marker");p(this,"rank",0);p(this,"initialRank",0);p(this,"activePlacement","center");p(this,"pointerEvents","none");p(this,"options",{rank:"low",interactive:!1,id:"",placement:sa,dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:y({},aa)});p(this,"projection",new Oe);p(this,"enabled",!0);p(this,"canShow",!1);p(this,"visible",!0);p(this,"isOccluded",!1);p(this,"offscreen",!1);p(this,"strategyIndex",-1);p(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});p(this,"dimensions",{width:0,height:0});p(this,"markerContainer");p(this,"containerEl");p(this,"contentEl",null);p(this,"contentHtml","");p(this,"style",{top:"0px",left:"0px"});p(this,"dirty",!1);p(this,"attachedDirty",!0);p(this,"collisionDirty",!0);p(this,"visibilityNeedsUpdate","show");p(this,"animation",null);p(this,"currentStrategyIndex",-1);p(this,"onStrategySelected",l((t,r=!1)=>{var i;if(this.currentStrategyIndex===t&&!r)return;this.currentStrategyIndex=t;let n=this.strategies[t];if(this.activePlacement=(i=n==null?void 0:n.name)!=null?i:"center",this.activePlacement===H.HIDDEN){this.markerContainer.setAttribute("data-placement",H.HIDDEN);let o=this.options.lowPriorityPin,s=o.size,u=o.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(s,"px")),this.markerContainer.style.setProperty("--pin-color",u),this.markerContainer.style.opacity=oa,this.style.top=-s/2+"px",this.style.left=-s/2+"px"}else{this.markerContainer.setAttribute("data-placement",this.activePlacement),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:o,height:s}=this.dimensions,u=-s/2+"px",f=-o/2+"px";switch(this.style.top=u,this.style.left=f,this.activePlacement){case H.TOP:{this.style.top=-s+"px";break}case H.BOTTOM:{this.style.top="0px";break}case H.LEFT:{this.style.left=-o+"px";break}case H.RIGHT:{this.style.left="0px";break}case H.TOP_LEFT:{this.style.top=-s+"px",this.style.left=-o+"px";break}case H.TOP_RIGHT:{this.style.top=-s+"px",this.style.left="0px";break}case H.BOTTOM_LEFT:{this.style.top="0px",this.style.left=-o+"px";break}case H.BOTTOM_RIGHT:{this.style.top="0px",this.style.left="0px";break}case H.CENTER:default:this.style.top=u,this.style.left=f}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));p(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,i,o,s;if(this.id=(r==null?void 0:r.id)||Me(),this.options=(0,ua.default)(this.options,r),this.options.placement=(n=r.placement)!=null?n:this.options.placement,typeof r.rank=="string")this.rank=Gt(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let u=Math.trunc(T.env.NODE_ENV==="test"?Tt.testId:Tt.testId*10)/10;Tt.testId+=.001,this.rank=u}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(i=this.markerContainer.firstElementChild)!=null?i:null,this.contentEl=(s=(o=this.markerContainer.firstElementChild)==null?void 0:o.firstElementChild)!=null?s:null}updateDimensions(t,r){if(t!=null&&r!=null)this.dimensions={width:t,height:r};else{let{width:n,height:i}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){let{width:t,height:r}=this.dimensions;return t===0||r===0?[]:(Array.isArray(this.options.placement)?this.options.placement:[this.options.placement]).map(o=>({name:o,getBoundingBox:l(()=>{let s=r/2,u=r/2,f=t/2,c=t/2;switch(o){case H.TOP:{s=r,u=0;break}case H.BOTTOM:{s=0,u=r;break}case H.LEFT:{f=t,c=0;break}case H.RIGHT:{f=0,c=t;break}case H.TOP_LEFT:{s=r,f=t,u=0,c=0;break}case H.TOP_RIGHT:{s=r,c=t,u=0,f=0;break}case H.BOTTOM_LEFT:{u=r,f=t,s=0,c=0;break}case H.BOTTOM_RIGHT:{u=r,c=t,s=0,f=0;break}case H.HIDDEN:let h=Math.max(2,4/2);return[this.options.lowPriorityPin.size/2+h,this.options.lowPriorityPin.size/2+h,this.options.lowPriorityPin.size/2+h,this.options.lowPriorityPin.size/2+h]}return[s+4,u+4,f+4,c+4]},"getBoundingBox")}))}toPackedMessage(t=!1){var n;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let i=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(i!==-1){let o=this.packedMessage.bboxes.splice(i,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let i=0;i<this.strategies.length;i++){let o=this.strategies[i];i===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),i]):this.packedMessage.bboxes.push([...o.getBoundingBox(),i])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){return this.options.rank==="always-visible"?-1:this.strategies.findIndex(t=>t.name===H.HIDDEN)}destroy(){}};l(Tt,"MarkerComponent"),p(Tt,"testId",0);var la=Tt;d();var Ai=class Ai extends he{constructor(){super(...arguments);p(this,"type","geometry");p(this,"userData",{entityId:"",type:"geometry"})}raycast(r,n){this.userData.type==="model"&&this.children[0]&&r.intersectObject(this.children[0],!0).forEach(i=>{n.push(i)})}};l(Ai,"Geometry3DObject3D");var Ct=Ai,Li=class Li{constructor(t,r){p(this,"id",Me());p(this,"components");p(this,"parentId");p(this,"entities2D",new Map);this.components=[t,r]}get object3d(){return this.components[0].mesh}get parentObject3D(){var t;return(t=this.components[0].mesh)==null?void 0:t.parent}get type(){return this.components[0].type}attach(t){this.parentObject3D instanceof ie?t.object3d.userData.attachedEntityId=this.id:this.entities2D.set(t.id,t)}detach(t){this.parentObject3D instanceof ie&&(t.object3d.userData.parentEntityId=void 0),this.entities2D.delete(t.id)}removeAllEntities(){for(let t of this.entities2D.values())this.detach(t)}};l(Li,"Geometry3D");var ue=Li;d();var Di=class Di extends he{};l(Di,"Geometry2DObject3D");var we=Di,Ni=class Ni{constructor(t,r,n=0){p(this,"id");p(this,"verticalOffset");p(this,"occluderId");p(this,"object3d",new we);p(this,"components");p(this,"disposed",!1);p(this,"worldPosition",new z);this.id=t.id||Me(),this.components=[t],this.verticalOffset=n,this.object3d=new we,this.object3d.position.set(r.x,r.y,r.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type,this.positionDirty=!0}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.positionDirty&&(this.object3d.matrixAutoUpdate=!0,this.object3d.getWorldPosition(this.worldPosition),this.positionDirty=!1,this.object3d.matrixAutoUpdate=!1),this.worldPosition}get positionDirty(){return this.object3d.userData.worldPositionDirty}set positionDirty(t){this.object3d.userData.worldPositionDirty=t}updatePosition(t){this.object3d.position.copy(t),this.positionDirty=!0}setAltitude(t){this.object3d.position.z=t,this.positionDirty=!0}};l(Ni,"Geometry2D");var Xe=Ni;d();d();var Xi=class Xi extends rr{constructor(r,n,i=!0){super();p(this,"rendererState");p(this,"convertTo3DMapPosition");p(this,"textSet",new Set);p(this,"batchedTextMap",new Map);p(this,"useWorker",!0);p(this,"debugTextAreaMesh",new Map);i===!1&&(this.useWorker=!1,sp(!1)),this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var u,f,c;let n,i,o,s=[];for(let h of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(h),(n==null?void 0:n.type)==="text3d"){i=n.components[0],o=n.components[1];let m=(u=i.mesh)==null?void 0:u.parent;if(!m||!(m instanceof oe)||!(i instanceof un))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((c=(f=i.feature.properties)==null?void 0:f.textArea)==null?void 0:c.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,br().then(({BatchedText:_})=>{let I=new _;return I.type="batchedtext",m.add(I),I}));let b=this.batchedTextMap.get(m);if(!b)throw new Error("batched text required");s.push(ca({entityId:h,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(i.mesh!=null&&i.textMesh==null&&i.mesh.parent!=null){if(this.textSet.has(h.toString()))continue;this.textSet.add(h.toString()),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,br().then(({BatchedText:_})=>{let I=new _;return I.type="batchedtext",m.add(I),I}));let b=this.batchedTextMap.get(m);if(!b)throw new Error("batched text required");s.push(ca({entityId:h,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let g=this.batchedTextMap.get(m);i.textMesh&&g&&i.polygonEntityId!=null&&Promise.all([g,Promise.resolve({meshComponent:i,styleComponent:o})]).then(([b,{meshComponent:_,styleComponent:I}])=>{let{textMesh:O}=_;if(b&&O){let A=Ri(b,O);_.visible&&!A?b.add(O):!_.visible&&A&&b.remove(O)}I.flipToFaceCamera&&this.flipIfNeeded(_,r)})}return Promise.all(s)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let o=i.rotation.z,s=Xr(o+n);s>Math.PI/2&&s<3*Math.PI/2&&(i.rotation.z=Xr(o+Math.PI))}showTextAreaMesh(){let r,n;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),(r==null?void 0:r.type)==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let o=n.feature.properties.textArea;if(!o)continue;let s=new Yo(o.maxWidth,o.maxHeight),u=new Fe(s,new Qe({color:"pink"})),{textMesh:f}=n;if(!f)continue;let c=this.convertTo3DMapPosition(o.position,xr);u.position.copy(c),u.position.z=f.position.z-.1,u.rotation.z=f.rotation.z,ki.identity(),ki.makeRotationAxis(new z(0,0,1),f.userData.rotationZ),xr.set(o.maxWidth/2,0,0),xr.applyMatrix4(ki),u.position.x-=xr.x,u.position.y-=xr.y,this.rendererState.entityScene.add(u),this.debugTextAreaMesh.set(i,u)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};l(Xi,"Text3DSystem");var fa=Xi;function sp(e){br().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}l(sp,"configureWorker");var ki=new Ke,xr=new z,Bi;function br(){return Bi||(Bi=import("./text3d-YQOBP3BF.js").then(e=>e)),Bi}l(br,"getText3DService");async function ca({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:o,type:s="text-area"}){return Promise.all([br(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:u,createTroikaTextArea:f},c])=>s==="text-area"?f(c.entityId,c.meshComponent,c.styleComponent,n):u(c.entityId,c.meshComponent,c.styleComponent,n)).catch(u=>{q.warn("Trouble creating text: ",u)}).then(u=>{if(!(u!=null&&u.text))return;let f=[Promise.resolve(u.text),i,Promise.resolve()];if(t.polygonEntityId){let c=o.geometry3DMap.get(t.polygonEntityId);if((c==null?void 0:c.type)==="geometry"){let h=c.components[0],m=c.components[1];h.textMesh=u.text,u.text.position.z=m.altitude+m.height+ap}}else f[2]=br().then(({syncText:c})=>c(u.text));return Promise.all(f)}).then(u=>{if(!u)return;let[f,c]=u;c.add(f),t.batchedText||(t.batchedText=c)})}l(ca,"createText");function Ri(e,t){return e._members.has(t)}l(Ri,"doesBatchedTextContainsText");var ap=.5;var lp=v.object({visible:v.boolean(),color:v.string(),flipToFaceCamera:v.boolean(),font:v.string().optional(),fontSize:v.number(),margin:v.union([v.number(),v.tuple([v.number(),v.number(),v.number(),v.number()])]),outlineColor:v.string(),outlineOpacity:v.number(),outlineBlur:v.union([v.number(),v.string()]),outlineWidth:v.number(),outlineOffsetX:v.number(),outlineOffsetY:v.number(),strokeWidth:v.number(),maxWidth:v.number().optional(),maxHeight:v.number().optional(),strokeOpacity:v.number(),strokeColor:v.string(),fillOpacity:v.number(),hoverColor:v.string().optional(),id:v.union([v.string(),v.number()]),type:v.literal("text3d"),position:v.tuple([v.number(),v.number(),v.number()]),content:v.string()}),pa=lp.partial().omit({id:!0,type:!0}).strict(),ha=pa.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Hv=v.object({appearance:pa.optional(),parentId:v.string().optional()}).strict(),Yi=class Yi{constructor(t){p(this,"mesh",new Ct);p(this,"textMesh");p(this,"type","text3d");p(this,"feature");p(this,"parent");p(this,"batchedText");p(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?Ri(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};l(Yi,"Text3DComponent");var un=Yi;d();var jt,Fi=class Fi{constructor(t){p(this,"color");p(this,"dirty",!0);p(this,"enabled",!0);Te(this,jt,!1);p(this,"edgeColors");p(this,"edgeVisibility");p(this,"geometry");p(this,"ranges");p(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[this.ranges.start*4+3]:0}set visible(t){if(!this.edgeVisibility||!this.ranges||se(this,jt)===t)return;Ce(this,jt,t);let r=this.edgeVisibility.array,n=t?1:0;for(let i=0;i<this.ranges.count;i++){let o=this.ranges.start+i;r[o]=n}this.edgeVisibility.needsUpdate=!0}get visible(){return se(this,jt)}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[this.ranges.start*4],this.edgeColors.array[this.ranges.start*4+1],this.edgeColors.array[this.ranges.start*4+2]]:[0,0,0]}};jt=new WeakMap,l(Fi,"OutlineComponent");var fn=Fi;d();d();d();var Gi=class Gi extends No{constructor(r){let n=r,i=3,o=i*4;super(new Uint8Array(r*o),i,r,Ao,Mo);p(this,"_width");p(this,"_height");p(this,"_propertiesLength");this._width=o,this._height=n,this._propertiesLength=i}setColor(r,n,i){let o=this.image.data,s=r*this._width;o[s]=Math.round(n.r*255),o[s+1]=Math.round(n.g*255),o[s+2]=Math.round(n.b*255),o[s+3]=0,o[s+4]=Math.round(i.r*255),o[s+5]=Math.round(i.g*255),o[s+6]=Math.round(i.b*255),o[s+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,i=r*this._width,o=new xe(n[i]/255,n[i+1]/255,n[i+2]/255),s=new xe(n[i+4]/255,n[i+5]/255,n[i+6]/255);return{color:o,topColor:s}}setTexture(r,n,i){let o=this.image.data,s=r*this._width;o[s+8]=n?255:0,o[s+9]=i?255:0,o[s+10]=0,o[s+11]=0,this.needsUpdate=!0}getTexture(r){let n=this.image.data,i=r*this._width,o=n[i+8]===255,s=n[i+9]===255;return{texture:o,topTexture:s}}};l(Gi,"BatchedPropertiesTexture");var cn=Gi;d();var da="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying float vVerticalOffset;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\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>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\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\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\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vVerticalOffset = position.z;\n}\n";d();var ma="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying float vVerticalOffset;\nvarying vec3 worldNormal;\n\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>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vVerticalOffset) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\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\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\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\n}\n";var up=-.05,fp=1,Vi=class Vi extends Fo{constructor(r,n,i=1){super(r);p(this,"propertiesTexture");p(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});p(this,"colorSpace",En);p(this,"showTextures",l(r=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,n,i),this.needsUpdate=!0)},"showTextures"));this.alphaTest=.01,this.propertiesTexture=new cn(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=o=>{let s=this.uniforms.uGradientIntensity,u=this.uniforms.uGradientEnd,f=this.uniforms.uGradientStart,c=this.uniforms.uTopTexture,h=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor,g=this.uniforms.uBlendTexture;this.uniforms=o.uniforms,o.vertexShader=da,o.fragmentShader=ma,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:u,uGradientStart:f,uMinSideAlpha:{value:up},uMaxSideAlpha:{value:fp},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:c,uTexture:h,uRepeatYFactor:m,uBlendTexture:g})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=tr,r.wrapT=tr,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=tr,r.wrapT=tr,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?Lo:En,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,n,i){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}getGradientShading(){return{start:this.uniforms.uGradientStart.value,end:this.uniforms.uGradientEnd.value,intensity:this.uniforms.uGradientIntensity.value}}setColor(r,n,i){this.propertiesTexture.setColor(r,n,i)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};l(Vi,"BatchedStandardMaterial");var Pr=Vi;d();var px={top:0,bottom:0,left:0,right:0,type:"pixel"},_r={enabled:!1,thickness:0,size:0,offset:0,segments:3};function hx(e,t){var r,n,i,o,s;return{bevelEnabled:(r=e==null?void 0:e.enabled)!=null?r:_r.enabled,bevelThickness:(n=e==null?void 0:e.thickness)!=null?n:_r.thickness,bevelSize:(i=e==null?void 0:e.size)!=null?i:(e==null?void 0:e.thickness)||_r.size,bevelOffset:(o=e==null?void 0:e.offset)!=null?o:_r.offset,bevelSegments:(s=e==null?void 0:e.segments)!=null?s:_r.segments,depth:t}}l(hx,"createExtrudeSettings");var ya="mappedin";var dx={ALWAYS_ON_TOP:10},mx=250;d();function Nx(e,t){var c,h,m;let r=0;for(let g of e)r+=((h=(c=g.components[0])==null?void 0:c.geometry)==null?void 0:h.attributes.position.count)||0;let n=new xe(t.color),i;i=new Pr({color:n,side:t.side==="back"?wo:t.side==="front"?Eo:Oo,opacity:(m=t.opacity)!=null?m:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let o=new Ut(e.length,r,0,i);o.renderOrder=0;let s,u,f;for(let g of e)s=g.components[0],!(!(s instanceof ze)||!s.geometry)&&(s.mesh=o,s.material=i,s.instanceIndex=o.addGeometry(s.geometry),o.addInstance(s.instanceIndex),o.userData.entities[s.instanceIndex]=g.id,i instanceof Pr&&i.setColor(s.instanceIndex,n,t.topColor?new xe(t.topColor):n),u=o.getGeometryIdAt(s.instanceIndex),s.batchedProps&&(f=o.getGeometryRangeAt(u),f&&(s.batchedProps.range=f),s.batchedProps.geometryId=u));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}l(Nx,"batchGeometries");function Wi(e){return w(e).darken(30).toRgbString()}l(Wi,"darkenColorForOutline");function kx(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let i=e.boundingBox,o=e.getAttribute("position"),s=e.getAttribute("normal"),u=e.getAttribute("uv"),f,c;e.index?(f=e.index.count/3,c=l(function(N,U){return e.index.getX(N*3+U)},"meshIndex")):(f=o.count/3,c=l(function(N,U){return N*3+U},"meshIndex"));let h=new Ke;h.makeRotationFromQuaternion(new wn().setFromEuler(new Mn(0,0,r/180*Math.PI)));let m=t.find(N=>N.face==="top"),g;m&&(g={min:n(m.bounds[1],m.bounds[0],0),max:n(m.bounds[3],m.bounds[2],i.max.z)});let b=t.find(N=>N.face==="side"),_;if(b&&(_={min:n(b.bounds[1],b.bounds[0],0),max:n(b.bounds[3],b.bounds[2],i.max.z)}),!(!_&&!g))for(let N=0;N<f;++N){let U=s.getX(c(N,0))+s.getX(c(N,1))+s.getX(c(N,2)),V=s.getY(c(N,0))+s.getY(c(N,1))+s.getY(c(N,2)),ce=s.getZ(c(N,0))+s.getZ(c(N,1))+s.getZ(c(N,2)),pe=Math.abs(U),Jt=Math.abs(V),Ar=Math.abs(ce);var I,O;pe<=Jt&&pe<=Ar?(I="x",Jt<=Ar?O="y":O="z"):Jt<=pe&&Jt<=Ar?(I="y",pe<=Ar?O="x":O="z"):(I="z",pe<=Jt?O="x":O="y"),I==="z"&&(I=O,O="z");let $t,Kt,Qt,er,Pn,_n;if(O==="z"||I==="z"){if(!b||!_)continue;$t=b.repeat.u,Kt=b.repeat.v,Qt=b.offset.u,er=b.offset.v,Pn=b.rotation,_n=_}else{if(!m||!g)continue;$t=m.repeat.u,Kt=m.repeat.v,Qt=m.offset.u,er=m.offset.v,Pn=(360-r+m.rotation)%360,_n=g}let{min:ve,max:po}=_n,Ot=new he;Ot.position.set(ve.x,ve.y,0),Ot.updateMatrix(),Ot.updateMatrixWorld();let ho=ve.clone().applyMatrix4(h),mo=po.clone().applyMatrix4(h),Ja=Math.abs(mo.x-ho.x),$a=Math.abs(mo.y-ho.y),yo=new z(Ja,$a,po.z).applyMatrix4(Ot.matrixWorld),Tn=Math.abs(yo[I]-ve[I]),Cn=Math.abs(yo[O]-ve[O]),go=Pn*Math.PI/180||0,vo=Math.cos(go),xo=Math.sin(go),Ka=Ot.matrixWorld.clone().invert(),Qa=new wn().setFromEuler(new Mn(0,0,r/180*Math.PI));for(let $e=0;$e<3;$e++){let bo=new z(o.getX(c(N,$e)),o.getY(c(N,$e)),o.getZ(c(N,$e))).applyMatrix4(Ka);bo.applyQuaternion(Qa);let In=bo.applyMatrix4(Ot.matrixWorld),Po=In.x,_o=In.y,To=In.z;var A,R;I==="x"?A=$t*(Po-ve[I])/Tn+Qt:I==="y"?A=$t*(_o-ve[I])/Tn+Qt:A=$t*(To-ve[I])/Tn+Qt,O==="x"?R=Kt*(Po-ve[O])/Cn+er:O==="y"?R=Kt*(_o-ve[O])/Cn+er:R=Kt*(To-ve[O])/Cn+er,A-=.5,R-=.5;let el=A*vo-R*xo+.5,tl=A*xo+R*vo+.5;u.setX(c(N,$e),el),u.setY(c(N,$e),tl)}}}l(kx,"updateUVsLegacy");d();var Hi=class Hi{constructor(){p(this,"focusMesh");p(this,"dirty",!0)}};l(Hi,"FocusableComponent");var pn=Hi;d();var ji=class ji{constructor(){p(this,"dirty",!0);p(this,"needsRebuild",!1);p(this,"mesh")}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}};l(ji,"BorderComponent");var hn=ji;function Tr(e,t,r){if(t!==void 0){if(e.type==="model"||e.type==="path"||e.type==="marker"||e.type==="label"||e.type==="geometry"||e.type==="group-container"||e.type==="custom-geometry")return t===!0?(e instanceof Xe&&e.components[1]===void 0?(e.components[1]=new Mt,e.components[1].dirty=!0):e instanceof ue&&e.components[2]===void 0?(e.components[2]=new Mt,e.components[2].dirty=!0):e instanceof oe&&e.components[0]===void 0&&(e.components[0]=new Mt,e.components[0].dirty=!0),!0):(e instanceof Xe?e.components[1]=void 0:e instanceof ue?e.components[2]=void 0:e instanceof oe&&(e.components[0]=void 0),!0);if(e.type==="geometry-group"){let n;for(let i of e.userData.entities3D.values())n=r.geometry3DMap.get(i),Tr(n,t,r);return!0}}return!1}l(Tr,"updateInteractivity");function lb(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"){let n;for(let i of e.userData.entities3D.values())n=t.geometry3DMap.get(i),n&&ga(n,r);return!0}return!1}}l(lb,"updateGroupColor");function hp(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].shading=t,e.components[1].dirty=!0)}l(hp,"updateShading");function ub(e,t,r){if(r!==void 0&&e.type==="geometry-group"){for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i&&hp(i,r)}return!0}return!1}l(ub,"updateGroupShading");function fb(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}l(fb,"updateImageProps");function dp(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),e.components[5]&&(e.components[5].needsRebuild=!0,e.components[5].dirty=!0),!0}else if(e.type==="geometry-group"){for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&dp(i,t,r)}return!0}}return!1}l(dp,"updateHeight");function ga(e,t){if(t!==void 0){let r=!1;(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&t.initialColor!==e.components[1].initialColor&&(e.components[1].initialColor=t.initialColor,r=!0),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,r=!0,e.components[3]&&(e.components[3].color=Wi(t.color),e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor,r=!0),r&&(e.components[1].dirty=!0))}}l(ga,"updateColor");function cb(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?e.updatePosition(r(t[1],t[0],t[2]||0)):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}l(cb,"updatePosition");function pb(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof oe?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}l(pb,"updateParent");function hb(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}l(hb,"updateEnabled");function db(e,t,r){if(t!==void 0&&e.type==="marker"){let n=e.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(xa(e,t.placement)&&(n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{Mi.parse(t.options||{})}catch(i){return q.error(i),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Tr(e,!1,r)):(n.pointerEvents="none",Tr(e,t.options.interactive,r))),va(e,t.options.rank),!0}}return!1}l(db,"updateMarker");function va(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Gt(t),!0):!1}l(va,"updateRank");function mp(e,t){var n;if(((n=t==null?void 0:t.options)==null?void 0:n.appearance)==null)return;let r=t.options.appearance||{};zi(e.appearance,r)}l(mp,"updateLabelAppearance");function mb(e,t,r){var n,i,o,s,u,f,c;if(t!==void 0&&e.type==="label"){let h=e.components[0];t.text!==void 0&&t.text!==h.text&&(h.text=t.text,h.textDirty=!0);try{gi((n=t.options)!=null?n:{})}catch(m){q.error(m);return}(Cs(h.appearance,((i=t.options)==null?void 0:i.appearance)||{})||((o=t.options)==null?void 0:o.textPlacement)!=null)&&(h.textDirty=!0),Is(h.appearance,((s=t.options)==null?void 0:s.appearance)||{})&&(h.pinDirty=!0),mp(h,t),xa(e,(u=t.options)==null?void 0:u.textPlacement)&&(h.currentStrategyIndex=-1),Tr(e,(f=t.options)==null?void 0:f.interactive,r),va(e,(c=t.options)==null?void 0:c.rank)}}l(mb,"updateLabel");function xa(e,t){if(t!==void 0){if(e.type==="label"){let r=e.components[0];return r.options.textPlacement=t,!0}else if(e.type==="marker"){let r=e.components[0];return r.options.placement=t,!0}}return!1}l(xa,"updatePlacement");function yb(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}l(yb,"updateHoverColor");function gb(e,t){if(t!==void 0){let r=e.components[2];if(e.type==="geometry"&&r!=null)return r.hover=t,r.dirty=!0,!0}return!1}l(gb,"updateHovered");function vb(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}l(vb,"updateFlipImageToFaceCamera");function xb(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].enableImageCollisions=t)}l(xb,"updateEnableImageCollisions");function ba(e,t,r){if(r!==void 0)if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){r!==e.components[1].visible&&(e.components[1].visible=r,e.components[1].dirty=!0);let n=e.components[3];return n&&(n.dirty=!0),!0}else{if(e.type==="geometry-group")return e.setVisible(r),!0;if(e.type==="group-container"){if(e.visible!==r)return e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof we){let i=t.geometry2DMap.get(n.userData.entityId);if(i){let o=i.components[0];o instanceof Os&&(o.canShow=r)}}}),!0}else if(e.type==="label")return e.components[0].visible=r,!0}return!1}l(ba,"updateVisibility");function yp(e,t,r){if(r!==void 0)if(e.type==="geometry-group"){for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&yp(i,t,r)}return!0}else if(e.type==="group-container"){if(e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof oe&&(n=e.parent.opacity),Pa(e,t,n),!0}}else e instanceof ue&&e.components[1].opacity!==r&&(e.components[1].opacity=r,e.components[1].dirty=!0);return!1}l(yp,"updateOpacity");function Pa(e,t,r=1){if(e.type==="group-container"&&"children"in e&&e.children.length>0){let n=r*e.opacity;e.userData.computedOpacity=n;for(let i of e.children)(i instanceof ie&&i.type==="geometry-group"||i instanceof oe&&i.type==="group-container")&&Pa(i,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n),o;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(o=i.components[1],o.dirty=!0)}}l(Pa,"cascadeOpacity");function bb(e,t,r){if(r!==void 0&&e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i&&gp(i,r)}}l(bb,"updateGroupTexture");function gp(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof ze){let i=e.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),e.components[1].dirty=!0,!0}}return!1}l(gp,"updateIndividualGeometryTexture");function Pb(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.opacity!==t){r.opacity=t;let n=e.components[0],i=e.components[3];i&&(i.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),r.dirty=!0;let o=e.parentObject3D;return(o==null?void 0:o.type)==="geometry-group"&&(o.userData.shadingDirty=!0),!0}}return!1}l(Pb,"updateIndividualGeometryOpacity");function _b(e,t){if(t!==void 0)if(e.type==="geometry"||e.type==="path"||e.type==="custom-geometry"){let r=e.components[1];if(r.altitude!==t)return r.altitude=t,r.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),e.components[5]&&(e.components[5].needsRebuild=!0,e.components[5].dirty=!0),!0}else{if(e.type==="group-container"&&e.altitude!==t)return e.setAltitude(t),!0;if(e.type==="geometry-group"&&e.altitude!==t)return e.setAltitude(t),!0}return!1}l(_b,"updateAltitude");function vp(e,t,r){if(r!==void 0){if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof ue&&vp(i,t,r)}else if(e.type==="geometry"){let n=e.components[3],i=e.components[1];!n&&r===!0?e.components[3]=new fn(Wi(i.color)):n&&(n.enabled=r,n.dirty=!0)}return!0}return!1}l(vp,"updateOutline");function Tb(e,t){if(t!==void 0){let r,n=4;if(e.type==="geometry"?(r=e.components[4],n=4):e.type==="group-container"&&(r=e.components[1],n=1),t===!0&&r==null)return e.components[n]=new pn,!0;if(t===!1&&r!=null)return e.components[n]=void 0,!0}return!1}l(Tb,"updateFocusable");function Cb(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.renderOrder!==t){r.renderOrder=t;let n=e.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),r.dirty=!0,!0}}return!1}l(Cb,"updateIndividualGeometryRenderOrder");function xp(e,t,r){if(r!=null){if(e.type==="geometry"){let n=e.components[1];n.side!==r&&(n.side=r,n.dirty=!0)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof ue&&xp(i,t,r)}}}l(xp,"updateSide");function Ib(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1],n;if(n=e.components[5],t.borderVisible!==r.borderVisible&&t.borderVisible!=null){if(t.borderVisible===!0){if(n==null){let i=new hn;e.components[5]=i,n=e.components[5],r.borderColor=r.color}n.visible=!0,n.dirty=!0}else t.borderVisible===!1&&n!=null&&(n.visible=!1,n.dirty=!0);r.borderVisible=t.borderVisible}r.borderColor!==t.borderColor&&t.borderColor!=null&&(r.borderColor=t.borderColor,n&&(n.dirty=!0)),r.borderWidth!==t.borderWidth&&t.borderWidth!=null&&(r.borderWidth=t.borderWidth,n&&(n.needsRebuild=!0))}}l(Ib,"updateBorder");function Sb(e,t,r){let{visible:n,color:i}=r;if(e.type!=="path")return;let o=e.components[0];n!=null&&ba(e,t,n),i!=null&&ga(e,{color:i}),Object.assign(o,bp(r)),Ui(r)||(o.materialDirty=!0,r.width!=null&&(o.dirty=!0))}l(Sb,"handlePathUpdate");function bp(e){return Cr(e,Pp)}l(bp,"pickPathOptions");var Pp=["animateArrowsOnPath","displayArrowsOnPath","width","accentColor","completeFraction","dashed","visibleThroughGeometry"];function Eb(e){if(!(e instanceof ue&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}l(Eb,"assetGeometryIsText3D");var _p=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function wb(e,t,r){ba(e,t,r.visible);let n=e.components[1],i=Cr(r,_p);"margin"in r&&q.warn("update to margin is not supported atm"),"content"in r&&q.warn("content update is not supported atm");try{ha.parse(i)}catch(o){q.error(o);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}l(wb,"handleText3DUpdate");var Tp=["color","material","opacity","verticalOffset","rotation","position","scale"];function Ob(e,t){let r=Cr(t,Tp),n=e.components[1],i=e.components[0];Object.keys(r).length>0&&(r.material&&(n.material=r.material),r.opacity!=null&&(n.opacity=r.opacity),r.visible!=null&&(n.visible=r.visible),r.verticalOffset!=null&&(n.verticalOffset=r.verticalOffset),r.color!=null&&(n.color=r.color),r.position!=null&&(i.feature.geometry.coordinates=r.position,i.positionDirty=!0),r.rotation!=null&&(n.rotation=r.rotation),r.scale!=null&&(n.scale=r.scale),n.dirty=!0)}l(Ob,"handleModelStyleUpdate");d();d();var Ji=Io(Aa());function La(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}l(La,"JSClipperError");La.prototype=Error.prototype;Ji.default.Error=function(e){throw new La(e)};var Ye=Ji.default;var gd="gray",$i=new Ye.ClipperOffset,te=100;function Ki(e,t,r){let{color:n=gd,opacity:i=1,width:o=1,join:s="round",cap:u="round",height:f=.01,altitude:c=0}=r||{};Array.isArray(i)&&(i=0);let h=[],m=e.geometry.coordinates.every(A=>A[2]!=null);for(let A=0;A<e.geometry.coordinates.length-1;A++){let R=t(e.geometry.coordinates[A][1],e.geometry.coordinates[A][0],e.geometry.coordinates[A][2]),N=t(e.geometry.coordinates[A+1][1],e.geometry.coordinates[A+1][0],e.geometry.coordinates[A+1][2]);h.push([R,N])}let g=h[0][0].y;$i.AddPaths(h.map(A=>A.map(R=>({X:R.x*te,Y:(m?R.z:R.y)*te}))),s==="round"?Ye.JoinType.jsRound:s==="miter"?Ye.JoinType.jsMiter:Ye.JoinType.jsSquare,u==="round"?Ye.EndType.etOpenRound:u==="butt"?Ye.EndType.etOpenButt:Ye.EndType.etOpenSquare);let b=new Ye.PolyTree;$i.Execute(b,o/2*te);let _=[],I={bevelEnabled:!1,depth:f};for(let A of b.m_AllPolys){let R=new Ro;if(A.IsHole())continue;let N=A.m_polygon;R.moveTo(N[0].X/te,N[0].Y/te),N.slice(1).forEach(U=>R.lineTo(U.X/te,U.Y/te)),R.lineTo(N[0].X/te,N[0].Y/te),R.holes=A.m_Childs.map(U=>{let V=new Bo,ce=U.m_polygon;return V.moveTo(ce[0].X/te,ce[0].Y/te),ce.slice(1).forEach(pe=>V.lineTo(pe.X/te,pe.Y/te)),V.lineTo(ce[0].X/te,ce[0].Y/te),V}),_.push(new Xo(R,I))}let O=Dr(_);return m&&(O.rotateX(Math.PI/2),O.translate(0,g+f/2,c||0)),O.userData={style:{color:n,opacity:i}},$i.Clear(),O}l(Ki,"renderLineStringGeometry");d();d();var fe=63710088e-1,Jb={centimeters:fe*100,centimetres:fe*100,degrees:360/(2*Math.PI),feet:fe*3.28084,inches:fe*39.37,kilometers:fe/1e3,kilometres:fe/1e3,meters:fe,metres:fe,miles:fe/1609.344,millimeters:fe*1e3,millimetres:fe*1e3,nauticalmiles:fe/1852,radians:1,yards:fe*1.0936};function Da(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}l(Da,"feature");function Na(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return Da({type:"LineString",coordinates:e},t,r)}l(Na,"lineString");function ka(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}l(ka,"featureCollection");function Ba(e,t,r={}){return Da({type:"MultiLineString",coordinates:e},t,r)}l(Ba,"multiLineString");d();function vn(e){return e.type==="Feature"?e.geometry:e}l(vn,"getGeom");function vd(e,t={}){let r=vn(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return xd(r,t);case"MultiPolygon":return bd(r,t);default:throw new Error("invalid poly")}}l(vd,"polygonToLine");function xd(e,t={}){let n=vn(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return Ra(n,i)}l(xd,"singlePolygonToLine");function bd(e,t={}){let n=vn(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},o=[];return n.forEach(s=>{o.push(Ra(s,i))}),ka(o)}l(bd,"multiPolygonToLine");function Ra(e,t){return e.length>1?Ba(e,t):Na(e[0],t)}l(Ra,"coordsToLine");var Qi=vd;d();function Xa(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}l(Xa,"scrubMaterial");function eo(e){for(let t=e.children.length-1;t>=0;t--)eo(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){Xa(t)}):"material"in e&&typeof e.material<"u"&&Xa(e.material)}l(eo,"destroyObject3D");d();function Ya(e){return e!=null&&e.geometry.type==="Polygon"&&e.geometry.coordinates[0].length>2}l(Ya,"isValidPolygon");function Pd(e,t){let r=e[0]*t[0]+e[1]*t[1],n=Math.sqrt(e[0]*e[0]+e[1]*e[1]),i=Math.sqrt(t[0]*t[0]+t[1]*t[1]);if(n===0||i===0)return 0;let o=r/(n*i),s=Math.max(-1,Math.min(1,o));return Math.acos(s)*(180/Math.PI)}l(Pd,"calculateAngle");function _d(e,t=5){if(e.length<3)return e;let r=e.length>3&&e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1],n=[],i=r?e.length-1:e.length;for(let o=0;o<i;o++){let s=r&&o===0?e[e.length-2]:e[o-1],u=e[o],f=r&&o===e.length-1?e[1]:e[o+1];if(s==null||f==null){n.push(u);continue}let c=[u[0]-s[0],u[1]-s[1]],h=[f[0]-u[0],f[1]-u[1]];Pd(c,h)>t&&n.push(u)}if(r&&n.length>0){let o=n[0],s=n[n.length-1];(o[0]!==s[0]||o[1]!==s[1])&&n.push([o[0],o[1]])}return n}l(_d,"filterVerticesByAngle");function Fa(e,t=5){return M(y({},e),{geometry:M(y({},e.geometry),{coordinates:e.geometry.coordinates.map(r=>_d(r,t))})})}l(Fa,"filterPolygonVerticesByAngle");var Va=.1,Td=15,Cd=.25,to=class to{constructor(t,r){p(this,"rendererState");p(this,"dirty",!1);p(this,"convertTo3DMapPosition");p(this,"colorToMaterialCache",{});this.rendererState=t,this.convertTo3DMapPosition=r}update(){var o,s,u;let t,r,n,i;for(let f of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(f),t!=null&&(i=t.components[0],r=t.components[1],t.type==="geometry"&&i instanceof ze&&Ya(i.feature))){if(n=t.components[5],n!=null&&n.dirty){if(n.mesh==null)try{let c=this.buildBorder(i.feature,r,n);(o=i.mesh)==null||o.add(c)}catch(c){q.error(c),n.dirty=!1}(s=n.mesh)==null||s.children.forEach(c=>{n&&c.material.color.set(r.borderColor)}),n.dirty=!1,n.visible=r.borderVisible}if(n!=null&&n.needsRebuild){eo(n.mesh);try{let c=this.buildBorder(i.feature,r,n);(u=i.mesh)==null||u.add(c)}catch(c){q.error(c)}n.needsRebuild=!1,n.visible=r.borderVisible}}}buildBorder(t,r,n){var N,U,V;let i=Qi(t),o=Fa(t,Td),s=Qi(o),u=r.borderWidth/2,f=r.borderColor,c=Ki(i,this.convertTo3DMapPosition,{width:u,height:u,color:f,cap:"square"}),h=c.clone();h.translate(0,0,r.height);let m;s.geometry.type==="LineString"?m=s.geometry.coordinates:m=s.geometry.coordinates.flat();let g=[];m.pop();for(let ce of m||[])try{let pe=Ki({type:"Feature",geometry:{type:"LineString",coordinates:[[ce[0],ce[1],0],[ce[0],ce[1],r.height]]},properties:{}},this.convertTo3DMapPosition,{width:u,height:u,color:f,cap:"butt"});g.push(pe)}catch(pe){q.warn(pe)}let b=Dr([c,h,...g]),_=(N=this.colorToMaterialCache[f])==null?void 0:N[0];_==null&&(_=new Qe({color:f}));let I=(U=this.colorToMaterialCache[f])==null?void 0:U[1];I==null&&(I=new Qe({color:f})),this.colorToMaterialCache[f]=[_,I];let O=new he,A=new Fe(b,_),R=new Fe(b,I);return O.add(A),O.add(R),R.material.depthWrite=!1,R.material.depthTest=!1,R.material.opacity=Cd,R.material.transparent=!0,O.position.z=(V=r.altitude)!=null?V:0,n.mesh=O,O}destroy(){for(let[t,[r,n]]of Object.entries(this.colorToMaterialCache))r.dispose(),n.dispose();this.colorToMaterialCache={}}};l(to,"BorderSystem");var Ga=to;var ro="#ffffff",Id=.1,xn=.1,Er,wr,Or,io=class io{constructor(t={}){p(this,"initialColor",ro);Te(this,Er,ro);p(this,"initialTopColor");Te(this,wr);p(this,"topTexture");p(this,"texture");Te(this,Or);p(this,"dirty",!0);p(this,"visible",!0);p(this,"opacity",1);p(this,"width",Id);p(this,"height",xn);p(this,"initialHeight",xn);p(this,"altitude",0);p(this,"join","round");p(this,"cap","round");p(this,"showImage",!0);p(this,"flipImageToFaceCamera",!0);p(this,"enableImageCollisions",!1);p(this,"url");p(this,"side","double");p(this,"renderOrder",0);p(this,"shading");p(this,"bevel");p(this,"borderVisible",!1);p(this,"borderColor");p(this,"borderWidth");this.color=(t==null?void 0:t.color)!==void 0?t.color:this.color,this.initialColor=this.color,this.width=(t==null?void 0:t.width)!==void 0?t.width:this.width,this.opacity=(t==null?void 0:t.opacity)!==void 0?t.opacity:this.opacity,this.visible=(t==null?void 0:t.visible)!==void 0?t.visible:this.visible,this.height=(t==null?void 0:t.height)!==void 0?t.height:this.height,this.initialHeight=this.height,this.altitude=(t==null?void 0:t.altitude)!==void 0?t.altitude:this.altitude,this.join=(t==null?void 0:t.join)!==void 0?t.join:this.join,this.cap=(t==null?void 0:t.cap)!==void 0?t.cap:this.cap,this.topColor=t==null?void 0:t.topColor,this.initialTopColor=this.topColor,this.texture=t==null?void 0:t.texture,this.topTexture=t==null?void 0:t.topTexture,this.showImage=(t==null?void 0:t.showImage)!==void 0?t.showImage:this.showImage,this.flipImageToFaceCamera=(t==null?void 0:t.flipImageToFaceCamera)!==void 0?t.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=t==null?void 0:t.url,this.side=(t==null?void 0:t.side)!==void 0?t.side:this.side,this.renderOrder=(t==null?void 0:t.renderOrder)!==void 0?t.renderOrder:this.renderOrder,this.shading=t==null?void 0:t.shading,this.bevel=t==null?void 0:t.bevel,this.borderVisible=(t==null?void 0:t.borderVisible)!==void 0?t.borderVisible:this.borderVisible,this.borderColor=(t==null?void 0:t.borderColor)!==void 0?t.borderColor:this.color,this.borderWidth=(t==null?void 0:t.borderWidth)!==void 0?t.borderWidth:Va,this.enableImageCollisions=(t==null?void 0:t.enableImageCollisions)!==void 0?t.enableImageCollisions:this.enableImageCollisions}set color(t){Rr(t)?Ce(this,Er,t):q.warn('Failed to update color. Invalid color "'.concat(t,'".'))}get color(){return se(this,Er)}set topColor(t){t===void 0||Rr(t)?Ce(this,wr,t):q.warn('Failed to update top color. Invalid color "'.concat(t,'".'))}get topColor(){return se(this,wr)}set hoverColor(t){Rr(t)?Ce(this,Or,t):q.warn('Failed to update hover color. Invalid color "'.concat(t,'".'))}get hoverColor(){return se(this,Or)}};Er=new WeakMap,wr=new WeakMap,Or=new WeakMap,l(io,"StyleComponent");var no=io;var oo=class oo extends ko{constructor(){super(...arguments);p(this,"type","entityBatchedMesh");p(this,"userData",{entities:{}})}};l(oo,"EntityBatchedMesh");var Ut=oo,Mr,wt,so=class so{constructor(t){p(this,"mesh");p(this,"imageMesh");p(this,"textMesh");p(this,"textEntityId");p(this,"type","geometry");p(this,"dirty",!0);p(this,"detached",!1);p(this,"instanceIndex",-1);p(this,"geometry");p(this,"batchedProps");p(this,"material");p(this,"feature");p(this,"currentHeight",xn);p(this,"color",new xe);p(this,"topColor",new xe);p(this,"position",new z);p(this,"altitude",0);Te(this,Mr,1);Te(this,wt);p(this,"texturesVisible",!1);this.feature=t}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(t){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,t)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}setColor(t,r){this.color.set(t),this.topColor.set(r),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var t;return(t=this.material)==null?void 0:t.getColor(this.instanceIndex)}get opacity(){return se(this,Mr)}set opacity(t){if(this.material&&(this.material.opacity=t,this.material.transparent=t<1,this.material.needsUpdate=!0),this.imageMesh){let r=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of r)n.opacity=t,n.needsUpdate=!0}Ce(this,Mr,t)}get texture(){var t,r;return(r=(t=this.material)==null?void 0:t.texture)==null?void 0:r.image.src}set texture(t){this.material&&(this.material.texture=t)}get textureInstance(){var t;return(t=this.material)==null?void 0:t.texture}set topTexture(t){this.material&&(this.material.topTexture=t)}get topTexture(){var t,r;return(r=(t=this.material)==null?void 0:t.topTexture)==null?void 0:r.image.src}get topTextureInstance(){var t;return(t=this.material)==null?void 0:t.topTexture}set blendTexture(t){this.material&&(this.material.blendTexture=t)}get featureBbox(){return se(this,wt)?se(this,wt):(Ce(this,wt,qo(this.feature)),se(this,wt))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};Mr=new WeakMap,wt=new WeakMap,l(so,"MeshComponent");var ze=so;var ao=class ao extends he{constructor(r){super();p(this,"visible",!0);p(this,"type","geometry-group");p(this,"components",[]);p(this,"userData",{entityId:"",entities3D:new Set,dirty:!0,shadingDirty:!0});this.userData.entityId=r}setVisible(r){this.visible!==r&&(this.visible=r,this.dispatchEvent({type:"childremoved",child:this}))}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let r;for(let i of this.children)if(!i.userData.detached){r=i;break}return r instanceof Ut?Object.values(r.userData.entities)[0]:void 0}setAltitude(r){this.position.z!==r&&(this.position.z=r,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};l(ao,"GeometryGroupObject3D");var ie=ao;var Zt=class Zt extends he{constructor(r){super();p(this,"childrenIds",new Set);p(this,"children",[]);p(this,"type","group-container");p(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});p(this,"components",[]);this.userData.entityId=r}addOccluderFeature(r,n){this.userData.occluderFeature=r,this.userData.occluderId=n,this.userData.occluderDirty=!0}addEntity(r){r instanceof Zt?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof Xe?(this.childrenIds.add(r.id),this.add(r.object3d),this.userData.entities2D.add(r.id),r.positionDirty=!0):r instanceof ie?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof ue&&r.object3d&&(this.childrenIds.add(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(r){r instanceof Zt?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof Xe?(this.childrenIds.delete(r.id),this.userData.entities2D.delete(r.id),this.remove(r.object3d)):r instanceof ie?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof ue&&r.object3d&&(this.childrenIds.delete(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(r){this.visible!==r&&(this.visible=r,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(r){this.position.z!==r&&(this.position.z=r,this.dispatchEvent({type:"childremoved",child:this}),this.set2DGeometryChildrenPositionDirty())}set2DGeometryChildrenPositionDirty(){this.children.forEach(r=>{r instanceof we?r.userData.worldPositionDirty=!0:r instanceof Zt&&r.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(r){this.userData.opacity=r}get opacity(){return this.userData.opacity}};l(Zt,"GroupContainerObject3D");var oe=Zt;d();function Sd(e){let t=e.min,r=e.max,n=new z(t.x,t.y,t.z),i=new z(r.x,t.y,t.z),o=new z(t.x,r.y,t.z),s=new z(r.x,r.y,t.z);return[n,i,o,s]}l(Sd,"getCornersOfBoundingBox");d();function Wa(e,t){let r;return typeof t=="string"||typeof t=="number"?(r=e.geometry2DMap.get(t),r==null&&(r=e.geometry3DMap.get(t))):typeof(t==null?void 0:t.id)=="string"||typeof(t==null?void 0:t.id)=="number"?(r=e.geometry2DMap.get(t.id),r==null&&(r=e.geometry3DMap.get(t.id))):r=t,r}l(Wa,"getGeometryByGeometryId");function Q0(e,t,r=[],n=new On,i){(e.getSystems().renderSystem.threeDdirty||e.getSystems().renderSystem.twoDdirty)&&e.renderSync();let o=Wa(e.getInternalState(),t);return Ha(o,r,n,i),r}l(Q0,"getVerticesOfEntity");var bn=new z;function Ha(e,t=[],r=new On,n){if(e.visible){if(e.isMesh||e.isLine||e.isPoints){let i=e.geometry;if(i.isBufferGeometry){let o=i.attributes.position;for(let s=0;s<o.count;s++)bn.fromBufferAttribute(o,s),n!==void 0&&(bn.z=n),t.push(bn.clone()),r.expandByPoint(bn)}}for(let i of e.children)Ha(i,t,r,n)}}l(Ha,"traverse");d();function Ed(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}l(Ed,"getPixelRatio");d();function wd(e,t,r=!1){let n=null,i=0;return function(...o){i++,i===1&&r===!0&&e(...o);let s=l(()=>{(!r||i>1)&&e(...o),n=null,i=0},"later");clearTimeout(n),n=setTimeout(s,t)}}l(wd,"debounce");d();var Od=(()=>{let e;return{getDeviceType(){if(e)return e;let{userAgent:t,platform:r,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(t),o=r==="iPad"||r.indexOf("Mac")===0&&n>0&&!window.MSStream,s=/android/i.test(t);return e={isIpad:o,isMobile:s||i||o,isSafari12:/Version\/12.+Safari/.test(t),isFirefox:/Firefox/.test(t),isWindows:/windows/i.test(t)},e},_reset(){e=void 0}}})(),ja=Od.getDeviceType,Ua=(()=>{let e,t,r;function n(){if(t!==void 0)return t;e||(e=document.createElement("canvas"));let o=e.getContext("webgl")||e.getContext("experimental-webgl");if(!o)return t;try{let s=ja().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return t=s?o.getParameter(s.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),t}catch(s){let u=new Error("Failed getting device info");throw u.name="FailedGettingDeviceInfo",u}}l(n,"getInfo");function i(){var s,u;if(!ja().isWindows)return!1;if(r!==void 0)return r;let o=(u=(s=Md())==null?void 0:s.toLowerCase())!=null?u:"";return r=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),r}return l(i,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(o){e=o,t=void 0,r=void 0}}})(),Md=Ua.getInfo,Ad=Ua.shouldDisableOffscreenCanvas;d();function Cr(e,t){let r={};for(let n=0;n<t.length;n++){let i=t[n];i in e&&(r[i]=e[i])}return r}l(Cr,"pick");function Ui(e){return Object.keys(e).length===0}l(Ui,"isEmpty");d();function wP(e,t,r,n){let i=e*(Math.PI/180),o=n/et,s=e+o*180/Math.PI,u=r/et/Math.cos(i),f=t+u*180/Math.PI;return{lat:s,lon:f}}l(wP,"cartesianToGeographic");function OP(e,t,r,n){let i=r*(Math.PI/180),o=n*(Math.PI/180),s=e*(Math.PI/180),u=t*(Math.PI/180),f=i-s,c=o-u,h=et*c*Math.cos(s),m=et*f;return{x:h,y:m}}l(OP,"geographicToCartesian");var Ld=l((e,t,r,n=!1)=>{var s;let i=e instanceof oe&&e.userData.preloadGeometry,o=n||i&&!e.visible;if(e.children&&(e.visible||i))for(let u of e.children){if(u.visible&&u.type&&!o)if("entities3D"in u.userData&&((s=u.userData)!=null&&s.entities3D)&&u instanceof ie){t.add(u.userData.entityId);for(let f of u.userData.entities3D.values())t.add(f)}else(u.type==="group-container"||u.type==="custom-geometry"||u instanceof Ct)&&t.add(u.userData.entityId);u instanceof ie&&u.userData.dirty&&r.add(u.userData.entityId),Ld(u,t,r,o)}return t},"populateGeometry3DIdsInScene"),Dd=l((e,t)=>{var r;if(e.children&&e.visible&&!((r=e.userData)!=null&&r.hidden))for(let n of e.children)n.visible&&n instanceof we&&t.add(n.userData.entityId),Dd(n,t);return t},"populateGeometry2DIdsInScene");function zi(e,t){for(let r in t)if(!(r==="__proto__"||r==="constructor"||r==="prototype")){if(t[r]==null){e[r]=void 0;continue}Array.isArray(t[r])?e[r]=t[r]:typeof t[r]=="object"?zi(e[r],t[r]):e[r]=t[r]}return e}l(zi,"mergeObjects");function MP(e,t,r){let n={translateX:e.x,translateY:e.y,translateZ:e.z,scale:e.meterInMercatorCoordinateUnits()},i=new Ke,o=new z(n.scale,-n.scale,n.scale),s=new Ke().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(o);return{id:ya,type:"custom",renderingMode:"3d",render:l((u,f)=>{i.fromArray(f.defaultProjectionData.mainMatrix),t.projectionMatrix=i.multiply(s),r()},"render")}}l(MP,"createCustomLayer");function AP(e,t=0){let r=3735928559^t,n=1103547991^t;for(let i=0,o;i<e.length;i++)o=e.charCodeAt(i),r=Math.imul(r^o,2654435761),n=Math.imul(n^o,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)}l(AP,"cyrb53");function LP(e,t,r){let n=e*(Math.PI/180)/2,i=t/2;return r*Math.tan(n)/i}l(LP,"getProjectionScaleFactor");function DP(e){return new So(new Sn(e[0][0],e[0][1]),new Sn(e[1][0],e[1][1])).getCenter().toArray()}l(DP,"getBoundingBoxCenter");function NP(e,t){return e<t||t<=12}l(NP,"shouldExpandZoomLevel");function kP(e){let t=1;return e.type==="geometry-group"&&e.parent!=null&&e.parent instanceof oe?t=e.parent.userData.computedOpacity:(e.type==="geometry"||e.type==="custom-geometry"||e.type==="model")&&e.parentObject3D!=null&&e.parentObject3D instanceof ie&&e.parentObject3D.parent!=null&&e.parentObject3D.parent instanceof oe&&(t=e.parentObject3D.parent.userData.computedOpacity),t}l(kP,"getGroupContainerOpacity");function BP(e,t,r=1e-10){if(e.length!==t.length)return!1;let n=Math.abs(e[0]-t[0])<r,i=Math.abs(e[1]-t[1])<r;if(e.length===3&&t.length===3){let o=Math.abs(e[2]-t[2])<r;return n&&i&&o}return n&&i}l(BP,"coordinatesEqual");var Nd="maplibre-frustum-culling-hack";function RP(){let e=new Do(.01,.01,.01),t=new Qe({opacity:0,depthWrite:!1,transparent:!0}),r=new Fe(e,t);return r.position.copy(new z(0,50,0)),r.frustumCulled=!1,r.name=Nd,r}l(RP,"maplibreFrustrumCullHack");var Je=new z,za=new Oe;function XP(e,t,r=new Lr){return e.traverse(n=>{if(n instanceof Fe){let o=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let u=0;u<o.count;u++)Je.fromBufferAttribute(o,u),Je.applyMatrix4(n.matrixWorld),Je.applyMatrix4(t.matrixWorldInverse),Je.applyMatrix4(t.projectionMatrix),Je.z<1&&Je.z>0&&(za.set(Je.x,Je.y),r.expandByPoint(za))}}),r}l(XP,"projectToBox2D");function qa(e,t){let r=t.clientWidth,n=t.clientHeight;return new Oe((e.x+1)*r/2,(1-e.y)*n/2)}l(qa,"ndcToScreen");function YP(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let i=qa(new Oe(e.min.x,e.min.y),r),o=qa(new Oe(e.max.x,e.max.y),r);n.style.left="".concat(i.x,"px"),n.style.top="".concat(o.y,"px");let s=Math.abs(o.x-i.x),u=Math.abs(o.y-i.y);return n.style.width="".concat(s,"px"),n.style.height="".concat(u,"px"),r.appendChild(n),n}l(YP,"drawProjectedBox");function FP(e,t){let r=0,n=0,i=e.clientWidth,o=e.clientHeight;if(t){let{left:s,top:u,right:f,bottom:c,type:h}=t,m=s!=null?s:0,g=u!=null?u:0,b=f!=null?f:0,_=c!=null?c:0;h==="portion"?(r=m*i,n=g*o,i=i-r-b*i,o=o-n-_*o):(r=m,n=g,i=i-r-b,o=o-n-_)}return[r,n,i,o].map(s=>Math.max(s,0))}l(FP,"rectFromScreenOffsets");d();var uo=class uo{constructor(t){p(this,"visible");p(this,"altitude");p(this,"color");p(this,"dirty",!0);p(this,"maxWidth");p(this,"maxHeight");p(this,"hoverByPolygon");p(this,"flipToFaceCamera",Za.flipToFaceCamera);p(this,"font");p(this,"fillOpacity");p(this,"fontSize");p(this,"margin");p(this,"outlineWidth");p(this,"outlineBlur");p(this,"outlineOffsetX");p(this,"strokeColor");p(this,"strokeOpacity");p(this,"strokeWidth");p(this,"hoverColor");p(this,"outlineOffsetY");p(this,"outlineColor");p(this,"outlineOpacity");t&&Object.assign(this,t)}getState(t=!1){let r={};for(let n in this)!t&&n==="dirty"||this[n]!==void 0&&(r[n]=this[n]);return r}};l(uo,"Text3DStyleComponent");var lo=uo,Za=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});d();d();var co=class co{constructor(t){p(this,"dirty",!0);p(this,"visible",!0);p(this,"opacity",1);p(this,"verticalOffset",0);p(this,"interactive",!1);p(this,"color");p(this,"material");p(this,"rotation");p(this,"scale");t&&Object.assign(this,t)}};l(co,"ModelStyleComponnet");var fo=co;d();var kd=[1,1,1],Bd=[0,0,0];export{Ge as a,vl as b,ly as c,xl as d,uy as e,fy as f,cy as g,gy as h,vy as i,nl as j,q as k,et as l,sl as m,al as n,kr as o,fm as p,cm as q,pm as r,ll as s,Pm as t,Me as u,rr as v,Rr as w,Ho as x,ml as y,Rm as z,gl as A,Xm as B,v as C,Du as D,Sg as E,jg as F,Os as G,gv as H,la as I,Xe as J,Ct as K,ue as L,px as M,hx as N,dx as O,mx as P,Sd as Q,Wa as R,Q0 as S,Ed as T,wd as U,Ad as V,Xr as W,wP as X,OP as Y,Ld as Z,Dd as _,MP as $,AP as aa,LP as ba,DP as ca,NP as da,kP as ea,BP as fa,RP as ga,XP as ha,YP as ia,FP as ja,lo as ka,Za as la,fo as ma,kd as na,Bd as oa,fa as pa,Hv as qa,un as ra,fn as sa,Pr as ta,Nx as ua,Wi as va,kx as wa,pn as xa,Tr as ya,lb as za,ub as Aa,fb as Ba,dp as Ca,ga as Da,cb as Ea,pb as Fa,hb as Ga,db as Ha,mb as Ia,yb as Ja,gb as Ka,vb as La,xb as Ma,ba as Na,yp as Oa,bb as Pa,gp as Qa,Pb as Ra,_b as Sa,vp as Ta,Tb as Ua,Cb as Va,xp as Wa,Ib as Xa,Sb as Ya,bp as Za,Eb as _a,wb as $a,Ob as ab,Ye as bb,Ki as cb,eo as db,Ga as eb,ro as fb,no as gb,Ut as hb,ze as ib,ie as jb,oe as kb};
|