@mappedin/mappedin-js 6.0.0-rc.2 → 6.0.0-rc.3

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.
Files changed (45) hide show
  1. package/THIRD_PARTY_LICENSES.txt +42 -2
  2. package/lib/esm/{GLTFExporter-Z6JPGY7L.js → GLTFExporter-RSA32FAS.js} +2 -2
  3. package/lib/esm/{GLTFLoader-QCSKNB7G.js → GLTFLoader-FLMCN6TW.js} +2 -2
  4. package/lib/esm/{browser-I5Q2RPA3.js → browser-4FMFOYKX.js} +2 -2
  5. package/lib/esm/chunk-43XLQYI5.js +193 -0
  6. package/lib/esm/chunk-43XLQYI5.js.map +7 -0
  7. package/lib/esm/{chunk-L4AKE3TV.js → chunk-4AZZH27P.js} +2 -2
  8. package/lib/esm/{chunk-W5WDIXXO.js → chunk-K3PVENYC.js} +2 -2
  9. package/lib/esm/{chunk-7SIXH4EE.js → chunk-LTNJEB3M.js} +2 -2
  10. package/lib/esm/chunk-UVZJOVQM.js +2 -0
  11. package/lib/esm/{chunk-AJPWEERG.js.map → chunk-UVZJOVQM.js.map} +1 -1
  12. package/lib/esm/chunk-WJDRJJIM.js +2153 -0
  13. package/lib/esm/chunk-WJDRJJIM.js.map +7 -0
  14. package/lib/esm/index.css +1 -1
  15. package/lib/esm/index.css.map +3 -3
  16. package/lib/esm/index.d.ts +280 -82
  17. package/lib/esm/index.js +1 -1
  18. package/lib/esm/{inspector-T3HA7VGW.css → inspector-4GBSTGDH.css} +2 -2
  19. package/lib/esm/{inspector-T3HA7VGW.css.map → inspector-4GBSTGDH.css.map} +3 -3
  20. package/lib/esm/{inspector-YD6373IB.js → inspector-BHVDJXVZ.js} +2 -2
  21. package/lib/esm/{internal-JKAX4KK2.js → internal-3NNUFZ25.js} +2 -2
  22. package/lib/esm/{internal-VKD5KMH3.css → internal-CH27ONAB.css} +2 -2
  23. package/lib/esm/{internal-VKD5KMH3.css.map → internal-CH27ONAB.css.map} +3 -3
  24. package/lib/esm/{outdoor-context-v5-TZEP6AEK.js → outdoor-context-v5-6IFFZHAJ.js} +2 -2
  25. package/lib/esm/{text3d-OX5R3UZU.js → text3d-EKD5MTTV.js} +2 -2
  26. package/lib/esm/{text3d-OX5R3UZU.js.map → text3d-EKD5MTTV.js.map} +1 -1
  27. package/lib/esm/text3d-ZPCG4PKJ.css +2 -0
  28. package/lib/esm/text3d-ZPCG4PKJ.css.map +7 -0
  29. package/lib/index-rn.js +193 -193
  30. package/lib/index.css +1 -1
  31. package/package.json +2 -2
  32. package/lib/esm/chunk-6KGIA4EU.js +0 -3
  33. package/lib/esm/chunk-6KGIA4EU.js.map +0 -7
  34. package/lib/esm/chunk-AJPWEERG.js +0 -2
  35. package/lib/esm/chunk-VI2AJVL2.js +0 -2343
  36. package/lib/esm/chunk-VI2AJVL2.js.map +0 -7
  37. /package/lib/esm/{GLTFExporter-Z6JPGY7L.js.map → GLTFExporter-RSA32FAS.js.map} +0 -0
  38. /package/lib/esm/{GLTFLoader-QCSKNB7G.js.map → GLTFLoader-FLMCN6TW.js.map} +0 -0
  39. /package/lib/esm/{browser-I5Q2RPA3.js.map → browser-4FMFOYKX.js.map} +0 -0
  40. /package/lib/esm/{chunk-L4AKE3TV.js.map → chunk-4AZZH27P.js.map} +0 -0
  41. /package/lib/esm/{chunk-W5WDIXXO.js.map → chunk-K3PVENYC.js.map} +0 -0
  42. /package/lib/esm/{chunk-7SIXH4EE.js.map → chunk-LTNJEB3M.js.map} +0 -0
  43. /package/lib/esm/{inspector-YD6373IB.js.map → inspector-BHVDJXVZ.js.map} +0 -0
  44. /package/lib/esm/{internal-JKAX4KK2.js.map → internal-3NNUFZ25.js.map} +0 -0
  45. /package/lib/esm/{outdoor-context-v5-TZEP6AEK.js.map → outdoor-context-v5-6IFFZHAJ.js.map} +0 -0
@@ -0,0 +1,193 @@
1
+ import{i as Fn,j as lo}from"./chunk-LTNJEB3M.js";import{a as Yr}from"./chunk-K3PVENYC.js";import{$ as Ye,A as Qi,Ca as io,Da as oo,Ea as so,I as Se,Ja as ao,P as Rn,Q as V,R as Xn,T as Qe,U as Yn,V as ue,W as fe,Y as et,aa as eo,c as Zi,d as qi,db as Xr,e as Ji,g as sr,la as to,p as $i,qa as ro,r as Ki,z as Bn,za as no}from"./chunk-4AZZH27P.js";import{a as h,b as _}from"./chunk-UVZJOVQM.js";import{b as Nn,c as ol,d as kn,e as c,f as Y,g as oe,h as Z}from"./chunk-ROCNZJLL.js";var us=Nn((dr,Yt)=>{h();var Nu=200,Wo="__lodash_hash_undefined__",ku=800,Bu=16,jo=9007199254740991,Uo="[object Arguments]",Ru="[object Array]",Xu="[object AsyncFunction]",Yu="[object Boolean]",Fu="[object Date]",Gu="[object Error]",Vo="[object Function]",Wu="[object GeneratorFunction]",ju="[object Map]",Uu="[object Number]",Vu="[object Null]",Ho="[object Object]",Hu="[object Proxy]",zu="[object RegExp]",Zu="[object Set]",qu="[object String]",Ju="[object Undefined]",$u="[object WeakMap]",Ku="[object ArrayBuffer]",Qu="[object DataView]",ef="[object Float32Array]",tf="[object Float64Array]",rf="[object Int8Array]",nf="[object Int16Array]",of="[object Int32Array]",sf="[object Uint8Array]",af="[object Uint8ClampedArray]",lf="[object Uint16Array]",uf="[object Uint32Array]",ff=/[\\^$.*+?()[\]{}|]/g,cf=/^\[object .+?Constructor\]$/,pf=/^(?:0|[1-9]\d*)$/,F={};F[ef]=F[tf]=F[rf]=F[nf]=F[of]=F[sf]=F[af]=F[lf]=F[uf]=!0;F[Uo]=F[Ru]=F[Ku]=F[Yu]=F[Qu]=F[Fu]=F[Gu]=F[Vo]=F[ju]=F[Uu]=F[Ho]=F[zu]=F[Zu]=F[qu]=F[$u]=!1;var zo=typeof global=="object"&&global&&global.Object===Object&&global,hf=typeof self=="object"&&self&&self.Object===Object&&self,gr=zo||hf||Function("return this")(),Zo=typeof dr=="object"&&dr&&!dr.nodeType&&dr,mr=Zo&&typeof Yt=="object"&&Yt&&!Yt.nodeType&&Yt,qo=mr&&mr.exports===Zo,Zn=qo&&zo.process,Lo=function(){try{var e=mr&&mr.require&&mr.require("util").types;return e||Zn&&Zn.binding&&Zn.binding("util")}catch{}}(),No=Lo&&Lo.isTypedArray;function Jo(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)}function df(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function mf(e){return function(t){return e(t)}}function yf(e,t){return e?.[t]}function gf(e,t){return function(r){return e(t(r))}}var vf=Array.prototype,xf=Function.prototype,Jr=Object.prototype,qn=gr["__core-js_shared__"],$r=xf.toString,Ae=Jr.hasOwnProperty,ko=function(){var e=/[^.]+$/.exec(qn&&qn.keys&&qn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),$o=Jr.toString,bf=$r.call(Object),_f=RegExp("^"+$r.call(Ae).replace(ff,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zr=qo?gr.Buffer:void 0,Bo=gr.Symbol,Ro=gr.Uint8Array,Xo=Zr?Zr.allocUnsafe:void 0,Ko=gf(Object.getPrototypeOf,Object),Yo=Object.create,Pf=Jr.propertyIsEnumerable,Tf=vf.splice,bt=Bo?Bo.toStringTag:void 0,qr=function(){try{var e=ri(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Cf=Zr?Zr.isBuffer:void 0,Fo=Math.max,Sf=Date.now,Qo=ri(gr,"Map"),yr=ri(Object,"create"),If=function(){function e(){}return function(t){if(!Me(t))return{};if(Yo)return Yo(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function _t(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])}}function wf(){this.__data__=yr?yr(null):{},this.size=0}function Of(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Ef(e){var t=this.__data__;if(yr){var r=t[e];return r===Wo?void 0:r}return Ae.call(t,e)?t[e]:void 0}function Mf(e){var t=this.__data__;return yr?t[e]!==void 0:Ae.call(t,e)}function Af(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yr&&t===void 0?Wo:t,this}_t.prototype.clear=wf;_t.prototype.delete=Of;_t.prototype.get=Ef;_t.prototype.has=Mf;_t.prototype.set=Af;function De(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])}}function Df(){this.__data__=[],this.size=0}function Lf(e){var t=this.__data__,r=Kr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Tf.call(t,r,1),--this.size,!0}function Nf(e){var t=this.__data__,r=Kr(t,e);return r<0?void 0:t[r][1]}function kf(e){return Kr(this.__data__,e)>-1}function Bf(e,t){var r=this.__data__,n=Kr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}De.prototype.clear=Df;De.prototype.delete=Lf;De.prototype.get=Nf;De.prototype.has=kf;De.prototype.set=Bf;function Ft(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])}}function Rf(){this.size=0,this.__data__={hash:new _t,map:new(Qo||De),string:new _t}}function Xf(e){var t=en(this,e).delete(e);return this.size-=t?1:0,t}function Yf(e){return en(this,e).get(e)}function Ff(e){return en(this,e).has(e)}function Gf(e,t){var r=en(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}Ft.prototype.clear=Rf;Ft.prototype.delete=Xf;Ft.prototype.get=Yf;Ft.prototype.has=Ff;Ft.prototype.set=Gf;function Gt(e){var t=this.__data__=new De(e);this.size=t.size}function Wf(){this.__data__=new De,this.size=0}function jf(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Uf(e){return this.__data__.get(e)}function Vf(e){return this.__data__.has(e)}function Hf(e,t){var r=this.__data__;if(r instanceof De){var n=r.__data__;if(!Qo||n.length<Nu-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ft(n)}return r.set(e,t),this.size=r.size,this}Gt.prototype.clear=Wf;Gt.prototype.delete=jf;Gt.prototype.get=Uf;Gt.prototype.has=Vf;Gt.prototype.set=Hf;function zf(e,t){var r=Qn(e),n=!r&&Kn(e),i=!r&&!n&&is(e),o=!r&&!n&&!i&&ss(e),s=r||n||i||o,l=s?df(e.length,String):[],u=l.length;for(var f in e)(t||Ae.call(e,f))&&!(s&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||rs(f,u)))&&l.push(f);return l}function Jn(e,t,r){(r!==void 0&&!tn(e[t],r)||r===void 0&&!(t in e))&&ei(e,t,r)}function Zf(e,t,r){var n=e[t];(!(Ae.call(e,t)&&tn(n,r))||r===void 0&&!(t in e))&&ei(e,t,r)}function Kr(e,t){for(var r=e.length;r--;)if(tn(e[r][0],t))return r;return-1}function ei(e,t,r){t=="__proto__"&&qr?qr(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var qf=ac();function Qr(e){return e==null?e===void 0?Ju:Vu:bt&&bt in Object(e)?lc(e):dc(e)}function Go(e){return vr(e)&&Qr(e)==Uo}function Jf(e){if(!Me(e)||pc(e))return!1;var t=ii(e)?_f:cf;return t.test(vc(e))}function $f(e){return vr(e)&&os(e.length)&&!!F[Qr(e)]}function Kf(e){if(!Me(e))return hc(e);var t=ns(e),r=[];for(var n in e)n=="constructor"&&(t||!Ae.call(e,n))||r.push(n);return r}function ti(e,t,r,n,i){e!==t&&qf(t,function(o,s){if(i||(i=new Gt),Me(o))Qf(e,t,s,r,ti,n,i);else{var l=n?n($n(e,s),o,s+"",e,t,i):void 0;l===void 0&&(l=o),Jn(e,s,l)}},as)}function Qf(e,t,r,n,i,o,s){var l=$n(e,r),u=$n(t,r),f=s.get(u);if(f){Jn(e,r,f);return}var p=o?o(l,u,r+"",e,t,s):void 0,d=p===void 0;if(d){var m=Qn(u),g=!m&&is(u),b=!m&&!g&&ss(u);p=u,m||g||b?Qn(l)?p=l:xc(l)?p=ic(l):g?(d=!1,p=tc(u,!0)):b?(d=!1,p=nc(u,!0)):p=[]:bc(u)||Kn(u)?(p=l,Kn(l)?p=_c(l):(!Me(l)||ii(l))&&(p=uc(u))):d=!1}d&&(s.set(u,p),i(p,u,n,o,s),s.delete(u)),Jn(e,r,p)}function es(e,t){return yc(mc(e,t,ls),e+"")}var ec=qr?function(e,t){return qr(e,"toString",{configurable:!0,enumerable:!1,value:Cc(t),writable:!0})}:ls;function tc(e,t){if(t)return e.slice();var r=e.length,n=Xo?Xo(r):new e.constructor(r);return e.copy(n),n}function rc(e){var t=new e.constructor(e.byteLength);return new Ro(t).set(new Ro(e)),t}function nc(e,t){var r=t?rc(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ic(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function oc(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var l=t[o],u=n?n(r[l],e[l],l,r,e):void 0;u===void 0&&(u=e[l]),i?ei(r,l,u):Zf(r,l,u)}return r}function sc(e){return es(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&&fc(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,o)}return t})}function ac(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),l=s.length;l--;){var u=s[e?l:++i];if(r(o[u],u,o)===!1)break}return t}}function ts(e,t,r,n,i,o){return Me(e)&&Me(t)&&(o.set(t,e),ti(e,t,void 0,ts,o),o.delete(t)),e}function en(e,t){var r=e.__data__;return cc(t)?r[typeof t=="string"?"string":"hash"]:r.map}function ri(e,t){var r=yf(e,t);return Jf(r)?r:void 0}function lc(e){var t=Ae.call(e,bt),r=e[bt];try{e[bt]=void 0;var n=!0}catch{}var i=$o.call(e);return n&&(t?e[bt]=r:delete e[bt]),i}function uc(e){return typeof e.constructor=="function"&&!ns(e)?If(Ko(e)):{}}function rs(e,t){var r=typeof e;return t=t??jo,!!t&&(r=="number"||r!="symbol"&&pf.test(e))&&e>-1&&e%1==0&&e<t}function fc(e,t,r){if(!Me(r))return!1;var n=typeof t;return(n=="number"?ni(r)&&rs(t,r.length):n=="string"&&t in r)?tn(r[t],e):!1}function cc(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function pc(e){return!!ko&&ko in e}function ns(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Jr;return e===r}function hc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function dc(e){return $o.call(e)}function mc(e,t,r){return t=Fo(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Fo(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(s),Jo(e,this,l)}}function $n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var yc=gc(ec);function gc(e){var t=0,r=0;return function(){var n=Sf(),i=Bu-(n-r);if(r=n,i>0){if(++t>=ku)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vc(e){if(e!=null){try{return $r.call(e)}catch{}try{return e+""}catch{}}return""}function tn(e,t){return e===t||e!==e&&t!==t}var Kn=Go(function(){return arguments}())?Go:function(e){return vr(e)&&Ae.call(e,"callee")&&!Pf.call(e,"callee")},Qn=Array.isArray;function ni(e){return e!=null&&os(e.length)&&!ii(e)}function xc(e){return vr(e)&&ni(e)}var is=Cf||Sc;function ii(e){if(!Me(e))return!1;var t=Qr(e);return t==Vo||t==Wu||t==Xu||t==Hu}function os(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jo}function Me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function vr(e){return e!=null&&typeof e=="object"}function bc(e){if(!vr(e)||Qr(e)!=Ho)return!1;var t=Ko(e);if(t===null)return!0;var r=Ae.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&$r.call(r)==bf}var ss=No?mf(No):$f;function _c(e){return oc(e,as(e))}var Pc=es(function(e){return e.push(void 0,ts),Jo(Tc,void 0,e)});function as(e){return ni(e)?zf(e,!0):Kf(e)}var Tc=sc(function(e,t,r,n){ti(e,t,r,n)});function Cc(e){return function(){return e}}function ls(e){return e}function Sc(){return!1}Yt.exports=Pc});var fa=Nn((br,Vt)=>{h();var dp=200,Vs="__lodash_hash_undefined__",mp=800,yp=16,Hs=9007199254740991,zs="[object Arguments]",gp="[object Array]",vp="[object AsyncFunction]",xp="[object Boolean]",bp="[object Date]",_p="[object Error]",Zs="[object Function]",Pp="[object GeneratorFunction]",Tp="[object Map]",Cp="[object Number]",Sp="[object Null]",qs="[object Object]",Ip="[object Proxy]",wp="[object RegExp]",Op="[object Set]",Ep="[object String]",Mp="[object Undefined]",Ap="[object WeakMap]",Dp="[object ArrayBuffer]",Lp="[object DataView]",Np="[object Float32Array]",kp="[object Float64Array]",Bp="[object Int8Array]",Rp="[object Int16Array]",Xp="[object Int32Array]",Yp="[object Uint8Array]",Fp="[object Uint8ClampedArray]",Gp="[object Uint16Array]",Wp="[object Uint32Array]",jp=/[\\^$.*+?()[\]{}|]/g,Up=/^\[object .+?Constructor\]$/,Vp=/^(?:0|[1-9]\d*)$/,G={};G[Np]=G[kp]=G[Bp]=G[Rp]=G[Xp]=G[Yp]=G[Fp]=G[Gp]=G[Wp]=!0;G[zs]=G[gp]=G[Dp]=G[xp]=G[Lp]=G[bp]=G[_p]=G[Zs]=G[Tp]=G[Cp]=G[qs]=G[wp]=G[Op]=G[Ep]=G[Ap]=!1;var Js=typeof global=="object"&&global&&global.Object===Object&&global,Hp=typeof self=="object"&&self&&self.Object===Object&&self,Tr=Js||Hp||Function("return this")(),$s=typeof br=="object"&&br&&!br.nodeType&&br,_r=$s&&typeof Vt=="object"&&Vt&&!Vt.nodeType&&Vt,Ks=_r&&_r.exports===$s,ui=Ks&&Js.process,Bs=function(){try{var e=_r&&_r.require&&_r.require("util").types;return e||ui&&ui.binding&&ui.binding("util")}catch{}}(),Rs=Bs&&Bs.isTypedArray;function zp(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)}function Zp(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function qp(e){return function(t){return e(t)}}function Jp(e,t){return e?.[t]}function $p(e,t){return function(r){return e(t(r))}}var Kp=Array.prototype,Qp=Function.prototype,fn=Object.prototype,fi=Tr["__core-js_shared__"],cn=Qp.toString,Ne=fn.hasOwnProperty,Xs=function(){var e=/[^.]+$/.exec(fi&&fi.keys&&fi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Qs=fn.toString,eh=cn.call(Object),th=RegExp("^"+cn.call(Ne).replace(jp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ln=Ks?Tr.Buffer:void 0,Ys=Tr.Symbol,Fs=Tr.Uint8Array,Gs=ln?ln.allocUnsafe:void 0,ea=$p(Object.getPrototypeOf,Object),Ws=Object.create,rh=fn.propertyIsEnumerable,nh=Kp.splice,Pt=Ys?Ys.toStringTag:void 0,un=function(){try{var e=yi(Object,"defineProperty");return e({},"",{}),e}catch{}}(),ih=ln?ln.isBuffer:void 0,js=Math.max,oh=Date.now,ta=yi(Tr,"Map"),Pr=yi(Object,"create"),sh=function(){function e(){}return function(t){if(!Ct(t))return{};if(Ws)return Ws(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Tt(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])}}function ah(){this.__data__=Pr?Pr(null):{},this.size=0}function lh(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function uh(e){var t=this.__data__;if(Pr){var r=t[e];return r===Vs?void 0:r}return Ne.call(t,e)?t[e]:void 0}function fh(e){var t=this.__data__;return Pr?t[e]!==void 0:Ne.call(t,e)}function ch(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Pr&&t===void 0?Vs:t,this}Tt.prototype.clear=ah;Tt.prototype.delete=lh;Tt.prototype.get=uh;Tt.prototype.has=fh;Tt.prototype.set=ch;function ke(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])}}function ph(){this.__data__=[],this.size=0}function hh(e){var t=this.__data__,r=pn(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():nh.call(t,r,1),--this.size,!0}function dh(e){var t=this.__data__,r=pn(t,e);return r<0?void 0:t[r][1]}function mh(e){return pn(this.__data__,e)>-1}function yh(e,t){var r=this.__data__,n=pn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}ke.prototype.clear=ph;ke.prototype.delete=hh;ke.prototype.get=dh;ke.prototype.has=mh;ke.prototype.set=yh;function Ht(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])}}function gh(){this.size=0,this.__data__={hash:new Tt,map:new(ta||ke),string:new Tt}}function vh(e){var t=dn(this,e).delete(e);return this.size-=t?1:0,t}function xh(e){return dn(this,e).get(e)}function bh(e){return dn(this,e).has(e)}function _h(e,t){var r=dn(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}Ht.prototype.clear=gh;Ht.prototype.delete=vh;Ht.prototype.get=xh;Ht.prototype.has=bh;Ht.prototype.set=_h;function zt(e){var t=this.__data__=new ke(e);this.size=t.size}function Ph(){this.__data__=new ke,this.size=0}function Th(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Ch(e){return this.__data__.get(e)}function Sh(e){return this.__data__.has(e)}function Ih(e,t){var r=this.__data__;if(r instanceof ke){var n=r.__data__;if(!ta||n.length<dp-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ht(n)}return r.set(e,t),this.size=r.size,this}zt.prototype.clear=Ph;zt.prototype.delete=Th;zt.prototype.get=Ch;zt.prototype.has=Sh;zt.prototype.set=Ih;function wh(e,t){var r=di(e),n=!r&&hi(e),i=!r&&!n&&oa(e),o=!r&&!n&&!i&&aa(e),s=r||n||i||o,l=s?Zp(e.length,String):[],u=l.length;for(var f in e)(t||Ne.call(e,f))&&!(s&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||na(f,u)))&&l.push(f);return l}function ci(e,t,r){(r!==void 0&&!mn(e[t],r)||r===void 0&&!(t in e))&&mi(e,t,r)}function Oh(e,t,r){var n=e[t];(!(Ne.call(e,t)&&mn(n,r))||r===void 0&&!(t in e))&&mi(e,t,r)}function pn(e,t){for(var r=e.length;r--;)if(mn(e[r][0],t))return r;return-1}function mi(e,t,r){t=="__proto__"&&un?un(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Eh=Wh();function hn(e){return e==null?e===void 0?Mp:Sp:Pt&&Pt in Object(e)?jh(e):qh(e)}function Us(e){return Cr(e)&&hn(e)==zs}function Mh(e){if(!Ct(e)||zh(e))return!1;var t=vi(e)?th:Up;return t.test(Qh(e))}function Ah(e){return Cr(e)&&sa(e.length)&&!!G[hn(e)]}function Dh(e){if(!Ct(e))return Zh(e);var t=ia(e),r=[];for(var n in e)n=="constructor"&&(t||!Ne.call(e,n))||r.push(n);return r}function ra(e,t,r,n,i){e!==t&&Eh(t,function(o,s){if(i||(i=new zt),Ct(o))Lh(e,t,s,r,ra,n,i);else{var l=n?n(pi(e,s),o,s+"",e,t,i):void 0;l===void 0&&(l=o),ci(e,s,l)}},la)}function Lh(e,t,r,n,i,o,s){var l=pi(e,r),u=pi(t,r),f=s.get(u);if(f){ci(e,r,f);return}var p=o?o(l,u,r+"",e,t,s):void 0,d=p===void 0;if(d){var m=di(u),g=!m&&oa(u),b=!m&&!g&&aa(u);p=u,m||g||b?di(l)?p=l:ed(l)?p=Yh(l):g?(d=!1,p=Bh(u,!0)):b?(d=!1,p=Xh(u,!0)):p=[]:td(u)||hi(u)?(p=l,hi(l)?p=rd(l):(!Ct(l)||vi(l))&&(p=Uh(u))):d=!1}d&&(s.set(u,p),i(p,u,n,o,s),s.delete(u)),ci(e,r,p)}function Nh(e,t){return $h(Jh(e,t,ua),e+"")}var kh=un?function(e,t){return un(e,"toString",{configurable:!0,enumerable:!1,value:id(t),writable:!0})}:ua;function Bh(e,t){if(t)return e.slice();var r=e.length,n=Gs?Gs(r):new e.constructor(r);return e.copy(n),n}function Rh(e){var t=new e.constructor(e.byteLength);return new Fs(t).set(new Fs(e)),t}function Xh(e,t){var r=t?Rh(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Yh(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Fh(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var l=t[o],u=n?n(r[l],e[l],l,r,e):void 0;u===void 0&&(u=e[l]),i?mi(r,l,u):Oh(r,l,u)}return r}function Gh(e){return Nh(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&&Vh(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,o)}return t})}function Wh(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),l=s.length;l--;){var u=s[e?l:++i];if(r(o[u],u,o)===!1)break}return t}}function dn(e,t){var r=e.__data__;return Hh(t)?r[typeof t=="string"?"string":"hash"]:r.map}function yi(e,t){var r=Jp(e,t);return Mh(r)?r:void 0}function jh(e){var t=Ne.call(e,Pt),r=e[Pt];try{e[Pt]=void 0;var n=!0}catch{}var i=Qs.call(e);return n&&(t?e[Pt]=r:delete e[Pt]),i}function Uh(e){return typeof e.constructor=="function"&&!ia(e)?sh(ea(e)):{}}function na(e,t){var r=typeof e;return t=t??Hs,!!t&&(r=="number"||r!="symbol"&&Vp.test(e))&&e>-1&&e%1==0&&e<t}function Vh(e,t,r){if(!Ct(r))return!1;var n=typeof t;return(n=="number"?gi(r)&&na(t,r.length):n=="string"&&t in r)?mn(r[t],e):!1}function Hh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zh(e){return!!Xs&&Xs in e}function ia(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fn;return e===r}function Zh(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function qh(e){return Qs.call(e)}function Jh(e,t,r){return t=js(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=js(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(s),zp(e,this,l)}}function pi(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var $h=Kh(kh);function Kh(e){var t=0,r=0;return function(){var n=oh(),i=yp-(n-r);if(r=n,i>0){if(++t>=mp)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Qh(e){if(e!=null){try{return cn.call(e)}catch{}try{return e+""}catch{}}return""}function mn(e,t){return e===t||e!==e&&t!==t}var hi=Us(function(){return arguments}())?Us:function(e){return Cr(e)&&Ne.call(e,"callee")&&!rh.call(e,"callee")},di=Array.isArray;function gi(e){return e!=null&&sa(e.length)&&!vi(e)}function ed(e){return Cr(e)&&gi(e)}var oa=ih||od;function vi(e){if(!Ct(e))return!1;var t=hn(e);return t==Zs||t==Pp||t==vp||t==Ip}function sa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Hs}function Ct(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Cr(e){return e!=null&&typeof e=="object"}function td(e){if(!Cr(e)||hn(e)!=qs)return!1;var t=ea(e);if(t===null)return!0;var r=Ne.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&cn.call(r)==eh}var aa=Rs?qp(Rs):Ah;function rd(e){return Fh(e,la(e))}function la(e){return gi(e)?wh(e,!0):Dh(e)}var nd=Gh(function(e,t,r){ra(e,t,r)});function id(e){return function(){return e}}function ua(e){return e}function od(){return!1}Vt.exports=nd});var Na=Nn((C_,Ar)=>{"use strict";h();var wd=!1,It=!1,wa=!0,Oa=!1,a={},Ea=!1;typeof Ar<"u"&&Ar.exports?(Ar.exports=a,Ea=!0):typeof document<"u"?window.ClipperLib=a:self.ClipperLib=a;var Pn;Ea?(z="chrome",Pn="Netscape"):(z=navigator.userAgent.toString().toLowerCase(),Pn=navigator.appName);var z,R={};z.indexOf("chrome")!=-1&&z.indexOf("chromium")==-1?R.chrome=1:R.chrome=0;z.indexOf("chromium")!=-1?R.chromium=1:R.chromium=0;z.indexOf("safari")!=-1&&z.indexOf("chrome")==-1&&z.indexOf("chromium")==-1?R.safari=1:R.safari=0;z.indexOf("firefox")!=-1?R.firefox=1:R.firefox=0;z.indexOf("firefox/17")!=-1?R.firefox17=1:R.firefox17=0;z.indexOf("firefox/15")!=-1?R.firefox15=1:R.firefox15=0;z.indexOf("firefox/3")!=-1?R.firefox3=1:R.firefox3=0;z.indexOf("opera")!=-1?R.opera=1:R.opera=0;z.indexOf("msie 10")!=-1?R.msie10=1:R.msie10=0;z.indexOf("msie 9")!=-1?R.msie9=1:R.msie9=0;z.indexOf("msie 8")!=-1?R.msie8=1:R.msie8=0;z.indexOf("msie 7")!=-1?R.msie7=1:R.msie7=0;z.indexOf("msie ")!=-1?R.msie=1:R.msie=0;a.biginteger_used=null;var qe,Od=0xdeadbeefcafe,Sa=(Od&16777215)==15715070;function y(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))}function X(){return new y(null)}function Ed(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}function Md(e,t,r,n,i,o){for(var s=t&32767,l=t>>15;--o>=0;){var u=this[e]&32767,f=this[e++]>>15,p=l*u+f*s;u=s*u+((p&32767)<<15)+r[n]+(i&1073741823),i=(u>>>30)+(p>>>15)+l*f+(i>>>30),r[n++]=u&1073741823}return i}function Ad(e,t,r,n,i,o){for(var s=t&16383,l=t>>14;--o>=0;){var u=this[e]&16383,f=this[e++]>>14,p=l*u+f*s;u=s*u+((p&16383)<<14)+r[n]+i,i=(u>>28)+(p>>14)+l*f,r[n++]=u&268435455}return i}Sa&&Pn=="Microsoft Internet Explorer"?(y.prototype.am=Md,qe=30):Sa&&Pn!="Netscape"?(y.prototype.am=Ed,qe=26):(y.prototype.am=Ad,qe=28);y.prototype.DB=qe;y.prototype.DM=(1<<qe)-1;y.prototype.DV=1<<qe;var Ii=52;y.prototype.FV=Math.pow(2,Ii);y.prototype.F1=Ii-qe;y.prototype.F2=2*qe-Ii;var Dd="0123456789abcdefghijklmnopqrstuvwxyz",Cn=new Array,Kt,de;Kt=48;for(de=0;de<=9;++de)Cn[Kt++]=de;Kt=97;for(de=10;de<36;++de)Cn[Kt++]=de;Kt=65;for(de=10;de<36;++de)Cn[Kt++]=de;function Ia(e){return Dd.charAt(e)}function Ma(e,t){var r=Cn[e.charCodeAt(t)];return r??-1}function Ld(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function Nd(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}function Ze(e){var t=X();return t.fromInt(e),t}function kd(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:Ma(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&&y.ZERO.subTo(this,this)}function Bd(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function Rd(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,l=this.DB-s*this.DB%t;if(s-- >0)for(l<this.DB&&(n=this[s]>>l)>0&&(i=!0,o=Ia(n));s>=0;)l<t?(n=(this[s]&(1<<l)-1)<<t-l,n|=this[--s]>>(l+=this.DB-t)):(n=this[s]>>(l-=t)&r,l<=0&&(l+=this.DB,--s)),n>0&&(i=!0),i&&(o+=Ia(n));return i?o:"0"}function Xd(){var e=X();return y.ZERO.subTo(this,e),e}function Yd(){return this.s<0?this.negate():this}function Fd(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}function Sn(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}function Gd(){return this.t<=0?0:this.DB*(this.t-1)+Sn(this[this.t-1]^this.s&this.DM)}function Wd(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}function jd(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}function Ud(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,l;for(l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>n|s,s=(this[l]&i)<<r;for(l=o-1;l>=0;--l)t[l]=0;t[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()}function Vd(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()}function Hd(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()}function zd(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&&y.ZERO.subTo(t,t)}function Zd(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()}function qd(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=X());var o=X(),s=this.s,l=e.s,u=this.DB-Sn(n[n.t-1]);u>0?(n.lShiftTo(u,o),i.lShiftTo(u,r)):(n.copyTo(o),i.copyTo(r));var f=o.t,p=o[f-1];if(p!=0){var d=p*(1<<this.F1)+(f>1?o[f-2]>>this.F2:0),m=this.FV/d,g=(1<<this.F1)/d,b=1<<this.F2,C=r.t,w=C-f,M=t??X();for(o.dlShiftTo(w,M),r.compareTo(M)>=0&&(r[r.t++]=1,r.subTo(M,r)),y.ONE.dlShiftTo(f,M),M.subTo(o,o);o.t<f;)o[o.t++]=0;for(;--w>=0;){var N=r[--C]==p?this.DM:Math.floor(r[C]*m+(r[C-1]+b)*g);if((r[C]+=o.am(0,N,r,w,0,f))<N)for(o.dlShiftTo(w,M),r.subTo(M,r);r[C]<--N;)r.subTo(M,r)}t!=null&&(r.drShiftTo(f,t),s!=l&&y.ZERO.subTo(t,t)),r.t=f,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&y.ZERO.subTo(r,r)}}}function Jd(e){var t=X();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(y.ZERO)>0&&e.subTo(t,t),t}function wt(e){this.m=e}function $d(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Kd(e){return e}function Qd(e){e.divRemTo(this.m,null,e)}function em(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function tm(e,t){e.squareTo(t),this.reduce(t)}wt.prototype.convert=$d;wt.prototype.revert=Kd;wt.prototype.reduce=Qd;wt.prototype.mulTo=em;wt.prototype.sqrTo=tm;function rm(){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}function Ot(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}function nm(e){var t=X();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(y.ZERO)>0&&this.m.subTo(t,t),t}function im(e){var t=X();return e.copyTo(t),this.reduce(t),t}function om(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)}function sm(e,t){e.squareTo(t),this.reduce(t)}function am(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Ot.prototype.convert=nm;Ot.prototype.revert=im;Ot.prototype.reduce=om;Ot.prototype.mulTo=am;Ot.prototype.sqrTo=sm;function lm(){return(this.t>0?this[0]&1:this.s)==0}function um(e,t){if(e>4294967295||e<1)return y.ONE;var r=X(),n=X(),i=t.convert(this),o=Sn(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)}function fm(e,t){var r;return e<256||t.isEven()?r=new wt(t):r=new Ot(t),this.exp(e,r)}y.prototype.copyTo=Ld;y.prototype.fromInt=Nd;y.prototype.fromString=kd;y.prototype.clamp=Bd;y.prototype.dlShiftTo=Wd;y.prototype.drShiftTo=jd;y.prototype.lShiftTo=Ud;y.prototype.rShiftTo=Vd;y.prototype.subTo=Hd;y.prototype.multiplyTo=zd;y.prototype.squareTo=Zd;y.prototype.divRemTo=qd;y.prototype.invDigit=rm;y.prototype.isEven=lm;y.prototype.exp=um;y.prototype.toString=Rd;y.prototype.negate=Xd;y.prototype.abs=Yd;y.prototype.compareTo=Fd;y.prototype.bitLength=Gd;y.prototype.mod=Jd;y.prototype.modPowInt=fm;y.ZERO=Ze(0);y.ONE=Ze(1);function cm(){var e=X();return this.copyTo(e),e}function pm(){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]}function hm(){return this.t==0?this.s:this[0]<<24>>24}function dm(){return this.t==0?this.s:this[0]<<16>>16}function mm(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function ym(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function gm(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=Ze(r),i=X(),o=X(),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}function vm(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,l=0;l<e.length;++l){var u=Ma(e,l);if(u<0){e.charAt(l)=="-"&&this.signum()==0&&(i=!0);continue}s=t*s+u,++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&&y.ZERO.subTo(this,this)}function xm(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(y.ONE.shiftLeft(e-1),wi,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(y.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)}}function bm(){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}function _m(e){return this.compareTo(e)==0}function Pm(e){return this.compareTo(e)<0?this:e}function Tm(e){return this.compareTo(e)>0?this:e}function Cm(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()}function Sm(e,t){return e&t}function Im(e){var t=X();return this.bitwiseTo(e,Sm,t),t}function wi(e,t){return e|t}function wm(e){var t=X();return this.bitwiseTo(e,wi,t),t}function Aa(e,t){return e^t}function Om(e){var t=X();return this.bitwiseTo(e,Aa,t),t}function Da(e,t){return e&~t}function Em(e){var t=X();return this.bitwiseTo(e,Da,t),t}function Mm(){for(var e=X(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function Am(e){var t=X();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function Dm(e){var t=X();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Lm(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}function Nm(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+Lm(this[e]);return this.s<0?this.t*this.DB:-1}function km(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function Bm(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=km(this[r]^t);return e}function Rm(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function Xm(e,t){var r=y.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function Ym(e){return this.changeBit(e,wi)}function Fm(e){return this.changeBit(e,Da)}function Gm(e){return this.changeBit(e,Aa)}function Wm(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()}function jm(e){var t=X();return this.addTo(e,t),t}function Um(e){var t=X();return this.subTo(e,t),t}function Vm(e){var t=X();return this.multiplyTo(e,t),t}function Hm(){var e=X();return this.squareTo(e),e}function zm(e){var t=X();return this.divRemTo(e,t,null),t}function Zm(e){var t=X();return this.divRemTo(e,null,t),t}function qm(e){var t=X(),r=X();return this.divRemTo(e,t,r),new Array(t,r)}function Jm(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function $m(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]}}function Dr(){}function La(e){return e}function Km(e,t,r){e.multiplyTo(t,r)}function Qm(e,t){e.squareTo(t)}Dr.prototype.convert=La;Dr.prototype.revert=La;Dr.prototype.mulTo=Km;Dr.prototype.sqrTo=Qm;function ey(e){return this.exp(e,new Dr)}function ty(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()}function ry(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)}function Qt(e){this.r2=X(),this.q3=X(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function ny(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=X();return e.copyTo(t),this.reduce(t),t}function iy(e){return e}function oy(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)}function sy(e,t){e.squareTo(t),this.reduce(t)}function ay(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Qt.prototype.convert=ny;Qt.prototype.revert=iy;Qt.prototype.reduce=oy;Qt.prototype.mulTo=ay;Qt.prototype.sqrTo=sy;function ly(e,t){var r=e.bitLength(),n,i=Ze(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 wt(t):t.isEven()?o=new Qt(t):o=new Ot(t);var s=new Array,l=3,u=n-1,f=(1<<n)-1;if(s[1]=o.convert(this),n>1){var p=X();for(o.sqrTo(s[1],p);l<=f;)s[l]=X(),o.mulTo(p,s[l-2],s[l]),l+=2}var d=e.t-1,m,g=!0,b=X(),C;for(r=Sn(e[d])-1;d>=0;){for(r>=u?m=e[d]>>r-u&f:(m=(e[d]&(1<<r+1)-1)<<u-r,d>0&&(m|=e[d-1]>>this.DB+r-u)),l=n;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--d),g)s[m].copyTo(i),g=!1;else{for(;l>1;)o.sqrTo(i,b),o.sqrTo(b,i),l-=2;l>0?o.sqrTo(i,b):(C=i,i=b,b=C),o.mulTo(b,s[m],i)}for(;d>=0&&(e[d]&1<<r)==0;)o.sqrTo(i,b),C=i,i=b,b=C,--r<0&&(r=this.DB-1,--d)}return o.revert(i)}function uy(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}function fy(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}function cy(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return y.ZERO;for(var r=e.clone(),n=this.clone(),i=Ze(1),o=Ze(0),s=Ze(0),l=Ze(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()||!l.isEven())&&(s.addTo(this,s),l.subTo(e,l)),s.rShiftTo(1,s)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(l,o)):(n.subTo(r,n),t&&s.subTo(i,s),l.subTo(o,l))}if(n.compareTo(y.ONE)!=0)return y.ZERO;if(l.compareTo(e)>=0)return l.subtract(e);if(l.signum()<0)l.addTo(e,l);else return l;return l.signum()<0?l.add(e):l}var Q=[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],py=(1<<26)/Q[Q.length-1];function hy(e){var t,r=this.abs();if(r.t==1&&r[0]<=Q[Q.length-1]){for(t=0;t<Q.length;++t)if(r[0]==Q[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Q.length;){for(var n=Q[t],i=t+1;i<Q.length&&n<py;)n*=Q[i++];for(n=r.modInt(n);t<i;)if(n%Q[t++]==0)return!1}return r.millerRabin(e)}function dy(e){var t=this.subtract(y.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Q.length&&(e=Q.length);for(var i=X(),o=0;o<e;++o){i.fromInt(Q[Math.floor(Math.random()*Q.length)]);var s=i.modPow(n,this);if(s.compareTo(y.ONE)!=0&&s.compareTo(t)!=0){for(var l=1;l++<r&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(y.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}y.prototype.chunkSize=mm;y.prototype.toRadix=gm;y.prototype.fromRadix=vm;y.prototype.fromNumber=xm;y.prototype.bitwiseTo=Cm;y.prototype.changeBit=Xm;y.prototype.addTo=Wm;y.prototype.dMultiply=Jm;y.prototype.dAddOffset=$m;y.prototype.multiplyLowerTo=ty;y.prototype.multiplyUpperTo=ry;y.prototype.modInt=fy;y.prototype.millerRabin=dy;y.prototype.clone=cm;y.prototype.intValue=pm;y.prototype.byteValue=hm;y.prototype.shortValue=dm;y.prototype.signum=ym;y.prototype.toByteArray=bm;y.prototype.equals=_m;y.prototype.min=Pm;y.prototype.max=Tm;y.prototype.and=Im;y.prototype.or=wm;y.prototype.xor=Om;y.prototype.andNot=Em;y.prototype.not=Mm;y.prototype.shiftLeft=Am;y.prototype.shiftRight=Dm;y.prototype.getLowestSetBit=Nm;y.prototype.bitCount=Bm;y.prototype.testBit=Rm;y.prototype.setBit=Ym;y.prototype.clearBit=Fm;y.prototype.flipBit=Gm;y.prototype.add=jm;y.prototype.subtract=Um;y.prototype.multiply=Vm;y.prototype.divide=zm;y.prototype.remainder=Zm;y.prototype.divideAndRemainder=qm;y.prototype.modPow=ly;y.prototype.modInverse=cy;y.prototype.pow=ey;y.prototype.gcd=uy;y.prototype.isProbablePrime=hy;y.prototype.square=Hm;var k=y;k.prototype.IsNegative=function(){return this.compareTo(k.ZERO)==-1};k.op_Equality=function(e,t){return e.compareTo(t)==0};k.op_Inequality=function(e,t){return e.compareTo(t)!=0};k.op_GreaterThan=function(e,t){return e.compareTo(t)>0};k.op_LessThan=function(e,t){return e.compareTo(t)<0};k.op_Addition=function(e,t){return new k(e).add(new k(t))};k.op_Subtraction=function(e,t){return new k(e).subtract(new k(t))};k.Int128Mul=function(e,t){return new k(e).multiply(new k(t))};k.op_Division=function(e,t){return e.divide(t)};k.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Tn>"u"&&(Tn=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}});var Tn;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};Tn(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)};R.msie||R.opera||R.safari?a.Cast_Int32=function(e){return e|0}:a.Cast_Int32=function(e){return~~e};R.chrome?a.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:R.firefox&&typeof Number.toInteger=="function"?a.Cast_Int64=function(e){return Number.toInteger(e)}:R.msie7||R.msie8?a.Cast_Int64=function(e){return parseInt(e,10)}:R.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};Oa&&(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;wd?(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&&k.op_Equality(k.Int128Mul(e.X-t.X,r.Y-t.Y),k.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,l,u;return t==3?(r=e[0],n=e[1],u=e[2],u?k.op_Equality(k.Int128Mul(r.Delta.Y,n.Delta.X),k.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],u=e[3],u?k.op_Equality(k.Int128Mul(i.Y-o.Y,o.X-s.X),k.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],l=e[3],u=e[4],u?k.op_Equality(k.Int128Mul(i.Y-o.Y,s.X-l.X),k.Int128Mul(i.X-o.X,s.Y-l.Y)):a.Cast_Int64((i.Y-o.Y)*(s.X-l.X))-a.Cast_Int64((i.X-o.X)*(s.Y-l.Y))===0)};a.ClipperBase.SlopesEqual3=function(e,t,r){return r?k.op_Equality(k.Int128Mul(e.Delta.Y,t.Delta.X),k.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?k.op_Equality(k.Int128Mul(e.Y-t.Y,t.X-r.X),k.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?k.op_Equality(k.Int128Mul(e.Y-t.Y,r.X-n.X),k.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){wa?!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 l={Value:this.m_UseFullRange};this.RangeTest(e[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(e[n],l),this.m_UseFullRange=l.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)l.Value=this.m_UseFullRange,this.RangeTest(e[o],l),this.m_UseFullRange=l.Value,this.InitEdge(i[o],i[o+1],i[o-1],e[o]);for(var u=i[0],f=u,p=u;;){if(a.IntPoint.op_Equality(f.Curr,f.Next.Curr)){if(f==f.Next)break;f==u&&(u=f.Next),f=this.RemoveEdge(f),p=f;continue}if(f.Prev==f.Next)break;if(r&&a.ClipperBase.SlopesEqual(f.Prev.Curr,f.Curr,f.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(f.Prev.Curr,f.Curr,f.Next.Curr))){f==u&&(u=f.Next),f=this.RemoveEdge(f),f=f.Prev,p=f;continue}if(f=f.Next,f==p)break}if(!r&&f==f.Next||r&&f.Prev==f.Next)return!1;r||(this.m_HasOpenPaths=!0,u.Prev.OutIdx=a.ClipperBase.Skip);var d=u;f=u;do this.InitEdge2(f,t),f=f.Next,s&&f.Curr.Y!=u.Curr.Y&&(s=!1);while(f!=u);if(s){if(r)return!1;f.Prev.OutIdx=a.ClipperBase.Skip,f.Prev.Bot.X<f.Prev.Top.X&&this.ReverseHorizontal(f.Prev);var m=new a.LocalMinima;for(m.Next=null,m.Y=f.Bot.Y,m.LeftBound=null,m.RightBound=f,m.RightBound.Side=a.EdgeSide.esRight,m.RightBound.WindDelta=0;f.Next.OutIdx!=a.ClipperBase.Skip;)f.NextInLML=f.Next,f.Bot.X!=f.Prev.Top.X&&this.ReverseHorizontal(f),f=f.Next;return this.InsertLocalMinima(m),this.m_edges.push(i),!0}this.m_edges.push(i);for(var g,b=null;f=this.FindNextLocMin(f),f!=b;){b==null&&(b=f);var m=new a.LocalMinima;m.Next=null,m.Y=f.Bot.Y,f.Dx<f.Prev.Dx?(m.LeftBound=f.Prev,m.RightBound=f,g=!1):(m.LeftBound=f,m.RightBound=f.Prev,g=!0),m.LeftBound.Side=a.EdgeSide.esLeft,m.RightBound.Side=a.EdgeSide.esRight,r?m.LeftBound.Next==m.RightBound?m.LeftBound.WindDelta=-1:m.LeftBound.WindDelta=1:m.LeftBound.WindDelta=0,m.RightBound.WindDelta=-m.LeftBound.WindDelta,f=this.ProcessBound(m.LeftBound,g);var C=this.ProcessBound(m.RightBound,!g);m.LeftBound.OutIdx==a.ClipperBase.Skip?m.LeftBound=null:m.RightBound.OutIdx==a.ClipperBase.Skip&&(m.RightBound=null),this.InsertLocalMinima(m),g||(f=C)}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 l=this.ExecuteInternal();l&&this.BuildResult(i)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==4&&r){var n=e[0],u=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 l=this.ExecuteInternal();l&&this.BuildResult2(u)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}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],u=e[1];return this.Execute(n,u,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 l=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,l,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 l=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,l,r.Top)}var u=t.NextInAEL;if(u!==null)for(;u!=r;)this.IntersectEdges(r,u,t.Curr,!1),u=u.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,l=n.Pts,u=l.Prev,f;e.Side==a.EdgeSide.esLeft?(t.Side==a.EdgeSide.esLeft?(this.ReversePolyPtLinks(l),l.Next=o,o.Prev=l,s.Next=u,u.Prev=s,r.Pts=u):(u.Next=o,o.Prev=u,l.Prev=s,s.Next=l,r.Pts=l),f=a.EdgeSide.esLeft):(t.Side==a.EdgeSide.esRight?(this.ReversePolyPtLinks(l),s.Next=u,u.Prev=s,l.Next=o,o.Prev=l):(s.Next=l,l.Prev=s,o.Prev=u,u.Next=o),f=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 p=e.OutIdx,d=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var m=this.m_ActiveEdges;m!==null;){if(m.OutIdx==d){m.OutIdx=p,m.Side=f;break}m=m.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,l=t.OutIdx>=0;if(wa&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(i||o)&&s&&l&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==a.ClipType.ctUnion?e.WindDelta===0?l&&(this.AddOutPt(e,r),s&&(e.OutIdx=-1)):s&&(this.AddOutPt(t,r),l&&(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),l&&(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 u=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=u}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 f,p,d,m;e.PolyTyp==a.PolyType.ptSubject?(f=this.m_SubjFillType,d=this.m_ClipFillType):(f=this.m_ClipFillType,d=this.m_SubjFillType),t.PolyTyp==a.PolyType.ptSubject?(p=this.m_SubjFillType,m=this.m_ClipFillType):(p=this.m_ClipFillType,m=this.m_SubjFillType);var g,b;switch(f){case a.PolyFillType.pftPositive:g=e.WindCnt;break;case a.PolyFillType.pftNegative:g=-e.WindCnt;break;default:g=Math.abs(e.WindCnt);break}switch(p){case a.PolyFillType.pftPositive:b=t.WindCnt;break;case a.PolyFillType.pftNegative:b=-t.WindCnt;break;default:b=Math.abs(t.WindCnt);break}if(s&&l)i||o||g!==0&&g!=1||b!==0&&b!=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)(b===0||b==1)&&(this.AddOutPt(e,r),a.Clipper.SwapSides(e,t),a.Clipper.SwapPolyIndexes(e,t));else if(l)(g===0||g==1)&&(this.AddOutPt(t,r),a.Clipper.SwapSides(e,t),a.Clipper.SwapPolyIndexes(e,t));else if((g===0||g==1)&&(b===0||b==1)&&!i&&!o){var C,w;switch(d){case a.PolyFillType.pftPositive:C=e.WindCnt2;break;case a.PolyFillType.pftNegative:C=-e.WindCnt2;break;default:C=Math.abs(e.WindCnt2);break}switch(m){case a.PolyFillType.pftPositive:w=t.WindCnt2;break;case a.PolyFillType.pftNegative:w=-t.WindCnt2;break;default:w=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(g==1&&b==1)switch(this.m_ClipType){case a.ClipType.ctIntersection:C>0&&w>0&&this.AddLocalMinPoly(e,t,r);break;case a.ClipType.ctUnion:C<=0&&w<=0&&this.AddLocalMinPoly(e,t,r);break;case a.ClipType.ctDifference:(e.PolyTyp==a.PolyType.ptClip&&C>0&&w>0||e.PolyTyp==a.PolyType.ptSubject&&C<=0&&w<=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,l=null;s.NextInLML!==null&&a.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(l=this.GetMaximaPair(s));;){for(var u=e==s,f=this.GetNextInAEL(e,n);f!==null&&!(f.Curr.X==e.Top.X&&e.NextInLML!==null&&f.Dx<e.NextInLML.Dx);){var p=this.GetNextInAEL(f,n);if(n==a.Direction.dLeftToRight&&f.Curr.X<=o||n==a.Direction.dRightToLeft&&f.Curr.X>=i){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),f==l&&u){n==a.Direction.dLeftToRight?this.IntersectEdges(e,f,f.Top,!1):this.IntersectEdges(f,e,f.Top,!1),l.OutIdx>=0&&a.Error("ProcessHorizontal error");return}else if(n==a.Direction.dLeftToRight){var d=new a.IntPoint(f.Curr.X,e.Curr.Y);this.IntersectEdges(e,f,d,!0)}else{var d=new a.IntPoint(f.Curr.X,e.Curr.Y);this.IntersectEdges(f,e,d,!0)}this.SwapPositionsInAEL(e,f)}else if(n==a.Direction.dLeftToRight&&f.Curr.X>=o||n==a.Direction.dRightToLeft&&f.Curr.X<=i)break;f=p}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 m=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var g=e.PrevInAEL,p=e.NextInAEL;if(g!==null&&g.Curr.X==e.Bot.X&&g.Curr.Y==e.Bot.Y&&g.WindDelta!==0&&g.OutIdx>=0&&g.Curr.Y>g.Top.Y&&a.ClipperBase.SlopesEqual(e,g,this.m_UseFullRange)){var b=this.AddOutPt(g,e.Bot);this.AddJoin(m,b,e.Top)}else if(p!==null&&p.Curr.X==e.Bot.X&&p.Curr.Y==e.Bot.Y&&p.WindDelta!==0&&p.OutIdx>=0&&p.Curr.Y>p.Top.Y&&a.ClipperBase.SlopesEqual(e,p,this.m_UseFullRange)){var b=this.AddOutPt(p,e.Bot);this.AddJoin(m,b,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else l!==null?l.OutIdx>=0?(n==a.Direction.dLeftToRight?this.IntersectEdges(e,l,e.Top,!1):this.IntersectEdges(l,e,e.Top,!1),l.OutIdx>=0&&a.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(l)):(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{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 my=function(e){return e<0?Math.ceil(e-.5):Math.round(e)},yy=function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},gy=function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},vy=function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)};R.msie?a.Clipper.Round=my:R.chromium?a.Clipper.Round=gy:R.safari?a.Clipper.Round=vy:a.Clipper.Round=yy;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,l=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(l!==null&&l.Curr.X==t.Bot.X&&l.Curr.Y==t.Bot.Y&&o!==null&&l.OutIdx>=0&&l.Curr.Y>l.Top.Y&&a.ClipperBase.SlopesEqual(t,l,this.m_UseFullRange)&&t.WindDelta!==0&&l.WindDelta!==0){var s=this.AddOutPt(l,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),l=0;l<o;l++)s[l]=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,l=0;l<i;l++)o.m_polygon[l]=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,l=r.Pt.X>n.Pt.X?a.Direction.dRightToLeft:a.Direction.dLeftToRight;if(s==l)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(l==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,l=e.OutPt1.Pt.Y==e.OffPt.Y;if(l&&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 u=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 f=s.Pt.Y>e.OffPt.Y;return u==f?!1:u?(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(l){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 p={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,o.Pt.X,s.Pt.X,p))return!1;var d=p.Left,m=p.Right,g=new a.IntPoint,b;return n.Pt.X>=d&&n.Pt.X<=m?(g.X=n.Pt.X,g.Y=n.Pt.Y,b=n.Pt.X>i.Pt.X):o.Pt.X>=d&&o.Pt.X<=m?(g.X=o.Pt.X,g.Y=o.Pt.Y,b=o.Pt.X>s.Pt.X):i.Pt.X>=d&&i.Pt.X<=m?(g.X=i.Pt.X,g.Y=i.Pt.Y,b=i.Pt.X>n.Pt.X):(g.X=s.Pt.X,g.Y=s.Pt.Y,b=s.Pt.X>o.Pt.X),e.OutPt1=n,e.OutPt2=o,this.JoinHorz(n,i,o,s,g,b)}else{for(i=n.Next;a.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var C=i.Pt.Y>n.Pt.Y||!a.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange);if(C){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 w=s.Pt.Y>o.Pt.Y||!a.ClipperBase.SlopesEqual(o.Pt,s.Pt,e.OffPt,this.m_UseFullRange);if(w){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&&C==w?!1:C?(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 l=(i.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(i.Y-e.Y);if(l==0)return-1;l>0==s.Y>i.Y&&(r=1-r)}else if(s.X>e.X){var l=(i.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(i.Y-e.Y);if(l==0)return-1;l>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,l=t.Next.Pt.Y;if(l==e.Y&&(s==e.X||o==e.Y&&s>e.X==i<e.X))return-1;if(o<e.Y!=l<e.Y){if(i>=e.X)if(s>e.X)r=1-r;else{var u=(i-e.X)*(l-e.Y)-(s-e.X)*(o-e.Y);if(u==0)return-1;u>0==l>o&&(r=1-r)}else if(s>e.X){var u=(i-e.X)*(l-e.Y)-(s-e.X)*(o-e.Y);if(u==0)return-1;u>0==l>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,l=this.m_PolyOuts.length;s<l-1;s++){var u=this.m_PolyOuts[s];u.Pts==null||a.Clipper.ParseFirstLeft(u.FirstLeft)!=n||u.IsHole==n.IsHole||this.Poly2ContainsPoly1(u.Pts,r.OutPt2)&&(u.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};Oa&&(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 l=new Array(r),i=0;i<r;++i)l[i]=new a.IntPoint(s.Pt),s=s.Next;return n=null,l};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,l=new Array;if(r)for(var u=0;u<s;u++){for(var f=new Array(o),p=0,d=e.length,m=e[p];p<d;p++,m=e[p])f[p]=new a.IntPoint(t[u].X+m.X,t[u].Y+m.Y);l.push(f)}else for(var u=0;u<s;u++){for(var f=new Array(o),p=0,d=e.length,m=e[p];p<d;p++,m=e[p])f[p]=new a.IntPoint(t[u].X-m.X,t[u].Y-m.Y);l.push(f)}for(var g=new Array,u=0;u<s-1+i;u++)for(var p=0;p<o;p++){var b=new Array;b.push(l[u%s][p%o]),b.push(l[(u+1)%s][p%o]),b.push(l[(u+1)%s][(p+1)%o]),b.push(l[u%s][(p+1)%o]),a.Clipper.Orientation(b)||b.reverse(),g.push(b)}var C=new a.Clipper(0);return C.AddPaths(g,a.PolyType.ptSubject,!0),C.Execute(a.ClipType.ctUnion,l,a.PolyFillType.pftNonZero,a.PolyFillType.pftNonZero),l};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],l=new a.Clipper,u,f=0,p=o.length;f<p;++f){var u=a.Clipper.Minkowski(r,o[f],!0,i);l.AddPaths(u,a.PolyType.ptSubject,!0)}i&&l.AddPaths(o,a.PolyType.ptClip,!0);var d=new a.Paths;return l.Execute(a.ClipType.ctUnion,d,s,s),d}};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,l=o[i];i<s;i++,l=o[i])a.Clipper.AddPolyNodeToPaths(l,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};Tn(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,l=1;l<=n;l++)a.IntPoint.op_Inequality(i.m_polygon[o],e[l])&&(o++,i.m_polygon.push(e[l]),(e[l].Y>i.m_polygon[s].Y||e[l].Y==i.m_polygon[s].Y&&e[l].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 u=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[s].Y>u.Y||i.m_polygon[s].Y==u.Y&&i.m_polygon[s].X<u.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,l=0,u=1;u<=i;u++){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+l*e)));var f=s;s=s*this.m_cos-this.m_sin*l,l=f*this.m_sin+l*this.m_cos}else for(var s=-1,l=-1,u=0;u<4;++u)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+l*e))),s<0?s=1:l<0?l=1:s=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var u=0;u<o-1;u++)this.m_normals.push(a.ClipperOffset.GetUnitNormal(this.m_srcPoly[u],this.m_srcPoly[u+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 p=o-1,u=0;u<o;u++)p=this.OffsetPoint(u,p,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==a.EndType.etClosedLine){for(var p=o-1,u=0;u<o;u++)p=this.OffsetPoint(u,p,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var d=this.m_normals[o-1],u=o-1;u>0;u--)this.m_normals[u]=new a.DoublePoint(-this.m_normals[u-1].X,-this.m_normals[u-1].Y);this.m_normals[0]=new a.DoublePoint(-d.X,-d.Y),p=0;for(var u=o-1;u>=0;u--)p=this.OffsetPoint(u,p,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var p=0,u=1;u<o-1;++u)p=this.OffsetPoint(u,p,r.m_jointype);var m;if(r.m_endtype==a.EndType.etOpenButt){var u=o-1;m=new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[u].X+this.m_normals[u].X*e),a.ClipperOffset.Round(this.m_srcPoly[u].Y+this.m_normals[u].Y*e)),this.m_destPoly.push(m),m=new a.IntPoint(a.ClipperOffset.Round(this.m_srcPoly[u].X-this.m_normals[u].X*e),a.ClipperOffset.Round(this.m_srcPoly[u].Y-this.m_normals[u].Y*e)),this.m_destPoly.push(m)}else{var u=o-1;p=o-2,this.m_sinA=0,this.m_normals[u]=new a.DoublePoint(-this.m_normals[u].X,-this.m_normals[u].Y),r.m_endtype==a.EndType.etOpenSquare?this.DoSquare(u,p):this.DoRound(u,p)}for(var u=o-1;u>0;u--)this.m_normals[u]=new a.DoublePoint(-this.m_normals[u-1].X,-this.m_normals[u-1].Y);this.m_normals[0]=new a.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),p=o-1;for(var u=p-1;u>0;--u)p=this.OffsetPoint(u,p,r.m_jointype);r.m_endtype==a.EndType.etOpenButt?(m=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(m),m=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(m)):(p=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 l=r.Childs()[0];r.Childs()[0]=l.Childs()[0];for(var u=1;u<l.ChildCount();u++)r.AddChild(l.Childs()[u])}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,l=0;l<n;++l)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,l,u,f,p,d,m=[],g=0;g<i;g++)if(s=n[g],o=s.length,o!==0){if(o<3){l=s,m.push(l);continue}for(l=s,u=t*t,f=s[0],p=1,d=1;d<o;d++)(s[d].X-f.X)*(s[d].X-f.X)+(s[d].Y-f.Y)*(s[d].Y-f.Y)<=u||(l[p]=s[d],f=s[d],p++);f=s[p-1],(s[0].X-f.X)*(s[0].X-f.X)+(s[0].Y-f.Y)*(s[0].Y-f.Y)<=u&&p--,p<o&&l.splice(p,o-p),l.length&&m.push(l)}return!r&&m.length?m=m[0]:!r&&m.length===0?m=[]:r&&m.length===0&&(m=[[]]),m};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,l=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};l[i]=s}return t||(l=l[0]),l};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,l,u,f,p,d,m,g,b,C,w,M,N,E=e.length,W=t*t,U=[];for(r=0;r<E;r++)if(i=e[r],l=i.length,l!=0){for(o=0;o<1e6;o++){for(s=[],l=i.length,i[l-1].X!=i[0].X||i[l-1].Y!=i[0].Y?(g=1,i.push({X:i[0].X,Y:i[0].Y}),l=i.length):g=0,m=[],n=0;n<l-2;n++)u=i[n],p=i[n+1],f=i[n+2],M=u.X,N=u.Y,b=f.X-M,C=f.Y-N,(b!==0||C!==0)&&(w=((p.X-M)*b+(p.Y-N)*C)/(b*b+C*C),w>1?(M=f.X,N=f.Y):w>0&&(M+=b*w,N+=C*w)),b=p.X-M,C=p.Y-N,d=b*b+C*C,d<=W&&(m[n+1]=1,n++);for(s.push({X:i[0].X,Y:i[0].Y}),n=1;n<l-1;n++)m[n]||s.push({X:i[n].X,Y:i[n].Y});if(s.push({X:i[l-1].X,Y:i[l-1].Y}),g&&i.pop(),m.length)i=s;else break}l=s.length,s[l-1].X==s[0].X&&s[l-1].Y==s[0].Y&&s.pop(),s.length>2&&U.push(s)}return!e[0]instanceof Array&&(U=U[0]),typeof U>"u"&&(U=[[]]),U};a.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,i=0,o,s,l=0,u=0,f=0,p=0,d=e.length;if(d<2)return 0;for(t&&(e[d]=e[0],d++);--d;)o=e[d],l=o.X,u=o.Y,s=e[d-1],f=s.X,p=s.Y,i+=n((l-f)*(l-f)+(u-p)*(u-p));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,l,u,f,p;for(l=0;l<i;l++)for(o=n[l],r.holes[l]=o.Contour(),u=0,f=o.Childs(),p=f.length;u<p;u++)s=f[u],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};Ar.exports=a});h();var Fr="[MappedinJS]",sl=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(sl||{});function al(e="",{prefix:t=Fr}={}){let r=`${t}${e?`-${e}`:""}`,n=(i,o)=>{if(typeof window<"u"&&window.rnDebug){let s=o.map(l=>l instanceof Error&&l.stack?`${l.message}
2
+ ${l.stack}`:l);window.rnDebug(`${e} ${i}: ${s.join(" ")}`)}};return{logState:_.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)}}}var uo=al();function jy(e){0<=e&&e<=3&&(uo.logState=e)}var H=uo;h();h();var tt=class extends Error{};tt.prototype.name="InvalidTokenError";function ll(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function ul(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ll(t)}catch{return atob(t)}}function fo(e,t){if(typeof e!="string")throw new tt("Invalid token specified: must be a string");t||(t={});let r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new tt(`Invalid token specified: missing part #${r+1}`);let i;try{i=ul(n)}catch(o){throw new tt(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new tt(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}h();var rt=63710088e-1;h();function fl(e,t,r,n){return(e<t||e>r)&&H.warn(n),Math.min(r,Math.max(t,e))}h();function cl(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}function ig(e){let t=fo(e);if(t.sub==null)throw new Error("Access token is missing sub claim.");return{sub:t.sub,aud:typeof t.aud=="string"?[t.aud]:t.aud??[],capabilities:t.capabilities??{}}}function Fe(e){return e*(Math.PI/180)}function pl(e){return e*(180/Math.PI)}function og(e,t){let r=Math.pow(10,t);return Math.sign(e)*Math.round(Math.abs(e)*r)/r}function co(e,t){return(e%t+t)%t}function sg([e,t],[r,n]){let i=Fe(n-t),o=Fe(r-e),s=Fe(t),l=Fe(n),u=Math.sin(i/2)*Math.sin(i/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(s)*Math.cos(l),f=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return rt*f}function ag([e,t],[r,n]){let i=Fe(t),o=Fe(e),s=Fe(n),u=Fe(r)-o,f=Math.sin(u)*Math.cos(s),p=Math.cos(i)*Math.sin(s)-Math.sin(i)*Math.cos(s)*Math.cos(u);return pl((Math.atan2(f,p)+Math.PI*2)%(Math.PI*2))}function lg(e,t){let r=co(e,Math.PI*2),n=co(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}}function hl(e){return e instanceof Xr?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)}function ug(){return typeof window<"u"&&window!==null}h();function dg(e,t,r=!1){let n=null,i=0;return function(...o){i++,i===1&&r===!0&&e(...o);let s=()=>{(!r||i>1)&&e(...o),n=null,i=0};clearTimeout(n),n=setTimeout(s,t)}}h();h();function dl(e,t){return`${t} ${e}`}var ar=class extends Error{constructor(t,r=Fr){super(dl(t,r)),this.name="MappedinError"}},po=class extends ar{constructor(t,r=Fr){super(t,r),this.name="MappedinRenderError"}};h();var Gn=class e extends Error{constructor(r){super(r);c(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function ho(e,t){if(e==null){let r;t?.customMessage?r=t.customMessage:r=`Expected ${t?.valueName?`'${t.valueName}'`:"value"} to be defined, but received ${e}`;let n=t?.errorClass||Gn,i=new n(r);throw t?.captureStackTrace!==!1&&Error.captureStackTrace&&Error.captureStackTrace(i,ho),i}}function bg(e,t,r){if(ho(e),e?.type!==t){let n=`Expected type ${t} but got ${e?.type}`;throw new Error(r??n)}}h();var Wn=[0,4,6,8,10],$=()=>{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],Wn.map((n,i)=>r.slice(n,i===Wn.length-1?void 0:Wn[i+1]).join("")).join("-")};function Cg(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)}h();var lr=class{constructor(){c(this,"_subscribers",{});c(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={}}};h();var mo="mi-session-data",yo="mi-local-data",ur="id",fr="deviceId",nt,ye,ge,Gr=class Gr{constructor(){oe(this,ye);oe(this,ge);try{let t=sessionStorage.getItem(mo);t?Z(this,ye,JSON.parse(t)):Z(this,ye,{[ur]:$()})}catch{Z(this,ye,{[ur]:$()})}try{let t=localStorage.getItem(yo);t?Z(this,ge,JSON.parse(t)):Z(this,ge,{[fr]:$()})}catch{Z(this,ge,{[fr]:$()})}Y(this,ye)[ur]||(Y(this,ye)[ur]=$()),Y(this,ge)[fr]||(Y(this,ge)[fr]=$())}static getInstance(){return Y(this,nt)||Z(this,nt,new Gr),Y(this,nt)}static ___clearInstance(){Z(this,nt,void 0)}saveSessionData(t,r){Y(this,ye)[t]=r;try{return sessionStorage.setItem(mo,JSON.stringify(Y(this,ye))),!0}catch{return!1}}loadSessionData(t){let r=Y(this,ye)[t];if(r!=null)return r}saveLocalData(t,r){Y(this,ge)[t]=r;try{return localStorage.setItem(yo,JSON.stringify(Y(this,ge))),!0}catch{return!1}}loadLocalData(t){let r=Y(this,ge)[t];if(r!=null)return r}};nt=new WeakMap,ye=new WeakMap,ge=new WeakMap,oe(Gr,nt);var jn=Gr;h();var ml=new Set(Object.keys(fe.NAMES)),Un;function go(){return Un==null&&(Un=new fe),Un}var yl=e=>ml.has(e.toLowerCase()),gl=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},vl=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},xl=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},Wr=e=>e==null||typeof e!="string"?!1:!!(gl(e)||vl(e)||xl(e)||yl(e)),kg=e=>{let t=go();return t.set(e),[t.r,t.g,t.b]},Bg=e=>{let t=go();return t.set(e[0],e[1],e[2]),"#"+t.getHexString()};h();var vo=["ease-in","ease-out","ease-in-out","linear"];var xo=e=>e,bl=e=>e*e,_l=e=>1-Math.cos(e*Math.PI/2),Pl=e=>1-(1-e)*(1-e),bo={linear:xo,"ease-in":bl,"ease-out":Pl,"ease-in-out":_l};function Fg(e,t,r,n,i,o=xo){if(t===r)return i;e=Math.max(t,Math.min(e,r));let s=(e-Math.min(t,r))/Math.abs(r-t),l=typeof o=="function"?o(s):bo[o](s);return n+l*(i-n)}function Tl(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}function Gg(e,t,r,n="ease-in"){if(t.length!==r.length)throw new ar("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=Tl(e,t),o=(e-t[i])/(t[i+1]-t[i]),s=typeof n=="function"?n(o):bo[n](o);return r[i]+s*(r[i+1]-r[i])}h();var x={};ol(x,{BRAND:()=>ql,DIRTY:()=>it,EMPTY_PATH:()=>wl,INVALID:()=>O,NEVER:()=>Lu,OK:()=>J,ParseStatus:()=>q,Schema:()=>L,ZodAny:()=>je,ZodArray:()=>Ee,ZodBigInt:()=>st,ZodBoolean:()=>at,ZodBranded:()=>pr,ZodCatch:()=>vt,ZodDate:()=>lt,ZodDefault:()=>gt,ZodDiscriminatedUnion:()=>Vr,ZodEffects:()=>he,ZodEnum:()=>mt,ZodError:()=>te,ZodFirstPartyTypeKind:()=>A,ZodFunction:()=>zr,ZodIntersection:()=>pt,ZodIssueCode:()=>v,ZodLazy:()=>ht,ZodLiteral:()=>dt,ZodMap:()=>Bt,ZodNaN:()=>Xt,ZodNativeEnum:()=>yt,ZodNever:()=>ve,ZodNull:()=>ft,ZodNullable:()=>Te,ZodNumber:()=>ot,ZodObject:()=>re,ZodOptional:()=>ce,ZodParsedType:()=>T,ZodPipeline:()=>hr,ZodPromise:()=>Ue,ZodReadonly:()=>xt,ZodRecord:()=>Hr,ZodSchema:()=>L,ZodSet:()=>Rt,ZodString:()=>We,ZodSymbol:()=>Nt,ZodTransformer:()=>he,ZodTuple:()=>Pe,ZodType:()=>L,ZodUndefined:()=>ut,ZodUnion:()=>ct,ZodUnknown:()=>Oe,ZodVoid:()=>kt,addIssueToContext:()=>P,any:()=>iu,array:()=>lu,bigint:()=>Ql,boolean:()=>Ao,coerce:()=>Du,custom:()=>Oo,date:()=>eu,datetimeRegex:()=>Io,defaultErrorMap:()=>Ie,discriminatedUnion:()=>pu,effect:()=>Cu,enum:()=>_u,function:()=>vu,getErrorMap:()=>At,getParsedType:()=>_e,instanceof:()=>$l,intersection:()=>hu,isAborted:()=>jr,isAsync:()=>Dt,isDirty:()=>Ur,isValid:()=>Ge,late:()=>Jl,lazy:()=>xu,literal:()=>bu,makeIssue:()=>cr,map:()=>yu,nan:()=>Kl,nativeEnum:()=>Pu,never:()=>su,null:()=>nu,nullable:()=>Iu,number:()=>Mo,object:()=>uu,objectUtil:()=>Vn,oboolean:()=>Au,onumber:()=>Mu,optional:()=>Su,ostring:()=>Eu,pipeline:()=>Ou,preprocess:()=>wu,promise:()=>Tu,quotelessJson:()=>Cl,record:()=>mu,set:()=>gu,setErrorMap:()=>Il,strictObject:()=>fu,string:()=>Eo,symbol:()=>tu,transformer:()=>Cu,tuple:()=>du,undefined:()=>ru,union:()=>cu,unknown:()=>ou,util:()=>B,void:()=>au});h();h();h();h();h();var B;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}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(l=>typeof i[i[l]]!="number"),s={};for(let l of o)s[l]=i[l];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"?`'${s}'`:s).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(B||(B={}));var Vn;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Vn||(Vn={}));var T=B.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_e=e=>{switch(typeof e){case"undefined":return T.undefined;case"string":return T.string;case"number":return Number.isNaN(e)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(e)?T.array:e===null?T.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?T.promise:typeof Map<"u"&&e instanceof Map?T.map:typeof Set<"u"&&e instanceof Set?T.set:typeof Date<"u"&&e instanceof Date?T.date:T.object;default:return T.unknown}};var v=B.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"]),Cl=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),te=class e 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=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 l=n,u=0;for(;u<s.path.length;){let f=s.path[u];u===s.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(r(s))):l[f]=l[f]||{_errors:[]},l=l[f],u++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,B.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()}};te.create=e=>new te(e);var Sl=(e,t)=>{let r;switch(e.code){case v.invalid_type:e.received===T.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case v.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,B.jsonStringifyReplacer)}`;break;case v.unrecognized_keys:r=`Unrecognized key(s) in object: ${B.joinValues(e.keys,", ")}`;break;case v.invalid_union:r="Invalid input";break;case v.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${B.joinValues(e.options)}`;break;case v.invalid_enum_value:r=`Invalid enum value. Expected ${B.joinValues(e.options)}, received '${e.received}'`;break;case v.invalid_arguments:r="Invalid function arguments";break;case v.invalid_return_type:r="Invalid function return type";break;case v.invalid_date:r="Invalid date";break;case v.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:B.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case v.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case v.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case v.custom:r="Invalid input";break;case v.invalid_intersection_types:r="Intersection results could not be merged";break;case v.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case v.not_finite:r="Number must be finite";break;default:r=t.defaultError,B.assertNever(e)}return{message:r}},Ie=Sl;var _o=Ie;function Il(e){_o=e}function At(){return _o}h();var cr=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let l="",u=n.filter(f=>!!f).slice().reverse();for(let f of u)l=f(s,{data:t,defaultError:l}).message;return{...i,path:o,message:l}},wl=[];function P(e,t){let r=At(),n=cr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ie?void 0:Ie].filter(i=>!!i)});e.common.issues.push(n)}var q=class e{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 O;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 e.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 O;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}}},O=Object.freeze({status:"aborted"}),it=e=>({status:"dirty",value:e}),J=e=>({status:"valid",value:e}),jr=e=>e.status==="aborted",Ur=e=>e.status==="dirty",Ge=e=>e.status==="valid",Dt=e=>typeof Promise<"u"&&e instanceof Promise;h();h();h();var S;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(S||(S={}));var pe=class{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}},Po=(e,t)=>{if(Ge(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 te(e.common.issues);return this._error=r,this._error}}};function D(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:(s,l)=>{let{message:u}=e;return s.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??n??l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:u??r??l.defaultError}},description:i}}var L=class{get description(){return this._def.description}_getType(t){return _e(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:_e(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new q,ctx:{common:t.parent.common,data:t.data,parsedType:_e(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Dt(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){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_e(t)},i=this._parseSync({data:t,path:n.path,parent:n});return Po(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_e(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ge(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Ge(n)?{value:n.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?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_e(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(Dt(i)?i:Promise.resolve(i));return Po(n,o)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=t(i),l=()=>o.addIssue({code:v.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!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 he({schema:this,typeName:A.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:r=>this["~validate"](r)}}optional(){return ce.create(this,this._def)}nullable(){return Te.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ee.create(this)}promise(){return Ue.create(this,this._def)}or(t){return ct.create([this,t],this._def)}and(t){return pt.create(this,t,this._def)}transform(t){return new he({...D(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new gt({...D(this._def),innerType:this,defaultValue:r,typeName:A.ZodDefault})}brand(){return new pr({typeName:A.ZodBranded,type:this,...D(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new vt({...D(this._def),innerType:this,catchValue:r,typeName:A.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return hr.create(this,t)}readonly(){return xt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ol=/^c[^\s-]{8,}$/i,El=/^[0-9a-z]+$/,Ml=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Al=/^[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,Dl=/^[a-z0-9_-]{21}$/i,Ll=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Nl=/^[-+]?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)?)??$/,kl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Hn,Rl=/^(?:(?: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])$/,Xl=/^(?:(?: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])$/,Yl=/^(([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]))$/,Fl=/^(([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])$/,Gl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Co="((\\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])))",jl=new RegExp(`^${Co}$`);function So(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Ul(e){return new RegExp(`^${So(e)}$`)}function Io(e){let t=`${Co}T${So(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Vl(e,t){return!!((t==="v4"||!t)&&Rl.test(e)||(t==="v6"||!t)&&Yl.test(e))}function Hl(e,t){if(!Ll.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?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function zl(e,t){return!!((t==="v4"||!t)&&Xl.test(e)||(t==="v6"||!t)&&Fl.test(e))}var We=class e extends L{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==T.string){let o=this._getOrReturnCtx(t);return P(o,{code:v.invalid_type,expected:T.string,received:o.parsedType}),O}let n=new q,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:v.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),P(i,{code:v.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,l=t.data.length<o.value;(s||l)&&(i=this._getOrReturnCtx(t,i),s?P(i,{code:v.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&P(i,{code:v.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")kl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"email",code:v.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Hn||(Hn=new RegExp(Bl,"u")),Hn.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"emoji",code:v.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Al.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"uuid",code:v.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Dl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"nanoid",code:v.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Ol.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"cuid",code:v.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")El.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"cuid2",code:v.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Ml.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"ulid",code:v.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),P(i,{validation:"url",code:v.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),P(i,{validation:"regex",code:v.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),P(i,{code:v.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),P(i,{code:v.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),P(i,{code:v.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Io(o).test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:v.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?jl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:v.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Ul(o).test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:v.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Nl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"duration",code:v.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Vl(t.data,o.version)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"ip",code:v.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Hl(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"jwt",code:v.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?zl(t.data,o.version)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"cidr",code:v.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Gl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"base64",code:v.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Wl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"base64url",code:v.invalid_string,message:o.message}),n.dirty()):B.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:v.invalid_string,...S.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...S.errToObj(t)})}url(t){return this._addCheck({kind:"url",...S.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...S.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...S.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...S.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...S.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...S.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...S.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...S.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...S.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...S.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...S.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...S.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...S.errToObj(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({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...S.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...S.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...S.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...S.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...S.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...S.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...S.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...S.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...S.errToObj(r)})}nonempty(t){return this.min(1,S.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...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}};We.create=e=>new We({checks:[],typeName:A.ZodString,coerce:e?.coerce??!1,...D(e)});function Zl(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}var ot=class e extends L{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)!==T.number){let o=this._getOrReturnCtx(t);return P(o,{code:v.invalid_type,expected:T.number,received:o.parsedType}),O}let n,i=new q;for(let o of this._def.checks)o.kind==="int"?B.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),P(n,{code:v.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),P(n,{code:v.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),P(n,{code:v.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Zl(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),P(n,{code:v.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),P(n,{code:v.not_finite,message:o.message}),i.dirty()):B.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,S.toString(r))}gt(t,r){return this.setLimit("min",t,!1,S.toString(r))}lte(t,r){return this.setLimit("max",t,!0,S.toString(r))}lt(t,r){return this.setLimit("max",t,!1,S.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:S.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:S.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:S.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:S.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.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"&&B.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)}};ot.create=e=>new ot({checks:[],typeName:A.ZodNumber,coerce:e?.coerce||!1,...D(e)});var st=class e extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==T.bigint)return this._getInvalidInput(t);let n,i=new q;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),P(n,{code:v.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),P(n,{code:v.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),P(n,{code:v.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):B.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return P(r,{code:v.invalid_type,expected:T.bigint,received:r.parsedType}),O}gte(t,r){return this.setLimit("min",t,!0,S.toString(r))}gt(t,r){return this.setLimit("min",t,!1,S.toString(r))}lte(t,r){return this.setLimit("max",t,!0,S.toString(r))}lt(t,r){return this.setLimit("max",t,!1,S.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:S.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:S.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}};st.create=e=>new st({checks:[],typeName:A.ZodBigInt,coerce:e?.coerce??!1,...D(e)});var at=class extends L{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==T.boolean){let n=this._getOrReturnCtx(t);return P(n,{code:v.invalid_type,expected:T.boolean,received:n.parsedType}),O}return J(t.data)}};at.create=e=>new at({typeName:A.ZodBoolean,coerce:e?.coerce||!1,...D(e)});var lt=class e extends L{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==T.date){let o=this._getOrReturnCtx(t);return P(o,{code:v.invalid_type,expected:T.date,received:o.parsedType}),O}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return P(o,{code:v.invalid_date}),O}let n=new q,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:v.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),P(i,{code:v.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):B.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:S.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:S.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}};lt.create=e=>new lt({checks:[],coerce:e?.coerce||!1,typeName:A.ZodDate,...D(e)});var Nt=class extends L{_parse(t){if(this._getType(t)!==T.symbol){let n=this._getOrReturnCtx(t);return P(n,{code:v.invalid_type,expected:T.symbol,received:n.parsedType}),O}return J(t.data)}};Nt.create=e=>new Nt({typeName:A.ZodSymbol,...D(e)});var ut=class extends L{_parse(t){if(this._getType(t)!==T.undefined){let n=this._getOrReturnCtx(t);return P(n,{code:v.invalid_type,expected:T.undefined,received:n.parsedType}),O}return J(t.data)}};ut.create=e=>new ut({typeName:A.ZodUndefined,...D(e)});var ft=class extends L{_parse(t){if(this._getType(t)!==T.null){let n=this._getOrReturnCtx(t);return P(n,{code:v.invalid_type,expected:T.null,received:n.parsedType}),O}return J(t.data)}};ft.create=e=>new ft({typeName:A.ZodNull,...D(e)});var je=class extends L{constructor(){super(...arguments),this._any=!0}_parse(t){return J(t.data)}};je.create=e=>new je({typeName:A.ZodAny,...D(e)});var Oe=class extends L{constructor(){super(...arguments),this._unknown=!0}_parse(t){return J(t.data)}};Oe.create=e=>new Oe({typeName:A.ZodUnknown,...D(e)});var ve=class extends L{_parse(t){let r=this._getOrReturnCtx(t);return P(r,{code:v.invalid_type,expected:T.never,received:r.parsedType}),O}};ve.create=e=>new ve({typeName:A.ZodNever,...D(e)});var kt=class extends L{_parse(t){if(this._getType(t)!==T.undefined){let n=this._getOrReturnCtx(t);return P(n,{code:v.invalid_type,expected:T.void,received:n.parsedType}),O}return J(t.data)}};kt.create=e=>new kt({typeName:A.ZodVoid,...D(e)});var Ee=class e extends L{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==T.array)return P(r,{code:v.invalid_type,expected:T.array,received:r.parsedType}),O;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,l=r.data.length<i.exactLength.value;(s||l)&&(P(r,{code:s?v.too_big:v.too_small,minimum:l?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&&(P(r,{code:v.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&&(P(r,{code:v.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,l)=>i.type._parseAsync(new pe(r,s,r.path,l)))).then(s=>q.mergeArray(n,s));let o=[...r.data].map((s,l)=>i.type._parseSync(new pe(r,s,r.path,l)));return q.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:S.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:S.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:S.toString(r)}})}nonempty(t){return this.min(1,t)}};Ee.create=(e,t)=>new Ee({type:e,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,...D(t)});function Lt(e){if(e instanceof re){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ce.create(Lt(n))}return new re({...e._def,shape:()=>t})}else return e instanceof Ee?new Ee({...e._def,type:Lt(e.element)}):e instanceof ce?ce.create(Lt(e.unwrap())):e instanceof Te?Te.create(Lt(e.unwrap())):e instanceof Pe?Pe.create(e.items.map(t=>Lt(t))):e}var re=class e extends L{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=B.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==T.object){let f=this._getOrReturnCtx(t);return P(f,{code:v.invalid_type,expected:T.object,received:f.parsedType}),O}let{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof ve&&this._def.unknownKeys==="strip"))for(let f in i.data)s.includes(f)||l.push(f);let u=[];for(let f of s){let p=o[f],d=i.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new pe(i,d,i.path,f)),alwaysSet:f in i.data})}if(this._def.catchall instanceof ve){let f=this._def.unknownKeys;if(f==="passthrough")for(let p of l)u.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(f==="strict")l.length>0&&(P(i,{code:v.unrecognized_keys,keys:l}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let p of l){let d=i.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new pe(i,d,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let f=[];for(let p of u){let d=await p.key,m=await p.value;f.push({key:d,value:m,alwaysSet:p.alwaysSet})}return f}).then(f=>q.mergeObjectSync(n,f)):q.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return S.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:S.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:A.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of B.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of B.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Lt(this)}partial(t){let r={};for(let n of B.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of B.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof ce;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return wo(B.objectKeys(this.shape))}};re.create=(e,t)=>new re({shape:()=>e,unknownKeys:"strip",catchall:ve.create(),typeName:A.ZodObject,...D(t)});re.strictCreate=(e,t)=>new re({shape:()=>e,unknownKeys:"strict",catchall:ve.create(),typeName:A.ZodObject,...D(t)});re.lazycreate=(e,t)=>new re({shape:e,unknownKeys:"strip",catchall:ve.create(),typeName:A.ZodObject,...D(t)});var ct=class extends L{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(o){for(let l of o)if(l.result.status==="valid")return l.result;for(let l of o)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let s=o.map(l=>new te(l.ctx.common.issues));return P(r,{code:v.invalid_union,unionErrors:s}),O}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...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 u of n){let f={...r,common:{...r.common,issues:[]},parent:null},p=u._parseSync({data:r.data,path:r.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:f}),f.common.issues.length&&s.push(f.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let l=s.map(u=>new te(u));return P(r,{code:v.invalid_union,unionErrors:l}),O}}get options(){return this._def.options}};ct.create=(e,t)=>new ct({options:e,typeName:A.ZodUnion,...D(t)});var we=e=>e instanceof ht?we(e.schema):e instanceof he?we(e.innerType()):e instanceof dt?[e.value]:e instanceof mt?e.options:e instanceof yt?B.objectValues(e.enum):e instanceof gt?we(e._def.innerType):e instanceof ut?[void 0]:e instanceof ft?[null]:e instanceof ce?[void 0,...we(e.unwrap())]:e instanceof Te?[null,...we(e.unwrap())]:e instanceof pr||e instanceof xt?we(e.unwrap()):e instanceof vt?we(e._def.innerType):[],Vr=class e extends L{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==T.object)return P(r,{code:v.invalid_type,expected:T.object,received:r.parsedType}),O;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}):(P(r,{code:v.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),O)}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=we(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of s){if(i.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);i.set(l,o)}}return new e({typeName:A.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...D(n)})}};function zn(e,t){let r=_e(e),n=_e(t);if(e===t)return{valid:!0,data:e};if(r===T.object&&n===T.object){let i=B.objectKeys(t),o=B.objectKeys(e).filter(l=>i.indexOf(l)!==-1),s={...e,...t};for(let l of o){let u=zn(e[l],t[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(r===T.array&&n===T.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let s=e[o],l=t[o],u=zn(s,l);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===T.date&&n===T.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var pt=class extends L{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(o,s)=>{if(jr(o)||jr(s))return O;let l=zn(o.value,s.value);return l.valid?((Ur(o)||Ur(s))&&r.dirty(),{status:r.value,value:l.data}):(P(n,{code:v.invalid_intersection_types}),O)};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}))}};pt.create=(e,t,r)=>new pt({left:e,right:t,typeName:A.ZodIntersection,...D(r)});var Pe=class e extends L{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==T.array)return P(n,{code:v.invalid_type,expected:T.array,received:n.parsedType}),O;if(n.data.length<this._def.items.length)return P(n,{code:v.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O;!this._def.rest&&n.data.length>this._def.items.length&&(P(n,{code:v.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,l)=>{let u=this._def.items[l]||this._def.rest;return u?u._parse(new pe(n,s,n.path,l)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>q.mergeArray(r,s)):q.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Pe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pe({items:e,typeName:A.ZodTuple,rest:null,...D(t)})};var Hr=class e extends L{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!==T.object)return P(n,{code:v.invalid_type,expected:T.object,received:n.parsedType}),O;let i=[],o=this._def.keyType,s=this._def.valueType;for(let l in n.data)i.push({key:o._parse(new pe(n,l,n.path,l)),value:s._parse(new pe(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?q.mergeObjectAsync(r,i):q.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof L?new e({keyType:t,valueType:r,typeName:A.ZodRecord,...D(n)}):new e({keyType:We.create(),valueType:t,typeName:A.ZodRecord,...D(r)})}},Bt=class extends L{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!==T.map)return P(n,{code:v.invalid_type,expected:T.map,received:n.parsedType}),O;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([l,u],f)=>({key:i._parse(new pe(n,l,n.path,[f,"key"])),value:o._parse(new pe(n,u,n.path,[f,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of s){let f=await u.key,p=await u.value;if(f.status==="aborted"||p.status==="aborted")return O;(f.status==="dirty"||p.status==="dirty")&&r.dirty(),l.set(f.value,p.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of s){let f=u.key,p=u.value;if(f.status==="aborted"||p.status==="aborted")return O;(f.status==="dirty"||p.status==="dirty")&&r.dirty(),l.set(f.value,p.value)}return{status:r.value,value:l}}}};Bt.create=(e,t,r)=>new Bt({valueType:t,keyType:e,typeName:A.ZodMap,...D(r)});var Rt=class e extends L{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==T.set)return P(n,{code:v.invalid_type,expected:T.set,received:n.parsedType}),O;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(P(n,{code:v.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&&(P(n,{code:v.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(u){let f=new Set;for(let p of u){if(p.status==="aborted")return O;p.status==="dirty"&&r.dirty(),f.add(p.value)}return{status:r.value,value:f}}let l=[...n.data.values()].map((u,f)=>o._parse(new pe(n,u,n.path,f)));return n.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(t,r){return new e({...this._def,minSize:{value:t,message:S.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:S.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Rt.create=(e,t)=>new Rt({valueType:e,minSize:null,maxSize:null,typeName:A.ZodSet,...D(t)});var zr=class e extends L{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==T.function)return P(r,{code:v.invalid_type,expected:T.function,received:r.parsedType}),O;function n(l,u){return cr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ie].filter(f=>!!f),issueData:{code:v.invalid_arguments,argumentsError:u}})}function i(l,u){return cr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ie].filter(f=>!!f),issueData:{code:v.invalid_return_type,returnTypeError:u}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Ue){let l=this;return J(async function(...u){let f=new te([]),p=await l._def.args.parseAsync(u,o).catch(g=>{throw f.addIssue(n(u,g)),f}),d=await Reflect.apply(s,this,p);return await l._def.returns._def.type.parseAsync(d,o).catch(g=>{throw f.addIssue(i(d,g)),f})})}else{let l=this;return J(function(...u){let f=l._def.args.safeParse(u,o);if(!f.success)throw new te([n(u,f.error)]);let p=Reflect.apply(s,this,f.data),d=l._def.returns.safeParse(p,o);if(!d.success)throw new te([i(p,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Pe.create(t).rest(Oe.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Pe.create([]).rest(Oe.create()),returns:r||Oe.create(),typeName:A.ZodFunction,...D(n)})}},ht=class extends L{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})}};ht.create=(e,t)=>new ht({getter:e,typeName:A.ZodLazy,...D(t)});var dt=class extends L{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return P(r,{received:r.data,code:v.invalid_literal,expected:this._def.value}),O}return{status:"valid",value:t.data}}get value(){return this._def.value}};dt.create=(e,t)=>new dt({value:e,typeName:A.ZodLiteral,...D(t)});function wo(e,t){return new mt({values:e,typeName:A.ZodEnum,...D(t)})}var mt=class e extends L{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return P(r,{expected:B.joinValues(n),received:r.parsedType,code:v.invalid_type}),O}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 P(r,{received:r.data,code:v.invalid_enum_value,options:n}),O}return J(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 e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};mt.create=wo;var yt=class extends L{_parse(t){let r=B.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==T.string&&n.parsedType!==T.number){let i=B.objectValues(r);return P(n,{expected:B.joinValues(i),received:n.parsedType,code:v.invalid_type}),O}if(this._cache||(this._cache=new Set(B.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=B.objectValues(r);return P(n,{received:n.data,code:v.invalid_enum_value,options:i}),O}return J(t.data)}get enum(){return this._def.values}};yt.create=(e,t)=>new yt({values:e,typeName:A.ZodNativeEnum,...D(t)});var Ue=class extends L{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==T.promise&&r.common.async===!1)return P(r,{code:v.invalid_type,expected:T.promise,received:r.parsedType}),O;let n=r.parsedType===T.promise?r.data:Promise.resolve(r.data);return J(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ue.create=(e,t)=>new Ue({type:e,typeName:A.ZodPromise,...D(t)});var he=class extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.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:s=>{P(n,s),s.fatal?r.abort():r.dirty()},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 l=>{if(r.value==="aborted")return O;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?O:u.status==="dirty"?it(u.value):r.value==="dirty"?it(u.value):u});{if(r.value==="aborted")return O;let l=this._def.schema._parseSync({data:s,path:n.path,parent:n});return l.status==="aborted"?O:l.status==="dirty"?it(l.value):r.value==="dirty"?it(l.value):l}}if(i.type==="refinement"){let s=l=>{let u=i.refinement(l,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?O:(l.status==="dirty"&&r.dirty(),s(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?O:(l.status==="dirty"&&r.dirty(),s(l.value).then(()=>({status:r.value,value:l.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(!Ge(s))return O;let l=i.transform(s.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Ge(s)?Promise.resolve(i.transform(s.value,o)).then(l=>({status:r.value,value:l})):O);B.assertNever(i)}};he.create=(e,t,r)=>new he({schema:e,typeName:A.ZodEffects,effect:t,...D(r)});he.createWithPreprocess=(e,t,r)=>new he({schema:t,effect:{type:"preprocess",transform:e},typeName:A.ZodEffects,...D(r)});var ce=class extends L{_parse(t){return this._getType(t)===T.undefined?J(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ce.create=(e,t)=>new ce({innerType:e,typeName:A.ZodOptional,...D(t)});var Te=class extends L{_parse(t){return this._getType(t)===T.null?J(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Te.create=(e,t)=>new Te({innerType:e,typeName:A.ZodNullable,...D(t)});var gt=class extends L{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===T.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};gt.create=(e,t)=>new gt({innerType:e,typeName:A.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...D(t)});var vt=class extends L{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Dt(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new te(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new te(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};vt.create=(e,t)=>new vt({innerType:e,typeName:A.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...D(t)});var Xt=class extends L{_parse(t){if(this._getType(t)!==T.nan){let n=this._getOrReturnCtx(t);return P(n,{code:v.invalid_type,expected:T.nan,received:n.parsedType}),O}return{status:"valid",value:t.data}}};Xt.create=e=>new Xt({typeName:A.ZodNaN,...D(e)});var ql=Symbol("zod_brand"),pr=class extends L{_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}},hr=class e extends L{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?O:o.status==="dirty"?(r.dirty(),it(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?O: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 e({in:t,out:r,typeName:A.ZodPipeline})}},xt=class extends L{_parse(t){let r=this._def.innerType._parse(t),n=i=>(Ge(i)&&(i.value=Object.freeze(i.value)),i);return Dt(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};xt.create=(e,t)=>new xt({innerType:e,typeName:A.ZodReadonly,...D(t)});function To(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Oo(e,t={},r){return e?je.create().superRefine((n,i)=>{let o=e(n);if(o instanceof Promise)return o.then(s=>{if(!s){let l=To(t,n),u=l.fatal??r??!0;i.addIssue({code:"custom",...l,fatal:u})}});if(!o){let s=To(t,n),l=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:l})}}):je.create()}var Jl={object:re.lazycreate},A;(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"})(A||(A={}));var $l=(e,t={message:`Input not instance of ${e.name}`})=>Oo(r=>r instanceof e,t),Eo=We.create,Mo=ot.create,Kl=Xt.create,Ql=st.create,Ao=at.create,eu=lt.create,tu=Nt.create,ru=ut.create,nu=ft.create,iu=je.create,ou=Oe.create,su=ve.create,au=kt.create,lu=Ee.create,uu=re.create,fu=re.strictCreate,cu=ct.create,pu=Vr.create,hu=pt.create,du=Pe.create,mu=Hr.create,yu=Bt.create,gu=Rt.create,vu=zr.create,xu=ht.create,bu=dt.create,_u=mt.create,Pu=yt.create,Tu=Ue.create,Cu=he.create,Su=ce.create,Iu=Te.create,wu=he.createWithPreprocess,Ou=hr.create,Eu=()=>Eo().optional(),Mu=()=>Mo().optional(),Au=()=>Ao().optional(),Du={string:e=>We.create({...e,coerce:!0}),number:e=>ot.create({...e,coerce:!0}),boolean:e=>at.create({...e,coerce:!0}),bigint:e=>st.create({...e,coerce:!0}),date:e=>lt.create({...e,coerce:!0})};var Lu=O;h();var Do=x;h();var Ve=Do;h();function rn(e){return(e%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}h();h();h();h();h();h();h();h();var K=63710088e-1,cs={centimeters:K*100,centimetres:K*100,degrees:K/111325,feet:K*3.28084,inches:K*39.37,kilometers:K/1e3,kilometres:K/1e3,meters:K,metres:K,miles:K/1609.344,millimeters:K*1e3,millimetres:K*1e3,nauticalmiles:K/1852,radians:1,yards:K*1.0936},zv={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/K,yards:1.0936133};function He(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}function Ic(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(!fs(e[0])||!fs(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return He(n,t,r)}function Zv(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 l={type:"Polygon",coordinates:e};return He(l,t,r)}function ps(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 He(n,t,r)}function qv(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}function Jv(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return He(n,t,r)}function $v(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return He(n,t,r)}function Kv(e,t){t===void 0&&(t="kilometers");var r=cs[t];if(!r)throw new Error(t+" units is invalid");return e*r}function Qv(e,t){t===void 0&&(t="kilometers");var r=cs[t];if(!r)throw new Error(t+" units is invalid");return e/r}function ex(e){var t=e%(2*Math.PI);return t*180/Math.PI}function tx(e){var t=e%360;return t*Math.PI/180}function fs(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function nn(e,t,r){if(e!==null)for(var n,i,o,s,l,u,f,p=0,d=0,m,g=e.type,b=g==="FeatureCollection",C=g==="Feature",w=b?e.features.length:1,M=0;M<w;M++){f=b?e.features[M].geometry:C?e.geometry:e,m=f?f.type==="GeometryCollection":!1,l=m?f.geometries.length:1;for(var N=0;N<l;N++){var E=0,W=0;if(s=m?f.geometries[N]:f,s!==null){u=s.coordinates;var U=s.type;switch(p=r&&(U==="Polygon"||U==="MultiPolygon")?1:0,U){case null:break;case"Point":if(t(u,d,M,E,W)===!1)return!1;d++,E++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],d,M,E,W)===!1)return!1;d++,U==="MultiPoint"&&E++}U==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-p;i++){if(t(u[n][i],d,M,E,W)===!1)return!1;d++}U==="MultiLineString"&&E++,U==="Polygon"&&W++}U==="Polygon"&&E++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(W=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-p;o++){if(t(u[n][i][o],d,M,E,W)===!1)return!1;d++}W++}E++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(nn(s.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function sx(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++);}function wc(e,t){var r,n,i,o,s,l,u,f,p,d,m=0,g=e.type==="FeatureCollection",b=e.type==="Feature",C=g?e.features.length:1;for(r=0;r<C;r++){for(l=g?e.features[r].geometry:b?e.geometry:e,f=g?e.features[r].properties:b?e.properties:{},p=g?e.features[r].bbox:b?e.bbox:void 0,d=g?e.features[r].id:b?e.id:void 0,u=l?l.type==="GeometryCollection":!1,s=u?l.geometries.length:1,i=0;i<s;i++){if(o=u?l.geometries[i]:l,o===null){if(t(null,m,f,p,d)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,m,f,p,d)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],m,f,p,d)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}m++}}function Oc(e,t){wc(e,function(r,n,i,o,s){var l=r===null?null:r.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(He(r,i,{bbox:o,id:s}),n,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var f=0;f<r.coordinates.length;f++){var p=r.coordinates[f],d={type:u,coordinates:p};if(t(He(d,i),n,f)===!1)return!1}})}function Ec(e,t){Oc(e,function(r,n,i){var o=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var l,u=0,f=0,p=0;if(nn(r,function(d,m,g,b,C){if(l===void 0||n>u||b>f||C>p){l=d,u=n,f=b,p=C,o=0;return}var w=ps([l,d],r.properties);if(t(w,n,i,C,o)===!1)return!1;o++,l=d})===!1)return!1}}})}function ax(e,t,r){var n=r,i=!1;return Ec(e,function(o,s,l,u,f){i===!1&&r===void 0?n=o:n=t(n,o,s,l,u,f),i=!0}),n}function oi(e){var t=[1/0,1/0,-1/0,-1/0];return nn(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}oi.default=oi;var hs=oi;function ds(e){return hs(e)}h();h();h();h();h();var Wt=class{constructor(){c(this,"hover",!1);c(this,"dirty",!1)}};h();var Ns=kn(us());h();var ms=x.union([x.enum(["low","medium","high","always-visible"]),x.number()]),ys=["","","low","medium","high","always-visible"],Mc=2,Ac=3;var Dc=5;function gs(e){return Math.min(Dc,Math.max(Mc,e))}function jt(e){if(typeof e=="number")return gs(e);let t=ys.indexOf(e);return t===-1?Ac:t}function bx(e){let t=gs(e);return ys[t]}h();h();h();var Lc=Ve.enum(vo),Nc=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},kc=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},Bc=e=>Nc(e)||kc(e),vs=Ve.object({on:Ve.literal("zoom-level"),input:Ve.array(Ve.number()).nonempty().refine(Bc,{message:"input array must be strictly increasing or decreasing"}),output:Ve.array(Ve.number()).nonempty(),easing:Lc.default("linear")}).refine(e=>e.input.length===e.output.length,{message:"input and output must have the same length"});h();function on(e){"@babel/helpers - typeof";return on=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},on(e)}var Rc=/^\s+/,Xc=/\s+$/;function I(e,t){if(e=e||"",t=t||{},e instanceof I)return e;if(!(this instanceof I))return new I(e,t);var r=Yc(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}I.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,i,o,s,l;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?l=i/12.92:l=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*s+.0722*l},setAlpha:function(t){return this._a=Ss(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=bs(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=bs(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+")"},toHsl:function(){var t=xs(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=xs(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+")"},toHex:function(t){return _s(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return jc(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString: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+")"},toPercentageRgb: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}},toPercentageRgbString: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+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:tp[_s(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+Ps(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var o=I(t);n="#"+Ps(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString: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())},clone:function(){return I(this.toString())},_applyModification: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},lighten:function(){return this._applyModification(zc,arguments)},brighten:function(){return this._applyModification(Zc,arguments)},darken:function(){return this._applyModification(qc,arguments)},desaturate:function(){return this._applyModification(Uc,arguments)},saturate:function(){return this._applyModification(Vc,arguments)},greyscale:function(){return this._applyModification(Hc,arguments)},spin:function(){return this._applyModification(Jc,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Qc,arguments)},complement:function(){return this._applyCombination($c,arguments)},monochromatic:function(){return this._applyCombination(ep,arguments)},splitcomplement:function(){return this._applyCombination(Kc,arguments)},triad:function(){return this._applyCombination(Ts,[3])},tetrad:function(){return this._applyCombination(Ts,[4])}};I.fromRatio=function(e,t){if(on(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=xr(e[n]));e=r}return I(e,t)};function Yc(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,o=null,s=!1,l=!1;return typeof e=="string"&&(e=op(e)),on(e)=="object"&&(Le(e.r)&&Le(e.g)&&Le(e.b)?(t=Fc(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Le(e.h)&&Le(e.s)&&Le(e.v)?(n=xr(e.s),i=xr(e.v),t=Wc(e.h,n,i),s=!0,l="hsv"):Le(e.h)&&Le(e.s)&&Le(e.l)&&(n=xr(e.s),o=xr(e.l),t=Gc(e.h,n,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=Ss(r),{ok:s,format:e.format||l,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}}function Fc(e,t,r){return{r:j(e,255)*255,g:j(t,255)*255,b:j(r,255)*255}}function xs(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,l=(n+i)/2;if(n==i)o=s=0;else{var u=n-i;switch(s=l>.5?u/(2-n-i):u/(n+i),n){case e:o=(t-r)/u+(t<r?6:0);break;case t:o=(r-e)/u+2;break;case r:o=(e-t)/u+4;break}o/=6}return{h:o,s,l}}function Gc(e,t,r){var n,i,o;e=j(e,360),t=j(t,100),r=j(r,100);function s(f,p,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?f+(p-f)*6*d:d<1/2?p:d<2/3?f+(p-f)*(2/3-d)*6:f}if(t===0)n=i=o=r;else{var l=r<.5?r*(1+t):r+t-r*t,u=2*r-l;n=s(u,l,e+1/3),i=s(u,l,e),o=s(u,l,e-1/3)}return{r:n*255,g:i*255,b:o*255}}function bs(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,l=n,u=n-i;if(s=n===0?0:u/n,n==i)o=0;else{switch(n){case e:o=(t-r)/u+(t<r?6:0);break;case t:o=(r-e)/u+2;break;case r:o=(e-t)/u+4;break}o/=6}return{h:o,s,v:l}}function Wc(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),l=r*(1-(1-i)*t),u=n%6,f=[r,s,o,o,l,r][u],p=[l,r,r,s,o,o][u],d=[o,o,l,r,r,s][u];return{r:f*255,g:p*255,b:d*255}}function _s(e,t,r,n){var i=[be(Math.round(e).toString(16)),be(Math.round(t).toString(16)),be(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("")}function jc(e,t,r,n,i){var o=[be(Math.round(e).toString(16)),be(Math.round(t).toString(16)),be(Math.round(r).toString(16)),be(Is(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("")}function Ps(e,t,r,n){var i=[be(Is(n)),be(Math.round(e).toString(16)),be(Math.round(t).toString(16)),be(Math.round(r).toString(16))];return i.join("")}I.equals=function(e,t){return!e||!t?!1:I(e).toRgbString()==I(t).toRgbString()};I.random=function(){return I.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Uc(e,t){t=t===0?0:t||10;var r=I(e).toHsl();return r.s-=t/100,r.s=sn(r.s),I(r)}function Vc(e,t){t=t===0?0:t||10;var r=I(e).toHsl();return r.s+=t/100,r.s=sn(r.s),I(r)}function Hc(e){return I(e).desaturate(100)}function zc(e,t){t=t===0?0:t||10;var r=I(e).toHsl();return r.l+=t/100,r.l=sn(r.l),I(r)}function Zc(e,t){t=t===0?0:t||10;var r=I(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)))),I(r)}function qc(e,t){t=t===0?0:t||10;var r=I(e).toHsl();return r.l-=t/100,r.l=sn(r.l),I(r)}function Jc(e,t){var r=I(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,I(r)}function $c(e){var t=I(e).toHsl();return t.h=(t.h+180)%360,I(t)}function Ts(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=I(e).toHsl(),n=[I(e)],i=360/t,o=1;o<t;o++)n.push(I({h:(r.h+o*i)%360,s:r.s,l:r.l}));return n}function Kc(e){var t=I(e).toHsl(),r=t.h;return[I(e),I({h:(r+72)%360,s:t.s,l:t.l}),I({h:(r+216)%360,s:t.s,l:t.l})]}function Qc(e,t,r){t=t||6,r=r||30;var n=I(e).toHsl(),i=360/r,o=[I(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,o.push(I(n));return o}function ep(e,t){t=t||6;for(var r=I(e).toHsv(),n=r.h,i=r.s,o=r.v,s=[],l=1/t;t--;)s.push(I({h:n,s:i,v:o})),o=(o+l)%1;return s}I.mix=function(e,t,r){r=r===0?0:r||50;var n=I(e).toRgb(),i=I(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 I(s)};I.readability=function(e,t){var r=I(e),n=I(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};I.isReadable=function(e,t,r){var n=I.readability(e,t),i,o;switch(o=!1,i=sp(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};I.mostReadable=function(e,t,r){var n=null,i=0,o,s,l,u;r=r||{},s=r.includeFallbackColors,l=r.level,u=r.size;for(var f=0;f<t.length;f++)o=I.readability(e,t[f]),o>i&&(i=o,n=I(t[f]));return I.isReadable(e,n,{level:l,size:u})||!s?n:(r.includeFallbackColors=!1,I.mostReadable(e,["#fff","#000"],r))};var si=I.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"},tp=I.hexNames=rp(si);function rp(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function Ss(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function j(e,t){np(e)&&(e="100%");var r=ip(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)}function sn(e){return Math.min(1,Math.max(0,e))}function se(e){return parseInt(e,16)}function np(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function ip(e){return typeof e=="string"&&e.indexOf("%")!=-1}function be(e){return e.length==1?"0"+e:""+e}function xr(e){return e<=1&&(e=e*100+"%"),e}function Is(e){return Math.round(parseFloat(e)*255).toString(16)}function Cs(e){return se(e)/255}var xe=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 Le(e){return!!xe.CSS_UNIT.exec(e)}function op(e){e=e.replace(Rc,"").replace(Xc,"").toLowerCase();var t=!1;if(si[e])e=si[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=xe.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=xe.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=xe.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=xe.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=xe.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=xe.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=xe.hex8.exec(e))?{r:se(r[1]),g:se(r[2]),b:se(r[3]),a:Cs(r[4]),format:t?"name":"hex8"}:(r=xe.hex6.exec(e))?{r:se(r[1]),g:se(r[2]),b:se(r[3]),format:t?"name":"hex"}:(r=xe.hex4.exec(e))?{r:se(r[1]+""+r[1]),g:se(r[2]+""+r[2]),b:se(r[3]+""+r[3]),a:Cs(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=xe.hex3.exec(e))?{r:se(r[1]+""+r[1]),g:se(r[2]+""+r[2]),b:se(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function sp(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}}var ws=x.object({margin:x.number().min(6).default(6),maxLines:x.number().min(1).default(2),textSize:x.number().min(0).default(11.5),maxWidth:x.number().min(0).default(150),lineHeight:x.number().min(0).default(1.2),color:x.string().default("#333"),outlineColor:x.string().default("white"),textColor:x.string().optional(),textOutlineColor:x.string().optional(),pinColor:x.string().optional(),pinOutlineColor:x.string().optional(),pinColorInactive:x.string().optional(),pinOutlineColorInactive:x.string().optional(),icon:x.string().optional(),iconSize:x.number().min(0).default(20),iconScale:x.union([x.number(),vs]).default(1),iconPadding:x.number().min(0).default(2),iconFit:x.enum(["fill","contain","cover"]).default("cover"),iconOverflow:x.enum(["visible","hidden"]).default("hidden"),iconVisibleAtZoomLevel:x.number().default(-1/0)}),Os=ws.transform(e=>({...e,textColor:e.textColor??e.color,textOutlineColor:e.textOutlineColor??e.outlineColor,pinColor:e.pinColor??e.color,pinOutlineColor:e.pinOutlineColor??e.outlineColor,pinColorInactive:e.pinColorInactive??I(e.pinColor??e.color).setAlpha(.5).toRgbString(),pinOutlineColorInactive:e.pinOutlineColorInactive??I(e.pinOutlineColor??e.outlineColor).setAlpha(.5).toRgbString()})),kx=ws.strict(),an=e=>Os.parse(e),ap=x.object({rank:ms.optional(),appearance:Os.optional(),interactive:x.boolean().default(!1)}),ai=e=>{ap.parse(e??{})},Bx=(e,t,r)=>{x.array(x.number()).min(2).max(3).parse(e),x.string().parse(t),ai(r)},Es=["color","outlineColor","margin"],lp=[...Es,"maxLines","lineHeight","textSize","maxWidth","textColor","textOutlineColor"],up=[...Es,"icon","pinColor","pinOutlineColor","pinColorInactive","pinOutlineColorInactive"],Ms=(e,t)=>lp.some(r=>t[r]!=null&&e[r]!==t[r]),As=(e,t)=>up.some(r=>t[r]!=null&&e[r]!==t[r]);var cp="LOW_PRIORITY",Ds=4,pp=6,Ls=6.5,hp={heightAbovePolygon:0},Ut=class Ut{constructor(t,r,n){c(this,"lines",0);c(this,"id");c(this,"rank");c(this,"type","label");c(this,"initialRank");c(this,"contextConfigured",!1);c(this,"fillText");c(this,"newStyle",{});c(this,"opacity",0);c(this,"visibilityNeedsUpdate",!1);c(this,"text");c(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});c(this,"projection",new Se);c(this,"labelCacheId");c(this,"_cache",{});c(this,"appearance");c(this,"options");c(this,"visible",!0);c(this,"enabled",!0);c(this,"isOccluded",!1);c(this,"offscreen",!1);c(this,"canShow",!1);c(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});c(this,"dimensions",{width:0,height:0});c(this,"currentStrategyIndex",-1);c(this,"totalMarkerSize",0);c(this,"iconScale",1);c(this,"iconPadding");c(this,"dirty",!0);c(this,"textDirty",!0);c(this,"markerDirty",!0);c(this,"attachedDirty",!0);c(this,"collisionDirty",!0);c(this,"lastTextAlign");c(this,"imageHash");c(this,"markerSize",0);c(this,"iconVisible",!1);c(this,"dp");c(this,"animate",!0);c(this,"onStrategySelected",t=>{if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let r=this.strategies[this.currentStrategyIndex];if(r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}});c(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});if(this.id=r.id??$(),this.options=(0,Ns.default)({},r,hp),this.text=t,this.dp=(o=1)=>o*n.pixelRatio,typeof r.rank=="string")this.rank=jt(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let o=Math.trunc(_.env.NODE_ENV==="test"?Ut.testId:Ut.testId*10)/10;Ut.testId+=.001,this.rank=o,this.initialRank=o}let i=an(r.appearance??{});this.appearance=i,this.iconPadding=i.iconPadding}get scaledMarkerSize(){return this.totalMarkerSize*this.iconScale}get scaledIconPadding(){return this.appearance.iconPadding*this.iconScale}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.iconSize):this.markerSize=this.dp(Ls),this.totalMarkerSize=Math.ceil((this.markerSize+2.5)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,i=Math.max(pp,n),o=this.iconVisible?i/2:0,s=this.iconVisible?this.scaledMarkerSize:Ls/2,l=[{name:"RIGHT",getBoundingBox:()=>{let u=Math.max(this.scaledMarkerSize,r);return[u/2+i,u/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+t+i]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.scaledMarkerSize/2+Ds,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let u=Math.max(this.scaledMarkerSize,r);return[u/2+i,u/2+i,this.scaledMarkerSize/2+t+i,this.scaledMarkerSize/2+i]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.scaledMarkerSize/2-Ds,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let u=this.dp();return[r+this.scaledMarkerSize/2/u+i,this.scaledMarkerSize/2+i,t/2+i,t/2+i]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.scaledMarkerSize/2,this.newStyle.left=-t/2}},{name:cp,getBoundingBox:()=>[s+o,s+o,s+o,s+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:l}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(t);let n=this.style;this.style=this.newStyle,this.newStyle=n}this.dirty=!1}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?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,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==this.packedMessage.bboxes[0]?.[4]){let r=this.packedMessage.bboxes.findIndex(n=>n[4]===this.currentStrategyIndex);if(r!==-1){let n=this.packedMessage.bboxes.splice(r,1)[0];this.packedMessage.bboxes.unshift(n)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let r=0;r<this.strategies.length;r++){let n=this.strategies[r];r===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...n.getBoundingBox(),r]):this.packedMessage.bboxes.push([...n.getBoundingBox(),r])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};c(Ut,"testId",0);var li=Ut,ks=li;h();var ha=kn(fa());var Sr=4,sd=8,ad="0.6",ca="low-priority-pin",xi=x.object({rank:x.union([x.enum(["low","medium","high","always-visible"]),x.number()]).optional(),interactive:x.union([x.boolean(),x.literal("pointer-events-auto")]).optional(),id:x.string().optional(),placement:x.union([x.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),x.array(x.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:x.boolean().optional(),zIndex:x.number().optional(),lowPriorityPin:x.object({enabled:x.boolean().optional(),size:x.number().positive().optional(),color:x.string().optional()}).optional()});function nb(e,t,r){x.array(x.number()).min(2).max(3).parse(e),x.string().parse(t),xi.parse(r)}var ld=Object.freeze({enabled:!0,size:sd,color:"#666"}),Zt=class Zt{constructor(t,r={}){c(this,"id");c(this,"type","marker");c(this,"rank",0);c(this,"initialRank",0);c(this,"activePlacement","center");c(this,"pointerEvents","none");c(this,"options",{rank:"low",interactive:!1,id:"",placement:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:{...ld}});c(this,"projection",new Se);c(this,"enabled",!0);c(this,"canShow",!1);c(this,"visible",!0);c(this,"isOccluded",!1);c(this,"offscreen",!1);c(this,"strategyIndex",-1);c(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});c(this,"dimensions",{width:0,height:0});c(this,"markerContainer");c(this,"containerEl");c(this,"contentEl",null);c(this,"contentHtml","");c(this,"style",{top:"0px",left:"0px"});c(this,"dirty",!1);c(this,"attachedDirty",!0);c(this,"collisionDirty",!0);c(this,"visibilityNeedsUpdate","show");c(this,"animation",null);c(this,"currentStrategyIndex",-1);c(this,"onStrategySelected",(t,r=!1)=>{if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activePlacement="center",this.markerContainer.setAttribute("data-placement",ca);let i=this.options.lowPriorityPin,o=i.size,s=i.color;this.markerContainer.style.setProperty("--mappedin-pin-size",`${o}px`),this.markerContainer.style.setProperty("--pin-color",s),this.markerContainer.style.opacity=ad,this.style.top=-o/2+"px",this.style.left=-o/2+"px"}else{this.activePlacement=this.strategies[t]?.name??"center",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:i,height:o}=this.dimensions,s=-o/2+"px",l=-i/2+"px";switch(this.style.top=s,this.style.left=l,this.activePlacement){case"top":{this.style.top=-o+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-i+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-o+"px",this.style.left=-i+"px";break}case"top-right":{this.style.top=-o+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-i+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=s,this.style.left=l}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left});c(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=r?.id||$(),this.options=(0,ha.default)(this.options,r),typeof r.rank=="string")this.rank=jt(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let n=Math.trunc(_.env.NODE_ENV==="test"?Zt.testId:Zt.testId*10)/10;Zt.testId+=.001,this.rank=n}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">${this.contentHtml}</div>`,this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=this.markerContainer.firstElementChild??null,this.contentEl=this.markerContainer.firstElementChild?.firstElementChild??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;if(t===0||r===0)return[];let i=(Array.isArray(this.options.placement)?this.options.placement:[this.options.placement]).map(o=>({name:o,getBoundingBox:()=>{let s=r/2,l=r/2,u=t/2,f=t/2;switch(o){case"top":{s=r,l=0;break}case"bottom":{s=0,l=r;break}case"left":{u=t,f=0;break}case"right":{u=0,f=t;break}case"top-left":{s=r,u=t,l=0,f=0;break}case"top-right":{s=r,f=t,l=0,u=0;break}case"bottom-left":{l=r,u=t,s=0,f=0;break}case"bottom-right":{l=r,f=t,s=0,u=0;break}}return[s+Sr,l+Sr,u+Sr,f+Sr]}}));if(this.options.lowPriorityPin?.enabled&&this.options.rank!=="always-visible"){let o={name:ca,getBoundingBox:()=>{let s=Math.max(2,Sr/2);return[this.options.lowPriorityPin.size/2+s,this.options.lowPriorityPin.size/2+s,this.options.lowPriorityPin.size/2+s,this.options.lowPriorityPin.size/2+s]}};i.push(o)}return i}toPackedMessage(t=!1){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!==this.packedMessage.bboxes[0]?.[4]){let n=this.packedMessage.bboxes.findIndex(i=>i[4]===this.currentStrategyIndex);if(n!==-1){let i=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(i)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let i=this.strategies[n];n===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...i.getBoundingBox(),n]):this.packedMessage.bboxes.push([...i.getBoundingBox(),n])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){return!this.options.lowPriorityPin?.enabled||this.options.rank==="always-visible"?-1:Array.isArray(this.options.placement)?this.options.placement.length:1}destroy(){}};c(Zt,"testId",0);var pa=Zt;h();var St=class extends ue{constructor(){super(...arguments);c(this,"type","geometry");c(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)})}},ae=class{constructor(t,r){c(this,"id",$());c(this,"components");c(this,"parentId");c(this,"entities2D",new Map);this.components=[t,r]}get object3d(){return this.components[0].mesh}get parentObject3D(){return this.components[0].mesh?.parent}get type(){return this.components[0].type}attach(t){this.parentObject3D instanceof ne?t.object3d.userData.attachedEntityId=this.id:this.entities2D.set(t.id,t)}detach(t){this.parentObject3D instanceof ne&&(t.object3d.userData.parentEntityId=void 0),this.entities2D.delete(t.id)}removeAllEntities(){for(let t of this.entities2D.values())this.detach(t)}};h();var Ce=class extends ue{},Be=class{constructor(t,r,n=0){c(this,"id");c(this,"verticalOffset");c(this,"occluderId");c(this,"object3d",new Ce);c(this,"components");c(this,"disposed",!1);c(this,"worldPosition",new V);this.id=t.id||$(),this.components=[t],this.verticalOffset=n,this.object3d=new Ce,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}};h();h();var da=class extends lr{constructor(r,n,i=!0){super();c(this,"rendererState");c(this,"convertTo3DMapPosition");c(this,"textSet",new Set);c(this,"batchedTextMap",new Map);c(this,"useWorker",!0);c(this,"debugTextAreaMesh",new Map);i===!1&&(this.useWorker=!1,ud(!1)),this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){let n,i,o,s=[];for(let l of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(l),n?.type==="text3d"){i=n.components[0],o=n.components[1];let u=i.mesh?.parent;if(!u||!(u instanceof ie)||!(i instanceof gn))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&i.feature.properties?.textArea?.position!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(u)||this.batchedTextMap.set(u,qt().then(({BatchedText:d})=>{let m=new d;return m.type="batchedtext",u.add(m),m}));let p=this.batchedTextMap.get(u);if(!p)throw new Error("batched text required");s.push(ma({entityId:l,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:p,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(l.toString()))continue;this.textSet.add(l.toString()),this.batchedTextMap.has(u)||this.batchedTextMap.set(u,qt().then(({BatchedText:d})=>{let m=new d;return m.type="batchedtext",u.add(m),m}));let p=this.batchedTextMap.get(u);if(!p)throw new Error("batched text required");s.push(ma({entityId:l,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:p,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let f=this.batchedTextMap.get(u);i.textMesh&&f&&i.polygonEntityId!=null&&Promise.all([f,Promise.resolve({meshComponent:i,styleComponent:o})]).then(([p,{meshComponent:d,styleComponent:m}])=>{let{textMesh:g}=d;if(p&&g){let b=Pi(p,g);d.visible&&!b?p.add(g):!d.visible&&b&&p.remove(g)}m.flipToFaceCamera&&this.flipIfNeeded(d,r)})}return Promise.all(s)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let o=i.rotation.z,s=rn(o+n);s>Math.PI/2&&s<3*Math.PI/2&&(i.rotation.z=rn(o+Math.PI))}showTextAreaMesh(){let r,n;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),r?.type==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let o=n.feature.properties.textArea;if(!o)continue;let s=new so(o.maxWidth,o.maxHeight),l=new Ye(s,new et({color:"pink"})),{textMesh:u}=n;if(!u)continue;let f=this.convertTo3DMapPosition(o.position,Ir);l.position.copy(f),l.position.z=u.position.z-.1,l.rotation.z=u.rotation.z,bi.identity(),bi.makeRotationAxis(new V(0,0,1),u.userData.rotationZ),Ir.set(o.maxWidth/2,0,0),Ir.applyMatrix4(bi),l.position.x-=Ir.x,l.position.y-=Ir.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(i,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};function ud(e){qt().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}var bi=new Qe,Ir=new V,_i;async function Cb(e){let{preloadFont:t}=await qt();return t(e)}function qt(){return _i||(_i=import("./text3d-EKD5MTTV.js").then(e=>e)),_i}async function ma({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:o,type:s="text-area"}){return Promise.all([qt(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:l,createTroikaTextArea:u},f])=>s==="text-area"?u(f.entityId,f.meshComponent,f.styleComponent,n):l(f.entityId,f.meshComponent,f.styleComponent,n)).catch(l=>{H.warn("Trouble creating text: ",l)}).then(l=>{if(!l?.text)return;let u=[Promise.resolve(l.text),i,Promise.resolve()];if(t.polygonEntityId){let f=o.geometry3DMap.get(t.polygonEntityId);if(f?.type==="geometry"){let p=f.components[0],d=f.components[1];p.textMesh=l.text,l.text.position.z=d.altitude+d.height+fd}}else u[2]=qt().then(({syncText:f})=>f(l.text));return Promise.all(u)}).then(l=>{if(!l)return;let[u,f]=l;f.add(u),t.batchedText||(t.batchedText=f)})}function Pi(e,t){return e._members.has(t)}var fd=.5;var cd=x.object({visible:x.boolean(),color:x.string(),flipToFaceCamera:x.boolean(),font:x.string().optional(),fontSize:x.number(),margin:x.union([x.number(),x.tuple([x.number(),x.number(),x.number(),x.number()])]),outlineColor:x.string(),outlineOpacity:x.number(),outlineBlur:x.union([x.number(),x.string()]),outlineWidth:x.number(),outlineOffsetX:x.number(),outlineOffsetY:x.number(),strokeWidth:x.number(),maxWidth:x.number().optional(),maxHeight:x.number().optional(),strokeOpacity:x.number(),strokeColor:x.string(),fillOpacity:x.number(),hoverColor:x.string().optional(),id:x.union([x.string(),x.number()]),type:x.literal("text3d"),position:x.tuple([x.number(),x.number(),x.number()]),content:x.string()}),ya=cd.partial().omit({id:!0,type:!0}).strict(),ga=ya.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Ab=x.object({appearance:ya.optional(),parentId:x.string().optional()}).strict(),gn=class{constructor(t){c(this,"mesh",new St);c(this,"textMesh");c(this,"type","text3d");c(this,"feature");c(this,"parent");c(this,"batchedText");c(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?Pi(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}};h();var Jt,vn=class{constructor(t){c(this,"color");c(this,"dirty",!0);c(this,"enabled",!0);oe(this,Jt,!1);c(this,"edgeColors");c(this,"edgeVisibility");c(this,"geometry");c(this,"ranges");c(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||Y(this,Jt)===t)return;Z(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 Y(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;h();h();h();var xn=class extends to{constructor(r){let n=r,i=3,o=i*4;super(new Uint8Array(r*o),i,r,Ki,$i);c(this,"_width");c(this,"_height");c(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 fe(n[i]/255,n[i+1]/255,n[i+2]/255),s=new fe(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}}};h();var va=`#define LAMBERT
3
+ varying vec3 vViewPosition;
4
+ varying vec4 vPosition;
5
+ varying vec2 vUv;
6
+ varying vec4 finalPosition;
7
+ varying float vVerticalOffset;
8
+ varying vec3 worldNormal;
9
+ varying float vBatchId;
10
+
11
+ #include <common>
12
+ #include <batching_pars_vertex>
13
+ #include <uv_pars_vertex>
14
+ #include <displacementmap_pars_vertex>
15
+ #include <envmap_pars_vertex>
16
+ #include <color_pars_vertex>
17
+ #include <fog_pars_vertex>
18
+ #include <normal_pars_vertex>
19
+ #include <morphtarget_pars_vertex>
20
+ #include <skinning_pars_vertex>
21
+ #include <shadowmap_pars_vertex>
22
+ #include <logdepthbuf_pars_vertex>
23
+ #include <clipping_planes_pars_vertex>
24
+
25
+ void main() {
26
+
27
+ #include <uv_vertex>
28
+ #include <color_vertex>
29
+ #include <morphinstance_vertex>
30
+ #include <morphcolor_vertex>
31
+ #include <batching_vertex>
32
+
33
+ #include <beginnormal_vertex>
34
+ #include <morphnormal_vertex>
35
+ #include <skinbase_vertex>
36
+ #include <skinnormal_vertex>
37
+ #include <defaultnormal_vertex>
38
+ #include <normal_vertex>
39
+
40
+ #include <begin_vertex>
41
+ #include <morphtarget_vertex>
42
+ #include <skinning_vertex>
43
+ #include <displacementmap_vertex>
44
+ #include <project_vertex>
45
+ #include <logdepthbuf_vertex>
46
+ #include <clipping_planes_vertex>
47
+
48
+ vViewPosition = - mvPosition.xyz;
49
+
50
+ #include <worldpos_vertex>
51
+ #include <envmap_vertex>
52
+ #include <shadowmap_vertex>
53
+ #include <fog_vertex>
54
+
55
+ // To mitigate visual defects on machines such as windows and iOS
56
+ vBatchId = getIndirectIndex(gl_DrawID) + 0.5;
57
+ vViewPosition = - mvPosition.xyz;
58
+ worldNormal = normal;
59
+ vUv = uv;
60
+ vVerticalOffset = position.z;
61
+ }
62
+ `;h();var xa=`#define LAMBERT
63
+ uniform vec3 diffuse;
64
+ uniform vec3 emissive;
65
+ uniform float opacity;
66
+ uniform float uGradientEnd;
67
+ uniform float uGradientIntensity;
68
+ uniform float uMinSideAlpha;
69
+ uniform float uMaxSideAlpha;
70
+ uniform float uGradientStart;
71
+ uniform highp sampler2D uPropertiesTexture;
72
+ uniform highp sampler2D uTopTexture;
73
+ uniform highp sampler2D uTexture;
74
+ uniform float uRepeatYFactor;
75
+ uniform bool uBlendTexture;
76
+ varying float vBatchId;
77
+
78
+ varying vec2 vUv;
79
+ varying float vVerticalOffset;
80
+ varying vec3 worldNormal;
81
+
82
+ #include <common>
83
+ #include <packing>
84
+ #include <dithering_pars_fragment>
85
+ #include <color_pars_fragment>
86
+ #include <uv_pars_fragment>
87
+ #include <map_pars_fragment>
88
+ #include <alphamap_pars_fragment>
89
+ #include <alphatest_pars_fragment>
90
+ #include <alphahash_pars_fragment>
91
+ #include <aomap_pars_fragment>
92
+ #include <lightmap_pars_fragment>
93
+ #include <emissivemap_pars_fragment>
94
+ #include <envmap_common_pars_fragment>
95
+ #include <envmap_pars_fragment>
96
+ #include <fog_pars_fragment>
97
+ #include <bsdfs>
98
+ #include <lights_pars_begin>
99
+ #include <normal_pars_fragment>
100
+ #include <lights_lambert_pars_fragment>
101
+ #include <shadowmap_pars_fragment>
102
+ #include <bumpmap_pars_fragment>
103
+ #include <normalmap_pars_fragment>
104
+ #include <specularmap_pars_fragment>
105
+ #include <logdepthbuf_pars_fragment>
106
+ #include <clipping_planes_pars_fragment>
107
+
108
+ vec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {
109
+ vec3 texturedColor = diffuseColor * texColor.rgb;
110
+ return mix(diffuseColor, texturedColor, texColor.a);
111
+ }
112
+
113
+ void main() {
114
+ #include <clipping_planes_fragment>
115
+
116
+ // get the normalized world normal of vertex fragment
117
+ vec3 surfaceNormal = normalize(worldNormal);
118
+
119
+ // get angle relative to Z up
120
+ float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));
121
+
122
+ int idx = int(vBatchId) * 1;
123
+ vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);
124
+ bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;
125
+
126
+ if(shouldShowTexture) {
127
+ vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));
128
+ diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;
129
+ }
130
+
131
+ // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue
132
+ if(angle < 0.02) {
133
+ bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;
134
+
135
+ if(shouldShowTopTexture) {
136
+ vec4 topTex2d = texture2D(uTopTexture, vUv);
137
+ diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;
138
+ } else {
139
+ diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);
140
+ }
141
+ }
142
+
143
+ vec4 diffuseColor = vec4(diffuse, opacity);
144
+
145
+ // only for vertical surfaces
146
+ if(angle > 89.0 && angle < 91.0) {
147
+
148
+ // get the percentage of the z position from the ground, up
149
+ float percentFromZeroZ = max((abs(vVerticalOffset) - uGradientStart) / uGradientEnd, 0.0);
150
+
151
+ // gradient based on percentage
152
+ float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);
153
+
154
+ // mix the shadow color with the diffuse color based on the alpha and opacity
155
+ diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);
156
+ }
157
+
158
+ ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
159
+ vec3 totalEmissiveRadiance = emissive;
160
+
161
+ #include <logdepthbuf_fragment>
162
+ #include <map_fragment>
163
+ #include <color_fragment>
164
+ #include <alphamap_fragment>
165
+ #include <alphatest_fragment>
166
+ #include <alphahash_fragment>
167
+ #include <specularmap_fragment>
168
+ #include <normal_fragment_begin>
169
+ #include <normal_fragment_maps>
170
+ #include <emissivemap_fragment>
171
+
172
+ // accumulation
173
+ #include <lights_lambert_fragment>
174
+ #include <lights_fragment_begin>
175
+ #include <lights_fragment_maps>
176
+ #include <lights_fragment_end>
177
+
178
+ // modulation
179
+ #include <aomap_fragment>
180
+
181
+ vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
182
+
183
+ #include <envmap_fragment>
184
+ #include <opaque_fragment>
185
+ #include <tonemapping_fragment>
186
+ #include <colorspace_fragment>
187
+ #include <fog_fragment>
188
+ #include <premultiplied_alpha_fragment>
189
+ #include <dithering_fragment>
190
+
191
+ }
192
+ `;var pd=-.05,hd=1,wr=class extends ao{constructor(r,n,i=1){super(r);c(this,"propertiesTexture");c(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});c(this,"colorSpace",Bn);c(this,"showTextures",r=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,n,i),this.needsUpdate=!0)});this.alphaTest=.01,this.propertiesTexture=new xn(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=o=>{let s=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,u=this.uniforms.uGradientStart,f=this.uniforms.uTopTexture,p=this.uniforms.uTexture,d=this.uniforms.uRepeatYFactor,m=this.uniforms.uBlendTexture;this.uniforms=o.uniforms,o.vertexShader=va,o.fragmentShader=xa,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:l,uGradientStart:u,uMinSideAlpha:{value:pd},uMaxSideAlpha:{value:hd},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:f,uTexture:p,uRepeatYFactor:d,uBlendTexture:m})}}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=sr,r.wrapT=sr,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=sr,r.wrapT=sr,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?Qi:Bn,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()}};h();var Qb={top:0,bottom:0,left:0,right:0,type:"pixel"},Or={enabled:!1,thickness:0,size:0,offset:0,segments:3};function e0(e,t){return{bevelEnabled:e?.enabled??Or.enabled,bevelThickness:e?.thickness??Or.thickness,bevelSize:e?.size??(e?.thickness||Or.size),bevelOffset:e?.offset??Or.offset,bevelSegments:e?.segments??Or.segments,depth:t}}var ba="mappedin";var t0={ALWAYS_ON_TOP:10},r0=250,n0="collision-worker.csp.js",i0="maplibre-worker.csp.js";h();function P0(e,t){let r=0;for(let f of e)r+=f.components[0]?.geometry?.attributes.position.count||0;let n=new fe(t.color),i;i=new wr({color:n,side:t.side==="back"?qi:t.side==="front"?Zi:Ji,opacity:t.opacity??1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let o=new $t(e.length,r,0,i);o.renderOrder=0;let s,l,u;for(let f of e)s=f.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]=f.id,i instanceof wr&&i.setColor(s.instanceIndex,n,t.topColor?new fe(t.topColor):n),l=o.getGeometryIdAt(s.instanceIndex),s.batchedProps&&(u=o.getGeometryRangeAt(l),u&&(s.batchedProps.range=u),s.batchedProps.geometryId=l));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}function Ti(e){return I(e).darken(30).toRgbString()}function T0(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"),l=e.getAttribute("uv"),u,f;e.index?(u=e.index.count/3,f=function(E,W){return e.index.getX(E*3+W)}):(u=o.count/3,f=function(E,W){return E*3+W});let p=new Qe;p.makeRotationFromQuaternion(new Rn().setFromEuler(new Yn(0,0,r/180*Math.PI)));let d=t.find(E=>E.face==="top"),m;d&&(m={min:n(d.bounds[1],d.bounds[0],0),max:n(d.bounds[3],d.bounds[2],i.max.z)});let g=t.find(E=>E.face==="side"),b;if(g&&(b={min:n(g.bounds[1],g.bounds[0],0),max:n(g.bounds[3],g.bounds[2],i.max.z)}),!(!b&&!m))for(let E=0;E<u;++E){let W=s.getX(f(E,0))+s.getX(f(E,1))+s.getX(f(E,2)),U=s.getY(f(E,0))+s.getY(f(E,1))+s.getY(f(E,2)),$e=s.getZ(f(E,0))+s.getZ(f(E,1))+s.getZ(f(E,2)),Xe=Math.abs(W),er=Math.abs(U),Rr=Math.abs($e);var C,w;Xe<=er&&Xe<=Rr?(C="x",er<=Rr?w="y":w="z"):er<=Xe&&er<=Rr?(C="y",Xe<=Rr?w="x":w="z"):(C="z",Xe<=er?w="x":w="y"),C==="z"&&(C=w,w="z");let tr,rr,nr,or,En,Mn;if(w==="z"||C==="z"){if(!g||!b)continue;tr=g.repeat.u,rr=g.repeat.v,nr=g.offset.u,or=g.offset.v,En=g.rotation,Mn=b}else{if(!d||!m)continue;tr=d.repeat.u,rr=d.repeat.v,nr=d.offset.u,or=d.offset.v,En=(360-r+d.rotation)%360,Mn=m}let{min:me,max:Ri}=Mn,Mt=new ue;Mt.position.set(me.x,me.y,0),Mt.updateMatrix(),Mt.updateMatrixWorld();let Xi=me.clone().applyMatrix4(p),Yi=Ri.clone().applyMatrix4(p),Qa=Math.abs(Yi.x-Xi.x),el=Math.abs(Yi.y-Xi.y),Fi=new V(Qa,el,Ri.z).applyMatrix4(Mt.matrixWorld),An=Math.abs(Fi[C]-me[C]),Dn=Math.abs(Fi[w]-me[w]),Gi=En*Math.PI/180||0,Wi=Math.cos(Gi),ji=Math.sin(Gi),tl=Mt.matrixWorld.clone().invert(),rl=new Rn().setFromEuler(new Yn(0,0,r/180*Math.PI));for(let Ke=0;Ke<3;Ke++){let Ui=new V(o.getX(f(E,Ke)),o.getY(f(E,Ke)),o.getZ(f(E,Ke))).applyMatrix4(tl);Ui.applyQuaternion(rl);let Ln=Ui.applyMatrix4(Mt.matrixWorld),Vi=Ln.x,Hi=Ln.y,zi=Ln.z;var M,N;C==="x"?M=tr*(Vi-me[C])/An+nr:C==="y"?M=tr*(Hi-me[C])/An+nr:M=tr*(zi-me[C])/An+nr,w==="x"?N=rr*(Vi-me[w])/Dn+or:w==="y"?N=rr*(Hi-me[w])/Dn+or:N=rr*(zi-me[w])/Dn+or,M-=.5,N-=.5;let nl=M*Wi-N*ji+.5,il=M*ji+N*Wi+.5;l.setX(f(E,Ke),nl),l.setY(f(E,Ke),il)}}}h();var bn=class{constructor(){c(this,"focusMesh");c(this,"dirty",!0)}};h();var _n=class{constructor(){c(this,"dirty",!0);c(this,"needsRebuild",!1);c(this,"mesh")}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}};function Er(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 Be&&e.components[1]===void 0?(e.components[1]=new Wt,e.components[1].dirty=!0):e instanceof ae&&e.components[2]===void 0?(e.components[2]=new Wt,e.components[2].dirty=!0):e instanceof ie&&e.components[0]===void 0&&(e.components[0]=new Wt,e.components[0].dirty=!0),!0):(e instanceof Be?e.components[1]=void 0:e instanceof ae?e.components[2]=void 0:e instanceof ie&&(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),Er(n,t,r);return!0}}return!1}function q0(e,t,r){if(!(!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&&_a(n,r);return!0}return!1}}function yd(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].shading=t,e.components[1].dirty=!0)}function J0(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&&yd(i,r)}return!0}return!1}function $0(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))}function gd(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?.type==="geometry"||i?.type==="model")&&gd(i,t,r)}return!0}}return!1}function _a(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=Ti(t.color),e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor,r=!0),r&&(e.components[1].dirty=!0))}}function K0(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)))}function Q0(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof ie?(e.parentObject3D?.removeEntity(e),t.addEntity(e),!0):!1}function e_(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}function t_(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(t.placement!==void 0&&(n.options.placement=t.placement,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{xi.parse(t.options||{})}catch(i){return H.error(i),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Er(e,!1,r)):(n.pointerEvents="none",Er(e,t.options.interactive,r))),Pa(e,t.options.rank),!0}}return!1}function Pa(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=jt(t),!0):!1}function vd(e,t){if(t?.options?.appearance==null)return;let r=an(t.options.appearance);Si(e.appearance,r)}function r_(e,t,r){if(t!==void 0&&e.type==="label"){let n=e.components[0];t.text!==void 0&&t.text!==n.text&&(n.text=t.text,n.textDirty=!0);try{ai(t.options??{})}catch(i){H.error(i);return}Ms(n.appearance,t.options?.appearance||{})&&(n.textDirty=!0),As(n.appearance,t.options?.appearance||{})&&(n.markerDirty=!0),vd(n,t),Er(e,t.options?.interactive,r),Pa(e,t.options?.rank)}}function n_(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}function i_(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}function o_(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}function Ta(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 Ce){let i=t.geometry2DMap.get(n.userData.entityId);if(i){let o=i.components[0];o instanceof ks&&(o.canShow=r)}}}),!0}else if(e.type==="label")return e.components[0].visible=r,!0}return!1}function xd(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?.type==="geometry"||i?.type==="model")&&xd(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 ie&&(n=e.parent.opacity),Ca(e,t,n),!0}}else e instanceof ae&&e.components[1].opacity!==r&&(e.components[1].opacity=r,e.components[1].dirty=!0);return!1}function Ca(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 ne&&i.type==="geometry-group"||i instanceof ie&&i.type==="group-container")&&Ca(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?.type==="geometry"||i?.type==="model")&&(o=i.components[1],o.dirty=!0)}}function s_(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&&bd(i,r)}}function bd(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if(t?.texture!=null&&n.texture!==t?.texture&&(n.texture=t.texture,r=!0),t?.topTexture!=null&&n.topTexture!==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}function a_(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?.type==="geometry-group"&&(o.userData.shadingDirty=!0),!0}}return!1}function l_(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}function _d(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 ae&&_d(i,t,r)}else if(e.type==="geometry"){let n=e.components[3],i=e.components[1];!n&&r===!0?e.components[3]=new vn(Ti(i.color)):n&&(n.enabled=r,n.dirty=!0)}return!0}return!1}function u_(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 bn,!0;if(t===!1&&r!=null)return e.components[n]=void 0,!0}return!1}function f_(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}function Pd(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 ae&&Pd(i,t,r)}}}function c_(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 _n;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))}}function p_(e,t,r){let{visible:n,color:i}=r;if(e.type!=="path")return;let o=e.components[0];n!=null&&Ta(e,t,n),i!=null&&_a(e,{color:i}),Object.assign(o,Td(r)),Ci(r)||(o.materialDirty=!0,r.width!=null&&(o.dirty=!0))}function Td(e){return Mr(e,Cd)}var Cd=["animateArrowsOnPath","displayArrowsOnPath","width","accentColor","completeFraction","dashed","visibleThroughGeometry"];function h_(e){if(!(e instanceof ae&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var Sd=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function d_(e,t,r){Ta(e,t,r.visible);let n=e.components[1],i=Mr(r,Sd);"margin"in r&&H.warn("update to margin is not supported atm"),"content"in r&&H.warn("content update is not supported atm");try{ga.parse(i)}catch(o){H.error(o);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}var Id=["color","material","opacity","verticalOffset","rotation","position","scale"];function m_(e,t){let r=Mr(t,Id),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)}h();h();var Oi=kn(Na());function ka(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}ka.prototype=Error.prototype;Oi.default.Error=function(e){throw new ka(e)};var Re=Oi.default;var by="gray",Ei=new Re.ClipperOffset,ee=100;function Mi(e,t,r){let{color:n=by,opacity:i=1,width:o=1,join:s="round",cap:l="round",height:u=.01,altitude:f=0}=r||{};Array.isArray(i)&&(i=0);let p=[],d=e.geometry.coordinates.every(M=>M[2]!=null);for(let M=0;M<e.geometry.coordinates.length-1;M++){let N=t(e.geometry.coordinates[M][1],e.geometry.coordinates[M][0],e.geometry.coordinates[M][2]),E=t(e.geometry.coordinates[M+1][1],e.geometry.coordinates[M+1][0],e.geometry.coordinates[M+1][2]);p.push([N,E])}let m=p[0][0].y;Ei.AddPaths(p.map(M=>M.map(N=>({X:N.x*ee,Y:(d?N.z:N.y)*ee}))),s==="round"?Re.JoinType.jsRound:s==="miter"?Re.JoinType.jsMiter:Re.JoinType.jsSquare,l==="round"?Re.EndType.etOpenRound:l==="butt"?Re.EndType.etOpenButt:Re.EndType.etOpenSquare);let g=new Re.PolyTree;Ei.Execute(g,o/2*ee);let b=[],C={bevelEnabled:!1,depth:u};for(let M of g.m_AllPolys){let N=new io;if(M.IsHole())continue;let E=M.m_polygon;N.moveTo(E[0].X/ee,E[0].Y/ee),E.slice(1).forEach(W=>N.lineTo(W.X/ee,W.Y/ee)),N.lineTo(E[0].X/ee,E[0].Y/ee),N.holes=M.m_Childs.map(W=>{let U=new no,$e=W.m_polygon;return U.moveTo($e[0].X/ee,$e[0].Y/ee),$e.slice(1).forEach(Xe=>U.lineTo(Xe.X/ee,Xe.Y/ee)),U.lineTo($e[0].X/ee,$e[0].Y/ee),U}),b.push(new oo(N,C))}let w=Yr(b);return d&&(w.rotateX(Math.PI/2),w.translate(0,m+u/2,f||0)),w.userData={style:{color:n,opacity:i}},Ei.Clear(),w}h();h();var le=63710088e-1,D_={centimeters:le*100,centimetres:le*100,degrees:360/(2*Math.PI),feet:le*3.28084,inches:le*39.37,kilometers:le/1e3,kilometres:le/1e3,meters:le,metres:le,miles:le/1609.344,millimeters:le*1e3,millimetres:le*1e3,nauticalmiles:le/1852,radians:1,yards:le*1.0936};function Ba(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}function Ra(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return Ba({type:"LineString",coordinates:e},t,r)}function Xa(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function Ya(e,t,r={}){return Ba({type:"MultiLineString",coordinates:e},t,r)}h();function In(e){return e.type==="Feature"?e.geometry:e}function _y(e,t={}){let r=In(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return Py(r,t);case"MultiPolygon":return Ty(r,t);default:throw new Error("invalid poly")}}function Py(e,t={}){let n=In(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return Fa(n,i)}function Ty(e,t={}){let n=In(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},o=[];return n.forEach(s=>{o.push(Fa(s,i))}),Xa(o)}function Fa(e,t){return e.length>1?Ya(e,t):Ra(e[0],t)}var Ai=_y;h();function Ga(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}function Di(e){for(let t=e.children.length-1;t>=0;t--)Di(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){Ga(t)}):"material"in e&&typeof e.material<"u"&&Ga(e.material)}h();function Wa(e){return e!=null&&e.geometry.type==="Polygon"&&e.geometry.coordinates[0].length>2}function Cy(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)}function Sy(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],l=e[o],u=r&&o===e.length-1?e[1]:e[o+1];if(s==null||u==null){n.push(l);continue}let f=[l[0]-s[0],l[1]-s[1]],p=[u[0]-l[0],u[1]-l[1]];Cy(f,p)>t&&n.push(l)}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}function ja(e,t=5){return{...e,geometry:{...e.geometry,coordinates:e.geometry.coordinates.map(r=>Sy(r,t))}}}var Va=.1,Iy=15,wy=.25,Ua=class{constructor(t,r){c(this,"rendererState");c(this,"dirty",!1);c(this,"convertTo3DMapPosition");c(this,"colorToMaterialCache",{});this.rendererState=t,this.convertTo3DMapPosition=r}update(){let t,r,n,i;for(let o of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(o),t!=null&&(i=t.components[0],r=t.components[1],t.type==="geometry"&&i instanceof ze&&Wa(i.feature))){if(n=t.components[5],n?.dirty){if(n.mesh==null)try{let s=this.buildBorder(i.feature,r,n);i.mesh?.add(s)}catch(s){H.error(s),n.dirty=!1}n.mesh?.children.forEach(s=>{n&&s.material.color.set(r.borderColor)}),n.dirty=!1,n.visible=r.borderVisible}if(n?.needsRebuild){Di(n.mesh);try{let s=this.buildBorder(i.feature,r,n);i.mesh?.add(s)}catch(s){H.error(s)}n.needsRebuild=!1,n.visible=r.borderVisible}}}buildBorder(t,r,n){let i=Ai(t),o=ja(t,Iy),s=Ai(o),l=r.borderWidth/2,u=r.borderColor,f=Mi(i,this.convertTo3DMapPosition,{width:l,height:l,color:u,cap:"square"}),p=f.clone();p.translate(0,0,r.height);let d;s.geometry.type==="LineString"?d=s.geometry.coordinates:d=s.geometry.coordinates.flat();let m=[];d.pop();for(let E of d||[])try{let W=Mi({type:"Feature",geometry:{type:"LineString",coordinates:[[E[0],E[1],0],[E[0],E[1],r.height]]},properties:{}},this.convertTo3DMapPosition,{width:l,height:l,color:u,cap:"butt"});m.push(W)}catch(W){H.warn(W)}let g=Yr([f,p,...m]),b=this.colorToMaterialCache[u]?.[0];b==null&&(b=new et({color:u}));let C=this.colorToMaterialCache[u]?.[1];C==null&&(C=new et({color:u})),this.colorToMaterialCache[u]=[b,C];let w=new ue,M=new Ye(g,b),N=new Ye(g,C);return w.add(M),w.add(N),N.material.depthWrite=!1,N.material.depthTest=!1,N.material.opacity=wy,N.material.transparent=!0,w.position.z=r.altitude??0,n.mesh=w,w}destroy(){for(let[t,[r,n]]of Object.entries(this.colorToMaterialCache))r.dispose(),n.dispose();this.colorToMaterialCache={}}};var Li="#ffffff",Oy=.1,wn=.1,Lr,Nr,kr,Ni=class{constructor(t={}){c(this,"initialColor",Li);oe(this,Lr,Li);c(this,"initialTopColor");oe(this,Nr);c(this,"topTexture");c(this,"texture");oe(this,kr);c(this,"dirty",!0);c(this,"visible",!0);c(this,"opacity",1);c(this,"width",Oy);c(this,"height",wn);c(this,"initialHeight",wn);c(this,"altitude",0);c(this,"join","round");c(this,"cap","round");c(this,"showImage",!0);c(this,"flipImageToFaceCamera",!0);c(this,"url");c(this,"side","double");c(this,"renderOrder",0);c(this,"shading");c(this,"bevel");c(this,"borderVisible",!1);c(this,"borderColor");c(this,"borderWidth");this.color=t?.color!==void 0?t.color:this.color,this.initialColor=this.color,this.width=t?.width!==void 0?t.width:this.width,this.opacity=t?.opacity!==void 0?t.opacity:this.opacity,this.visible=t?.visible!==void 0?t.visible:this.visible,this.height=t?.height!==void 0?t.height:this.height,this.initialHeight=this.height,this.altitude=t?.altitude!==void 0?t.altitude:this.altitude,this.join=t?.join!==void 0?t.join:this.join,this.cap=t?.cap!==void 0?t.cap:this.cap,this.topColor=t?.topColor,this.initialTopColor=this.topColor,this.texture=t?.texture,this.topTexture=t?.topTexture,this.showImage=t?.showImage!==void 0?t.showImage:this.showImage,this.flipImageToFaceCamera=t?.flipImageToFaceCamera!==void 0?t.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=t?.url,this.side=t?.side!==void 0?t.side:this.side,this.renderOrder=t?.renderOrder!==void 0?t.renderOrder:this.renderOrder,this.shading=t?.shading,this.bevel=t?.bevel,this.borderVisible=t?.borderVisible!==void 0?t.borderVisible:this.borderVisible,this.borderColor=t?.borderColor!==void 0?t.borderColor:this.color,this.borderWidth=t?.borderWidth!==void 0?t.borderWidth:Va}set color(t){Wr(t)?Z(this,Lr,t):H.warn(`Failed to update color. Invalid color "${t}".`)}get color(){return Y(this,Lr)}set topColor(t){t===void 0||Wr(t)?Z(this,Nr,t):H.warn(`Failed to update top color. Invalid color "${t}".`)}get topColor(){return Y(this,Nr)}set hoverColor(t){Wr(t)?Z(this,kr,t):H.warn(`Failed to update hover color. Invalid color "${t}".`)}get hoverColor(){return Y(this,kr)}};Lr=new WeakMap,Nr=new WeakMap,kr=new WeakMap;var $t=class extends ro{constructor(){super(...arguments);c(this,"type","entityBatchedMesh");c(this,"userData",{entities:{}})}},Br,Et,ze=class{constructor(t){c(this,"mesh");c(this,"imageMesh");c(this,"textMesh");c(this,"textEntityId");c(this,"type","geometry");c(this,"dirty",!0);c(this,"detached",!1);c(this,"instanceIndex",-1);c(this,"geometry");c(this,"batchedProps");c(this,"material");c(this,"feature");c(this,"currentHeight",wn);c(this,"color",new fe);c(this,"topColor",new fe);c(this,"position",new V);c(this,"altitude",0);oe(this,Br,1);oe(this,Et);c(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(){return this.material?.getColor(this.instanceIndex)}get opacity(){return Y(this,Br)}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}Z(this,Br,t)}get texture(){return this.material?.texture?.image.src}set texture(t){this.material&&(this.material.texture=t)}get textureInstance(){return this.material?.texture}set topTexture(t){this.material&&(this.material.topTexture=t)}get topTexture(){return this.material?.topTexture?.image.src}get topTextureInstance(){return this.material?.topTexture}set blendTexture(t){this.material&&(this.material.blendTexture=t)}get featureBbox(){return Y(this,Et)?Y(this,Et):(Z(this,Et,ds(this.feature)),Y(this,Et))}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)}};Br=new WeakMap,Et=new WeakMap;var ne=class extends ue{constructor(r){super();c(this,"visible",!0);c(this,"type","geometry-group");c(this,"components",[]);c(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 $t?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}};var ie=class e extends ue{constructor(r){super();c(this,"childrenIds",new Set);c(this,"children",[]);c(this,"type","group-container");c(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});c(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 e?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof Be?(this.childrenIds.add(r.id),this.add(r.object3d),this.userData.entities2D.add(r.id),r.positionDirty=!0):r instanceof ne?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof ae&&r.object3d&&(this.childrenIds.add(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(r){r instanceof e?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof Be?(this.childrenIds.delete(r.id),this.userData.entities2D.delete(r.id),this.remove(r.object3d)):r instanceof ne?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof ae&&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 Ce?r.userData.worldPositionDirty=!0:r instanceof e&&r.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(r){this.userData.opacity=r}get opacity(){return this.userData.opacity}};h();function Ey(e){let t=e.min,r=e.max,n=new V(t.x,t.y,t.z),i=new V(r.x,t.y,t.z),o=new V(t.x,r.y,t.z),s=new V(r.x,r.y,t.z);return[n,i,o,s]}h();function Ha(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?.id=="string"||typeof t?.id=="number"?(r=e.geometry2DMap.get(t.id),r==null&&(r=e.geometry3DMap.get(t.id))):r=t,r}function EP(e,t,r=[],n=new Xn,i){(e.getSystems().renderSystem.threeDdirty||e.getSystems().renderSystem.twoDdirty)&&e.renderSync();let o=Ha(e.getInternalState(),t);return za(o,r,n,i),r}var On=new V;function za(e,t=[],r=new Xn,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++)On.fromBufferAttribute(o,s),n!==void 0&&(On.z=n),t.push(On.clone()),r.expandByPoint(On)}}for(let i of e.children)za(i,t,r,n)}}h();function My(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}h();function Ay(e,t,r=!1){let n=null,i=0;return function(...o){i++,i===1&&r===!0&&e(...o);let s=()=>{(!r||i>1)&&e(...o),n=null,i=0};clearTimeout(n),n=setTimeout(s,t)}}h();var Dy=(()=>{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}}})(),Za=Dy.getDeviceType,qa=(()=>{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=Za().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return t=s?o.getParameter(s.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),t}catch{let l=new Error("Failed getting device info");throw l.name="FailedGettingDeviceInfo",l}}function i(){if(!Za().isWindows)return!1;if(r!==void 0)return r;let o=Ly()?.toLowerCase()??"";return r=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),r}return{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(o){e=o,t=void 0,r=void 0}}})(),Ly=qa.getInfo,Ny=qa.shouldDisableOffscreenCanvas;h();function Mr(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}function Ci(e){return Object.keys(e).length===0}h();var ky=e=>t=>{if(!t.includes("mappedin")){let r={};for(let n in e){let i=e[n];t.includes("mappedin")||(e[n]=i)}return{url:t,headers:r}}return{url:t,headers:e}};function $P(e,t,r,n){let i=e*(Math.PI/180),o=n/rt,s=e+o*180/Math.PI,l=r/rt/Math.cos(i),u=t+l*180/Math.PI;return{lat:s,lon:u}}function KP(e,t,r,n){let i=r*(Math.PI/180),o=n*(Math.PI/180),s=e*(Math.PI/180),l=t*(Math.PI/180),u=i-s,f=o-l,p=rt*f*Math.cos(s),d=rt*u;return{x:p,y:d}}var By=(e,t,r,n=!1)=>{let i=e instanceof ie&&e.userData.preloadGeometry,o=n||i&&!e.visible;if(e.children&&(e.visible||i))for(let s of e.children){if(s.visible&&s.type&&!o)if("entities3D"in s.userData&&s.userData?.entities3D&&s instanceof ne){t.add(s.userData.entityId);for(let l of s.userData.entities3D.values())t.add(l)}else(s.type==="group-container"||s.type==="custom-geometry"||s instanceof St)&&t.add(s.userData.entityId);s instanceof ne&&s.userData.dirty&&r.add(s.userData.entityId),By(s,t,r,o)}return t},Ry=(e,t)=>{if(e.children&&e.visible&&!e.userData?.hidden)for(let r of e.children)r.visible&&r instanceof Ce&&t.add(r.userData.entityId),Ry(r,t);return t};function Si(e,t){for(let r in t){if(t[r]==null){e[r]=void 0;continue}typeof t[r]=="object"?Si(e[r],t[r]):e[r]=t[r]}return e}function QP(e,t,r){let n={translateX:e.x,translateY:e.y,translateZ:e.z,scale:e.meterInMercatorCoordinateUnits()},i=new Qe,o=new V(n.scale,-n.scale,n.scale),s=new Qe().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(o);return{id:ba,type:"custom",renderingMode:"3d",render:(l,u)=>{i.fromArray(u.defaultProjectionData.mainMatrix),t.projectionMatrix=i.multiply(s),r()}}}function Xy(e){return fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}async function eT(e){let t=await Xy(e),{access_token:r}=await t.json();return{"x-mappedin-tiles-key":r}}function tT(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)}function rT(e,t,r){let n=e*(Math.PI/180)/2,i=t/2;return r*Math.tan(n)/i}function nT(e){return new lo(new Fn(e[0][0],e[0][1]),new Fn(e[1][0],e[1][1])).getCenter().toArray()}function iT(e,t){return e<t||t<=12}function oT(e){let t=1;return e.type==="geometry-group"&&e.parent!=null&&e.parent instanceof ie?t=e.parent.userData.computedOpacity:(e.type==="geometry"||e.type==="custom-geometry"||e.type==="model")&&e.parentObject3D!=null&&e.parentObject3D instanceof ne&&e.parentObject3D.parent!=null&&e.parentObject3D.parent instanceof ie&&(t=e.parentObject3D.parent.userData.computedOpacity),t}function sT(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}var Yy="maplibre-frustum-culling-hack";function aT(){let e=new eo(.01,.01,.01),t=new et({opacity:0,depthWrite:!1,transparent:!0}),r=new Ye(e,t);return r.position.copy(new V(0,50,0)),r.frustumCulled=!1,r.name=Yy,r}var Je=new V,Ja=new Se;function lT(e,t,r=new Xr){return e.traverse(n=>{if(n instanceof Ye){let o=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let l=0;l<o.count;l++)Je.fromBufferAttribute(o,l),Je.applyMatrix4(n.matrixWorld),Je.applyMatrix4(t.matrixWorldInverse),Je.applyMatrix4(t.projectionMatrix),Je.z<1&&Je.z>0&&(Ja.set(Je.x,Je.y),r.expandByPoint(Ja))}}),r}function $a(e,t){let r=t.clientWidth,n=t.clientHeight;return new Se((e.x+1)*r/2,(1-e.y)*n/2)}function uT(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border=`2px solid ${t}`,n.style.pointerEvents="none";let i=$a(new Se(e.min.x,e.min.y),r),o=$a(new Se(e.max.x,e.max.y),r);n.style.left=`${i.x}px`,n.style.top=`${o.y}px`;let s=Math.abs(o.x-i.x),l=Math.abs(o.y-i.y);return n.style.width=`${s}px`,n.style.height=`${l}px`,r.appendChild(n),n}function fT(e,t){let r=0,n=0,i=e.clientWidth,o=e.clientHeight;if(t){let{left:s,top:l,right:u,bottom:f,type:p}=t,d=s??0,m=l??0,g=u??0,b=f??0;p==="portion"?(r=d*i,n=m*o,i=i-r-g*i,o=o-n-b*o):(r=d,n=m,i=i-r-g,o=o-n-b)}return[r,n,i,o].map(s=>Math.max(s,0))}h();var ki=class{constructor(t){c(this,"visible");c(this,"altitude");c(this,"color");c(this,"dirty",!0);c(this,"maxWidth");c(this,"maxHeight");c(this,"hoverByPolygon");c(this,"flipToFaceCamera",Ka.flipToFaceCamera);c(this,"font");c(this,"fillOpacity");c(this,"fontSize");c(this,"margin");c(this,"outlineWidth");c(this,"outlineBlur");c(this,"outlineOffsetX");c(this,"strokeColor");c(this,"strokeOpacity");c(this,"strokeWidth");c(this,"hoverColor");c(this,"outlineOffsetY");c(this,"outlineColor");c(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}},Ka=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});h();h();var Bi=class{constructor(t){c(this,"dirty",!0);c(this,"visible",!0);c(this,"opacity",1);c(this,"verticalOffset",0);c(this,"interactive",!1);c(this,"color");c(this,"material");c(this,"rotation");c(this,"scale");t&&Object.assign(this,t)}};h();var Fy=[1,1,1],Gy=[0,0,0];export{sl as a,jy as b,H as c,ar as d,po as e,rt as f,fl as g,cl as h,ig as i,Fe as j,og as k,sg as l,ag as m,lg as n,hl as o,ug as p,dg as q,bg as r,$ as s,Cg as t,lr as u,jn as v,Wr as w,kg as x,Bg as y,xo as z,_l as A,Fg as B,Tl as C,Gg as D,He as E,Ic as F,Zv as G,ps as H,qv as I,Jv as J,$v as K,Kv as L,Qv as M,ex as N,tx as O,nn as P,sx as Q,Oc as R,ax as S,hs as T,x as U,Ve as V,us as W,ms as X,Dc as Y,bx as Z,I as _,ws as $,an as aa,Bx as ba,ks as ca,fa as da,nb as ea,pa as fa,Be as ga,St as ha,ae as ia,Qb as ja,e0 as ka,ba as la,t0 as ma,r0 as na,n0 as oa,i0 as pa,Ey as qa,Ha as ra,EP as sa,My as ta,Ay as ua,Ny as va,ky as wa,rn as xa,$P as ya,KP as za,By as Aa,Ry as Ba,QP as Ca,eT as Da,tT as Ea,rT as Fa,nT as Ga,iT as Ha,oT as Ia,sT as Ja,aT as Ka,lT as La,uT as Ma,fT as Na,ki as Oa,Ka as Pa,Bi as Qa,Fy as Ra,Gy as Sa,da as Ta,ud as Ua,Cb as Va,cd as Wa,ga as Xa,Ab as Ya,gn as Za,vn as _a,wr as $a,P0 as ab,Ti as bb,T0 as cb,bn as db,Er as eb,q0 as fb,J0 as gb,$0 as hb,gd as ib,_a as jb,K0 as kb,Q0 as lb,e_ as mb,t_ as nb,r_ as ob,n_ as pb,i_ as qb,o_ as rb,Ta as sb,xd as tb,s_ as ub,bd as vb,a_ as wb,l_ as xb,_d as yb,u_ as zb,f_ as Ab,Pd as Bb,c_ as Cb,p_ as Db,Td as Eb,h_ as Fb,d_ as Gb,m_ as Hb,Re as Ib,Mi as Jb,Di as Kb,Ua as Lb,Li as Mb,Ni as Nb,$t as Ob,ze as Pb,ne as Qb,ie as Rb};
193
+ //# sourceMappingURL=chunk-43XLQYI5.js.map