@reventlessdev/reventless-host-shell 3.0.0-alpha.69 → 3.0.0-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Geocoder.res-rAkDQFlX.js → Geocoder.res-D_vkSSbG.js} +1 -1
- package/dist/assets/{GraphMode.res-9L1CHmrj.js → GraphMode.res-DUtVZtnp.js} +1 -1
- package/dist/assets/{MapMode.res-DQ9J2NHd.js → MapMode.res-BYqQbaRY.js} +1 -1
- package/dist/assets/index-Bv-mXpuE.js +128 -0
- package/dist/assets/{index-ajCVmhSE.js → index-aRRmV3vx.js} +1 -1
- package/dist/mf-entry-bootstrap-0.js +1 -1
- package/package.json +5 -5
- package/dist/assets/index-Bg8uD9S2.js +0 -128
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as t,g as o,d as c,D as d,z as i,f as s,e as m,j as u,$ as f,k as p,F as g}from"./index-
|
|
1
|
+
import{i as t,g as o,d as c,D as d,z as i,f as s,e as m,j as u,$ as f,k as p,F as g}from"./index-Bv-mXpuE.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-C8lRAcSv.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-CfkhEoF5.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Bp_g55i_.js";let h=`query Geocode($text: String!) {
|
|
2
2
|
geocode(text: $text) {
|
|
3
3
|
label
|
|
4
4
|
lat
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as xh,t as bu,g as Th,h as wu,r as Ch,f as Sh,a as td,c as rd,b as ad,d as nd,e as Dh,i as id,j as od,m as sd,s as ud,k as ld,u as fd,l as Ah,n as Eu,v as xu,o as hd,C as Vr,R as cd,S as vd,T as dd,q as gd,w as pd,x as yd}from"./index-
|
|
1
|
+
import{p as xh,t as bu,g as Th,h as wu,r as Ch,f as Sh,a as td,c as rd,b as ad,d as nd,e as Dh,i as id,j as od,m as sd,s as ud,k as ld,u as fd,l as Ah,n as Eu,v as xu,o as hd,C as Vr,R as cd,S as vd,T as dd,q as gd,w as pd,x as yd}from"./index-Bv-mXpuE.js";import{a as da,_ as md}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import{h as Oa,b as Oi}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";function bd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-C8lRAcSv.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Bp_g55i_.js";function Lh(t){return Sh(ad(t),e=>{let r=e[1],a=e[0],n=td(r),i=rd(a,r,n);if(typeof i=="object")switch(i.TAG){case"KEntityId":return[a,i._0,!1];case"KArrayOfEntityIds":return[a,i._0,!0];default:return}})}function wd(t){return Lh(t).length!==0}function Tu(t,e,r){return r?Sh(Dh(id(Th(t.dict,e),od),[]),nd):sd(ud(t.dict,e),[],a=>[a])}function Ed(t){let e=Lh(t.schema),r=xh(t),a={};r.forEach(l=>{a[l.key]=bu(t,l)});let n=l=>l.length>8?l.slice(0,8)+"…":l,i=r.map(l=>({id:l.key,label:bu(t,l),group:t.readModelName})),o=r.flatMap(l=>e.flatMap(f=>{let h=f[1];return Tu(l,f[0],f[2]).map(v=>{let c=Th(a,v);return c!==void 0?{id:v,label:c,group:t.readModelName}:{id:v,label:n(v),group:wu(h)}})})),s=Ch(i.concat(o),[],(l,f)=>l.some(h=>h.id===f.id)?l:l.concat([f])),u=r.flatMap(l=>e.flatMap(f=>{let h=f[0];return Tu(l,h,f[2]).map(v=>({from:l.key,to_:v,label:wu(h)}))}));return{nodes:s,edges:u}}function Pi(t){return Ch(t,[],(e,r)=>{let a=r.group;return a!==void 0&&!e.includes(a)?e.concat([a]):e})}function ws(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function xd(t){if(Array.isArray(t))return t}function Td(t){if(Array.isArray(t))return ws(t)}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cd(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Mh(a.key),a)}}function Ar(t,e,r){return e&&Cd(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Hs(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw i}}}}function Nh(t,e,r){return(e=Mh(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sd(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Dd(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,n,i,o,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(a=i.call(r)).done)&&(s.push(a.value),s.length!==e);u=!0);}catch(f){l=!0,n=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw n}}return s}}function Ad(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ld(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(t,e){return xd(t)||Dd(t,e)||Hs(t,e)||Ad()}function $n(t){return Td(t)||Sd(t)||Hs(t)||Ld()}function Nd(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Mh(t){var e=Nd(t,"string");return typeof e=="symbol"?e:e+""}function dt(t){"@babel/helpers - typeof";return dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dt(t)}function Hs(t,e){if(t){if(typeof t=="string")return ws(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ws(t,e):void 0}}var ct=typeof window>"u"?null:window,Cu=ct?ct.navigator:null;ct&&ct.document;var Md=dt(""),Rh=dt({}),Rd=dt(function(){}),Od=typeof HTMLElement>"u"?"undefined":dt(HTMLElement),nn=function(e){return e&&e.instanceString&&it(e.instanceString)?e.instanceString():null},Me=function(e){return e!=null&&dt(e)==Md},it=function(e){return e!=null&&dt(e)===Rd},Je=function(e){return!Bt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},_e=function(e){return e!=null&&dt(e)===Rh&&!Je(e)&&e.constructor===Object},Pd=function(e){return e!=null&&dt(e)===Rh},be=function(e){return e!=null&&dt(e)===dt(1)&&!isNaN(e)},Id=function(e){return be(e)&&Math.floor(e)===e},Kn=function(e){if(Od!=="undefined")return e!=null&&e instanceof HTMLElement},Bt=function(e){return on(e)||Oh(e)},on=function(e){return nn(e)==="collection"&&e._private.single},Oh=function(e){return nn(e)==="collection"&&!e._private.single},Ys=function(e){return nn(e)==="core"},Ph=function(e){return nn(e)==="stylesheet"},kd=function(e){return nn(e)==="event"},br=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Bd=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Fd=function(e){return _e(e)&&be(e.x1)&&be(e.x2)&&be(e.y1)&&be(e.y2)},zd=function(e){return Pd(e)&&it(e.then)},Vd=function(){return Cu&&Cu.userAgent.match(/msie|trident|edge/i)},ga=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var a=function(){var i=this,o=arguments,s,u=r.apply(i,o),l=a.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return a.cache={},a},qs=ga(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),hi=ga(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Ih=ga(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Su=function(e){return br(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},dr=function(e,r){return e.slice(-1*r.length)===r},vt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Gd="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",Ud="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",Hd="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",Yd="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",qd="\\#[0-9a-fA-F]{3}",_d="\\#[0-9a-fA-F]{6}",kh=function(e,r){return e<r?-1:e>r?1:0},Wd=function(e,r){return-1*kh(e,r)},Ie=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];t[o]=a[o]}}return t},Xd=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,o=16;return r?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},$d=function(e){var r,a,n,i,o,s,u,l;function f(d,p,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?d+(p-d)*6*y:y<1/2?p:y<2/3?d+(p-d)*(2/3-y)*6:d}var h=new RegExp("^"+Hd+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,o=h[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=u=l=Math.round(i*255);else{var v=i<.5?i*(1+n):i+n-i*n,c=2*i-v;s=Math.round(255*f(c,v,a+1/3)),u=Math.round(255*f(c,v,a)),l=Math.round(255*f(c,v,a-1/3))}r=[s,u,l,o]}return r},Kd=function(e){var r,a=new RegExp("^"+Gd+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(s&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},Zd=function(e){return Qd[e.toLowerCase()]},Bh=function(e){return(Je(e)?e:null)||Zd(e)||Xd(e)||Kd(e)||$d(e)},Qd={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Fh=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(_e(o))throw Error("Tried to set map with object key");i<a.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},zh=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(_e(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r},wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ii,Du;function un(){if(Du)return Ii;Du=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Ii=t,Ii}var ki,Au;function Jd(){if(Au)return ki;Au=1;var t=typeof wn=="object"&&wn&&wn.Object===Object&&wn;return ki=t,ki}var Bi,Lu;function ci(){if(Lu)return Bi;Lu=1;var t=Jd(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Bi=r,Bi}var Fi,Nu;function jd(){if(Nu)return Fi;Nu=1;var t=ci(),e=function(){return t.Date.now()};return Fi=e,Fi}var zi,Mu;function eg(){if(Mu)return zi;Mu=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return zi=e,zi}var Vi,Ru;function tg(){if(Ru)return Vi;Ru=1;var t=eg(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return Vi=r,Vi}var Gi,Ou;function _s(){if(Ou)return Gi;Ou=1;var t=ci(),e=t.Symbol;return Gi=e,Gi}var Ui,Pu;function rg(){if(Pu)return Ui;Pu=1;var t=_s(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,n=t?t.toStringTag:void 0;function i(o){var s=r.call(o,n),u=o[n];try{o[n]=void 0;var l=!0}catch{}var f=a.call(o);return l&&(s?o[n]=u:delete o[n]),f}return Ui=i,Ui}var Hi,Iu;function ag(){if(Iu)return Hi;Iu=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return Hi=r,Hi}var Yi,ku;function Vh(){if(ku)return Yi;ku=1;var t=_s(),e=rg(),r=ag(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):r(s)}return Yi=o,Yi}var qi,Bu;function ng(){if(Bu)return qi;Bu=1;function t(e){return e!=null&&typeof e=="object"}return qi=t,qi}var _i,Fu;function ln(){if(Fu)return _i;Fu=1;var t=Vh(),e=ng(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return _i=a,_i}var Wi,zu;function ig(){if(zu)return Wi;zu=1;var t=tg(),e=un(),r=ln(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(r(l))return a;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=t(l);var h=i.test(l);return h||o.test(l)?s(l.slice(2),h?2:8):n.test(l)?a:+l}return Wi=u,Wi}var Xi,Vu;function og(){if(Vu)return Xi;Vu=1;var t=un(),e=jd(),r=ig(),a="Expected a function",n=Math.max,i=Math.min;function o(s,u,l){var f,h,v,c,d,p,y=0,g=!1,b=!1,m=!0;if(typeof s!="function")throw new TypeError(a);u=r(u)||0,t(l)&&(g=!!l.leading,b="maxWait"in l,v=b?n(r(l.maxWait)||0,u):v,m="trailing"in l?!!l.trailing:m);function w(I){var E=f,A=h;return f=h=void 0,y=I,c=s.apply(A,E),c}function T(I){return y=I,d=setTimeout(N,u),g?w(I):c}function D(I){var E=I-p,A=I-y,C=u-E;return b?i(C,v-A):C}function x(I){var E=I-p,A=I-y;return p===void 0||E>=u||E<0||b&&A>=v}function N(){var I=e();if(x(I))return O(I);d=setTimeout(N,D(I))}function O(I){return d=void 0,m&&f?w(I):(f=h=void 0,c)}function R(){d!==void 0&&clearTimeout(d),y=0,f=p=h=d=void 0}function P(){return d===void 0?c:O(e())}function M(){var I=e(),E=x(I);if(f=arguments,h=this,p=I,E){if(d===void 0)return T(p);if(b)return clearTimeout(d),d=setTimeout(N,u),w(p)}return d===void 0&&(d=setTimeout(N,u)),c}return M.cancel=R,M.flush=P,M}return Xi=o,Xi}var sg=og(),fn=sn(sg),$i=ct?ct.performance:null,Gh=$i&&$i.now?function(){return $i.now()}:function(){return Date.now()},ug=(function(){if(ct){if(ct.requestAnimationFrame)return function(t){ct.requestAnimationFrame(t)};if(ct.mozRequestAnimationFrame)return function(t){ct.mozRequestAnimationFrame(t)};if(ct.webkitRequestAnimationFrame)return function(t){ct.webkitRequestAnimationFrame(t)};if(ct.msRequestAnimationFrame)return function(t){ct.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Gh())},1e3/60)}})(),Zn=function(e){return ug(e)},ir=Gh,Fr=9261,Uh=65599,ia=5381,Hh=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr,a=r,n;n=e.next(),!n.done;)a=a*Uh+n.value|0;return a},Xa=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Uh+e|0},$a=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ia;return(r<<5)+r+e|0},lg=function(e,r){return e*2097152+r},hr=function(e){return e[0]*2097152+e[1]},En=function(e,r){return[Xa(e[0],r[0]),$a(e[1],r[1])]},Gu=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return Hh(o,r)},Ur=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return Hh(o,r)},Yh=function(){return fg(arguments)},fg=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Ur(n):r=Ur(n,r)}return r};function hg(t,e,r,a,n){var i=n*Math.PI/180,o=Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,s=Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a;return{x:o,y:s}}var cg=function(e,r,a,n,i,o){return{x:(e-a)*i+a,y:(r-n)*o+n}};function vg(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=hg(t.x,t.y,a,n,r),u=cg(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}var Uu=!0,dg=console.warn!=null,gg=console.trace!=null,Ws=Number.MAX_SAFE_INTEGER||9007199254740991,qh=function(){return!0},Qn=function(){return!1},Hu=function(){return 0},Xs=function(){},nt=function(e){throw new Error(e)},_h=function(e){if(e!==void 0)Uu=!!e;else return Uu},Ke=function(e){_h()&&(dg?console.warn(e):(console.log(e),gg&&console.trace()))},pg=function(e){return Ie({},e)},Qt=function(e){return e==null?e:Je(e)?e.slice():_e(e)?pg(e):e},yg=function(e){return e.slice()},Wh=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},mg={},Xh=function(){return mg},Tt=function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var o=r[i],s=a?.[o];n[o]=s===void 0?e[o]:s}return n}},wr=function(e,r,a){for(var n=e.length-1;n>=0;n--)e[n]===r&&e.splice(n,1)},$s=function(e){e.splice(0,e.length)},bg=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Mt=function(e,r,a){return a&&(r=Ih(a,r)),e[r]},Zt=function(e,r,a,n){a&&(r=Ih(a,r)),e[r]=n},wg=(function(){function t(){Dr(this,t),this._obj={}}return Ar(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])})(),nr=typeof Map<"u"?Map:wg,Eg="undefined",xg=(function(){function t(e){if(Dr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Ar(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}])})(),xa=(typeof Set>"u"?"undefined":dt(Set))!==Eg?Set:xg,vi=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ys(e)){nt("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){nt("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new xa,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Je(r.classes)?l=r.classes:Me(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,h=l.length;f<h;f++){var v=l[f];!v||v===""||i.classes.add(v)}this.createEmitter(),(a===void 0||a)&&this.restore();var c=r.style||r.css;c&&(Ke("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(c))},Yu=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var o;_e(a)&&!Bt(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!it(n)?n:i,n=it(n)?n:function(){};for(var s=this._private.cy,u=a=Me(a)?this.filter(a):a,l=[],f=[],h={},v={},c={},d=0,p,y=this.byGroup(),g=y.nodes,b=y.edges,m=0;m<u.length;m++){var w=u[m],T=w.id();w.isNode()&&(l.unshift(w),e.bfs&&(c[T]=!0,f.push(w)),v[T]=0)}for(var D=function(){var I=e.bfs?l.shift():l.pop(),E=I.id();if(e.dfs){if(c[E])return 0;c[E]=!0,f.push(I)}var A=v[E],C=h[E],S=C!=null?C.source():null,L=C!=null?C.target():null,V=C==null?void 0:I.same(S)?L[0]:S[0],F;if(F=n(I,C,V,d++,A),F===!0)return p=I,1;if(F===!1)return 1;for(var B=I.connectedEdges().filter(function(K){return(!i||K.source().same(I))&&b.has(K)}),Y=0;Y<B.length;Y++){var q=B[Y],Q=q.connectedNodes().filter(function(K){return!K.same(I)&&g.has(K)}),$=Q.id();Q.length!==0&&!c[$]&&(Q=Q[0],l.push(Q),e.bfs&&(c[$]=!0,f.push(Q)),h[$]=q,v[$]=v[E]+1)}},x;l.length!==0&&(x=D(),!(x!==0&&x===1)););for(var N=s.collection(),O=0;O<f.length;O++){var R=f[O],P=h[R.id()];P!=null&&N.push(P),N.push(R)}return{path:s.collection(N),found:s.collection(p)}}},Ka={breadthFirstSearch:Yu({bfs:!0}),depthFirstSearch:Yu({dfs:!0})};Ka.bfs=Ka.breadthFirstSearch;Ka.dfs=Ka.depthFirstSearch;var kn={exports:{}},Tg=kn.exports,qu;function Cg(){return qu||(qu=1,(function(t,e){(function(){var r,a,n,i,o,s,u,l,f,h,v,c,d,p,y;n=Math.floor,h=Math.min,a=function(g,b){return g<b?-1:g>b?1:0},f=function(g,b,m,w,T){var D;if(m==null&&(m=0),T==null&&(T=a),m<0)throw new Error("lo must be non-negative");for(w==null&&(w=g.length);m<w;)D=n((m+w)/2),T(b,g[D])<0?w=D:m=D+1;return[].splice.apply(g,[m,m-m].concat(b)),b},s=function(g,b,m){return m==null&&(m=a),g.push(b),p(g,0,g.length-1,m)},o=function(g,b){var m,w;return b==null&&(b=a),m=g.pop(),g.length?(w=g[0],g[0]=m,y(g,0,b)):w=m,w},l=function(g,b,m){var w;return m==null&&(m=a),w=g[0],g[0]=b,y(g,0,m),w},u=function(g,b,m){var w;return m==null&&(m=a),g.length&&m(g[0],b)<0&&(w=[g[0],b],b=w[0],g[0]=w[1],y(g,0,m)),b},i=function(g,b){var m,w,T,D,x,N;for(b==null&&(b=a),D=(function(){N=[];for(var O=0,R=n(g.length/2);0<=R?O<R:O>R;0<=R?O++:O--)N.push(O);return N}).apply(this).reverse(),x=[],w=0,T=D.length;w<T;w++)m=D[w],x.push(y(g,m,b));return x},d=function(g,b,m){var w;if(m==null&&(m=a),w=g.indexOf(b),w!==-1)return p(g,0,w,m),y(g,w,m)},v=function(g,b,m){var w,T,D,x,N;if(m==null&&(m=a),T=g.slice(0,b),!T.length)return T;for(i(T,m),N=g.slice(b),D=0,x=N.length;D<x;D++)w=N[D],u(T,w,m);return T.sort(m).reverse()},c=function(g,b,m){var w,T,D,x,N,O,R,P,M;if(m==null&&(m=a),b*10<=g.length){if(D=g.slice(0,b).sort(m),!D.length)return D;for(T=D[D.length-1],R=g.slice(b),x=0,O=R.length;x<O;x++)w=R[x],m(w,T)<0&&(f(D,w,0,null,m),D.pop(),T=D[D.length-1]);return D}for(i(g,m),M=[],N=0,P=h(b,g.length);0<=P?N<P:N>P;0<=P?++N:--N)M.push(o(g,m));return M},p=function(g,b,m,w){var T,D,x;for(w==null&&(w=a),T=g[m];m>b;){if(x=m-1>>1,D=g[x],w(T,D)<0){g[m]=D,m=x;continue}break}return g[m]=T},y=function(g,b,m){var w,T,D,x,N;for(m==null&&(m=a),T=g.length,N=b,D=g[b],w=2*b+1;w<T;)x=w+1,x<T&&!(m(g[w],g[x])<0)&&(w=x),g[b]=g[w],b=w,w=2*b+1;return g[b]=D,p(g,N,b,m)},r=(function(){g.push=s,g.pop=o,g.replace=l,g.pushpop=u,g.heapify=i,g.updateItem=d,g.nlargest=v,g.nsmallest=c;function g(b){this.cmp=b??a,this.nodes=[]}return g.prototype.push=function(b){return s(this.nodes,b,this.cmp)},g.prototype.pop=function(){return o(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},g.prototype.replace=function(b){return l(this.nodes,b,this.cmp)},g.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(b){return d(this.nodes,b,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var b;return b=new g,b.nodes=this.nodes.slice(0),b},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g})(),(function(g,b){return t.exports=b()})(this,function(){return r})}).call(Tg)})(kn)),kn.exports}var Ki,_u;function Sg(){return _u||(_u=1,Ki=Cg()),Ki}var Dg=Sg(),hn=sn(Dg),Ag=Tt({root:null,weight:function(e){return 1},directed:!1}),Lg={dijkstra:function(e){if(!_e(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=Ag(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=Me(n)?this.filter(n)[0]:n[0],f={},h={},v={},c=this.byGroup(),d=c.nodes,p=c.edges;p.unmergeBy(function(A){return A.isLoop()});for(var y=function(C){return f[C.id()]},g=function(C,S){f[C.id()]=S,b.updateItem(C)},b=new hn(function(A,C){return y(A)-y(C)}),m=0;m<d.length;m++){var w=d[m];f[w.id()]=w.same(l)?0:1/0,b.push(w)}for(var T=function(C,S){for(var L=(o?C.edgesTo(S):C.edgesWith(S)).intersect(p),V=1/0,F,B=0;B<L.length;B++){var Y=L[B],q=u(Y);(q<V||!F)&&(V=q,F=Y)}return{edge:F,dist:V}};b.size()>0;){var D=b.pop(),x=y(D),N=D.id();if(v[N]=x,x!==1/0)for(var O=D.neighborhood().intersect(d),R=0;R<O.length;R++){var P=O[R],M=P.id(),I=T(D,P),E=x+I.dist;E<y(P)&&(g(P,E),h[M]={node:D,edge:I.edge})}}return{distanceTo:function(C){var S=Me(C)?d.filter(C)[0]:C[0];return v[S.id()]},pathTo:function(C){var S=Me(C)?d.filter(C)[0]:C[0],L=[],V=S,F=V.id();if(S.length>0)for(L.unshift(S);h[F];){var B=h[F];L.unshift(B.edge),L.unshift(B.node),V=B.node,F=V.id()}return s.spawn(L)}}}},Ng={kruskal:function(e){e=e||function(m){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,o=new Array(i),s=a,u=function(w){for(var T=0;T<o.length;T++){var D=o[T];if(D.has(w))return T}},l=0;l<i;l++)o[l]=this.spawn(a[l]);for(var f=n.sort(function(m,w){return e(m)-e(w)}),h=0;h<f.length;h++){var v=f[h],c=v.source()[0],d=v.target()[0],p=u(c),y=u(d),g=o[p],b=o[y];p!==y&&(s.merge(v),g.merge(b),o.splice(y,1))}return s}},Mg=Tt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Rg={aStar:function(e){var r=this.cy(),a=Mg(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,u=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var l=n.id(),f=i.id(),h={},v={},c={},d=new hn(function(F,B){return v[F.id()]-v[B.id()]}),p=new xa,y={},g={},b=function(B,Y){d.push(B),p.add(Y)},m,w,T=function(){m=d.pop(),w=m.id(),p.delete(w)},D=function(B){return p.has(B)};b(n,l),h[l]=0,v[l]=o(n);for(var x=0;d.size()>0;){if(T(),x++,w===f){for(var N=[],O=i,R=f,P=g[R];N.unshift(O),P!=null&&N.unshift(P),O=y[R],O!=null;)R=O.id(),P=g[R];return{found:!0,distance:h[w],path:this.spawn(N),steps:x}}c[w]=!0;for(var M=m._private.edges,I=0;I<M.length;I++){var E=M[I];if(this.hasElementWithId(E.id())&&!(s&&E.data("source")!==w)){var A=E.source(),C=E.target(),S=A.id()!==w?A:C,L=S.id();if(this.hasElementWithId(L)&&!c[L]){var V=h[w]+u(E);if(!D(L)){h[L]=V,v[L]=V+o(S),b(S,L),y[L]=m,g[L]=E;continue}V<h[L]&&(h[L]=V,v[L]=V+o(S),y[L]=m,g[L]=E)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},Og=Tt({weight:function(e){return 1},directed:!1}),Pg={floydWarshall:function(e){for(var r=this.cy(),a=Og(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),u=s.nodes,l=s.edges,f=u.length,h=f*f,v=function(q){return u.indexOf(q)},c=function(q){return u[q]},d=new Array(h),p=0;p<h;p++){var y=p%f,g=(p-y)/f;g===y?d[p]=0:d[p]=1/0}for(var b=new Array(h),m=new Array(h),w=0;w<l.length;w++){var T=l[w],D=T.source()[0],x=T.target()[0];if(D!==x){var N=v(D),O=v(x),R=N*f+O,P=o(T);if(d[R]>P&&(d[R]=P,b[R]=O,m[R]=T),!i){var M=O*f+N;!i&&d[M]>P&&(d[M]=P,b[M]=N,m[M]=T)}}}for(var I=0;I<f;I++)for(var E=0;E<f;E++)for(var A=E*f+I,C=0;C<f;C++){var S=E*f+C,L=I*f+C;d[A]+d[L]<d[S]&&(d[S]=d[A]+d[L],b[S]=b[A])}var V=function(q){return(Me(q)?r.filter(q):q)[0]},F=function(q){return v(V(q))},B={distance:function(q,Q){var $=F(q),K=F(Q);return d[$*f+K]},path:function(q,Q){var $=F(q),K=F(Q),j=c($);if($===K)return j.collection();if(b[$*f+K]==null)return r.collection();var re=r.collection(),U=$,H;for(re.merge(j);$!==K;)U=$,$=b[$*f+K],H=m[U*f+$],re.merge(H),re.merge(c($));return re}};return B}},Ig=Tt({weight:function(e){return 1},directed:!1,root:null}),kg={bellmanFord:function(e){var r=this,a=Ig(e),n=a.weight,i=a.directed,o=a.root,s=n,u=this,l=this.cy(),f=this.byGroup(),h=f.edges,v=f.nodes,c=v.length,d=new nr,p=!1,y=[];o=l.collection(o)[0],h.unmergeBy(function(ge){return ge.isLoop()});for(var g=h.length,b=function(le){var he=d.get(le.id());return he||(he={},d.set(le.id(),he)),he},m=function(le){return(Me(le)?l.$(le):le)[0]},w=function(le){return b(m(le)).dist},T=function(le){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,fe=m(le),ve=[],ye=fe;;){if(ye==null)return r.spawn();var me=b(ye),xe=me.edge,Le=me.pred;if(ve.unshift(ye[0]),ye.same(he)&&ve.length>0)break;xe!=null&&ve.unshift(xe),ye=Le}return u.spawn(ve)},D=0;D<c;D++){var x=v[D],N=b(x);x.same(o)?N.dist=0:N.dist=1/0,N.pred=null,N.edge=null}for(var O=!1,R=function(le,he,fe,ve,ye,me){var xe=ve.dist+me;xe<ye.dist&&!fe.same(ve.edge)&&(ye.dist=xe,ye.pred=le,ye.edge=fe,O=!0)},P=1;P<c;P++){O=!1;for(var M=0;M<g;M++){var I=h[M],E=I.source(),A=I.target(),C=s(I),S=b(E),L=b(A);R(E,A,I,S,L,C),i||R(A,E,I,L,S,C)}if(!O)break}if(O)for(var V=[],F=0;F<g;F++){var B=h[F],Y=B.source(),q=B.target(),Q=s(B),$=b(Y).dist,K=b(q).dist;if($+Q<K||!i&&K+Q<$)if(p||(Ke("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var j=[];$+Q<K&&j.push(Y),!i&&K+Q<$&&j.push(q);for(var re=j.length,U=0;U<re;U++){var H=j[U],_=[H];_.push(b(H).edge);for(var W=b(H).pred;_.indexOf(W)===-1;)_.push(W),_.push(b(W).edge),W=b(W).pred;_=_.slice(_.indexOf(W));for(var J=_[0].id(),te=0,de=2;de<_.length;de+=2)_[de].id()<J&&(J=_[de].id(),te=de);_=_.slice(te).concat(_.slice(0,te)),_.push(_[0]);var Te=_.map(function(ge){return ge.id()}).join(",");V.indexOf(Te)===-1&&(y.push(u.spawn(_)),V.push(Te))}}else break}return{distanceTo:w,pathTo:T,hasNegativeWeightCycle:p,negativeWeightCycles:y}}},Bg=Math.sqrt(2),Fg=function(e,r,a){a.length===0&&nt("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=r[i],u=r[o],l=a,f=l.length-1;f>=0;f--){var h=l[f],v=h[1],c=h[2];(r[v]===s&&r[c]===u||r[v]===u&&r[c]===s)&&l.splice(f,1)}for(var d=0;d<l.length;d++){var p=l[d];p[1]===u?(l[d]=p.slice(),l[d][1]=s):p[2]===u&&(l[d]=p.slice(),l[d][2]=s)}for(var y=0;y<r.length;y++)r[y]===u&&(r[y]=s);return l},Zi=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=Fg(i,e,r),a--}return r},zg={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(L){return L.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/Bg);if(i<2){nt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<o;f++){var h=n[f];l.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var v=1/0,c=[],d=new Array(i),p=new Array(i),y=new Array(i),g=function(V,F){for(var B=0;B<i;B++)F[B]=V[B]},b=0;b<=s;b++){for(var m=0;m<i;m++)p[m]=m;var w=Zi(p,l.slice(),i,u),T=w.slice();g(p,y);var D=Zi(p,w,u,2),x=Zi(y,T,u,2);D.length<=x.length&&D.length<v?(v=D.length,c=D,g(p,d)):x.length<=D.length&&x.length<v&&(v=x.length,c=x,g(y,d))}for(var N=this.spawn(c.map(function(L){return n[L[0]]})),O=this.spawn(),R=this.spawn(),P=d[0],M=0;M<d.length;M++){var I=d[M],E=a[M];I===P?O.merge(E):R.merge(E)}var A=function(V){var F=e.spawn();return V.forEach(function(B){F.merge(B),B.connectedEdges().forEach(function(Y){e.contains(Y)&&!N.contains(Y)&&F.merge(Y)})}),F},C=[A(O),A(R)],S={cut:N,components:C,partition1:O,partition2:R};return S}},Qi,Vg=function(e){return{x:e.x,y:e.y}},di=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},$h=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},oa=function(e){return{x:e[0],y:e[1]}},Gg=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},Ug=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},Hg=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,o=r;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},Yg=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(v,c){return v-c});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+s]:(e[h-1+s]+e[h+s])/2},qg=function(e){return Math.PI*e/180},xn=function(e,r){return Math.atan2(r,e)-Math.PI/2},Ks=Math.log2||function(t){return Math.log(t)/Math.log(2)},Zs=function(e){return e>0?1:e<0?-1:0},Hr=function(e,r){return Math.sqrt(kr(e,r))},kr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},_g=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},mt=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},la=function(e,r,a,n){return{x:mt(e.x,r.x,a.x,n),y:mt(e.y,r.y,a.y,n)}},Wg=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=Hr(e,r),s={x:i.x/o,y:i.y/o};return a=a??0,n=n??a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},Za=function(e,r,a){return Math.max(e,Math.min(a,r))},Rt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Xg=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},$g=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Kg=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},Kh=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},Bn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Fn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(r.length===1)a=n=i=o=r[0];else if(r.length===2)a=i=r[0],o=n=r[1];else if(r.length===4){var s=ft(r,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Wu=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Qs=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},gr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},Xu=function(e,r){return gr(e,r.x,r.y)},Zh=function(e,r){return gr(e,r.x1,r.y1)&&gr(e,r.x2,r.y2)},Zg=(Qi=Math.hypot)!==null&&Qi!==void 0?Qi:function(t,e){return Math.sqrt(t*t+e*e)};function Qg(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(N,O){return{x:N.x+O.x,y:N.y+O.y}},a=function(N,O){return{x:N.x-O.x,y:N.y-O.y}},n=function(N,O){return{x:N.x*O,y:N.y*O}},i=function(N,O){return N.x*O.y-N.y*O.x},o=function(N){var O=Zg(N.x,N.y);return O===0?{x:0,y:0}:{x:N.x/O,y:N.y/O}},s=function(N){for(var O=0,R=0;R<N.length;R++){var P=N[R],M=N[(R+1)%N.length];O+=P.x*M.y-M.x*P.y}return O/2},u=function(N,O,R,P){var M=a(O,N),I=a(P,R),E=i(M,I);if(Math.abs(E)<1e-9)return r(N,n(M,.5));var A=i(a(R,N),I)/E;return r(N,n(M,A))},l=t.map(function(x){return{x:x.x,y:x.y}});s(l)<0&&l.reverse();for(var f=l.length,h=[],v=0;v<f;v++){var c=l[v],d=l[(v+1)%f],p=a(d,c),y=o({x:p.y,y:-p.x});h.push(y)}for(var g=h.map(function(x,N){var O=r(l[N],n(x,e)),R=r(l[(N+1)%f],n(x,e));return{p1:O,p2:R}}),b=[],m=0;m<f;m++){var w=g[(m-1+f)%f],T=g[m],D=u(w.p1,w.p2,T.p1,T.p2);b.push(D)}return b}function Jg(t,e,r,a,n,i){var o=sp(t,e,r,a,n),s=Qg(o,i),u=Rt();return s.forEach(function(l){return Kh(u,l.x,l.y)}),u}var Qh=function(e,r,a,n,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?Er(i,o):u,f=i/2,h=o/2;l=Math.min(l,f,h);var v=l!==f,c=l!==h,d;if(v){var p=a-f+l-s,y=n-h-s,g=a+f-l+s,b=y;if(d=pr(e,r,a,n,p,y,g,b,!1),d.length>0)return d}if(c){var m=a+f+s,w=n-h+l-s,T=m,D=n+h-l+s;if(d=pr(e,r,a,n,m,w,T,D,!1),d.length>0)return d}if(v){var x=a-f+l-s,N=n+h+s,O=a+f-l+s,R=N;if(d=pr(e,r,a,n,x,N,O,R,!1),d.length>0)return d}if(c){var P=a-f-s,M=n-h+l-s,I=P,E=n+h-l+s;if(d=pr(e,r,a,n,P,M,I,E,!1),d.length>0)return d}var A;{var C=a-f+l,S=n-h+l;if(A=Ga(e,r,a,n,C,S,l+s),A.length>0&&A[0]<=C&&A[1]<=S)return[A[0],A[1]]}{var L=a+f-l,V=n-h+l;if(A=Ga(e,r,a,n,L,V,l+s),A.length>0&&A[0]>=L&&A[1]<=V)return[A[0],A[1]]}{var F=a+f-l,B=n+h-l;if(A=Ga(e,r,a,n,F,B,l+s),A.length>0&&A[0]>=F&&A[1]>=B)return[A[0],A[1]]}{var Y=a-f+l,q=n+h-l;if(A=Ga(e,r,a,n,Y,q,l+s),A.length>0&&A[0]<=Y&&A[1]>=q)return[A[0],A[1]]}return[]},jg=function(e,r,a,n,i,o,s){var u=s,l=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,o),v=Math.max(n,o);return l-u<=e&&e<=f+u&&h-u<=r&&r<=v+u},ep=function(e,r,a,n,i,o,s,u,l){var f={x1:Math.min(a,s,i)-l,x2:Math.max(a,s,i)+l,y1:Math.min(n,u,o)-l,y2:Math.max(n,u,o)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},tp=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-r+o)/s,l=(-r-o)/s;return[u,l]},rp=function(e,r,a,n,i){var o=1e-5;e===0&&(e=o),r/=e,a/=e,n/=e;var s,u,l,f,h,v,c,d;if(u=(3*a-r*r)/9,l=-(27*n)+r*(9*a-2*(r*r)),l/=54,s=u*u*u+l*l,i[1]=0,c=r/3,s>0){h=l+Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),v=l-Math.sqrt(s),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),i[0]=-c+h+v,c+=(h+v)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-v+h)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,s===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),d=2*Math.sqrt(u),i[0]=-c+d*Math.cos(f/3),i[2]=-c+d*Math.cos((f+2*Math.PI)/3),i[4]=-c+d*Math.cos((f+4*Math.PI)/3)},ap=function(e,r,a,n,i,o,s,u){var l=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*u+4*o*o-4*o*u+u*u,f=9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*u-6*o*o+3*o*u,h=3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*u-n*r+2*o*o+2*o*r-u*r,v=1*a*i-a*a+a*e-i*e+n*o-n*n+n*r-o*r,c=[];rp(l,f,h,v,c);for(var d=1e-7,p=[],y=0;y<6;y+=2)Math.abs(c[y+1])<d&&c[y]>=0&&c[y]<=1&&p.push(c[y]);p.push(1),p.push(0);for(var g=-1,b,m,w,T=0;T<p.length;T++)b=Math.pow(1-p[T],2)*a+2*(1-p[T])*p[T]*i+p[T]*p[T]*s,m=Math.pow(1-p[T],2)*n+2*(1-p[T])*p[T]*o+p[T]*p[T]*u,w=Math.pow(b-e,2)+Math.pow(m-r,2),g>=0?w<g&&(g=w):g=w;return g},np=function(e,r,a,n,i,o){var s=[e-a,r-n],u=[i-a,o-n],l=u[0]*u[0]+u[1]*u[1],f=s[0]*s[0]+s[1]*s[1],h=s[0]*u[0]+s[1]*u[1],v=h*h/l;return h<0?f:v>l?(e-i)*(e-i)+(r-o)*(r-o):f-v},It=function(e,r,a){for(var n,i,o,s,u,l=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(o=a[(f+1)*2],s=a[(f+1)*2+1]):(o=a[(f+1-a.length/2)*2],s=a[(f+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)u=(e-n)/(o-n)*(s-i)+i,u>r&&l++;else continue;return l%2!==0},or=function(e,r,a,n,i,o,s,u,l){var f=new Array(a.length),h;u[0]!=null?(h=Math.atan(u[1]/u[0]),u[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=u;for(var v=Math.cos(-h),c=Math.sin(-h),d=0;d<f.length/2;d++)f[d*2]=o/2*(a[d*2]*v-a[d*2+1]*c),f[d*2+1]=s/2*(a[d*2+1]*v+a[d*2]*c),f[d*2]+=n,f[d*2+1]+=i;var p;if(l>0){var y=jn(f,-l);p=Jn(y)}else p=f;return It(e,r,p)},ip=function(e,r,a,n,i,o,s,u){for(var l=new Array(a.length*2),f=0;f<u.length;f++){var h=u[f];l[f*4+0]=h.startX,l[f*4+1]=h.startY,l[f*4+2]=h.stopX,l[f*4+3]=h.stopY;var v=Math.pow(h.cx-e,2)+Math.pow(h.cy-r,2);if(v<=Math.pow(h.radius,2))return!0}return It(e,r,l)},Jn=function(e){for(var r=new Array(e.length/2),a,n,i,o,s,u,l,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],i=e[h*4+2],o=e[h*4+3],h<e.length/4-1?(s=e[(h+1)*4],u=e[(h+1)*4+1],l=e[(h+1)*4+2],f=e[(h+1)*4+3]):(s=e[0],u=e[1],l=e[2],f=e[3]);var v=pr(a,n,i,o,s,u,l,f,!0);r[h*2]=v[0],r[h*2+1]=v[1]}return r},jn=function(e,r){for(var a=new Array(e.length*2),n,i,o,s,u=0;u<e.length/2;u++){n=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,f=-(o-n),h=Math.sqrt(l*l+f*f),v=l/h,c=f/h;a[u*4]=n+v*r,a[u*4+1]=i+c*r,a[u*4+2]=o+v*r,a[u*4+3]=s+c*r}return a},op=function(e,r,a,n,i,o){var s=a-e,u=n-r;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),f=l-1;if(f<0)return[];var h=f/l;return[(a-e)*h+e,(n-r)*h+r]},Gr=function(e,r,a,n,i,o,s){return e-=i,r-=o,e/=a/2+s,r/=n/2+s,e*e+r*r<=1},Ga=function(e,r,a,n,i,o,s){var u=[a-e,n-r],l=[e-i,r-o],f=u[0]*u[0]+u[1]*u[1],h=2*(l[0]*u[0]+l[1]*u[1]),v=l[0]*l[0]+l[1]*l[1]-s*s,c=h*h-4*f*v;if(c<0)return[];var d=(-h+Math.sqrt(c))/(2*f),p=(-h-Math.sqrt(c))/(2*f),y=Math.min(d,p),g=Math.max(d,p),b=[];if(y>=0&&y<=1&&b.push(y),g>=0&&g<=1&&b.push(g),b.length===0)return[];var m=b[0]*u[0]+e,w=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[m,w];var T=b[1]*u[0]+e,D=b[1]*u[1]+r;return[m,w,T,D]}else return[m,w]},Ji=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},pr=function(e,r,a,n,i,o,s,u,l){var f=e-i,h=a-e,v=s-i,c=r-o,d=n-r,p=u-o,y=v*c-p*f,g=h*c-d*f,b=p*h-v*d;if(b!==0){var m=y/b,w=g/b,T=.001,D=0-T,x=1+T;return D<=m&&m<=x&&D<=w&&w<=x?[e+m*h,r+m*d]:l?[e+m*h,r+m*d]:[]}else return y===0||g===0?Ji(e,a,s)===s?[s,u]:Ji(e,a,i)===i?[i,o]:Ji(i,s,a)===a?[a,n]:[]:[]},sp=function(e,r,a,n,i){var o=[],s=n/2,u=i/2,l=r,f=a;o.push({x:l+s*e[0],y:f+u*e[1]});for(var h=1;h<e.length/2;h++)o.push({x:l+s*e[h*2],y:f+u*e[h*2+1]});return o},Qa=function(e,r,a,n,i,o,s,u){var l=[],f,h=new Array(a.length),v=!0;o==null&&(v=!1);var c;if(v){for(var d=0;d<h.length/2;d++)h[d*2]=a[d*2]*o+n,h[d*2+1]=a[d*2+1]*s+i;if(u>0){var p=jn(h,-u);c=Jn(p)}else c=h}else c=a;for(var y,g,b,m,w=0;w<c.length/2;w++)y=c[w*2],g=c[w*2+1],w<c.length/2-1?(b=c[(w+1)*2],m=c[(w+1)*2+1]):(b=c[0],m=c[1]),f=pr(e,r,n,i,y,g,b,m),f.length!==0&&l.push(f[0],f[1]);return l},up=function(e,r,a,n,i,o,s,u,l){var f=[],h,v=new Array(a.length*2);l.forEach(function(b,m){m===0?(v[v.length-2]=b.startX,v[v.length-1]=b.startY):(v[m*4-2]=b.startX,v[m*4-1]=b.startY),v[m*4]=b.stopX,v[m*4+1]=b.stopY,h=Ga(e,r,n,i,b.cx,b.cy,b.radius),h.length!==0&&f.push(h[0],h[1])});for(var c=0;c<v.length/4;c++)h=pr(e,r,n,i,v[c*4],v[c*4+1],v[c*4+2],v[c*4+3],!1),h.length!==0&&f.push(h[0],h[1]);if(f.length>2){for(var d=[f[0],f[1]],p=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2),y=1;y<f.length/2;y++){var g=Math.pow(f[y*2]-e,2)+Math.pow(f[y*2+1]-r,2);g<=p&&(d[0]=f[y*2],d[1]=f[y*2+1],p=g)}return d}return f},Tn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),o=(i-a)/i;return o<0&&(o=1e-5),[r[0]+o*n[0],r[1]+o*n[1]]},Nt=function(e,r){var a=Es(e,r);return a=Jh(a),a},Jh=function(e){for(var r,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<n;l++)r=e[2*l],a=e[2*l+1],i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);for(var f=2/(s-i),h=2/(u-o),v=0;v<n;v++)r=e[2*v]=e[2*v]*f,a=e[2*v+1]=e[2*v+1]*h,i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);if(o<-1)for(var c=0;c<n;c++)a=e[2*c+1]=e[2*c+1]+(-1-o);return e},Es=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Er=function(e,r){return Math.min(e/4,r/4,8)},jh=function(e,r){return Math.min(e/10,r/10,8)},Js=function(){return 8},lp=function(e,r,a){return[e-2*r+a,2*(r-e),e]},xs=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function ji(t,e){function r(h){for(var v=[],c=0;c<h.length;c++){var d=h[c],p=h[(c+1)%h.length],y={x:p.x-d.x,y:p.y-d.y},g={x:-y.y,y:y.x},b=Math.sqrt(g.x*g.x+g.y*g.y);v.push({x:g.x/b,y:g.y/b})}return v}function a(h,v){var c=1/0,d=-1/0,p=kt(h),y;try{for(p.s();!(y=p.n()).done;){var g=y.value,b=g.x*v.x+g.y*v.y;c=Math.min(c,b),d=Math.max(d,b)}}catch(m){p.e(m)}finally{p.f()}return{min:c,max:d}}function n(h,v){return!(h.max<v.min||v.max<h.min)}var i=[].concat($n(r(t)),$n(r(e))),o=kt(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=a(t,u),f=a(e,u);if(!n(l,f))return!1}}catch(h){o.e(h)}finally{o.f()}return!0}var fp=Tt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),hp={pageRank:function(e){for(var r=fp(e),a=r.dampingFactor,n=r.precision,i=r.iterations,o=r.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,h=l.length,v=h*h,c=f.length,d=new Array(v),p=new Array(h),y=(1-a)/h,g=0;g<h;g++){for(var b=0;b<h;b++){var m=g*h+b;d[m]=0}p[g]=0}for(var w=0;w<c;w++){var T=f[w],D=T.data("source"),x=T.data("target");if(D!==x){var N=l.indexOfId(D),O=l.indexOfId(x),R=o(T),P=O*h+N;d[P]+=R,p[N]+=R}}for(var M=1/h+y,I=0;I<h;I++)if(p[I]===0)for(var E=0;E<h;E++){var A=E*h+I;d[A]=M}else for(var C=0;C<h;C++){var S=C*h+I;d[S]=d[S]/p[I]+y}for(var L=new Array(h),V=new Array(h),F,B=0;B<h;B++)L[B]=1;for(var Y=0;Y<i;Y++){for(var q=0;q<h;q++)V[q]=0;for(var Q=0;Q<h;Q++)for(var $=0;$<h;$++){var K=Q*h+$;V[Q]+=d[K]*L[$]}_g(V),F=L,L=V,V=F;for(var j=0,re=0;re<h;re++){var U=F[re]-L[re];j+=U*U}if(j<n)break}var H={rank:function(W){return W=s.collection(W)[0],L[l.indexOf(W)]}};return H}},$u=Tt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),fa={degreeCentralityNormalized:function(e){e=$u(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},v=0,c=0,d=0;d<n;d++){var p=a[d],y=p.id();e.root=p;var g=this.degreeCentrality(e);v<g.indegree&&(v=g.indegree),c<g.outdegree&&(c=g.outdegree),f[y]=g.indegree,h[y]=g.outdegree}return{indegree:function(m){return v==0?0:(Me(m)&&(m=r.filter(m)),f[m.id()]/v)},outdegree:function(m){return c===0?0:(Me(m)&&(m=r.filter(m)),h[m.id()]/c)}}}else{for(var i={},o=0,s=0;s<n;s++){var u=a[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(m){return o===0?0:(Me(m)&&(m=r.filter(m)),i[m.id()]/o)}}}},degreeCentrality:function(e){e=$u(e);var r=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,u=n.alpha;if(i=r.collection(i)[0],s){for(var c=i.connectedEdges(),d=c.filter(function(D){return D.target().same(i)&&a.has(D)}),p=c.filter(function(D){return D.source().same(i)&&a.has(D)}),y=d.length,g=p.length,b=0,m=0,w=0;w<d.length;w++)b+=o(d[w]);for(var T=0;T<p.length;T++)m+=o(p[T]);return{indegree:Math.pow(y,1-u)*Math.pow(b,u),outdegree:Math.pow(g,1-u)*Math.pow(m,u)}}else{for(var l=i.connectedEdges().intersection(a),f=l.length,h=0,v=0;v<l.length;v++)h+=o(l[v]);return{degree:Math.pow(f,1-u)*Math.pow(h,u)}}}};fa.dc=fa.degreeCentrality;fa.dcn=fa.degreeCentralityNormalised=fa.degreeCentralityNormalized;var Ku=Tt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),ha={closenessCentralityNormalized:function(e){for(var r=Ku(e),a=r.harmonic,n=r.weight,i=r.directed,o=this.cy(),s={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),h=0;h<l.length;h++){for(var v=0,c=l[h],d=0;d<l.length;d++)if(h!==d){var p=f.distance(c,l[d]);a?v+=1/p:v+=p}a||(v=1/v),u<v&&(u=v),s[c.id()]=v}return{closeness:function(g){return u==0?0:(Me(g)?g=o.filter(g)[0].id():g=g.id(),s[g]/u)}}},closenessCentrality:function(e){var r=Ku(e),a=r.root,n=r.weight,i=r.directed,o=r.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var h=l[f];if(!h.same(a)){var v=s.distanceTo(h);o?u+=1/v:u+=v}}return o?u:1/u}};ha.cc=ha.closenessCentrality;ha.ccn=ha.closenessCentralityNormalised=ha.closenessCentralityNormalized;var cp=Tt({weight:null,directed:!1}),Ts={betweennessCentrality:function(e){for(var r=cp(e),a=r.directed,n=r.weight,i=n!=null,o=this.cy(),s=this.nodes(),u={},l={},f=0,h={set:function(m,w){l[m]=w,w>f&&(f=w)},get:function(m){return l[m]}},v=0;v<s.length;v++){var c=s[v],d=c.id();a?u[d]=c.outgoers().nodes():u[d]=c.openNeighborhood().nodes(),h.set(d,0)}for(var p=function(){for(var m=s[y].id(),w=[],T={},D={},x={},N=new hn(function(Q,$){return x[Q]-x[$]}),O=0;O<s.length;O++){var R=s[O].id();T[R]=[],D[R]=0,x[R]=1/0}for(D[m]=1,x[m]=0,N.push(m);!N.empty();){var P=N.pop();if(w.push(P),i)for(var M=0;M<u[P].length;M++){var I=u[P][M],E=o.getElementById(P),A=void 0;E.edgesTo(I).length>0?A=E.edgesTo(I)[0]:A=I.edgesTo(E)[0];var C=n(A);I=I.id(),x[I]>x[P]+C&&(x[I]=x[P]+C,N.nodes.indexOf(I)<0?N.push(I):N.updateItem(I),D[I]=0,T[I]=[]),x[I]==x[P]+C&&(D[I]=D[I]+D[P],T[I].push(P))}else for(var S=0;S<u[P].length;S++){var L=u[P][S].id();x[L]==1/0&&(N.push(L),x[L]=x[P]+1),x[L]==x[P]+1&&(D[L]=D[L]+D[P],T[L].push(P))}}for(var V={},F=0;F<s.length;F++)V[s[F].id()]=0;for(;w.length>0;){for(var B=w.pop(),Y=0;Y<T[B].length;Y++){var q=T[B][Y];V[q]=V[q]+D[q]/D[B]*(1+V[B])}B!=s[y].id()&&h.set(B,h.get(B)+V[B])}},y=0;y<s.length;y++)p();var g={betweenness:function(m){var w=o.collection(m).id();return h.get(w)},betweennessNormalized:function(m){if(f==0)return 0;var w=o.collection(m).id();return h.get(w)/f}};return g.betweennessNormalised=g.betweennessNormalized,g}};Ts.bc=Ts.betweennessCentrality;var vp=Tt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),dp=function(e){return vp(e)},gp=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},pp=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},ec=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var o=0;o<r;o++)e[o*r+n]=e[o*r+n]/a}},yp=function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+s]*r[s*a+u]}return n},mp=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=yp(e,n,r);return e},bp=function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return ec(n,r),n},wp=function(e,r,a,n){for(var i=0;i<a;i++){var o=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(o!==s)return!1}return!0},Ep=function(e,r,a,n){for(var i=[],o=0;o<r;o++){for(var s=[],u=0;u<r;u++)Math.round(e[o*r+u]*1e3)/1e3>0&&s.push(a[u]);s.length!==0&&i.push(n.collection(s))}return i},xp=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},Tp=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&xp(e[r],e[a])&&e.splice(a,1);return e},Zu=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=dp(e),o={},s=0;s<r.length;s++)o[r[s].id()]=s;for(var u=r.length,l=u*u,f=new Array(l),h,v=0;v<l;v++)f[v]=0;for(var c=0;c<a.length;c++){var d=a[c],p=o[d.source().id()],y=o[d.target().id()],g=gp(d,i.attributes);f[p*u+y]+=g,f[y*u+p]+=g}pp(f,u,i.multFactor),ec(f,u);for(var b=!0,m=0;b&&m<i.maxIterations;)b=!1,h=mp(f,u,i.expandFactor),f=bp(h,u,i.inflateFactor),wp(f,h,l,4)||(b=!0),m++;var w=Ep(f,u,r,n);return w=Tp(w),w},Cp={markovClustering:Zu,mcl:Zu},Sp=function(e){return e},tc=function(e,r){return Math.abs(r-e)},Qu=function(e,r,a){return e+tc(r,a)},Ju=function(e,r,a){return e+Math.pow(a-r,2)},Dp=function(e){return Math.sqrt(e)},Ap=function(e,r,a){return Math.max(e,tc(r,a))},Pa=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Sp,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},pa={euclidean:function(e,r,a){return e>=2?Pa(e,r,a,0,Ju,Dp):Pa(e,r,a,0,Qu)},squaredEuclidean:function(e,r,a){return Pa(e,r,a,0,Ju)},manhattan:function(e,r,a){return Pa(e,r,a,0,Qu)},max:function(e,r,a){return Pa(e,r,a,-1/0,Ap)}};pa["squared-euclidean"]=pa.squaredEuclidean;pa.squaredeuclidean=pa.squaredEuclidean;function gi(t,e,r,a,n,i){var o;return it(t)?o=t:o=pa[t]||pa.euclidean,e===0&&it(t)?o(n,i):o(e,r,a,n,i)}var Lp=Tt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),js=function(e){return Lp(e)},ei=function(e,r,a,n,i){var o=i!=="kMedoids",s=o?function(h){return a[h]}:function(h){return n[h](a)},u=function(v){return n[v](r)},l=a,f=r;return gi(e,n.length,s,u,l,f)},eo=function(e,r,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(r),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,o[l]=e.max(a[l]).value;for(var f=0;f<r;f++){u=[];for(var h=0;h<n;h++)u[h]=Math.random()*(o[h]-i[h])+i[h];s[f]=u}return s},rc=function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=ei(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},ac=function(e,r,a){for(var n=[],i=null,o=0;o<r.length;o++)i=r[o],a[i.id()]===e&&n.push(i);return n},Np=function(e,r,a){return Math.abs(r-e)<=a},Mp=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var o=Math.abs(e[n][i]-r[n][i]);if(o>a)return!1}return!0},Rp=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},ju=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];Rp(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<r;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},el=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=ei("manhattan",r[i],e,a,"kMedoids");return n},Op=function(e){var r=this.cy(),a=this.nodes(),n=null,i=js(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=eo(a,i.k,i.attributes)):dt(i.testCentroids)==="object"?u=i.testCentroids:u=eo(a,i.k,i.attributes):u=eo(a,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],s[n.id()]=rc(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var v=0;v<i.k;v++){var c=ac(v,a,s);if(c.length!==0){for(var d=i.attributes.length,p=u[v],y=new Array(d),g=new Array(d),b=0;b<d;b++){g[b]=0;for(var m=0;m<c.length;m++)n=c[m],g[b]+=i.attributes[b](n);y[b]=g[b]/c.length,Np(y[b],p[b],i.sensitivityThreshold)||(l=!0)}u[v]=y,o[v]=r.collection(c)}}f++}return o},Pp=function(e){var r=this.cy(),a=this.nodes(),n=null,i=js(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(dt(i.testCentroids)==="object"?s=i.testCentroids:s=ju(a,i.k)):s=ju(a,i.k);for(var h=!0,v=0;h&&v<i.maxIterations;){for(var c=0;c<a.length;c++)n=a[c],u[n.id()]=rc(n,s,i.distance,i.attributes,"kMedoids");h=!1;for(var d=0;d<s.length;d++){var p=ac(d,a,u);if(p.length!==0){f[d]=el(s[d],p,i.attributes);for(var y=0;y<p.length;y++)l=el(p[y],p,i.attributes),l<f[d]&&(f[d]=l,s[d]=p[y],h=!0);o[d]=r.collection(p)}}v++}return o},Ip=function(e,r,a,n,i){for(var o,s,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],i.m);for(var f=0;f<e.length;f++)for(var h=0;h<i.attributes.length;h++){o=0,s=0;for(var v=0;v<r.length;v++)o+=n[v][f]*i.attributes[h](r[v]),s+=n[v][f];e[f][h]=o/s}},kp=function(e,r,a,n,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var s,u,l,f=2/(i.m-1),h=0;h<a.length;h++)for(var v=0;v<n.length;v++){s=0;for(var c=0;c<a.length;c++)u=ei(i.distance,n[v],a[h],i.attributes,"cmeans"),l=ei(i.distance,n[v],a[c],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[v][h]=1/s}},Bp=function(e,r,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<r.length;l++){s=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>s&&(s=r[l][f],u=f);i[u].push(e[l])}for(var h=0;h<i.length;h++)i[h]=n.collection(i[h]);return i},tl=function(e){var r=this.cy(),a=this.nodes(),n=js(e),i,o,s,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);s=new Array(a.length);for(var h=0;h<a.length;h++)s[h]=new Array(n.k);for(var v=0;v<a.length;v++){for(var c=0,d=0;d<n.k;d++)s[v][d]=Math.random(),c+=s[v][d];for(var p=0;p<n.k;p++)s[v][p]=s[v][p]/c}o=new Array(n.k);for(var y=0;y<n.k;y++)o[y]=new Array(n.attributes.length);l=new Array(a.length);for(var g=0;g<a.length;g++)l[g]=new Array(n.k);for(var b=!0,m=0;b&&m<n.maxIterations;)b=!1,Ip(o,a,s,l,n),kp(s,u,o,a,n),Mp(s,u,n.sensitivityThreshold)||(b=!0),m++;return i=Bp(a,s,n,r),{clusters:i,degreeOfMembership:s}},Fp={kMeans:Op,kMedoids:Pp,fuzzyCMeans:tl,fcm:tl},zp=Tt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Vp={single:"min",complete:"max"},Gp=function(e){var r=zp(e),a=Vp[r.linkage];return a!=null&&(r.linkage=a),r},rl=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(O,R){return gi(i.distance,l.length,function(P){return l[P](O)},function(P){return l[P](R)},O,R)},h=0;h<e.length;h++){var v=e[h].key,c=a[v][n[v]];c<s&&(o=v,s=c)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[o],p=r[n[o]],y;i.mode==="dendrogram"?y={left:d,right:p,key:d.key}:y={value:d.value.concat(p.value),key:d.key},e[d.index]=y,e.splice(p.index,1),r[d.key]=y;for(var g=0;g<e.length;g++){var b=e[g];d.key===b.key?u=1/0:i.linkage==="min"?(u=a[d.key][b.key],a[d.key][b.key]>a[p.key][b.key]&&(u=a[p.key][b.key])):i.linkage==="max"?(u=a[d.key][b.key],a[d.key][b.key]<a[p.key][b.key]&&(u=a[p.key][b.key])):i.linkage==="mean"?u=(a[d.key][b.key]*d.size+a[p.key][b.key]*p.size)/(d.size+p.size):i.mode==="dendrogram"?u=f(b.value,d.value):u=f(b.value[0],d.value[0]),a[d.key][b.key]=a[b.key][d.key]=u}for(var m=0;m<e.length;m++){var w=e[m].key;if(n[w]===d.key||n[w]===p.key){for(var T=w,D=0;D<e.length;D++){var x=e[D].key;a[w][x]<a[w][T]&&(T=x)}n[w]=T}e[m].index=m}return d.key=p.key=d.index=p.index=null,!0},sa=function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&sa(e.left,r),e.right&&sa(e.right,r)))},Cs=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Cs(e.left,r),n=Cs(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Ss=function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&sa(e.left,n),e.right&&sa(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&sa(e.left,n),e.right&&sa(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=Ss(e.left,r-1,a)),e.right&&(i=Ss(e.right,r-1,a)),n.concat(i))},al=function(e){for(var r=this.cy(),a=this.nodes(),n=Gp(e),i=n.attributes,o=function(m,w){return gi(n.distance,i.length,function(T){return i[T](m)},function(T){return i[T](w)},m,w)},s=[],u=[],l=[],f=[],h=0;h<a.length;h++){var v={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};s[h]=v,f[h]=v,u[h]=[],l[h]=0}for(var c=0;c<s.length;c++)for(var d=0;d<=c;d++){var p=void 0;n.mode==="dendrogram"?p=c===d?1/0:o(s[c].value,s[d].value):p=c===d?1/0:o(s[c].value[0],s[d].value[0]),u[c][d]=p,u[d][c]=p,p<u[c][l[c]]&&(l[c]=d)}for(var y=rl(s,f,u,l,n);y;)y=rl(s,f,u,l,n);var g;return n.mode==="dendrogram"?(g=Ss(s[0],n.dendrogramDepth,r),n.addDendrogram&&Cs(s[0],r)):(g=new Array(s.length),s.forEach(function(b,m){b.key=b.index=null,g[m]=r.collection(b.value)})),g},Up={hierarchicalClustering:al,hca:al},Hp=Tt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Yp=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||nt("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||be(a)||nt("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),Hp(e)},qp=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-gi(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},_p=function(e,r){var a=null;return r==="median"?a=Yg(e):r==="mean"?a=Hg(e):r==="min"?a=Gg(e):r==="max"?a=Ug(e):a=r,a},Wp=function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},nl=function(e,r,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<a.length;u++){var l=a[u];r[i*e+l]>s&&(o=l,s=r[i*e+l])}o>0&&n.push(o)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},Xp=function(e,r,a){for(var n=nl(e,r,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var u=-1,l=-1/0,f=0;f<o.length;f++){for(var h=0,v=0;v<o.length;v++)h+=r[o[v]*e+o[f]];h>l&&(u=f,l=h)}a[i]=o[u]}return n=nl(e,r,a),n},il=function(e){for(var r=this.cy(),a=this.nodes(),n=Yp(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,u,l,f,h,v;s=a.length,u=s*s,l=new Array(u);for(var c=0;c<u;c++)l[c]=-1/0;for(var d=0;d<s;d++)for(var p=0;p<s;p++)d!==p&&(l[d*s+p]=qp(n.distance,a[d],a[p],n.attributes));f=_p(l,n.preference);for(var y=0;y<s;y++)l[y*s+y]=f;h=new Array(u);for(var g=0;g<u;g++)h[g]=0;v=new Array(u);for(var b=0;b<u;b++)v[b]=0;for(var m=new Array(s),w=new Array(s),T=new Array(s),D=0;D<s;D++)m[D]=0,w[D]=0,T[D]=0;for(var x=new Array(s*n.minIterations),N=0;N<x.length;N++)x[N]=0;var O;for(O=0;O<n.maxIterations;O++){for(var R=0;R<s;R++){for(var P=-1/0,M=-1/0,I=-1,E=0,A=0;A<s;A++)m[A]=h[R*s+A],E=v[R*s+A]+l[R*s+A],E>=P?(M=P,P=E,I=A):E>M&&(M=E);for(var C=0;C<s;C++)h[R*s+C]=(1-n.damping)*(l[R*s+C]-P)+n.damping*m[C];h[R*s+I]=(1-n.damping)*(l[R*s+I]-M)+n.damping*m[I]}for(var S=0;S<s;S++){for(var L=0,V=0;V<s;V++)m[V]=v[V*s+S],w[V]=Math.max(0,h[V*s+S]),L+=w[V];L-=w[S],w[S]=h[S*s+S],L+=w[S];for(var F=0;F<s;F++)v[F*s+S]=(1-n.damping)*Math.min(0,L-w[F])+n.damping*m[F];v[S*s+S]=(1-n.damping)*(L-w[S])+n.damping*m[S]}for(var B=0,Y=0;Y<s;Y++){var q=v[Y*s+Y]+h[Y*s+Y]>0?1:0;x[O%n.minIterations*s+Y]=q,B+=q}if(B>0&&(O>=n.minIterations-1||O==n.maxIterations-1)){for(var Q=0,$=0;$<s;$++){T[$]=0;for(var K=0;K<n.minIterations;K++)T[$]+=x[K*s+$];(T[$]===0||T[$]===n.minIterations)&&Q++}if(Q===s)break}}for(var j=Wp(s,h,v),re=Xp(s,l,j),U={},H=0;H<j.length;H++)U[j[H]]=[];for(var _=0;_<a.length;_++){var W=i[a[_].id()],J=re[W];J!=null&&U[J].push(a[_])}for(var te=new Array(j.length),de=0;de<j.length;de++)te[de]=r.collection(U[j[de]]);return te},$p={affinityPropagation:il,ap:il},Kp=Tt({root:void 0,directed:!1}),Zp={hierholzer:function(e){if(!_e(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Kp(e),n=a.root,i=a.directed,o=this,s=!1,u,l,f;n&&(f=Me(n)?this.filter(n)[0].id():n[0].id());var h={},v={};i?o.forEach(function(b){var m=b.id();if(b.isNode()){var w=b.indegree(!0),T=b.outdegree(!0),D=w-T,x=T-w;D==1?u?s=!0:u=m:x==1?l?s=!0:l=m:(x>1||D>1)&&(s=!0),h[m]=[],b.outgoers().forEach(function(N){N.isEdge()&&h[m].push(N.id())})}else v[m]=[void 0,b.target().id()]}):o.forEach(function(b){var m=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(u?l?s=!0:l=m:u=m),h[m]=[],b.connectedEdges().forEach(function(T){return h[m].push(T.id())})}else v[m]=[b.source().id(),b.target().id()]});var c={found:!1,trail:void 0};if(s)return c;if(l&&u)if(i){if(f&&l!=f)return c;f=l}else{if(f&&l!=f&&u!=f)return c;f||(f=l)}else f||(f=o[0].id());var d=function(m){for(var w=m,T=[m],D,x,N;h[w].length;)D=h[w].shift(),x=v[D][0],N=v[D][1],w!=N?(h[N]=h[N].filter(function(O){return O!=D}),w=N):!i&&w!=x&&(h[x]=h[x].filter(function(O){return O!=D}),w=x),T.unshift(D),T.unshift(w);return T},p=[],y=[];for(y=d(f);y.length!=1;)h[y[0]].length==0?(p.unshift(o.getElementById(y.shift())),p.unshift(o.getElementById(y.shift()))):y=d(y.shift()).concat(y);p.unshift(o.getElementById(y.shift()));for(var g in h)if(h[g].length)return c;return c.found=!0,c.trail=this.spawn(p,!0),c}},Cn=function(){var e=this,r={},a=0,n=0,i=[],o=[],s={},u=function(v,c){for(var d=o.length-1,p=[],y=e.spawn();o[d].x!=v||o[d].y!=c;)p.push(o.pop().edge),d--;p.push(o.pop().edge),p.forEach(function(g){var b=g.connectedNodes().intersection(e);y.merge(g),b.forEach(function(m){var w=m.id(),T=m.connectedEdges().intersection(e);y.merge(m),r[w].cutVertex?y.merge(T.filter(function(D){return D.isLoop()})):y.merge(T)})}),i.push(y)},l=function(v,c,d){v===d&&(n+=1),r[c]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(c).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(c)));else{var y,g,b,m;p.forEach(function(w){y=w.source().id(),g=w.target().id(),b=y===c?g:y,b!==d&&(m=w.id(),s[m]||(s[m]=!0,o.push({x:c,y:b,edge:w})),b in r?r[c].low=Math.min(r[c].low,r[b].id):(l(v,b,c),r[c].low=Math.min(r[c].low,r[b].low),r[c].id<=r[b].low&&(r[c].cutVertex=!0,u(c,b))))})}};e.forEach(function(h){if(h.isNode()){var v=h.id();v in r||(n=0,l(v,v),r[v].cutVertex=n>1)}});var f=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},Qp={hopcroftTarjanBiconnected:Cn,htbc:Cn,htb:Cn,hopcroftTarjanBiconnectedComponents:Cn},Sn=function(){var e=this,r={},a=0,n=[],i=[],o=e.spawn(e),s=function(l){i.push(l),r[l]={index:a,low:a++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(p){var y=p.target().id();y!==l&&(y in r||s(y),r[y].explored||(r[l].low=Math.min(r[l].low,r[y].low)))}),r[l].index===r[l].low){for(var h=e.spawn();;){var v=i.pop();if(h.merge(e.getElementById(v)),r[v].low=r[l].index,r[v].explored=!0,v===l)break}var c=h.edgesWith(h),d=h.merge(c);n.push(d),o=o.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||s(l)}}),{cut:o,components:n}},Jp={tarjanStronglyConnected:Sn,tsc:Sn,tscc:Sn,tarjanStronglyConnectedComponents:Sn},nc={};[Ka,Lg,Ng,Rg,Pg,kg,zg,hp,fa,ha,Ts,Cp,Fp,Up,$p,Zp,Qp,Jp].forEach(function(t){Ie(nc,t)});/*!
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as ly,y as cy,e as sm,i as bs,g as Uu,d as om,p as am,k as ac,o as im,r as uy,n as lc,v as Pd,l as cc,w as hy,z as lm,A as dy,B as Ad,$ as py,D as rm,x as fy,E as my}from"./index-
|
|
1
|
+
import{f as ly,y as cy,e as sm,i as bs,g as Uu,d as om,p as am,k as ac,o as im,r as uy,n as lc,v as Pd,l as cc,w as hy,z as lm,A as dy,B as Ad,$ as py,D as rm,x as fy,E as my}from"./index-Bv-mXpuE.js";import{_ as Id,a as fr}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import{h as xs,a as Md,b as Ed}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuPed97e.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-C8lRAcSv.js";import"./preload-helper-BlTxHScW.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-CfkhEoF5.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Bp_g55i_.js";var Dd={exports:{}};/**
|
|
2
2
|
* MapLibre GL JS
|
|
3
3
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.24.0/LICENSE.txt
|
|
4
4
|
*/var gy=Dd.exports;(function(Be,Ze){(function(He,rt){Be.exports=rt()})(gy,(function(){var He={},rt={};function jt(R,h,ge){if(rt[R]=ge,R==="index"){var qt="var sharedModule = {}; ("+rt.shared+")(sharedModule); ("+rt.worker+")(sharedModule);",Nt={};return rt.shared(Nt),rt.index(He,Nt),typeof window<"u"&&He.setWorkerUrl(window.URL.createObjectURL(new Blob([qt],{type:"text/javascript"}))),He}}jt("shared",["exports"],(function(R){function h(r,e,i,s){return new(i||(i=Promise))((function(o,l){function u(m){try{g(s.next(m))}catch(v){l(v)}}function p(m){try{g(s.throw(m))}catch(v){l(v)}}function g(m){var v;m.done?o(m.value):(v=m.value,v instanceof i?v:new i((function(_){_(v)}))).then(u,p)}g((s=s.apply(r,e||[])).next())}))}function ge(r,e){this.x=r,this.y=e}function qt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Nt,nr;typeof SuppressedError=="function"&&SuppressedError,ge.prototype={clone(){return new ge(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,e){return this.clone()._rotateAround(r,e)},matMult(r){return this.clone()._matMult(r)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){const e=r.x-this.x,i=r.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult(r){const e=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=e,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){const r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){const e=Math.cos(r),i=Math.sin(r),s=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=s,this},_rotateAround(r,e){const i=Math.cos(r),s=Math.sin(r),o=e.y+s*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-s*(this.y-e.y),this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:ge},ge.convert=function(r){if(r instanceof ge)return r;if(Array.isArray(r))return new ge(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new ge(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var hi=(function(){if(nr)return Nt;function r(e,i,s,o){this.cx=3*e,this.bx=3*(s-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(o-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=s,this.p2y=o}return nr=1,Nt=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var s=e,o=0;o<8;o++){var l=this.sampleCurveX(s)-e;if(Math.abs(l)<i)return s;var u=this.sampleCurveDerivativeX(s);if(Math.abs(u)<1e-6)break;s-=l/u}var p=0,g=1;for(s=e,o=0;o<20&&(l=this.sampleCurveX(s),!(Math.abs(l-e)<i));o++)e>l?p=s:g=s,s=.5*(g-p)+p;return s},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Nt})(),Je=qt(hi);let ii,Le;function Bi(){return ii!=null||(ii=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ii}function Ut(){if(Le==null&&(Le=!1,Bi())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let s=0;s<25;s++){const o=4*s;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(s%5,Math.floor(s/5),1,1)}const i=e.getImageData(0,0,5,5).data;for(let s=0;s<100;s++)if(s%4!=3&&i[s]!==s){Le=!0;break}}}return Le||!1}var he=1e-6,gt=typeof Float32Array<"u"?Float32Array:Array;function tt(){var r=new gt(9);return gt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Wt(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function kt(){var r=new gt(3);return gt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function Gt(r){var e=r[0],i=r[1],s=r[2];return Math.sqrt(e*e+i*i+s*s)}function Fe(r,e,i){var s=new gt(3);return s[0]=r,s[1]=e,s[2]=i,s}function W(r,e,i){return r[0]=e[0]+i[0],r[1]=e[1]+i[1],r[2]=e[2]+i[2],r}function K(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function ee(r,e,i){var s=e[0],o=e[1],l=e[2],u=i[0],p=i[1],g=i[2];return r[0]=o*g-l*p,r[1]=l*u-s*g,r[2]=s*p-o*u,r}var _e,Me=Gt;function Xe(r,e,i){var s=e[0],o=e[1],l=e[2],u=e[3];return r[0]=i[0]*s+i[4]*o+i[8]*l+i[12]*u,r[1]=i[1]*s+i[5]*o+i[9]*l+i[13]*u,r[2]=i[2]*s+i[6]*o+i[10]*l+i[14]*u,r[3]=i[3]*s+i[7]*o+i[11]*l+i[15]*u,r}function ze(){var r=new gt(4);return gt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function We(r,e,i,s){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",l=Math.PI/360;e*=l,s*=l,i*=l;var u=Math.sin(e),p=Math.cos(e),g=Math.sin(i),m=Math.cos(i),v=Math.sin(s),_=Math.cos(s);switch(o){case"xyz":r[0]=u*m*_+p*g*v,r[1]=p*g*_-u*m*v,r[2]=p*m*v+u*g*_,r[3]=p*m*_-u*g*v;break;case"xzy":r[0]=u*m*_-p*g*v,r[1]=p*g*_-u*m*v,r[2]=p*m*v+u*g*_,r[3]=p*m*_+u*g*v;break;case"yxz":r[0]=u*m*_+p*g*v,r[1]=p*g*_-u*m*v,r[2]=p*m*v-u*g*_,r[3]=p*m*_+u*g*v;break;case"yzx":r[0]=u*m*_+p*g*v,r[1]=p*g*_+u*m*v,r[2]=p*m*v-u*g*_,r[3]=p*m*_-u*g*v;break;case"zxy":r[0]=u*m*_-p*g*v,r[1]=p*g*_+u*m*v,r[2]=p*m*v+u*g*_,r[3]=p*m*_-u*g*v;break;case"zyx":r[0]=u*m*_-p*g*v,r[1]=p*g*_+u*m*v,r[2]=p*m*v-u*g*_,r[3]=p*m*_+u*g*v;break;default:throw new Error("Unknown angle order "+o)}return r}function Ve(){var r=new gt(2);return gt!=Float32Array&&(r[0]=0,r[1]=0),r}function et(r,e){var i=new gt(2);return i[0]=r,i[1]=e,i}kt(),_e=new gt(4),gt!=Float32Array&&(_e[0]=0,_e[1]=0,_e[2]=0,_e[3]=0),kt(),Fe(1,0,0),Fe(0,1,0),ze(),ze(),tt(),Ve();const De=8192;function St(r,e,i){return e*(De/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function Pt(r){return r instanceof Error?r:new Error(typeof r=="string"?r:String(r))}function sr(r,e){return(r%e+e)%e}function Hi(r,e,i){return r*(1-i)+e*i}function Br(r){if(r<=0)return 0;if(r>=1)return 1;const e=r*r,i=e*r;return 4*(r<.5?i:3*(r-e)+i-.75)}function nn(r,e,i,s){const o=new Je(r,e,i,s);return l=>o.solve(l)}const ws=nn(.25,.1,.25,1);function xi(r,e,i){return Math.min(i,Math.max(e,r))}function Bn(r,e,i){const s=i-e,o=((r-e)%s+s)%s+e;return o===e?i:o}function Xi(r,...e){for(const i of e)for(const s in i)r[s]=i[s];return r}let Ts=1;function Or(r,e,i){const s={};for(const o in r)s[o]=e.call(this,r[o],o,r);return s}function sn(r,e,i){const s={};for(const o in r)e.call(this,r[o],o,r)&&(s[o]=r[o]);return s}function ke(r){return Array.isArray(r)?r.map(ke):typeof r=="object"&&r?Or(r,ke):r}const Ht={};function ri(r){Ht[r]||(typeof console<"u"&&console.warn(r),Ht[r]=!0)}function Oi(r,e,i){return(i.y-r.y)*(e.x-r.x)>(e.y-r.y)*(i.x-r.x)}function ni(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let Ai=null;function on(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}const Fa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ba(r,e,i,s,o){return h(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const l=new VideoFrame(r,{timestamp:0});try{const u=l?.format;if(!u||!u.startsWith("BGR")&&!u.startsWith("RGB"))throw new Error(`Unrecognized format ${u}`);const p=u.startsWith("BGR"),g=new Uint8ClampedArray(s*o*4);if(yield l.copyTo(g,(function(m,v,_,T,b){const I=4*Math.max(-v,0),M=(Math.max(0,_)-_)*T*4+I,A=4*T,D=Math.max(0,v),L=Math.max(0,_);return{rect:{x:D,y:L,width:Math.min(m.width,v+T)-D,height:Math.min(m.height,_+b)-L},layout:[{offset:M,stride:A}]}})(r,e,i,s,o)),p)for(let m=0;m<g.length;m+=4){const v=g[m];g[m]=g[m+2],g[m+2]=v}return g}finally{l.close()}}))}let Vr,On;function go(r,e,i,s){return r.addEventListener(e,i,s),{unsubscribe:()=>{r.removeEventListener(e,i,s)}}}function jr(r){return r*Math.PI/180}function an(r){return r/Math.PI*180}const Oa={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Va={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},_o="AbortError";class Ss extends Error{constructor(e=_o){super(e instanceof Error?e.message:e),this.name=_o,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function hc(r){return r instanceof Error&&r.name===_o}function yo(r){if(r.aborted)throw new Ss(r.reason)}const Nr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function wr(r){return Nr.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}const Yi="global-dispatcher";class Vn extends Error{constructor(e,i,s,o){super(`AJAXError: ${i} (${e}): ${s}`),this.status=e,this.statusText=i,this.url=s,this.body=o}}const ja=()=>{var r;return ni(self)?(r=self.worker)===null||r===void 0?void 0:r.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href},ln=function(r,e){return h(this,void 0,void 0,(function*(){var i,s;if(r.url.includes("://")&&!/^https?:|^file:/.test(r.url)){const o=wr(r.url);if(o){const l=yield o(r,e);return l.data||r.type!=="arrayBuffer"?l:Xi(l,{data:new ArrayBuffer(0)})}if(ni(self)&&(!((i=self.worker)===null||i===void 0)&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:Yi},e)}if(!(o=>{var l;return o.startsWith("file:")||((l=ja())===null||l===void 0?void 0:l.startsWith("file:"))&&!/^\w+:/.test(o)})(r.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return(function(o,l){return h(this,void 0,void 0,(function*(){const u=new Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,cache:o.cache,referrer:ja(),referrerPolicy:o.referrerPolicy,signal:l.signal});let p,g;o.type!=="json"||u.headers.has("Accept")||u.headers.set("Accept","application/json");try{p=yield fetch(u)}catch(v){throw hc(v)?v:new Vn(0,Pt(v).message,o.url,new Blob)}if(!p.ok){const v=yield p.blob();throw new Vn(p.status,p.statusText,o.url,v)}g=o.type==="arrayBuffer"||o.type==="image"?p.arrayBuffer():o.type==="json"?p.json():p.text();const m=yield g;return yo(l.signal),{data:m,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires"),etag:p.headers.get("ETag")}}))})(r,e);if(ni(self)&&(!((s=self.worker)===null||s===void 0)&&s.actor))return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:Yi},e)}return(function(o,l){return new Promise(((u,p)=>{var g;const m=new XMLHttpRequest;m.open(o.method||"GET",o.url,!0),o.type!=="arrayBuffer"&&o.type!=="image"||(m.responseType="arraybuffer");for(const v in o.headers)m.setRequestHeader(v,o.headers[v]);o.type==="json"&&(m.responseType="text",!((g=o.headers)===null||g===void 0)&&g.Accept||m.setRequestHeader("Accept","application/json")),m.withCredentials=o.credentials==="include",m.onerror=()=>{p(new Error(m.statusText))},m.onload=()=>{if(!l.signal.aborted)if((m.status>=200&&m.status<300||m.status===0)&&m.response!==null){let v=m.response;if(o.type==="json")try{v=JSON.parse(m.response)}catch(_){return void p(_)}u({data:v,cacheControl:m.getResponseHeader("Cache-Control"),expires:m.getResponseHeader("Expires"),etag:m.getResponseHeader("ETag")})}else{const v=new Blob([m.response],{type:m.getResponseHeader("Content-Type")});p(new Vn(m.status,m.statusText,o.url,v))}},l.signal.addEventListener("abort",(()=>{m.abort(),p(new Ss(l.signal.reason))})),m.send(o.body)}))})(r,e)}))};function or(r){if(!r||r.indexOf("://")<=0||r.startsWith("data:image/")||r.startsWith("blob:"))return!0;const e=new URL(r),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function jn(r,e,i){var s;!((s=i[r])===null||s===void 0)&&s.includes(e)||(i[r]||(i[r]=[]),i[r].push(e))}function cn(r,e,i){if(i?.[r]){const s=i[r].indexOf(e);s!==-1&&i[r].splice(s,1)}}class Ps{constructor(e,i={}){Xi(this,i),this.type=e}}class Nn extends Ps{constructor(e,i={}){super("error",Xi({error:e},i))}}class vo{on(e,i){return this._listeners||(this._listeners={}),jn(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return cn(e,i,this._listeners),cn(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners||(this._oneTimeListeners={}),jn(e,i,this._oneTimeListeners),this):new Promise((s=>this.once(e,s)))}fire(e,i){var s,o;typeof e=="string"&&(e=new Ps(e,i||{}));const l=e.type;if(this.listens(l)){e.target=this;const u=!((s=this._listeners)===null||s===void 0)&&s[l]?this._listeners[l].slice():[];for(const m of u)m.call(this,e);const p=!((o=this._oneTimeListeners)===null||o===void 0)&&o[l]?this._oneTimeListeners[l].slice():[];for(const m of p)cn(l,m,this._oneTimeListeners),m.call(this,e);const g=this._eventedParent;g&&(Xi(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof Nn&&console.error(e.error);return this}listens(e){var i,s,o,l,u;return((s=(i=this._listeners)===null||i===void 0?void 0:i[e])===null||s===void 0?void 0:s.length)>0||((l=(o=this._oneTimeListeners)===null||o===void 0?void 0:o[e])===null||l===void 0?void 0:l.length)>0||((u=this._eventedParent)===null||u===void 0?void 0:u.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var ce={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const Na=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ua(r,e){const i={};for(const s in r)s!=="ref"&&(i[s]=r[s]);return Na.forEach((s=>{s in e&&(i[s]=e[s])})),i}function ot(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!ot(r[i],e[i]))return!1;return!0}if(typeof r=="object"&&r!==null&&e!==null){if(typeof e!="object"||Object.keys(r).length!==Object.keys(e).length)return!1;for(const i in r)if(!ot(r[i],e[i]))return!1;return!0}return r===e}function Di(r,e){r.push(e)}function un(r,e,i){Di(i,{command:"addSource",args:[r,e[r]]})}function dc(r,e,i){Di(e,{command:"removeSource",args:[r]}),i[r]=!0}function pc(r,e,i,s){dc(r,i,s),un(r,e,i)}function Gu(r,e,i){let s;for(s in r[i])if(Object.prototype.hasOwnProperty.call(r[i],s)&&s!=="data"&&!ot(r[i][s],e[i][s]))return!1;for(s in e[i])if(Object.prototype.hasOwnProperty.call(e[i],s)&&s!=="data"&&!ot(r[i][s],e[i][s]))return!1;return!0}function xo(r,e,i,s,o,l){r=r||{},e=e||{};for(const u in r)Object.prototype.hasOwnProperty.call(r,u)&&(ot(r[u],e[u])||i.push({command:l,args:[s,u,e[u],o]}));for(const u in e)Object.prototype.hasOwnProperty.call(e,u)&&!Object.prototype.hasOwnProperty.call(r,u)&&(ot(r[u],e[u])||i.push({command:l,args:[s,u,e[u],o]}))}function Ga(r){return r.id}function fc(r,e){return r[e.id]=e,r}class ye{constructor(e,i,s,o){this.message=(e?`${e}: `:"")+s,o&&(this.identifier=o),i!=null&&i.__line__&&(this.line=i.__line__)}}function hn(r,...e){for(const i of e)for(const s in i)r[s]=i[s];return r}class si extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class $a{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[s,o]of i)this.bindings[s]=o}concat(e){return new $a(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Ur={kind:"null"},we={kind:"number"},Oe={kind:"string"},Ge={kind:"boolean"},Vi={kind:"color"},bo={kind:"projectionDefinition"},Tr={kind:"object"},je={kind:"value"},Is={kind:"collator"},Ms={kind:"formatted"},wo={kind:"padding"},Un={kind:"colorArray"},Es={kind:"numberArray"},Gn={kind:"resolvedImage"},Cs={kind:"variableAnchorOffsetCollection"};function oi(r,e){return{kind:"array",itemType:r,N:e}}function at(r){if(r.kind==="array"){const e=at(r.itemType);return typeof r.N=="number"?`array<${e}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${e}>`}return r.kind}const To=[Ur,we,Oe,Ge,Vi,bo,Ms,Tr,oi(je),wo,Es,Un,Gn,Cs];function $n(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!$n(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(const i of To)if(!$n(i,e))return null}}return`Expected ${at(r)} but found ${at(e)} instead.`}function As(r,e){return e.some((i=>i.kind===r.kind))}function dn(r,e){return e.some((i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r))}function ar(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}const mc=.96422,pn=.82521,So=4/29,It=6/29,gc=3*It*It,_c=It*It*It,Ds=Math.PI/180,yc=180/Math.PI;function vc(r){return(r%=360)<0&&(r+=360),r}function xc([r,e,i,s]){let o,l;const u=Za((.2225045*(r=Po(r))+.7168786*(e=Po(e))+.0606169*(i=Po(i)))/1);r===e&&e===i?o=l=u:(o=Za((.4360747*r+.3850649*e+.1430804*i)/mc),l=Za((.0139322*r+.0971045*e+.7141733*i)/pn));const p=116*u-16;return[p<0?0:p,500*(o-u),200*(u-l),s]}function Po(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Za(r){return r>_c?Math.pow(r,1/3):r/gc+So}function qa([r,e,i,s]){let o=(r+16)/116,l=isNaN(e)?o:o+e/500,u=isNaN(i)?o:o-i/200;return o=1*Ha(o),l=mc*Ha(l),u=pn*Ha(u),[Wa(3.1338561*l-1.6168667*o-.4906146*u),Wa(-.9787684*l+1.9161415*o+.033454*u),Wa(.0719453*l-.2289914*o+1.4052427*u),s]}function Wa(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Ha(r){return r>It?r*r*r:gc*(r-So)}const $u=Object.hasOwn||function(r,e){return Object.prototype.hasOwnProperty.call(r,e)};function zs(r,e){return $u(r,e)?r[e]:void 0}function Io(r){return parseInt(r.padEnd(2,r),16)/255}function bc(r,e){return Zn(e?r/100:r,0,1)}function Zn(r,e,i){return Math.min(Math.max(e,r),i)}function Xa(r){return!r.some(Number.isNaN)}const ks={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Gr(r,e,i){return r+i*(e-r)}function qn(r,e,i){return r.map(((s,o)=>Gr(s,e[o],i)))}class Ue{constructor(e,i,s,o=1,l=!0){this.r=e,this.g=i,this.b=s,this.a=o,l||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,i,s,o]))}static parse(e){if(e instanceof Ue)return e;if(typeof e!="string")return;const i=(function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=zs(ks,s);if(o){const[u,p,g]=o;return[u/255,p/255,g/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const u=s.length<6?1:2;let p=1;return[Io(s.slice(p,p+=u)),Io(s.slice(p,p+=u)),Io(s.slice(p,p+=u)),Io(s.slice(p,p+u)||"ff")]}if(s.startsWith("rgb")){const u=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[p,g,m,v,_,T,b,I,M,A,D,L]=u,k=[v||" ",b||" ",A].join("");if(k===" "||k===" /"||k===",,"||k===",,,"){const F=[m,T,M].join(""),O=F==="%%%"?100:F===""?255:0;if(O){const j=[Zn(+g/O,0,1),Zn(+_/O,0,1),Zn(+I/O,0,1),D?bc(+D,L):1];if(Xa(j))return j}}return}}const l=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(l){const[u,p,g,m,v,_,T,b,I]=l,M=[g||" ",v||" ",T].join("");if(M===" "||M===" /"||M===",,"||M===",,,"){const A=[+p,Zn(+m,0,100),Zn(+_,0,100),b?bc(+b,I):1];if(Xa(A))return(function([D,L,k,F]){function O(j){const Y=(j+D/30)%12,J=L*Math.min(k,1-k);return k-J*Math.max(-1,Math.min(Y-3,9-Y,1))}return D=vc(D),L/=100,k/=100,[O(0),O(8),O(4),F]})(A)}}})(e);return i?new Ue(...i,!1):void 0}get rgb(){const{r:e,g:i,b:s,a:o}=this,l=o||1/0;return this.overwriteGetter("rgb",[e/l,i/l,s/l,o])}get hcl(){return this.overwriteGetter("hcl",(function(e){const[i,s,o,l]=xc(e),u=Math.sqrt(s*s+o*o);return[Math.round(1e4*u)?vc(Math.atan2(o,s)*yc):NaN,u,i,l]})(this.rgb))}get lab(){return this.overwriteGetter("lab",xc(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){const[e,i,s,o]=this.rgb;return`rgba(${[e,i,s].map((l=>Math.round(255*l))).join(",")},${o})`}static interpolate(e,i,s,o="rgb"){switch(o){case"rgb":{const[l,u,p,g]=qn(e.rgb,i.rgb,s);return new Ue(l,u,p,g,!1)}case"hcl":{const[l,u,p,g]=e.hcl,[m,v,_,T]=i.hcl;let b,I;if(isNaN(l)||isNaN(m))isNaN(l)?isNaN(m)?b=NaN:(b=m,p!==1&&p!==0||(I=v)):(b=l,_!==1&&_!==0||(I=u));else{let k=m-l;m>l&&k>180?k-=360:m<l&&l-m>180&&(k+=360),b=l+s*k}const[M,A,D,L]=(function([k,F,O,j]){return k=isNaN(k)?0:k*Ds,qa([O,Math.cos(k)*F,Math.sin(k)*F,j])})([b,I??Gr(u,v,s),Gr(p,_,s),Gr(g,T,s)]);return new Ue(M,A,D,L,!1)}case"lab":{const[l,u,p,g]=qa(qn(e.lab,i.lab,s));return new Ue(l,u,p,g,!1)}}}}Ue.black=new Ue(0,0,0,1),Ue.white=new Ue(1,1,1,1),Ue.transparent=new Ue(0,0,0,0),Ue.red=new Ue(1,0,0,1);class Ya{constructor(e,i,s){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Zu=["bottom","center","top"];class Ka{constructor(e,i,s,o,l,u){this.text=e,this.image=i,this.scale=s,this.fontStack=o,this.textColor=l,this.verticalAlign=u}}class zi{constructor(e){this.sections=e}static fromString(e){return new zi([new Ka(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((e=>e.text.length!==0||e.image&&e.image.name.length!==0))}static factory(e){return e instanceof zi?e:zi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class di{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof di)return e;if(typeof e=="number")return new di([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const i of e)if(typeof i!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new di(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,s){return new di(qn(e.values,i.values,s))}}class vt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof vt)return e;if(typeof e=="number")return new vt([e]);if(Array.isArray(e)){for(const i of e)if(typeof i!="number")return;return new vt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,s){return new vt(qn(e.values,i.values,s))}}class Re{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Re)return e;if(typeof e=="string"){const s=Ue.parse(e);return s?new Re([s]):void 0}if(!Array.isArray(e))return;const i=[];for(const s of e){if(typeof s!="string")return;const o=Ue.parse(s);if(!o)return;i.push(o)}return new Re(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,s,o="rgb"){const l=[];if(e.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let u=0;u<e.values.length;u++)l.push(Ue.interpolate(e.values[u],i.values[u],s,o));return new Re(l)}}class ht extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const $r=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class bi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof bi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let i=0;i<e.length;i+=2){const s=e[i],o=e[i+1];if(typeof s!="string"||!$r.has(s)||!Array.isArray(o)||o.length!==2||typeof o[0]!="number"||typeof o[1]!="number")return}return new bi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,s){const o=e.values,l=i.values;if(o.length!==l.length)throw new ht(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`);const u=[];for(let p=0;p<o.length;p+=2){if(o[p]!==l[p])throw new ht(`Cannot interpolate values containing mismatched anchors. from[${p}]: ${o[p]}, to[${p}]: ${l[p]}`);u.push(o[p]);const[g,m]=o[p+1],[v,_]=l[p+1];u.push([Gr(g,v,s),Gr(m,_,s)])}return new bi(u)}}class ji{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ji({name:e,available:!1}):null}}class wi{constructor(e,i,s){this.from=e,this.to=i,this.transition=s}static interpolate(e,i,s){return new wi(e,i,s)}static parse(e){return e instanceof wi?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new wi(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new wi(e.from,e.to,e.transition):typeof e=="string"?new wi(e,e,1):void 0}}function Wn(r,e,i,s){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[r,e,i,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[r,e,i,s]:[r,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Zr(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof wi||r instanceof Ue||r instanceof Ya||r instanceof zi||r instanceof di||r instanceof vt||r instanceof Re||r instanceof bi||r instanceof ji)return!0;if(Array.isArray(r)){for(const e of r)if(!Zr(e))return!1;return!0}if(typeof r=="object"){for(const e in r)if(!Zr(r[e]))return!1;return!0}return!1}function At(r){if(r===null)return Ur;if(typeof r=="string")return Oe;if(typeof r=="boolean")return Ge;if(typeof r=="number")return we;if(r instanceof Ue)return Vi;if(r instanceof wi)return bo;if(r instanceof Ya)return Is;if(r instanceof zi)return Ms;if(r instanceof di)return wo;if(r instanceof vt)return Es;if(r instanceof Re)return Un;if(r instanceof bi)return Cs;if(r instanceof ji)return Gn;if(Array.isArray(r)){const e=r.length;let i;for(const s of r){const o=At(s);if(i){if(i===o)continue;i=je;break}i=o}return oi(i||je,e)}return Tr}function fn(r){const e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof Ue||r instanceof wi||r instanceof zi||r instanceof di||r instanceof vt||r instanceof Re||r instanceof bi||r instanceof ji?r.toString():JSON.stringify(r)}class mr{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Zr(e[1]))return i.error("invalid value");const s=e[1];let o=At(s);const l=i.expectedType;return o.kind!=="array"||o.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(o=l),new mr(o,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Mo={string:Oe,number:we,boolean:Ge,object:Tr};class ki{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let s,o=1;const l=e[0];if(l==="array"){let p,g;if(e.length>2){const m=e[1];if(typeof m!="string"||!(m in Mo)||m==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=Mo[m],o++}else p=je;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);g=e[2],o++}s=oi(p,g)}else{if(!Mo[l])throw new Error(`Types doesn't contain name = ${l}`);s=Mo[l]}const u=[];for(;o<e.length;o++){const p=i.parse(e[o],o,je);if(!p)return null;u.push(p)}return new ki(s,u)}evaluate(e){for(let i=0;i<this.args.length;i++){const s=this.args[i].evaluate(e);if(!$n(this.type,At(s)))return s;if(i===this.args.length-1)throw new ht(`Expected value to be of type ${at(this.type)}, but found ${at(At(s))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const mn={"to-boolean":Ge,"to-color":Vi,"to-number":we,"to-string":Oe};class Sr{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const s=e[0];if(!mn[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return i.error("Expected one argument.");const o=mn[s],l=[];for(let u=1;u<e.length;u++){const p=i.parse(e[u],u,je);if(!p)return null;l.push(p)}return new Sr(o,l)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,s;for(const o of this.args){if(i=o.evaluate(e),s=null,i instanceof Ue)return i;if(typeof i=="string"){const l=e.parseColor(i);if(l)return l}else if(Array.isArray(i)&&(s=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Wn(i[0],i[1],i[2],i[3]),!s))return new Ue(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new ht(s||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(const s of this.args){i=s.evaluate(e);const o=di.parse(i);if(o)return o}throw new ht(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(const s of this.args){i=s.evaluate(e);const o=vt.parse(i);if(o)return o}throw new ht(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(const s of this.args){i=s.evaluate(e);const o=Re.parse(i);if(o)return o}throw new ht(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(const s of this.args){i=s.evaluate(e);const o=bi.parse(i);if(o)return o}throw new ht(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(const s of this.args){if(i=s.evaluate(e),i===null)return 0;const o=Number(i);if(!isNaN(o))return o}throw new ht(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return zi.fromString(fn(this.args[0].evaluate(e)));case"resolvedImage":return ji.fromString(fn(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return fn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const wc=["Unknown","Point","LineString","Polygon"];class Ja{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?wc[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let i=this._parseColorCache.get(e);return i||(i=Ue.parse(e),this._parseColorCache.set(e,i)),i}}class gn{constructor(e,i,s=[],o,l=new $a,u=[]){this.registry=e,this.path=s,this.key=s.map((p=>`[${p}]`)).join(""),this.scope=l,this.errors=u,this.expectedType=o,this._isConstant=i}parse(e,i,s,o,l={}){return i?this.concat(i,s,o)._parse(e,l):this._parse(e,l)}_parse(e,i){function s(o,l,u){return u==="assert"?new ki(l,[o]):u==="coerce"?new Sr(l,[o]):o}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const o=e[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const l=this.registry[o];if(l){let u=l.parse(e,this);if(!u)return null;if(this.expectedType){const p=this.expectedType,g=u.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||g.kind!=="value"){if(p.kind==="projectionDefinition"&&["string","array"].includes(g.kind)||["color","formatted","resolvedImage"].includes(p.kind)&&["value","string"].includes(g.kind)||["padding","numberArray"].includes(p.kind)&&["value","number","array"].includes(g.kind)||p.kind==="colorArray"&&["value","string","array"].includes(g.kind)||p.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(g.kind))u=s(u,p,i.typeAnnotation||"coerce");else if(this.checkSubtype(p,g))return null}else u=s(u,p,i.typeAnnotation||"assert")}if(!(u instanceof mr)&&u.type.kind!=="resolvedImage"&&this._isConstant(u)){const p=new Ja;try{u=new mr(u.type,u.evaluate(p))}catch(g){return this.error(g.message),null}}return u}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,s){const o=typeof e=="number"?this.path.concat(e):this.path,l=s?this.scope.concat(s):this.scope;return new gn(this.registry,this._isConstant,o,i||null,l,this.errors)}error(e,...i){const s=`${this.key}${i.map((o=>`[${o}]`)).join("")}`;this.errors.push(new si(s,e))}checkSubtype(e,i){const s=$n(e,i);return s&&this.error(s),s}}class dt{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let l=1;l<e.length-1;l+=2){const u=e[l];if(typeof u!="string")return i.error(`Expected string, but found ${typeof u} instead.`,l);if(/[^a-zA-Z0-9_]/.test(u))return i.error("Variable names must contain only alphanumeric characters or '_'.",l);const p=i.parse(e[l+1],l+1);if(!p)return null;s.push([u,p])}const o=i.parse(e[e.length-1],e.length-1,i.expectedType,s);return o?new dt(s,o):null}outputDefined(){return this.result.outputDefined()}}class Hn{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const s=e[1];return i.scope.has(s)?new Hn(s,i.scope.get(s)):i.error(`Unknown variable "${s}". Make sure "${s}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Ye{constructor(e,i,s){this.type=e,this.index=i,this.input=s}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=i.parse(e[1],1,we),o=i.parse(e[2],2,oi(i.expectedType||je));return s&&o?new Ye(o.type.itemType,s,o):null}evaluate(e){const i=this.index.evaluate(e),s=this.input.evaluate(e);if(i<0)throw new ht(`Array index out of bounds: ${i} < 0.`);if(i>=s.length)throw new ht(`Array index out of bounds: ${i} > ${s.length-1}.`);if(i!==Math.floor(i))throw new ht(`Array index must be an integer, but found ${i} instead.`);return s[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Ne{constructor(e,i){this.type=Ge,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=i.parse(e[1],1,je),o=i.parse(e[2],2,je);return s&&o?As(s.type,[Ge,Oe,we,Ur,je])?new Ne(s,o):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${at(s.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!dn(i,["boolean","string","number","null"]))throw new ht(`Expected first argument to be of type boolean, string, number or null, but found ${at(At(i))} instead.`);if(!dn(s,["string","array"]))throw new ht(`Expected second argument to be of type array or string, but found ${at(At(s))} instead.`);return s.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Xn{constructor(e,i,s){this.type=we,this.needle=e,this.haystack=i,this.fromIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const s=i.parse(e[1],1,je),o=i.parse(e[2],2,je);if(!s||!o)return null;if(!As(s.type,[Ge,Oe,we,Ur,je]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${at(s.type)} instead`);if(e.length===4){const l=i.parse(e[3],3,we);return l?new Xn(s,o,l):null}return new Xn(s,o)}evaluate(e){const i=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!dn(i,["boolean","string","number","null"]))throw new ht(`Expected first argument to be of type boolean, string, number or null, but found ${at(At(i))} instead.`);let o;if(this.fromIndex&&(o=this.fromIndex.evaluate(e)),dn(s,["string"])){const l=s.indexOf(i,o);return l===-1?-1:[...s.slice(0,l)].length}if(dn(s,["array"]))return s.indexOf(i,o);throw new ht(`Expected second argument to be of type array or string, but found ${at(At(s))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Ke{constructor(e,i,s,o,l,u){this.inputType=e,this.type=i,this.input=s,this.cases=o,this.outputs=l,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let s,o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);const l={},u=[];for(let m=2;m<e.length-1;m+=2){let v=e[m];const _=e[m+1];Array.isArray(v)||(v=[v]);const T=i.concat(m);if(v.length===0)return T.error("Expected at least one branch label.");for(const I of v){if(typeof I!="number"&&typeof I!="string")return T.error("Branch labels must be numbers or strings.");if(typeof I=="number"&&Math.abs(I)>Number.MAX_SAFE_INTEGER)return T.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof I=="number"&&Math.floor(I)!==I)return T.error("Numeric branch labels must be integer values.");if(s){if(T.checkSubtype(s,At(I)))return null}else s=At(I);if(l[String(I)]!==void 0)return T.error("Branch labels must be unique.");l[String(I)]=u.length}const b=i.parse(_,m,o);if(!b)return null;o=o||b.type,u.push(b)}const p=i.parse(e[1],1,je);if(!p)return null;const g=i.parse(e[e.length-1],e.length-1,o);return g?p.type.kind!=="value"&&i.concat(1).checkSubtype(s,p.type)?null:new Ke(s,o,p,l,u,g):null}evaluate(e){const i=this.input.evaluate(e);return(At(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class lr{constructor(e,i,s){this.type=e,this.branches=i,this.otherwise=s}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);const o=[];for(let u=1;u<e.length-1;u+=2){const p=i.parse(e[u],u,Ge);if(!p)return null;const g=i.parse(e[u+1],u+1,s);if(!g)return null;o.push([p,g]),s=s||g.type}const l=i.parse(e[e.length-1],e.length-1,s);if(!l)return null;if(!s)throw new Error("Can't infer output type");return new lr(s,o,l)}evaluate(e){for(const[i,s]of this.branches)if(i.evaluate(e))return s.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[i,s]of this.branches)e(i),e(s);e(this.otherwise)}outputDefined(){return this.branches.every((([e,i])=>i.outputDefined()))&&this.otherwise.outputDefined()}}class Yn{constructor(e,i,s,o){this.type=e,this.input=i,this.beginIndex=s,this.endIndex=o}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const s=i.parse(e[1],1,je),o=i.parse(e[2],2,we);if(!s||!o)return null;if(!As(s.type,[oi(je),Oe,je]))return i.error(`Expected first argument to be of type array or string, but found ${at(s.type)} instead`);if(e.length===4){const l=i.parse(e[3],3,we);return l?new Yn(s.type,s,o,l):null}return new Yn(s.type,s,o)}evaluate(e){const i=this.input.evaluate(e),s=this.beginIndex.evaluate(e);let o;if(this.endIndex&&(o=this.endIndex.evaluate(e)),dn(i,["string"]))return[...i].slice(s,o).join("");if(dn(i,["array"]))return i.slice(s,o);throw new ht(`Expected first argument to be of type array or string, but found ${at(At(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function _n(r,e){const i=r.length-1;let s,o,l=0,u=i,p=0;for(;l<=u;)if(p=Math.floor((l+u)/2),s=r[p],o=r[p+1],s<=e){if(p===i||e<o)return p;l=p+1}else{if(!(s>e))throw new ht("Input is not a number.");u=p-1}return 0}class Kn{constructor(e,i,s){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[o,l]of s)this.labels.push(o),this.outputs.push(l)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const s=i.parse(e[1],1,we);if(!s)return null;const o=[];let l=null;i.expectedType&&i.expectedType.kind!=="value"&&(l=i.expectedType);for(let u=1;u<e.length;u+=2){const p=u===1?-1/0:e[u],g=e[u+1],m=u,v=u+1;if(typeof p!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',m);if(o.length&&o[o.length-1][0]>=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',m);const _=i.parse(g,v,l);if(!_)return null;l=l||_.type,o.push([p,_])}return new Kn(l,s,o)}evaluate(e){const i=this.labels,s=this.outputs;if(i.length===1)return s[0].evaluate(e);const o=this.input.evaluate(e);if(o<=i[0])return s[0].evaluate(e);const l=i.length;return o>=i[l-1]?s[l-1].evaluate(e):s[_n(i,o)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Qa(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Eo,Tc,Sc=(function(){if(Tc)return Eo;function r(e,i,s,o){this.cx=3*e,this.bx=3*(s-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(o-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=s,this.p2y=o}return Tc=1,Eo=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var s=e,o=0;o<8;o++){var l=this.sampleCurveX(s)-e;if(Math.abs(l)<i)return s;var u=this.sampleCurveDerivativeX(s);if(Math.abs(u)<1e-6)break;s-=l/u}var p=0,g=1;for(s=e,o=0;o<20&&(l=this.sampleCurveX(s),!(Math.abs(l-e)<i));o++)e>l?p=s:g=s,s=.5*(g-p)+p;return s},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Eo})(),Pc=Qa(Sc);class Rt{constructor(e,i,s,o,l){this.type=e,this.operator=i,this.interpolation=s,this.input=o,this.labels=[],this.outputs=[];for(const[u,p]of l)this.labels.push(u),this.outputs.push(p)}static interpolationFactor(e,i,s,o){let l=0;if(e.name==="exponential")l=Xt(i,e.base,s,o);else if(e.name==="linear")l=Xt(i,1,s,o);else if(e.name==="cubic-bezier"){const u=e.controlPoints;l=new Pc(u[0],u[1],u[2],u[3]).solve(Xt(i,1,s,o))}return l}static parse(e,i){let[s,o,l,...u]=e;if(!Array.isArray(o)||o.length===0)return i.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){const m=o[1];if(typeof m!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:m}}else{if(o[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const m=o.slice(1);if(m.length!==4||m.some((v=>typeof v!="number"||v<0||v>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:m}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(l=i.parse(l,2,we),!l)return null;const p=[];let g=null;s!=="interpolate-hcl"&&s!=="interpolate-lab"||i.expectedType==Un?i.expectedType&&i.expectedType.kind!=="value"&&(g=i.expectedType):g=Vi;for(let m=0;m<u.length;m+=2){const v=u[m],_=u[m+1],T=m+3,b=m+4;if(typeof v!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',T);if(p.length&&p[p.length-1][0]>=v)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',T);const I=i.parse(_,b,g);if(!I)return null;g=g||I.type,p.push([v,I])}return ar(g,we)||ar(g,bo)||ar(g,Vi)||ar(g,wo)||ar(g,Es)||ar(g,Un)||ar(g,Cs)||ar(g,oi(we))?new Rt(g,s,o,l,p):i.error(`Type ${at(g)} is not interpolatable.`)}evaluate(e){const i=this.labels,s=this.outputs;if(i.length===1)return s[0].evaluate(e);const o=this.input.evaluate(e);if(o<=i[0])return s[0].evaluate(e);const l=i.length;if(o>=i[l-1])return s[l-1].evaluate(e);const u=_n(i,o),p=Rt.interpolationFactor(this.interpolation,o,i[u],i[u+1]),g=s[u].evaluate(e),m=s[u+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Gr(g,m,p);case"color":return Ue.interpolate(g,m,p);case"padding":return di.interpolate(g,m,p);case"colorArray":return Re.interpolate(g,m,p);case"numberArray":return vt.interpolate(g,m,p);case"variableAnchorOffsetCollection":return bi.interpolate(g,m,p);case"array":return qn(g,m,p);case"projectionDefinition":return wi.interpolate(g,m,p)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ue.interpolate(g,m,p,"hcl");case"colorArray":return Re.interpolate(g,m,p,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ue.interpolate(g,m,p,"lab");case"colorArray":return Re.interpolate(g,m,p,"lab")}}}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Xt(r,e,i,s){const o=s-i,l=r-i;return o===0?0:e===1?l/o:(Math.pow(e,l)-1)/(Math.pow(e,o)-1)}const Ni={color:Ue.interpolate,number:Gr,padding:di.interpolate,numberArray:vt.interpolate,colorArray:Re.interpolate,variableAnchorOffsetCollection:bi.interpolate,array:qn};class Rs{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let s=null;const o=i.expectedType;o&&o.kind!=="value"&&(s=o);const l=[];for(const p of e.slice(1)){const g=i.parse(p,1+l.length,s,void 0,{typeAnnotation:"omit"});if(!g)return null;s=s||g.type,l.push(g)}if(!s)throw new Error("No output type");const u=o&&l.some((p=>$n(o,p.type)));return new Rs(u?je:s,l)}evaluate(e){let i,s=null,o=0;for(const l of this.args)if(o++,s=l.evaluate(e),s&&s instanceof ji&&!s.available&&(i||(i=s.name),s=null,o===this.args.length&&(s=i)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function Ls(r,e){return r==="=="||r==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function $t(r,e,i,s){return s.compare(e,i)===0}function yn(r,e,i){const s=r!=="=="&&r!=="!=";return class cm{constructor(l,u,p){this.type=Ge,this.lhs=l,this.rhs=u,this.collator=p,this.hasUntypedArgument=l.type.kind==="value"||u.type.kind==="value"}static parse(l,u){if(l.length!==3&&l.length!==4)return u.error("Expected two or three arguments.");const p=l[0];let g=u.parse(l[1],1,je);if(!g)return null;if(!Ls(p,g.type))return u.concat(1).error(`"${p}" comparisons are not supported for type '${at(g.type)}'.`);let m=u.parse(l[2],2,je);if(!m)return null;if(!Ls(p,m.type))return u.concat(2).error(`"${p}" comparisons are not supported for type '${at(m.type)}'.`);if(g.type.kind!==m.type.kind&&g.type.kind!=="value"&&m.type.kind!=="value")return u.error(`Cannot compare types '${at(g.type)}' and '${at(m.type)}'.`);s&&(g.type.kind==="value"&&m.type.kind!=="value"?g=new ki(m.type,[g]):g.type.kind!=="value"&&m.type.kind==="value"&&(m=new ki(g.type,[m])));let v=null;if(l.length===4){if(g.type.kind!=="string"&&m.type.kind!=="string"&&g.type.kind!=="value"&&m.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(v=u.parse(l[3],3,Is),!v)return null}return new cm(g,m,v)}evaluate(l){const u=this.lhs.evaluate(l),p=this.rhs.evaluate(l);if(s&&this.hasUntypedArgument){const g=At(u),m=At(p);if(g.kind!==m.kind||g.kind!=="string"&&g.kind!=="number")throw new ht(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${g.kind}, ${m.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const g=At(u),m=At(p);if(g.kind!=="string"||m.kind!=="string")return e(l,u,p)}return this.collator?i(l,u,p,this.collator.evaluate(l)):e(l,u,p)}eachChild(l){l(this.lhs),l(this.rhs),this.collator&&l(this.collator)}outputDefined(){return!0}}}const el=yn("==",(function(r,e,i){return e===i}),$t),Ic=yn("!=",(function(r,e,i){return e!==i}),(function(r,e,i,s){return!$t(0,e,i,s)})),qu=yn("<",(function(r,e,i){return e<i}),(function(r,e,i,s){return s.compare(e,i)<0})),Jn=yn(">",(function(r,e,i){return e>i}),(function(r,e,i,s){return s.compare(e,i)>0})),Co=yn("<=",(function(r,e,i){return e<=i}),(function(r,e,i,s){return s.compare(e,i)<=0})),tl=yn(">=",(function(r,e,i){return e>=i}),(function(r,e,i,s){return s.compare(e,i)>=0}));class Ao{constructor(e,i,s){this.type=Is,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return i.error("Collator options argument must be an object.");const o=i.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,Ge);if(!o)return null;const l=i.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,Ge);if(!l)return null;let u=null;return s.locale&&(u=i.parse(s.locale,1,Oe),!u)?null:new Ao(o,l,u)}evaluate(e){return new Ya(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Do{constructor(e,i,s,o,l,u){this.type=Oe,this.number=e,this.locale=i,this.currency=s,this.unit=o,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const s=i.parse(e[1],1,we);if(!s)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return i.error("NumberFormat options argument must be an object.");let l=null;if(o.locale&&(l=i.parse(o.locale,1,Oe),!l))return null;let u=null;if(o.currency&&(u=i.parse(o.currency,1,Oe),!u))return null;let p=null;if(o.unit&&(p=i.parse(o.unit,1,Oe),!p))return null;if(u&&p)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let g=null;if(o["min-fraction-digits"]&&(g=i.parse(o["min-fraction-digits"],1,we),!g))return null;let m=null;return o["max-fraction-digits"]&&(m=i.parse(o["max-fraction-digits"],1,we),!m)?null:new Do(s,l,u,p,g,m)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class vn{constructor(e){this.type=Ms,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return i.error("First argument must be an image or text section.");const o=[];let l=!1;for(let u=1;u<=e.length-1;++u){const p=e[u];if(l&&typeof p=="object"&&!Array.isArray(p)){l=!1;let g=null;if(p["font-scale"]&&(g=i.parse(p["font-scale"],1,we),!g))return null;let m=null;if(p["text-font"]&&(m=i.parse(p["text-font"],1,oi(Oe)),!m))return null;let v=null;if(p["text-color"]&&(v=i.parse(p["text-color"],1,Vi),!v))return null;let _=null;if(p["vertical-align"]){if(typeof p["vertical-align"]=="string"&&!Zu.includes(p["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${p["vertical-align"]}' instead.`);if(_=i.parse(p["vertical-align"],1,Oe),!_)return null}const T=o[o.length-1];T.scale=g,T.font=m,T.textColor=v,T.verticalAlign=_}else{const g=i.parse(e[u],1,je);if(!g)return null;const m=g.type.kind;if(m!=="string"&&m!=="value"&&m!=="null"&&m!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,o.push({content:g,scale:null,font:null,textColor:null,verticalAlign:null})}}return new vn(o)}evaluate(e){return new zi(this.sections.map((i=>{const s=i.content.evaluate(e);return At(s)===Gn?new Ka("",s,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new Ka(fn(s),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)})))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}}class Qn{constructor(e){this.type=Gn,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const s=i.parse(e[1],1,Oe);return s?new Qn(s):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),s=ji.fromString(i);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(i)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class Ui{constructor(e){this.type=we,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=i.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${at(s.type)} instead.`):new Ui(s):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new ht(`Expected value to be of type string or array, but found ${at(At(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const cr=8192;function zo(r,e){const i=(180+r[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(i*o*cr),Math.round(s*o*cr)]}function il(r,e){const i=Math.pow(2,e.z);return[(o=(r[0]/cr+e.x)/i,360*o-180),(s=(r[1]/cr+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90)];var s,o}function xn(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}function Fs(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}function Wu(r,e,i){const s=r[0]-e[0],o=r[1]-e[1],l=r[0]-i[0],u=r[1]-i[1];return s*u-l*o==0&&s*l<=0&&o*u<=0}function ko(r,e,i,s){return(o=[s[0]-i[0],s[1]-i[1]])[0]*(l=[e[0]-r[0],e[1]-r[1]])[1]-o[1]*l[0]!=0&&!(!Ec(r,e,i,s)||!Ec(i,s,r,e));var o,l}function Hu(r,e,i){for(const s of i)for(let o=0;o<s.length-1;++o)if(ko(r,e,s[o],s[o+1]))return!0;return!1}function Pr(r,e,i=!1){let s=!1;for(const p of e)for(let g=0;g<p.length-1;g++){if(Wu(r,p[g],p[g+1]))return i;(l=p[g])[1]>(o=r)[1]!=(u=p[g+1])[1]>o[1]&&o[0]<(u[0]-l[0])*(o[1]-l[1])/(u[1]-l[1])+l[0]&&(s=!s)}var o,l,u;return s}function Xu(r,e){for(const i of e)if(Pr(r,i))return!0;return!1}function rl(r,e){for(const i of r)if(!Pr(i,e))return!1;for(let i=0;i<r.length-1;++i)if(Hu(r[i],r[i+1],e))return!1;return!0}function Mc(r,e){for(const i of e)if(rl(r,i))return!0;return!1}function Ec(r,e,i,s){const o=s[0]-i[0],l=s[1]-i[1],u=(r[0]-i[0])*l-o*(r[1]-i[1]),p=(e[0]-i[0])*l-o*(e[1]-i[1]);return u>0&&p<0||u<0&&p>0}function Ro(r,e,i){const s=[];for(let o=0;o<r.length;o++){const l=[];for(let u=0;u<r[o].length;u++){const p=zo(r[o][u],i);xn(e,p),l.push(p)}s.push(l)}return s}function Cc(r,e,i){const s=[];for(let o=0;o<r.length;o++){const l=Ro(r[o],e,i);s.push(l)}return s}function Ac(r,e,i,s){if(r[0]<i[0]||r[0]>i[2]){const o=.5*s;let l=r[0]-i[0]>o?-s:i[0]-r[0]>o?s:0;l===0&&(l=r[0]-i[2]>o?-s:i[2]-r[0]>o?s:0),r[0]+=l}xn(e,r)}function Dc(r,e,i,s){const o=Math.pow(2,s.z)*cr,l=[s.x*cr,s.y*cr],u=[];for(const p of r)for(const g of p){const m=[g.x+l[0],g.y+l[1]];Ac(m,e,i,o),u.push(m)}return u}function zc(r,e,i,s){const o=Math.pow(2,s.z)*cr,l=[s.x*cr,s.y*cr],u=[];for(const g of r){const m=[];for(const v of g){const _=[v.x+l[0],v.y+l[1]];xn(e,_),m.push(_)}u.push(m)}if(e[2]-e[0]<=o/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const g of u)for(const m of g)Ac(m,e,i,o)}var p;return u}class bn{constructor(e,i){this.type=Ge,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Zr(e[1])){const s=e[1];if(s.type==="FeatureCollection"){const o=[];for(const l of s.features){const{type:u,coordinates:p}=l.geometry;u==="Polygon"&&o.push(p),u==="MultiPolygon"&&o.push(...p)}if(o.length)return new bn(s,{type:"MultiPolygon",coordinates:o})}else if(s.type==="Feature"){const o=s.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new bn(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new bn(s,s)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,s){const o=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(s.type==="Polygon"){const p=Ro(s.coordinates,l,u),g=Dc(i.geometry(),o,l,u);if(!Fs(o,l))return!1;for(const m of g)if(!Pr(m,p))return!1}if(s.type==="MultiPolygon"){const p=Cc(s.coordinates,l,u),g=Dc(i.geometry(),o,l,u);if(!Fs(o,l))return!1;for(const m of g)if(!Xu(m,p))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,s){const o=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(s.type==="Polygon"){const p=Ro(s.coordinates,l,u),g=zc(i.geometry(),o,l,u);if(!Fs(o,l))return!1;for(const m of g)if(!rl(m,p))return!1}if(s.type==="MultiPolygon"){const p=Cc(s.coordinates,l,u),g=zc(i.geometry(),o,l,u);if(!Fs(o,l))return!1;for(const m of g)if(!Mc(m,p))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let nl=class{constructor(r=[],e=(i,s)=>i<s?-1:i>s?1:0){if(this.data=r,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:e,compare:i}=this,s=e[r];for(;r>0;){const o=r-1>>1,l=e[o];if(i(s,l)>=0)break;e[r]=l,r=o}e[r]=s}_down(r){const{data:e,compare:i}=this,s=this.length>>1,o=e[r];for(;r<s;){let l=1+(r<<1);const u=l+1;if(u<this.length&&i(e[u],e[l])<0&&(l=u),i(e[l],o)>=0)break;e[r]=e[l],r=l}e[r]=o}};function sl(r,e,i=0,s=r.length-1,o=Yu){for(;s>i;){if(s-i>600){const g=s-i+1,m=e-i+1,v=Math.log(g),_=.5*Math.exp(2*v/3),T=.5*Math.sqrt(v*_*(g-_)/g)*(m-g/2<0?-1:1);sl(r,e,Math.max(i,Math.floor(e-m*_/g+T)),Math.min(s,Math.floor(e+(g-m)*_/g+T)),o)}const l=r[e];let u=i,p=s;for(es(r,i,e),o(r[s],l)>0&&es(r,i,s);u<p;){for(es(r,u,p),u++,p--;o(r[u],l)<0;)u++;for(;o(r[p],l)>0;)p--}o(r[i],l)===0?es(r,i,p):(p++,es(r,p,s)),p<=e&&(i=p+1),e<=p&&(s=p-1)}}function es(r,e,i){const s=r[e];r[e]=r[i],r[i]=s}function Yu(r,e){return r<e?-1:r>e?1:0}function Lo(r,e){if(r.length<=1)return[r];const i=[];let s,o;for(const l of r){const u=Ju(l);u!==0&&(l.area=Math.abs(u),o===void 0&&(o=u<0),o===u<0?(s&&i.push(s),s=[l]):s.push(l))}if(s&&i.push(s),e>1)for(let l=0;l<i.length;l++)i[l].length<=e||(sl(i[l],e,1,i[l].length-1,Ku),i[l]=i[l].slice(0,e));return i}function Ku(r,e){return e.area-r.area}function Ju(r){let e=0;for(let i,s,o=0,l=r.length,u=l-1;o<l;u=o++)i=r[o],s=r[u],e+=(s.x-i.x)*(i.y+s.y);return e}const Bs=1/298.257223563,kc=Bs*(2-Bs),Rc=Math.PI/180;class ol{constructor(e){const i=6378.137*Rc*1e3,s=Math.cos(e*Rc),o=1/(1-kc*(1-s*s)),l=Math.sqrt(o);this.kx=i*l*s,this.ky=i*l*o*(1-kc)}distance(e,i){const s=this.wrap(e[0]-i[0])*this.kx,o=(e[1]-i[1])*this.ky;return Math.sqrt(s*s+o*o)}pointOnLine(e,i){let s,o,l,u,p=1/0;for(let g=0;g<e.length-1;g++){let m=e[g][0],v=e[g][1],_=this.wrap(e[g+1][0]-m)*this.kx,T=(e[g+1][1]-v)*this.ky,b=0;_===0&&T===0||(b=(this.wrap(i[0]-m)*this.kx*_+(i[1]-v)*this.ky*T)/(_*_+T*T),b>1?(m=e[g+1][0],v=e[g+1][1]):b>0&&(m+=_/this.kx*b,v+=T/this.ky*b)),_=this.wrap(i[0]-m)*this.kx,T=(i[1]-v)*this.ky;const I=_*_+T*T;I<p&&(p=I,s=m,o=v,l=g,u=b)}return{point:[s,o],index:l,t:Math.max(0,Math.min(1,u))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Lc(r,e){return e[0]-r[0]}function ts(r){return r[1]-r[0]+1}function gr(r,e){return r[1]>=r[0]&&r[1]<e}function al(r,e){if(r[0]>r[1])return[null,null];const i=ts(r);if(e){if(i===2)return[r,null];const o=Math.floor(i/2);return[[r[0],r[0]+o],[r[0]+o,r[1]]]}if(i===1)return[r,null];const s=Math.floor(i/2)-1;return[[r[0],r[0]+s],[r[0]+s+1,r[1]]]}function ll(r,e){if(!gr(e,r.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let s=e[0];s<=e[1];++s)xn(i,r[s]);return i}function Fo(r){const e=[1/0,1/0,-1/0,-1/0];for(const i of r)for(const s of i)xn(e,s);return e}function cl(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function ul(r,e,i){if(!cl(r)||!cl(e))return NaN;let s=0,o=0;return r[2]<e[0]&&(s=e[0]-r[2]),r[0]>e[2]&&(s=r[0]-e[2]),r[1]>e[3]&&(o=r[1]-e[3]),r[3]<e[1]&&(o=e[1]-r[3]),i.distance([0,0],[s,o])}function wn(r,e,i){const s=i.pointOnLine(e,r);return i.distance(r,s.point)}function hl(r,e,i,s,o){const l=Math.min(wn(r,[i,s],o),wn(e,[i,s],o)),u=Math.min(wn(i,[r,e],o),wn(s,[r,e],o));return Math.min(l,u)}function Fc(r,e,i,s,o){if(!gr(e,r.length)||!gr(s,i.length))return 1/0;let l=1/0;for(let u=e[0];u<e[1];++u){const p=r[u],g=r[u+1];for(let m=s[0];m<s[1];++m){const v=i[m],_=i[m+1];if(ko(p,g,v,_))return 0;l=Math.min(l,hl(p,g,v,_,o))}}return l}function Qu(r,e,i,s,o){if(!gr(e,r.length)||!gr(s,i.length))return NaN;let l=1/0;for(let u=e[0];u<=e[1];++u)for(let p=s[0];p<=s[1];++p)if(l=Math.min(l,o.distance(r[u],i[p])),l===0)return l;return l}function eh(r,e,i){if(Pr(r,e,!0))return 0;let s=1/0;for(const o of e){const l=o[0],u=o[o.length-1];if(l!==u&&(s=Math.min(s,wn(r,[u,l],i)),s===0))return s;const p=i.pointOnLine(o,r);if(s=Math.min(s,i.distance(r,p.point)),s===0)return s}return s}function th(r,e,i,s){if(!gr(e,r.length))return NaN;for(let l=e[0];l<=e[1];++l)if(Pr(r[l],i,!0))return 0;let o=1/0;for(let l=e[0];l<e[1];++l){const u=r[l],p=r[l+1];for(const g of i)for(let m=0,v=g.length,_=v-1;m<v;_=m++){const T=g[_],b=g[m];if(ko(u,p,T,b))return 0;o=Math.min(o,hl(u,p,T,b,s))}}return o}function Bc(r,e){for(const i of r)for(const s of i)if(Pr(s,e,!0))return!0;return!1}function nt(r,e,i,s=1/0){const o=Fo(r),l=Fo(e);if(s!==1/0&&ul(o,l,i)>=s)return s;if(Fs(o,l)){if(Bc(r,e))return 0}else if(Bc(e,r))return 0;let u=1/0;for(const p of r)for(let g=0,m=p.length,v=m-1;g<m;v=g++){const _=p[v],T=p[g];for(const b of e)for(let I=0,M=b.length,A=M-1;I<M;A=I++){const D=b[A],L=b[I];if(ko(_,T,D,L))return 0;u=Math.min(u,hl(_,T,D,L,i))}}return u}function Oc(r,e,i,s,o,l){if(!l)return;const u=ul(ll(s,l),o,i);u<e&&r.push([u,l,[0,0]])}function Bo(r,e,i,s,o,l,u){if(!l||!u)return;const p=ul(ll(s,l),ll(o,u),i);p<e&&r.push([p,l,u])}function Oo(r,e,i,s,o=1/0){let l=Math.min(s.distance(r[0],i[0][0]),o);if(l===0)return l;const u=new nl([[0,[0,r.length-1],[0,0]]],Lc),p=Fo(i);for(;u.length>0;){const g=u.pop();if(g[0]>=l)continue;const m=g[1],v=e?50:100;if(ts(m)<=v){if(!gr(m,r.length))return NaN;if(e){const _=th(r,m,i,s);if(isNaN(_)||_===0)return _;l=Math.min(l,_)}else for(let _=m[0];_<=m[1];++_){const T=eh(r[_],i,s);if(l=Math.min(l,T),l===0)return 0}}else{const _=al(m,e);Oc(u,l,s,r,p,_[0]),Oc(u,l,s,r,p,_[1])}}return l}function Vo(r,e,i,s,o,l=1/0){let u=Math.min(l,o.distance(r[0],i[0]));if(u===0)return u;const p=new nl([[0,[0,r.length-1],[0,i.length-1]]],Lc);for(;p.length>0;){const g=p.pop();if(g[0]>=u)continue;const m=g[1],v=g[2],_=e?50:100,T=s?50:100;if(ts(m)<=_&&ts(v)<=T){if(!gr(m,r.length)&&gr(v,i.length))return NaN;let b;if(e&&s)b=Fc(r,m,i,v,o),u=Math.min(u,b);else if(e&&!s){const I=r.slice(m[0],m[1]+1);for(let M=v[0];M<=v[1];++M)if(b=wn(i[M],I,o),u=Math.min(u,b),u===0)return u}else if(!e&&s){const I=i.slice(v[0],v[1]+1);for(let M=m[0];M<=m[1];++M)if(b=wn(r[M],I,o),u=Math.min(u,b),u===0)return u}else b=Qu(r,m,i,v,o),u=Math.min(u,b)}else{const b=al(m,e),I=al(v,s);Bo(p,u,o,r,i,b[0],I[0]),Bo(p,u,o,r,i,b[0],I[1]),Bo(p,u,o,r,i,b[1],I[0]),Bo(p,u,o,r,i,b[1],I[1])}}return u}function dl(r){return r.type==="MultiPolygon"?r.coordinates.map((e=>({type:"Polygon",coordinates:e}))):r.type==="MultiLineString"?r.coordinates.map((e=>({type:"LineString",coordinates:e}))):r.type==="MultiPoint"?r.coordinates.map((e=>({type:"Point",coordinates:e}))):[r]}class Tn{constructor(e,i){this.type=we,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Zr(e[1])){const s=e[1];if(s.type==="FeatureCollection")return new Tn(s,s.features.map((o=>dl(o.geometry))).flat());if(s.type==="Feature")return new Tn(s,dl(s.geometry));if("type"in s&&"coordinates"in s)return new Tn(s,dl(s))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,s){const o=i.geometry(),l=o.flat().map((g=>il([g.x,g.y],i.canonical)));if(o.length===0)return NaN;const u=new ol(l[0][1]);let p=1/0;for(const g of s){switch(g.type){case"Point":p=Math.min(p,Vo(l,!1,[g.coordinates],!1,u,p));break;case"LineString":p=Math.min(p,Vo(l,!1,g.coordinates,!0,u,p));break;case"Polygon":p=Math.min(p,Oo(l,!1,g.coordinates,u,p))}if(p===0)return p}return p})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,s){const o=i.geometry(),l=o.flat().map((g=>il([g.x,g.y],i.canonical)));if(o.length===0)return NaN;const u=new ol(l[0][1]);let p=1/0;for(const g of s){switch(g.type){case"Point":p=Math.min(p,Vo(l,!0,[g.coordinates],!1,u,p));break;case"LineString":p=Math.min(p,Vo(l,!0,g.coordinates,!0,u,p));break;case"Polygon":p=Math.min(p,Oo(l,!0,g.coordinates,u,p))}if(p===0)return p}return p})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(i,s){const o=i.geometry();if(o.length===0||o[0].length===0)return NaN;const l=Lo(o,0).map((g=>g.map((m=>m.map((v=>il([v.x,v.y],i.canonical))))))),u=new ol(l[0][0][0][1]);let p=1/0;for(const g of s)for(const m of l){switch(g.type){case"Point":p=Math.min(p,Oo([g.coordinates],!1,m,u,p));break;case"LineString":p=Math.min(p,Oo(g.coordinates,!0,m,u,p));break;case"Polygon":p=Math.min(p,nt(m,g.coordinates,u,p))}if(p===0)return p}return p})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Os{constructor(e){this.type=je,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=e[1];return s==null?i.error("Global state property must be defined."):typeof s!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Os(s)}evaluate(e){var i;const s=(i=e.globals)===null||i===void 0?void 0:i.globalState;return s&&Object.keys(s).length!==0?zs(s,this.key):null}eachChild(){}outputDefined(){return!1}}const is={"==":el,"!=":Ic,">":Jn,"<":qu,">=":tl,"<=":Co,array:ki,at:Ye,boolean:ki,case:lr,coalesce:Rs,collator:Ao,format:vn,image:Qn,in:Ne,"index-of":Xn,interpolate:Rt,"interpolate-hcl":Rt,"interpolate-lab":Rt,length:Ui,let:dt,literal:mr,match:Ke,number:ki,"number-format":Do,object:ki,slice:Yn,step:Kn,string:ki,"to-boolean":Sr,"to-color":Sr,"to-number":Sr,"to-string":Sr,var:Hn,within:bn,distance:Tn,"global-state":Os};class Ki{constructor(e,i,s,o){this.name=e,this.type=i,this._evaluate=s,this.args=o}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){const s=e[0],o=Ki.definitions[s];if(!o)return i.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const l=Array.isArray(o)?o[0]:o.type,u=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,p=u.filter((([m])=>!Array.isArray(m)||m.length===e.length-1));let g=null;for(const[m,v]of p){g=new gn(i.registry,jo,i.path,null,i.scope);const _=[];let T=!1;for(let b=1;b<e.length;b++){const I=e[b],M=Array.isArray(m)?m[b-1]:m.type,A=g.parse(I,1+_.length,M);if(!A){T=!0;break}_.push(A)}if(!T)if(Array.isArray(m)&&m.length!==_.length)g.error(`Expected ${m.length} arguments, but found ${_.length} instead.`);else{for(let b=0;b<_.length;b++){const I=Array.isArray(m)?m[b]:m.type,M=_[b];g.concat(b+1).checkSubtype(I,M.type)}if(g.errors.length===0)return new Ki(s,l,v,_)}}if(p.length===1)i.errors.push(...g.errors);else{const m=(p.length?p:u).map((([_])=>{return T=_,Array.isArray(T)?`(${T.map(at).join(", ")})`:`(${at(T.type)}...)`;var T})).join(" | "),v=[];for(let _=1;_<e.length;_++){const T=i.parse(e[_],1+v.length);if(!T)return null;v.push(at(T.type))}i.error(`Expected arguments of type ${m}, but found (${v.join(", ")}) instead.`)}return null}static register(e,i){Ki.definitions=i;for(const s in i)e[s]=Ki}}function Vc(r,[e,i,s,o]){e=e.evaluate(r),i=i.evaluate(r),s=s.evaluate(r);const l=o?o.evaluate(r):1,u=Wn(e,i,s,l);if(u)throw new ht(u);return new Ue(e/255,i/255,s/255,l,!1)}function jc(r,e){return r in e}function pl(r,e){const i=e[r];return i===void 0?null:i}function Sn(r){return{type:r}}function jo(r){if(r instanceof Hn)return jo(r.boundExpression);if(r instanceof Ki&&r.name==="error"||r instanceof Ao||r instanceof bn||r instanceof Tn||r instanceof Os)return!1;const e=r instanceof Sr||r instanceof ki;let i=!0;return r.eachChild((s=>{i=e?i&&jo(s):i&&s instanceof mr})),!!i&&No(r)&&Uo(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function No(r){if(r instanceof Ki&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof bn||r instanceof Tn)return!1;let e=!0;return r.eachChild((i=>{e&&!No(i)&&(e=!1)})),e}function Vs(r){if(r instanceof Ki&&r.name==="feature-state")return!1;let e=!0;return r.eachChild((i=>{e&&!Vs(i)&&(e=!1)})),e}function Uo(r,e){if(r instanceof Ki&&e.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild((s=>{i&&!Uo(s,e)&&(i=!1)})),i}function Nc(r){return{result:"success",value:r}}function rs(r){return{result:"error",value:r}}function ns(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function Uc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function fl(r){return!!r.expression&&r.expression.interpolated}function $e(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Go(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&At(r)===Tr}function ih(r){return r}function Gc(r,e){const i=r.stops&&typeof r.stops[0][0]=="object",s=i||!(i||r.property!==void 0),o=r.type||(fl(e)?"exponential":"interval"),l=(function(v){switch(v.type){case"color":return Ue.parse;case"padding":return di.parse;case"numberArray":return vt.parse;case"colorArray":return Re.parse;default:return null}})(e);if(l&&((r=hn({},r)).stops&&(r.stops=r.stops.map((v=>[v[0],l(v[1])]))),r.default=l(r.default?r.default:e.default)),r.colorSpace&&(u=r.colorSpace)!=="rgb"&&u!=="hcl"&&u!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var u;const p=(function(v){switch(v){case"exponential":return $c;case"interval":return nh;case"categorical":return rh;case"identity":return sh;default:throw new Error(`Unknown function type "${v}"`)}})(o);let g,m;if(o==="categorical"){g=Object.create(null);for(const v of r.stops)g[v[0]]=v[1];m=typeof r.stops[0][0]}if(i){const v={},_=[];for(let I=0;I<r.stops.length;I++){const M=r.stops[I],A=M[0].zoom;v[A]===void 0&&(v[A]={zoom:A,type:r.type,property:r.property,default:r.default,stops:[]},_.push(A)),v[A].stops.push([M[0].value,M[1]])}const T=[];for(const I of _)T.push([v[I].zoom,Gc(v[I],e)]);const b={name:"linear"};return{kind:"composite",interpolationType:b,interpolationFactor:Rt.interpolationFactor.bind(void 0,b),zoomStops:T.map((I=>I[0])),evaluate:({zoom:I},M)=>$c({stops:T,base:r.base},e,I).evaluate(I,M)}}if(s){const v=o==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:Rt.interpolationFactor.bind(void 0,v),zoomStops:r.stops.map((_=>_[0])),evaluate:({zoom:_})=>p(r,e,_,g,m)}}return{kind:"source",evaluate(v,_){const T=_&&_.properties?_.properties[r.property]:void 0;return T===void 0?js(r.default,e.default):p(r,e,T,g,m)}}}function js(r,e,i){return r!==void 0?r:e!==void 0?e:i!==void 0?i:void 0}function rh(r,e,i,s,o){return js(typeof i===o?s[i]:void 0,r.default,e.default)}function nh(r,e,i){if($e(i)!=="number")return js(r.default,e.default);const s=r.stops.length;if(s===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[s-1][0])return r.stops[s-1][1];const o=_n(r.stops.map((l=>l[0])),i);return r.stops[o][1]}function $c(r,e,i){const s=r.base!==void 0?r.base:1;if($e(i)!=="number")return js(r.default,e.default);const o=r.stops.length;if(o===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[o-1][0])return r.stops[o-1][1];const l=_n(r.stops.map((v=>v[0])),i),u=(function(v,_,T,b){const I=b-T,M=v-T;return I===0?0:_===1?M/I:(Math.pow(_,M)-1)/(Math.pow(_,I)-1)})(i,s,r.stops[l][0],r.stops[l+1][0]),p=r.stops[l][1],g=r.stops[l+1][1],m=Ni[e.type]||ih;return typeof p.evaluate=="function"?{evaluate(...v){const _=p.evaluate.apply(void 0,v),T=g.evaluate.apply(void 0,v);if(_!==void 0&&T!==void 0)return m(_,T,u,r.colorSpace)}}:m(p,g,u,r.colorSpace)}function sh(r,e,i){switch(e.type){case"color":i=Ue.parse(i);break;case"formatted":i=zi.fromString(i.toString());break;case"resolvedImage":i=ji.fromString(i.toString());break;case"padding":i=di.parse(i);break;case"colorArray":i=Re.parse(i);break;case"numberArray":i=vt.parse(i);break;default:$e(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return js(i,r.default,e.default)}Ki.register(is,{error:[{kind:"error"},[Oe],(r,[e])=>{throw new ht(e.evaluate(r))}],typeof:[Oe,[je],(r,[e])=>at(At(e.evaluate(r)))],"to-rgba":[oi(we,4),[Vi],(r,[e])=>{const[i,s,o,l]=e.evaluate(r).rgb;return[255*i,255*s,255*o,l]}],rgb:[Vi,[we,we,we],Vc],rgba:[Vi,[we,we,we,we],Vc],has:{type:Ge,overloads:[[[Oe],(r,[e])=>jc(e.evaluate(r),r.properties())],[[Oe,Tr],(r,[e,i])=>jc(e.evaluate(r),i.evaluate(r))]]},get:{type:je,overloads:[[[Oe],(r,[e])=>pl(e.evaluate(r),r.properties())],[[Oe,Tr],(r,[e,i])=>pl(e.evaluate(r),i.evaluate(r))]]},"feature-state":[je,[Oe],(r,[e])=>pl(e.evaluate(r),r.featureState||{})],properties:[Tr,[],r=>r.properties()],"geometry-type":[Oe,[],r=>r.geometryType()],id:[je,[],r=>r.id()],zoom:[we,[],r=>r.globals.zoom],"heatmap-density":[we,[],r=>r.globals.heatmapDensity||0],elevation:[we,[],r=>r.globals.elevation||0],"line-progress":[we,[],r=>r.globals.lineProgress||0],accumulated:[je,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[we,Sn(we),(r,e)=>{let i=0;for(const s of e)i+=s.evaluate(r);return i}],"*":[we,Sn(we),(r,e)=>{let i=1;for(const s of e)i*=s.evaluate(r);return i}],"-":{type:we,overloads:[[[we,we],(r,[e,i])=>e.evaluate(r)-i.evaluate(r)],[[we],(r,[e])=>-e.evaluate(r)]]},"/":[we,[we,we],(r,[e,i])=>e.evaluate(r)/i.evaluate(r)],"%":[we,[we,we],(r,[e,i])=>e.evaluate(r)%i.evaluate(r)],ln2:[we,[],()=>Math.LN2],pi:[we,[],()=>Math.PI],e:[we,[],()=>Math.E],"^":[we,[we,we],(r,[e,i])=>Math.pow(e.evaluate(r),i.evaluate(r))],sqrt:[we,[we],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[we,[we],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[we,[we],(r,[e])=>Math.log(e.evaluate(r))],log2:[we,[we],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[we,[we],(r,[e])=>Math.sin(e.evaluate(r))],cos:[we,[we],(r,[e])=>Math.cos(e.evaluate(r))],tan:[we,[we],(r,[e])=>Math.tan(e.evaluate(r))],asin:[we,[we],(r,[e])=>Math.asin(e.evaluate(r))],acos:[we,[we],(r,[e])=>Math.acos(e.evaluate(r))],atan:[we,[we],(r,[e])=>Math.atan(e.evaluate(r))],min:[we,Sn(we),(r,e)=>Math.min(...e.map((i=>i.evaluate(r))))],max:[we,Sn(we),(r,e)=>Math.max(...e.map((i=>i.evaluate(r))))],abs:[we,[we],(r,[e])=>Math.abs(e.evaluate(r))],round:[we,[we],(r,[e])=>{const i=e.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[we,[we],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[we,[we],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[Ge,[Oe,je],(r,[e,i])=>r.properties()[e.value]===i.value],"filter-id-==":[Ge,[je],(r,[e])=>r.id()===e.value],"filter-type-==":[Ge,[Oe],(r,[e])=>r.geometryType()===e.value],"filter-<":[Ge,[Oe,je],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s<o}],"filter-id-<":[Ge,[je],(r,[e])=>{const i=r.id(),s=e.value;return typeof i==typeof s&&i<s}],"filter->":[Ge,[Oe,je],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s>o}],"filter-id->":[Ge,[je],(r,[e])=>{const i=r.id(),s=e.value;return typeof i==typeof s&&i>s}],"filter-<=":[Ge,[Oe,je],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s<=o}],"filter-id-<=":[Ge,[je],(r,[e])=>{const i=r.id(),s=e.value;return typeof i==typeof s&&i<=s}],"filter->=":[Ge,[Oe,je],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s>=o}],"filter-id->=":[Ge,[je],(r,[e])=>{const i=r.id(),s=e.value;return typeof i==typeof s&&i>=s}],"filter-has":[Ge,[je],(r,[e])=>e.value in r.properties()],"filter-has-id":[Ge,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ge,[oi(Oe)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ge,[oi(je)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[Ge,[Oe,oi(je)],(r,[e,i])=>i.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[Ge,[Oe,oi(je)],(r,[e,i])=>(function(s,o,l,u){for(;l<=u;){const p=l+u>>1;if(o[p]===s)return!0;o[p]>s?u=p-1:l=p+1}return!1})(r.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Ge,overloads:[[[Ge,Ge],(r,[e,i])=>e.evaluate(r)&&i.evaluate(r)],[Sn(Ge),(r,e)=>{for(const i of e)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ge,overloads:[[[Ge,Ge],(r,[e,i])=>e.evaluate(r)||i.evaluate(r)],[Sn(Ge),(r,e)=>{for(const i of e)if(i.evaluate(r))return!0;return!1}]]},"!":[Ge,[Ge],(r,[e])=>!e.evaluate(r)],"is-supported-script":[Ge,[Oe],(r,[e])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(e.evaluate(r))}],upcase:[Oe,[Oe],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[Oe,[Oe],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[Oe,Sn(je),(r,e)=>e.map((i=>fn(i.evaluate(r)))).join("")],split:[oi(Oe),[Oe,Oe],(r,[e,i])=>e.evaluate(r).split(i.evaluate(r))],join:[Oe,[oi(Oe),Oe],(r,[e,i])=>e.evaluate(r).join(i.evaluate(r))],"resolved-locale":[Oe,[Is],(r,[e])=>e.evaluate(r).resolvedLocale()]});class Ns{constructor(e,i,s){this.expression=e,this._warningHistory={},this._evaluator=new Ja,this._defaultValue=i?(function(o){if(o.type==="color"&&Go(o.default))return new Ue(0,0,0,0);switch(o.type){case"color":return Ue.parse(o.default)||null;case"padding":return di.parse(o.default)||null;case"numberArray":return vt.parse(o.default)||null;case"colorArray":return Re.parse(o.default)||null;case"variableAnchorOffsetCollection":return bi.parse(o.default)||null;case"projectionDefinition":return wi.parse(o.default)||null;default:return o.default===void 0?null:o.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=s}evaluateWithoutErrorHandling(e,i,s,o,l,u){return this._globalState&&(e=os(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=s,this._evaluator.canonical=o,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=u,this.expression.evaluate(this._evaluator)}evaluate(e,i,s,o,l,u){this._globalState&&(e=os(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=s||null,this._evaluator.canonical=o,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=u||null;try{const p=this.expression.evaluate(this._evaluator);if(p==null||typeof p=="number"&&p!=p)return this._defaultValue;if(this._enumValues&&!(p in this._enumValues))throw new ht(`Expected value to be one of ${Object.keys(this._enumValues).map((g=>JSON.stringify(g))).join(", ")}, but found ${JSON.stringify(p)} instead.`);return p}catch(p){return this._warningHistory[p.message]||(this._warningHistory[p.message]=!0,typeof console<"u"&&console.warn(p.message)),this._defaultValue}}}function $o(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in is}function Us(r,e,i){const s=new gn(is,jo,[],e?(function(l){const u={color:Vi,string:Oe,number:we,enum:Oe,boolean:Ge,formatted:Ms,padding:wo,numberArray:Es,colorArray:Un,projectionDefinition:bo,resolvedImage:Gn,variableAnchorOffsetCollection:Cs};return l.type==="array"?oi(u[l.value]||je,l.length):u[l.type]})(e):void 0),o=s.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?Nc(new Ns(o,e,i)):rs(s.errors)}class Zo{constructor(e,i,s){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Vs(i.expression),this.globalStateRefs=ss(i.expression),this._globalState=s}evaluateWithoutErrorHandling(e,i,s,o,l,u){return this._globalState&&(e=os(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,s,o,l,u)}evaluate(e,i,s,o,l,u){return this._globalState&&(e=os(e,this._globalState)),this._styleExpression.evaluate(e,i,s,o,l,u)}}class qo{constructor(e,i,s,o,l){this.kind=e,this.zoomStops=s,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Vs(i.expression),this.globalStateRefs=ss(i.expression),this.interpolationType=o,this._globalState=l}evaluateWithoutErrorHandling(e,i,s,o,l,u){return this._globalState&&(e=os(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,s,o,l,u)}evaluate(e,i,s,o,l,u){return this._globalState&&(e=os(e,this._globalState)),this._styleExpression.evaluate(e,i,s,o,l,u)}interpolationFactor(e,i,s){return this.interpolationType?Rt.interpolationFactor(this.interpolationType,e,i,s):0}}function Zc(r,e,i){const s=Us(r,e,i);if(s.result==="error")return s;const o=s.value.expression,l=No(o);if(!l&&!ns(e))return rs([new si("","data expressions not supported")]);const u=Uo(o,["zoom"]);if(!u&&!Uc(e))return rs([new si("","zoom expressions not supported")]);const p=Pn(o);return p||u?p instanceof si?rs([p]):p instanceof Rt&&!fl(e)?rs([new si("",'"interpolate" expressions cannot be used with this property')]):Nc(p?new qo(l?"camera":"composite",s.value,p.labels,p instanceof Rt?p.interpolation:void 0,i):new Zo(l?"constant":"source",s.value,i)):rs([new si("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Wo{constructor(e,i){this._parameters=e,this._specification=i,hn(this,Gc(this._parameters,this._specification))}static deserialize(e){return new Wo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Pn(r){let e=null;if(r instanceof dt)e=Pn(r.result);else if(r instanceof Rs){for(const i of r.args)if(e=Pn(i),e)break}else(r instanceof Kn||r instanceof Rt)&&r.input instanceof Ki&&r.input.name==="zoom"&&(e=r);return e instanceof si||r.eachChild((i=>{const s=Pn(i);s instanceof si?e=s:!e&&s?e=new si("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new si("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function ss(r,e=new Set){return r instanceof Os&&e.add(r.key),r.eachChild((i=>{ss(i,e)})),e}function os(r,e){const{zoom:i,heatmapDensity:s,elevation:o,lineProgress:l,isSupportedScript:u,accumulated:p}=r??{};return{zoom:i,heatmapDensity:s,elevation:o,lineProgress:l,isSupportedScript:u,accumulated:p,globalState:e}}function ml(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const e of r.slice(1))if(!ml(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const oh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Gs(r,e){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};ml(r)||(r=$s(r));const i=Us(r,oh,e);if(i.result==="error")throw new Error(i.value.map((s=>`${s.key}: ${s.message}`)).join(", "));return{filter:(s,o,l)=>i.value.evaluate(s,o,{},l),needGeometry:gl(r),getGlobalStateRefs:()=>ss(i.value.expression)}}function ah(r,e){return r<e?-1:r>e?1:0}function gl(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let e=1;e<r.length;e++)if(gl(r[e]))return!0;return!1}function $s(r){if(!r)return!0;const e=r[0];return r.length<=1?e!=="any":e==="=="?_l(r[1],r[2],"=="):e==="!="?Zs(_l(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?_l(r[1],r[2],e):e==="any"?(i=r.slice(1),["any"].concat(i.map($s))):e==="all"?["all"].concat(r.slice(1).map($s)):e==="none"?["all"].concat(r.slice(1).map($s).map(Zs)):e==="in"?qc(r[1],r.slice(2)):e==="!in"?Zs(qc(r[1],r.slice(2))):e==="has"?yl(r[1]):e!=="!has"||Zs(yl(r[1]));var i}function _l(r,e,i){switch(r){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,r,e]}}function qc(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((i=>typeof i!=typeof e[0]))?["filter-in-large",r,["literal",e.sort(ah)]]:["filter-in-small",r,["literal",e]]}}function yl(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Zs(r){return["!",r]}function Ho(r){const e=typeof r;if(e==="number"||e==="boolean"||e==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let o="[";for(const l of r)o+=`${Ho(l)},`;return`${o}]`}const i=Object.keys(r).sort();let s="{";for(let o=0;o<i.length;o++)s+=`${JSON.stringify(i[o])}:${Ho(r[i[o]])},`;return`${s}}`}function lh(r){let e="";for(const i of Na)e+=`/${Ho(r[i])}`;return e}function Wc(r){const e=r.value;return e?[new ye(r.key,e,"constants have been deprecated as of v8")]:[]}function Dt(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function In(r){if(Array.isArray(r))return r.map(In);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const e={};for(const i in r)e[i]=In(r[i]);return e}return Dt(r)}function Ri(r){const e=r.key,i=r.value,s=r.valueSpec||{},o=r.objectElementValidators||{},l=r.style,u=r.styleSpec,p=r.validateSpec;let g=[];const m=$e(i);if(m!=="object")return[new ye(e,i,`object expected, ${m} found`)];for(const v in i){const _=v.split(".")[0],T=zs(s,_)||s["*"];let b;if(zs(o,_))b=o[_];else if(zs(s,_)){if(i[v]===void 0)continue;b=p}else if(o["*"])b=o["*"];else{if(!s["*"]){g.push(new ye(e,i[v],`unknown property "${v}"`));continue}b=p}g=g.concat(b({key:(e&&`${e}.`)+v,value:i[v],valueSpec:T,style:l,styleSpec:u,object:i,objectKey:v,validateSpec:p},i))}for(const v in s)o[v]||s[v].required&&s[v].default===void 0&&i[v]===void 0&&g.push(new ye(e,i,`missing required property "${v}"`));return g}function Xo(r){const e=r.value,i=r.valueSpec,s=r.style,o=r.styleSpec,l=r.key,u=r.arrayElementValidator||r.validateSpec;if($e(e)!=="array")return[new ye(l,e,`array expected, ${$e(e)} found`)];if(i.length&&e.length!==i.length)return[new ye(l,e,`array length ${i.length} expected, length ${e.length} found`)];let p={type:i.value,values:i.values};o.$version<7&&(p.function=i.function),$e(i.value)==="object"&&(p=i.value);let g=[];for(let m=0;m<e.length;m++)g=g.concat(u({array:e,arrayIndex:m,value:e[m],valueSpec:p,validateSpec:r.validateSpec,style:s,styleSpec:o,key:`${l}[${m}]`}));return g}function as(r){const e=r.key,i=r.value,s=r.valueSpec;let o=$e(i);return o==="number"&&i!=i&&(o="NaN"),o!=="number"?[new ye(e,i,`number expected, ${o} found`)]:"minimum"in s&&i<s.minimum?[new ye(e,i,`${i} is less than the minimum value ${s.minimum}`)]:"maximum"in s&&i>s.maximum?[new ye(e,i,`${i} is greater than the maximum value ${s.maximum}`)]:[]}function Yo(r){const e=r.valueSpec,i=Dt(r.value.type);let s,o,l,u={};const p=i!=="categorical"&&r.value.property===void 0,g=!p,m=$e(r.value.stops)==="array"&&$e(r.value.stops[0])==="array"&&$e(r.value.stops[0][0])==="object",v=Ri({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(b){if(i==="identity")return[new ye(b.key,b.value,'identity function may not have a "stops" property')];let I=[];const M=b.value;return I=I.concat(Xo({key:b.key,value:M,valueSpec:b.valueSpec,validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec,arrayElementValidator:_})),$e(M)==="array"&&M.length===0&&I.push(new ye(b.key,M,"array must have at least one stop")),I},default:function(b){return b.validateSpec({key:b.key,value:b.value,valueSpec:e,validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec})}}});return i==="identity"&&p&&v.push(new ye(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||v.push(new ye(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!fl(r.valueSpec)&&v.push(new ye(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(g&&!ns(r.valueSpec)?v.push(new ye(r.key,r.value,"property functions not supported")):p&&!Uc(r.valueSpec)&&v.push(new ye(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!m||r.value.property!==void 0||v.push(new ye(r.key,r.value,'"property" property is required')),v;function _(b){let I=[];const M=b.value,A=b.key;if($e(M)!=="array")return[new ye(A,M,`array expected, ${$e(M)} found`)];if(M.length!==2)return[new ye(A,M,`array length 2 expected, length ${M.length} found`)];if(m){if($e(M[0])!=="object")return[new ye(A,M,`object expected, ${$e(M[0])} found`)];if(M[0].zoom===void 0)return[new ye(A,M,"object stop key must have zoom")];if(M[0].value===void 0)return[new ye(A,M,"object stop key must have value")];if(l&&l>Dt(M[0].zoom))return[new ye(A,M[0].zoom,"stop zoom values must appear in ascending order")];Dt(M[0].zoom)!==l&&(l=Dt(M[0].zoom),o=void 0,u={}),I=I.concat(Ri({key:`${A}[0]`,value:M[0],valueSpec:{zoom:{}},validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec,objectElementValidators:{zoom:as,value:T}}))}else I=I.concat(T({key:`${A}[0]`,value:M[0],validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec},M));return $o(In(M[1]))?I.concat([new ye(`${A}[1]`,M[1],"expressions are not allowed in function stops.")]):I.concat(b.validateSpec({key:`${A}[1]`,value:M[1],valueSpec:e,validateSpec:b.validateSpec,style:b.style,styleSpec:b.styleSpec}))}function T(b,I){const M=$e(b.value),A=Dt(b.value),D=b.value!==null?b.value:I;if(s){if(M!==s)return[new ye(b.key,D,`${M} stop domain type must match previous stop domain type ${s}`)]}else s=M;if(M!=="number"&&M!=="string"&&M!=="boolean")return[new ye(b.key,D,"stop domain value must be a number, string, or boolean")];if(M!=="number"&&i!=="categorical"){let L=`number expected, ${M} found`;return ns(e)&&i===void 0&&(L+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ye(b.key,D,L)]}return i!=="categorical"||M!=="number"||isFinite(A)&&Math.floor(A)===A?i!=="categorical"&&M==="number"&&o!==void 0&&A<o?[new ye(b.key,D,"stop domain values must appear in ascending order")]:(o=A,i==="categorical"&&A in u?[new ye(b.key,D,"stop domain values must be unique")]:(u[A]=!0,[])):[new ye(b.key,D,`integer expected, found ${A}`)]}}function qr(r){const e=(r.expressionContext==="property"?Zc:Us)(In(r.value),r.valueSpec);if(e.result==="error")return e.value.map((s=>new ye(`${r.key}${s.key}`,r.value,s.message)));const i=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ye(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Vs(i))return[new ye(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Vs(i))return[new ye(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!Uo(i,["zoom","feature-state"]))return[new ye(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!No(i))return[new ye(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qs(r){const e=r.key,i=r.value,s=$e(i);return s!=="string"?[new ye(e,i,`color expected, ${s} found`)]:Ue.parse(String(i))?[]:[new ye(e,i,`color expected, "${i}" found`)]}function Mn(r){const e=r.key,i=r.value,s=r.valueSpec,o=[];return Array.isArray(s.values)?s.values.indexOf(Dt(i))===-1&&o.push(new ye(e,i,`expected one of [${s.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(s.values).indexOf(Dt(i))===-1&&o.push(new ye(e,i,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(i)} found`)),o}function ls(r){return ml(In(r.value))?qr(hn({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Hc(r)}function Hc(r){const e=r.value,i=r.key;if($e(e)!=="array")return[new ye(i,e,`array expected, ${$e(e)} found`)];const s=r.styleSpec;let o,l=[];if(e.length<1)return[new ye(i,e,"filter array must have at least 1 element")];switch(l=l.concat(Mn({key:`${i}[0]`,value:e[0],valueSpec:s.filter_operator,style:r.style,styleSpec:r.styleSpec})),Dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Dt(e[1])==="$type"&&l.push(new ye(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&l.push(new ye(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=$e(e[1]),o!=="string"&&l.push(new ye(`${i}[1]`,e[1],`string expected, ${o} found`)));for(let u=2;u<e.length;u++)o=$e(e[u]),Dt(e[1])==="$type"?l=l.concat(Mn({key:`${i}[${u}]`,value:e[u],valueSpec:s.geometry_type,style:r.style,styleSpec:r.styleSpec})):o!=="string"&&o!=="number"&&o!=="boolean"&&l.push(new ye(`${i}[${u}]`,e[u],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let u=1;u<e.length;u++)l=l.concat(Hc({key:`${i}[${u}]`,value:e[u],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":o=$e(e[1]),e.length!==2?l.push(new ye(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):o!=="string"&&l.push(new ye(`${i}[1]`,e[1],`string expected, ${o} found`))}return l}function Xc(r,e){const i=r.key,s=r.validateSpec,o=r.style,l=r.styleSpec,u=r.value,p=r.objectKey,g=l[`${e}_${r.layerType}`];if(!g)return[];const m=p.match(/^(.*)-transition$/);if(e==="paint"&&m&&g[m[1]]&&g[m[1]].transition)return s({key:i,value:u,valueSpec:l.transition,style:o,styleSpec:l});const v=r.valueSpec||g[p];if(!v)return[new ye(i,u,`unknown property "${p}"`)];let _;if($e(u)==="string"&&ns(v)&&!v.tokens&&(_=/^{([^}]+)}$/.exec(u)))return[new ye(i,u,`"${p}" does not support interpolation syntax
|